1 /* src/vmcore/field.h - field functions header
3 Copyright (C) 1996-2005, 2006, 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 /* forward typedefs ***********************************************************/
31 typedef struct fieldinfo fieldinfo;
37 #include "vm/global.h"
39 #include "vmcore/descriptor.h"
40 #include "vmcore/class.h"
41 #include "vmcore/loader.h"
42 #include "vmcore/references.h"
43 #include "vmcore/utf8.h"
46 /* fieldinfo ******************************************************************/
48 struct fieldinfo { /* field of a class */
50 /* CAUTION: The first field must be a pointer that is never the same */
51 /* value as CLASSREF_PSEUDO_VFTBL! This is used to check whether */
52 /* a constant_FMIref has been resolved. */
54 classinfo *clazz; /* needed by typechecker. Could be optimized */
55 /* away by using constant_FMIref instead of */
56 /* fieldinfo throughout the compiler. */
58 s4 flags; /* ACC flags */
59 s4 type; /* basic data type */
60 utf *name; /* name of field */
61 utf *descriptor;/* JavaVM descriptor string of field */
62 utf *signature; /* Signature attribute string */
63 typedesc *parseddesc;/* parsed descriptor */
65 int32_t offset; /* offset from start of object (instance variables) */
66 imm_union *value; /* storage for static values (class variables) */
70 /* function prototypes ********************************************************/
72 bool field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool);
73 classinfo *field_get_type(fieldinfo *f);
74 void field_free(fieldinfo *f);
76 java_handle_bytearray_t *field_get_annotations(fieldinfo *f);
79 void field_printflags(fieldinfo *f);
80 void field_print(fieldinfo *f);
81 void field_println(fieldinfo *f);
82 void field_fieldref_print(constant_FMIref *fr);
83 void field_fieldref_println(constant_FMIref *fr);
90 * These are local overrides for various environment variables in Emacs.
91 * Please do not remove this and leave it at the end of the file, where
92 * Emacs will automagically detect them.
93 * ---------------------------------------------------------------------