OSDN Git Service

1638f94e1072250b2bbde9f5a42508f807e944e6
[pf3gnuchains/gcc-fork.git] / libjava / java / lang / Class.h
1 // Class.h - Header file for java.lang.Class.  -*- c++ -*-
2
3 /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 // Written primary using compiler source and Class.java as guides.
12 #ifndef __JAVA_LANG_CLASS_H__
13 #define __JAVA_LANG_CLASS_H__
14
15 #pragma interface
16
17 #include <stddef.h>
18 #include <java/lang/Object.h>
19 #include <java/lang/String.h>
20 #include <java/net/URL.h>
21 #include <java/lang/reflect/Modifier.h>
22 #include <java/security/ProtectionDomain.h>
23 #include <java/lang/Package.h>
24
25 // Avoid including SystemClassLoader.h.
26 extern "Java"
27 {
28   namespace gnu
29   {
30     namespace gcj
31     {
32       namespace runtime
33       {
34         class SystemClassLoader;
35       }
36     }
37   }
38 }
39
40 // We declare these here to avoid including gcj/cni.h.
41 extern "C" void _Jv_InitClass (jclass klass);
42 extern "C" jclass _Jv_NewClassFromInitializer 
43    (const char *class_initializer);
44 extern "C" void _Jv_RegisterNewClasses (char **classes);
45 extern "C" void _Jv_RegisterClasses (const jclass *classes);
46 extern "C" void _Jv_RegisterClasses_Counted (const jclass *classes,
47                                              size_t count);
48
49 // This must be predefined with "C" linkage.
50 extern "C" void *_Jv_LookupInterfaceMethodIdx (jclass klass, jclass iface, 
51                                                int meth_idx);
52 extern "C" void *_Jv_ResolvePoolEntry (jclass this_class, jint index);
53
54 // These are the possible values for the `state' field of the class
55 // structure.  Note that ordering is important here.  Whenever the
56 // state changes, one should notify all waiters of this class.
57 enum
58 {
59   JV_STATE_NOTHING = 0,         // Set by compiler.
60
61   JV_STATE_PRELOADING = 1,      // Can do _Jv_FindClass.
62
63   // There is an invariant through libgcj that a class will always be
64   // at a state greater than or equal to JV_STATE_LOADING when it is
65   // returned by a class loader to user code.  Hence, defineclass.cc
66   // installs supers before returning a class, C++-ABI-compiled
67   // classes are created with supers installed, and BC-ABI-compiled
68   // classes are linked to this state before being returned by their
69   // class loader.
70   JV_STATE_LOADING = 3,         // Has super installed.
71   JV_STATE_READ = 4,            // Has been completely defined.
72   JV_STATE_LOADED = 5,          // Has Miranda methods defined.
73
74   JV_STATE_COMPILED = 6,        // This was a compiled class.
75
76   JV_STATE_PREPARED = 7,        // Layout & static init done.
77   JV_STATE_LINKED = 9,          // Strings interned.
78
79   JV_STATE_IN_PROGRESS = 10,    // <clinit> running.
80
81   JV_STATE_ERROR = 12,
82
83   JV_STATE_PHANTOM = 13,        // Bytecode is missing. In many cases we can
84                                 // work around that. If not, throw a
85                                 // NoClassDefFoundError.
86
87   JV_STATE_DONE = 14,           // Must be last.
88
89
90 };
91
92 struct _Jv_Field;
93 struct _Jv_VTable;
94 union _Jv_word;
95 struct _Jv_ArrayVTable;
96 class _Jv_Linker;
97 class _Jv_ExecutionEngine;
98 class _Jv_CompiledEngine;
99 class _Jv_IndirectCompiledEngine;
100 class _Jv_InterpreterEngine;
101
102 #ifdef INTERPRETER
103 class _Jv_ClassReader;
104 class _Jv_InterpClass;
105 class _Jv_InterpMethod;
106 #endif
107
108 struct _Jv_Constants
109 {
110   jint size;
111   jbyte *tags;
112   _Jv_word *data;
113 };
114
115 struct _Jv_Method
116 {
117   // Method name.
118   _Jv_Utf8Const *name;
119   // Method signature.
120   _Jv_Utf8Const *signature;
121   // Access flags.
122   _Jv_ushort accflags;
123   // Method's index in the vtable.
124   _Jv_ushort index;
125   // Pointer to underlying function.
126   void *ncode;
127   // NULL-terminated list of exception class names; can be NULL if
128   // there are none such.
129   _Jv_Utf8Const **throws;
130
131   _Jv_Method *getNextMethod ()
132   { return this + 1; }
133 };
134
135 // The table used to resolve interface calls.
136 struct _Jv_IDispatchTable
137 {
138   // Index into interface's ioffsets.
139   jshort iindex;
140   jshort itable_length;
141   // Class Interface dispatch table.
142   void *itable[0];
143 };
144
145 // Used by _Jv_Linker::get_interfaces ()
146 struct _Jv_ifaces
147 {
148   jclass *list;
149   jshort len;
150   jshort count;
151 };
152
153 struct _Jv_MethodSymbol
154 {
155   _Jv_Utf8Const *class_name;
156   _Jv_Utf8Const *name;
157   _Jv_Utf8Const *signature;
158 };
159
160 struct _Jv_OffsetTable
161 {
162   jint state;
163   jint offsets[];
164 };
165
166 struct _Jv_AddressTable
167 {
168   jint state;
169   void *addresses[];
170 };
171
172 struct _Jv_CatchClass
173 {
174   java::lang::Class **address;
175   _Jv_Utf8Const *classname;
176 };
177
178 // Possible values for the assertion_code field in the type assertion table.
179 enum
180 {
181   JV_ASSERT_END_OF_TABLE = 0,
182   JV_ASSERT_TYPES_COMPATIBLE = 1,
183   JV_ASSERT_IS_INSTANTIABLE = 2
184 };
185
186 // Entry in the type assertion table, used to validate type constraints
187 // for binary compatibility.
188 struct _Jv_TypeAssertion
189 {
190   jint assertion_code;
191   _Jv_Utf8Const *op1;
192   _Jv_Utf8Const *op2;
193 };
194
195 #define JV_PRIMITIVE_VTABLE ((_Jv_VTable *) -1)
196
197 #define JV_CLASS(Obj) ((jclass) (*(_Jv_VTable **) Obj)->clas)
198
199 // Forward declarations for friends of java::lang::Class
200
201 // Friend functions implemented in natClass.cc.
202 _Jv_Method *_Jv_GetMethodLocal (jclass klass, _Jv_Utf8Const *name,
203                                 _Jv_Utf8Const *signature);
204 jboolean _Jv_IsAssignableFrom (jclass, jclass);
205 jboolean _Jv_IsAssignableFromSlow (jclass, jclass);
206 jboolean _Jv_InterfaceAssignableFrom (jclass, jclass);
207
208 _Jv_Method* _Jv_LookupDeclaredMethod (jclass, _Jv_Utf8Const *, 
209                                       _Jv_Utf8Const*, jclass * = NULL);
210 jfieldID JvGetFirstInstanceField (jclass);
211 jint JvNumInstanceFields (jclass);
212 jfieldID JvGetFirstStaticField (jclass);
213 jint JvNumStaticFields (jclass);
214
215 jobject _Jv_AllocObject (jclass);
216 void *_Jv_AllocObj (jint, jclass);
217 void *_Jv_AllocPtrFreeObj (jint, jclass);
218 void *_Jv_AllocArray (jint, jclass);
219
220 bool _Jv_getInterfaceMethod(jclass, jclass&, int&, 
221                             const _Jv_Utf8Const*,
222                             const _Jv_Utf8Const*);
223
224 jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv *, jclass, jfieldID,
225                                   jboolean);
226 jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID,
227                                    jboolean);
228 jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);
229
230 jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);
231 jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);
232 jint JvNumMethods (jclass);
233 jmethodID JvGetFirstMethod (jclass);
234
235 #ifdef INTERPRETER
236 // Finds a desired interpreter method in the given class or NULL if not found
237 class _Jv_MethodBase;
238 _Jv_MethodBase *_Jv_FindInterpreterMethod (jclass, jmethodID);
239 #endif
240
241 // Friend classes and functions to implement the ClassLoader
242 class java::lang::ClassLoader;
243 class java::lang::VMClassLoader;
244
245 class java::io::ObjectOutputStream;
246 class java::io::ObjectInputStream;
247 class java::io::ObjectStreamClass;
248
249 void _Jv_RegisterClassHookDefault (jclass klass);
250 void _Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*);
251 void _Jv_UnregisterInitiatingLoader (jclass,java::lang::ClassLoader*);
252 void _Jv_UnregisterClass (jclass);
253 jclass _Jv_FindClassNoException (_Jv_Utf8Const *name,
254                       java::lang::ClassLoader *loader);
255 jclass _Jv_FindClass (_Jv_Utf8Const *name,
256                       java::lang::ClassLoader *loader);
257 jclass _Jv_FindClassInCache (_Jv_Utf8Const *name);
258 jclass _Jv_PopClass (void);
259 void _Jv_PushClass (jclass k);
260 void _Jv_NewArrayClass (jclass element,
261                         java::lang::ClassLoader *loader,
262                         _Jv_VTable *array_vtable = 0);
263 jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass,
264                      java::lang::ClassLoader *loader);
265 void _Jv_InitNewClassFields (jclass klass);
266
267 // Friend functions and classes in prims.cc
268 void _Jv_InitPrimClass (jclass, const char *, char, int);
269 jstring _Jv_GetMethodString (jclass, _Jv_Method *, jclass = NULL);
270
271 jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
272                           jint flags);
273 jclass _Jv_GetArrayClass (jclass klass, java::lang::ClassLoader *loader);
274
275 jboolean _Jv_IsInterpretedClass (jclass);
276 jboolean _Jv_IsBinaryCompatibilityABI (jclass);
277
278 jboolean _Jv_IsPhantomClass (jclass);
279
280 void _Jv_CopyClassesToSystemLoader (gnu::gcj::runtime::SystemClassLoader *);
281
282 #ifdef INTERPRETER
283 void _Jv_InitField (jobject, jclass, int);
284 #endif
285
286 class _Jv_StackTrace;
287 class _Jv_BytecodeVerifier;
288 class java::io::VMObjectStreamClass;
289
290 void _Jv_sharedlib_register_hook (jclass klass);
291
292
293 class java::lang::Class : public java::lang::Object
294 {
295 public:
296   static jclass forName (jstring className, jboolean initialize, 
297                          java::lang::ClassLoader *loader);
298   static jclass forName (jstring className);
299   JArray<jclass> *getClasses (void);
300
301   java::lang::ClassLoader *getClassLoader (void);
302 private:
303   java::lang::ClassLoader *getClassLoader (jclass caller);
304 public:
305   // This is an internal method that circumvents the usual security
306   // checks when getting the class loader.
307   java::lang::ClassLoader *getClassLoaderInternal (void)
308   {
309     return loader;
310   }
311
312   java::lang::reflect::Constructor *getConstructor (JArray<jclass> *);
313   JArray<java::lang::reflect::Constructor *> *getConstructors (void);
314   java::lang::reflect::Constructor *getDeclaredConstructor (JArray<jclass> *);
315   JArray<java::lang::reflect::Constructor *> *getDeclaredConstructors (jboolean);
316   java::lang::reflect::Field *getDeclaredField (jstring);
317   JArray<java::lang::reflect::Field *> *getDeclaredFields ();
318   JArray<java::lang::reflect::Field *> *getDeclaredFields (jboolean);
319   java::lang::reflect::Method *getDeclaredMethod (jstring, JArray<jclass> *);
320   JArray<java::lang::reflect::Method *> *getDeclaredMethods (void);
321
322   JArray<jclass> *getDeclaredClasses (void);
323   JArray<jclass> *getDeclaredClasses (jboolean);
324   jclass getDeclaringClass (void);
325
326   java::lang::reflect::Field *getField (jstring);
327 private:
328   JArray<java::lang::reflect::Field *> internalGetFields ();
329   java::lang::reflect::Field *getField (jstring, jint);
330   jint _getMethods (JArray<java::lang::reflect::Method *> *result,
331                     jint offset);
332   java::lang::reflect::Field *getPrivateField (jstring);
333   java::lang::reflect::Method *getPrivateMethod (jstring, JArray<jclass> *);
334   java::security::ProtectionDomain *getProtectionDomain0 ();
335
336   java::lang::reflect::Method *_getMethod (jstring, JArray<jclass> *);
337   java::lang::reflect::Method *_getDeclaredMethod (jstring, JArray<jclass> *);
338
339 public:
340   JArray<java::lang::reflect::Field *> *getFields (void);
341
342   JArray<jclass> *getInterfaces (void);
343
344   void getSignature (java::lang::StringBuffer *buffer);
345   static jstring getSignature (JArray<jclass> *, jboolean is_constructor);
346   JArray<java::lang::reflect::Method *> *getMethods (void);
347
348   inline jint getModifiers (void)
349   {
350     return accflags & java::lang::reflect::Modifier::ALL_FLAGS;
351   }
352
353   jstring getName (void);
354
355   java::net::URL        *getResource (jstring resourceName);
356   java::io::InputStream *getResourceAsStream (jstring resourceName);
357   JArray<jobject> *getSigners (void);
358   void setSigners(JArray<jobject> *);
359
360   inline jclass getSuperclass (void)
361   {
362     return superclass;
363   }
364
365   inline jclass getInterface (jint n)
366   {
367     return interfaces[n];
368   }
369
370   inline jboolean isArray (void)
371     {
372       return name->first() == '[';
373     }
374
375   inline jclass getComponentType (void)
376     {
377       return isArray () ? element_type : 0;
378     }
379
380   jboolean isAssignableFrom (jclass cls);
381   jboolean isInstance (jobject obj);
382
383   inline jboolean isInterface (void)
384   {
385     return (accflags & java::lang::reflect::Modifier::INTERFACE) != 0;
386   }
387   
388   inline jboolean isPrimitive (void)
389     {
390       return vtable == JV_PRIMITIVE_VTABLE;
391     }
392
393   jobject newInstance (void);
394   java::security::ProtectionDomain *getProtectionDomain (void);
395   java::lang::Package *getPackage (void);
396   jstring toString (void);
397   jboolean desiredAssertionStatus (void);
398
399   JArray<java::lang::reflect::TypeVariable *> *getTypeParameters (void);
400
401   java::lang::Class *getEnclosingClass (void);
402   java::lang::reflect::Constructor *getEnclosingConstructor (void);
403   java::lang::reflect::Method *getEnclosingMethod (void);
404   jboolean isEnum (void);
405
406   // FIXME: this probably shouldn't be public.
407   jint size (void)
408   {
409     return size_in_bytes;
410   }
411
412   // The index of the first method we declare ourself (as opposed to
413   // inheriting).
414   inline jint firstMethodIndex (void)
415   {
416     return vtable_method_count - method_count;
417   }
418     
419   // finalization
420   void finalize ();
421
422   // This constructor is used to create Class object for the primitive
423   // types. See prims.cc.
424   Class ();
425
426   static java::lang::Class class$;
427
428 private:   
429
430   void memberAccessCheck (jint flags);
431
432   void initializeClass (void);
433
434   static jstring getPackagePortion (jstring);
435
436   void set_state (jint nstate)
437   {
438     state = nstate;
439     notifyAll ();
440   }
441
442   // Friend functions implemented in natClass.cc.
443   friend _Jv_Method *::_Jv_GetMethodLocal (jclass klass, _Jv_Utf8Const *name,
444                                            _Jv_Utf8Const *signature);
445   friend jboolean (::_Jv_IsAssignableFrom) (jclass, jclass);
446   friend jboolean (::_Jv_IsAssignableFromSlow) (jclass, jclass);
447   friend jboolean (::_Jv_InterfaceAssignableFrom) (jclass, jclass);
448   friend void *::_Jv_LookupInterfaceMethodIdx (jclass klass, jclass iface, 
449                                                int method_idx);
450
451   friend void ::_Jv_InitClass (jclass klass);
452   friend java::lang::Class* ::_Jv_NewClassFromInitializer (const char *class_initializer);
453   friend void _Jv_RegisterNewClasses (void **classes);
454
455   friend _Jv_Method* ::_Jv_LookupDeclaredMethod (jclass, _Jv_Utf8Const *, 
456                                                  _Jv_Utf8Const*, jclass *);
457   friend jfieldID (::JvGetFirstInstanceField) (jclass);
458   friend jint (::JvNumInstanceFields) (jclass);
459   friend jfieldID (::JvGetFirstStaticField) (jclass);
460   friend jint (::JvNumStaticFields) (jclass);
461
462   friend jobject (::_Jv_AllocObject) (jclass);
463   friend void *::_Jv_AllocObj (jint, jclass);
464   friend void *::_Jv_AllocPtrFreeObj (jint, jclass);
465   friend void *::_Jv_AllocArray (jint, jclass);
466
467   friend jobject (::_Jv_JNI_ToReflectedField) (_Jv_JNIEnv *, jclass, jfieldID,
468                                                jboolean);
469   friend jobject (::_Jv_JNI_ToReflectedMethod) (_Jv_JNIEnv *, jclass, jmethodID,
470                                                 jboolean);
471   friend jfieldID (::_Jv_FromReflectedField) (java::lang::reflect::Field *);
472
473   friend jmethodID (::_Jv_FromReflectedMethod) (java::lang::reflect::Method *);
474   friend jmethodID (::_Jv_FromReflectedConstructor) (java::lang::reflect::Constructor *);
475   friend jint (::JvNumMethods) (jclass);
476   friend jmethodID (::JvGetFirstMethod) (jclass);
477 #ifdef INTERPRETER
478   friend _Jv_MethodBase *(::_Jv_FindInterpreterMethod) (jclass klass,
479                                                         jmethodID desired_method);
480 #endif
481
482   // Friends classes and functions to implement the ClassLoader
483   friend class java::lang::ClassLoader;
484   friend class java::lang::VMClassLoader;
485
486   friend class java::io::ObjectOutputStream;
487   friend class java::io::ObjectInputStream;
488   friend class java::io::ObjectStreamClass;
489
490   friend void ::_Jv_RegisterClasses (const jclass *classes);
491   friend void ::_Jv_RegisterClasses_Counted (const jclass *classes, 
492                                              size_t count);
493   friend void ::_Jv_RegisterClassHookDefault (jclass klass);
494   friend void ::_Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*);
495   friend void ::_Jv_UnregisterInitiatingLoader (jclass,java::lang::ClassLoader*);
496   friend void ::_Jv_UnregisterClass (jclass);
497   friend jclass (::_Jv_FindClassNoException) (_Jv_Utf8Const *name,
498                                    java::lang::ClassLoader *loader);
499   friend jclass (::_Jv_FindClass) (_Jv_Utf8Const *name,
500                                    java::lang::ClassLoader *loader);
501   friend jclass (::_Jv_FindClassInCache) (_Jv_Utf8Const *name);
502   friend jclass (::_Jv_PopClass) (void);
503   friend void ::_Jv_PushClass (jclass k);
504   friend void ::_Jv_NewArrayClass (jclass element,
505                                    java::lang::ClassLoader *loader,
506                                    _Jv_VTable *array_vtable);
507   friend jclass (::_Jv_NewClass) (_Jv_Utf8Const *name, jclass superclass,
508                                   java::lang::ClassLoader *loader);
509   friend void ::_Jv_InitNewClassFields (jclass klass);
510
511   // in prims.cc
512   friend void ::_Jv_InitPrimClass (jclass, const char *, char, int);
513
514   friend jstring (::_Jv_GetMethodString) (jclass, _Jv_Method *, jclass);
515
516   friend jboolean (::_Jv_CheckAccess) (jclass self_klass, jclass other_klass,
517                                    jint flags);
518   
519   friend bool (::_Jv_getInterfaceMethod) (jclass, jclass&, int&, 
520                                           const _Jv_Utf8Const*,
521                                           const _Jv_Utf8Const*);
522
523   friend jclass (::_Jv_GetArrayClass) (jclass klass,
524                                        java::lang::ClassLoader *loader);
525
526   friend jboolean (::_Jv_IsInterpretedClass) (jclass);
527   friend jboolean (::_Jv_IsBinaryCompatibilityABI) (jclass);
528
529   friend jboolean (::_Jv_IsPhantomClass) (jclass);
530
531 #ifdef INTERPRETER
532   friend void ::_Jv_InitField (jobject, jclass, int);
533
534   friend class ::_Jv_ClassReader;       
535   friend class ::_Jv_InterpClass;
536   friend class ::_Jv_InterpMethod;
537 #endif
538   friend class ::_Jv_StackTrace;
539
540 #ifdef JV_MARKOBJ_DECL
541   friend JV_MARKOBJ_DECL;
542 #endif
543
544   friend class ::_Jv_BytecodeVerifier;
545   friend class java::io::VMObjectStreamClass;
546
547   friend class ::_Jv_Linker;
548   friend class ::_Jv_ExecutionEngine;
549   friend class ::_Jv_CompiledEngine;
550   friend class ::_Jv_IndirectCompiledEngine;
551   friend class ::_Jv_InterpreterEngine;
552
553   friend void ::_Jv_sharedlib_register_hook (jclass klass);
554
555   friend void *::_Jv_ResolvePoolEntry (jclass this_class, jint index);
556
557   friend void ::_Jv_CopyClassesToSystemLoader (gnu::gcj::runtime::SystemClassLoader *);
558
559   // Chain for class pool.  This also doubles as the ABI version
560   // number.  It is only used for this purpose at class registration
561   // time, and only for precompiled classes.
562   jclass next_or_version;
563   // Name of class.
564   _Jv_Utf8Const *name;
565   // Access flags for class.
566   _Jv_ushort accflags;
567   // The superclass, or null for Object.
568   jclass superclass;
569   // Class constants.
570   _Jv_Constants constants;
571   // Methods.  If this is an array class, then this field holds a
572   // pointer to the element type.
573   union
574   {
575     _Jv_Method *methods;
576     jclass element_type;
577   };
578   // Number of methods.  If this class is primitive, this holds the
579   // character used to represent this type in a signature.
580   jshort method_count;
581   // Number of methods in the vtable.
582   jshort vtable_method_count;
583   // The fields.
584   _Jv_Field *fields;
585   // Size of instance fields, in bytes.
586   jint size_in_bytes;
587   // Total number of fields (instance and static).
588   jshort field_count;
589   // Number of static fields.
590   jshort static_field_count;
591   // The vtbl for all objects of this class.
592   _Jv_VTable *vtable;
593   // Virtual method offset table.
594   _Jv_OffsetTable *otable;
595   // Offset table symbols.
596   _Jv_MethodSymbol *otable_syms;
597   // Address table
598   _Jv_AddressTable *atable;
599   _Jv_MethodSymbol *atable_syms;
600   // Interface table
601   _Jv_AddressTable *itable;
602   _Jv_MethodSymbol *itable_syms;
603   _Jv_CatchClass *catch_classes;
604   // Interfaces implemented by this class.
605   jclass *interfaces;
606   // The class loader for this class.
607   java::lang::ClassLoader *loader;
608   // Number of interfaces.
609   jshort interface_count;
610   // State of this class.
611   jbyte state;
612   // The thread which has locked this class.  Used during class
613   // initialization.
614   java::lang::Thread *thread;
615   // How many levels of "extends" this class is removed from Object.
616   jshort depth;
617   // Vector of this class's superclasses, ordered by decreasing depth.
618   jclass *ancestors;
619   // In a regular class, this field points to the Class Interface Dispatch 
620   // Table. In an interface, it points to the ioffsets table.
621   union 
622   {
623     _Jv_IDispatchTable *idt;
624     jshort *ioffsets;
625   };
626   // Pointer to the class that represents an array of this class.
627   jclass arrayclass;
628   // Security Domain to which this class belongs (or null).
629   java::security::ProtectionDomain *protectionDomain;
630   // Pointer to the type assertion table for this class.
631   _Jv_TypeAssertion *assertion_table;
632   // Signers of this class (or null).
633   JArray<jobject> *hack_signers;
634   // Used by Jv_PopClass and _Jv_PushClass to communicate with StackTrace.
635   jclass chain;
636   // Additional data, specific to the generator (JIT, native,
637   // interpreter) of this class.
638   void *aux_info;
639   // Execution engine.
640   _Jv_ExecutionEngine *engine;
641 };
642
643 // Inline functions that are friends of java::lang::Class
644
645 inline void _Jv_InitClass (jclass klass)
646 {
647   if (__builtin_expect (klass->state == JV_STATE_DONE, true))
648     return;
649   klass->initializeClass ();  
650 }
651
652 // Return array class corresponding to element type KLASS, creating it if
653 // necessary.
654 inline jclass
655 _Jv_GetArrayClass (jclass klass, java::lang::ClassLoader *loader)
656 {
657   extern void _Jv_NewArrayClass (jclass element,
658                                  java::lang::ClassLoader *loader,
659                                  _Jv_VTable *array_vtable = 0);
660   if (__builtin_expect (!klass->arrayclass, false))
661     _Jv_NewArrayClass (klass, loader);
662   return klass->arrayclass;
663 }
664
665 #endif /* __JAVA_LANG_CLASS_H__ */