* src/native/jni.cpp: [OPENJDK] Fix FindClass called from JNI_OnLoad.
[cacao.git] / src / vm / field.hpp
1 /* src/vm/field.hpp - field functions header
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
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.
12
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.
17
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
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _FIELD_HPP
27 #define _FIELD_HPP
28
29 /* forward typedefs ***********************************************************/
30
31 typedef struct fieldinfo fieldinfo; 
32
33
34 #include "config.h"
35 #include "vm/types.h"
36
37 #include "vm/descriptor.hpp"
38 #include "vm/class.hpp"
39 #include "vm/global.h"
40 #include "vm/loader.hpp"
41 #include "vm/references.h"
42 #include "vm/utf8.h"
43
44
45 /* fieldinfo ******************************************************************/
46
47 struct fieldinfo {            /* field of a class                                 */
48
49         /* CAUTION: The first field must be a pointer that is never the same      */
50         /*          value as CLASSREF_PSEUDO_VFTBL! This is used to check whether */
51         /*          a constant_FMIref has been resolved.                          */
52
53         classinfo *clazz;     /* needed by typechecker. Could be optimized        */
54                               /* away by using constant_FMIref instead of         */
55                               /* fieldinfo throughout the compiler.               */
56
57         s4         flags;     /* ACC flags                                        */
58         s4         type;      /* basic data type                                  */
59         utf       *name;      /* name of field                                    */
60         utf       *descriptor;/* JavaVM descriptor string of field                */
61         utf       *signature; /* Signature attribute string                       */
62         typedesc  *parseddesc;/* parsed descriptor                                */
63
64         int32_t    offset;    /* offset from start of object (instance variables) */
65         imm_union *value;     /* storage for static values (class variables)      */
66 };
67
68
69 /* function prototypes ********************************************************/
70
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74
75 bool       field_load(classbuffer *cb, fieldinfo *f, descriptor_pool *descpool);
76 classinfo *field_get_type(fieldinfo *f);
77 void       field_free(fieldinfo *f);
78
79 java_handle_bytearray_t *field_get_annotations(fieldinfo *f);
80
81 #if !defined(NDEBUG)
82 void field_printflags(fieldinfo *f);
83 void field_print(fieldinfo *f);
84 void field_println(fieldinfo *f);
85 void field_fieldref_print(constant_FMIref *fr);
86 void field_fieldref_println(constant_FMIref *fr);
87 #endif
88
89 #ifdef __cplusplus
90 }
91 #endif
92
93 #endif /* _FIELD_HPP */
94
95
96 /*
97  * These are local overrides for various environment variables in Emacs.
98  * Please do not remove this and leave it at the end of the file, where
99  * Emacs will automagically detect them.
100  * ---------------------------------------------------------------------
101  * Local variables:
102  * mode: c
103  * indent-tabs-mode: t
104  * c-basic-offset: 4
105  * tab-width: 4
106  * End:
107  */