1 
2 #include "xmlvm.h"
3 #include "java_lang_Class.h"
4 
5 
6 //XMLVM_BEGIN_NATIVE_IMPLEMENTATION
7 
8 #include "java_lang_reflect_Field.h"
9 #include "java_lang_reflect_Constructor.h"
10 #include "java_lang_reflect_Method.h"
11 #include "org_xmlvm_runtime_XMLVMArray.h"
12 #include "java_lang_ClassNotFoundException.h"
13 #include "xmlvm-util.h"
14 
15 
16 __TIB_DEFINITION_boolean __TIB_boolean;
17 __TIB_DEFINITION_byte    __TIB_byte;
18 __TIB_DEFINITION_char    __TIB_char;
19 __TIB_DEFINITION_short   __TIB_short;
20 __TIB_DEFINITION_int     __TIB_int;
21 __TIB_DEFINITION_long    __TIB_long;
22 __TIB_DEFINITION_float   __TIB_float;
23 __TIB_DEFINITION_double  __TIB_double;
24 __TIB_DEFINITION_void    __TIB_void;
25 
26 JAVA_OBJECT __CLASS_boolean;
27 JAVA_OBJECT __CLASS_byte;
28 JAVA_OBJECT __CLASS_char;
29 JAVA_OBJECT __CLASS_short;
30 JAVA_OBJECT __CLASS_int;
31 JAVA_OBJECT __CLASS_long;
32 JAVA_OBJECT __CLASS_float;
33 JAVA_OBJECT __CLASS_double;
34 JAVA_OBJECT __CLASS_void;
35 
36 
37 JAVA_OBJECT __CLASS_boolean_1ARRAY;
38 JAVA_OBJECT __CLASS_byte_1ARRAY;
39 JAVA_OBJECT __CLASS_char_1ARRAY;
40 JAVA_OBJECT __CLASS_short_1ARRAY;
41 JAVA_OBJECT __CLASS_int_1ARRAY;
42 JAVA_OBJECT __CLASS_long_1ARRAY;
43 JAVA_OBJECT __CLASS_float_1ARRAY;
44 JAVA_OBJECT __CLASS_double_1ARRAY;
45 
46 JAVA_OBJECT __CLASS_boolean_2ARRAY;
47 JAVA_OBJECT __CLASS_byte_2ARRAY;
48 JAVA_OBJECT __CLASS_char_2ARRAY;
49 JAVA_OBJECT __CLASS_short_2ARRAY;
50 JAVA_OBJECT __CLASS_int_2ARRAY;
51 JAVA_OBJECT __CLASS_long_2ARRAY;
52 JAVA_OBJECT __CLASS_float_2ARRAY;
53 JAVA_OBJECT __CLASS_double_2ARRAY;
54 
55 JAVA_OBJECT __CLASS_boolean_3ARRAY;
56 JAVA_OBJECT __CLASS_byte_3ARRAY;
57 JAVA_OBJECT __CLASS_char_3ARRAY;
58 JAVA_OBJECT __CLASS_short_3ARRAY;
59 JAVA_OBJECT __CLASS_int_3ARRAY;
60 JAVA_OBJECT __CLASS_long_3ARRAY;
61 JAVA_OBJECT __CLASS_float_3ARRAY;
62 JAVA_OBJECT __CLASS_double_3ARRAY;
63 
64 
init_primitive_class(void * clazz,const char * name)65 void init_primitive_class(void* clazz, const char* name)
66 {
67     __TIB_DEFINITION_TEMPLATE* c = (__TIB_DEFINITION_TEMPLATE*) clazz;
68     //TODO who is initializing this class?
69     c->classInitializationBegan = 1;
70     c->classInitialized = 1;
71     c->initializerThreadId = -1;
72     c->className = name;
73     c->extends = (__TIB_DEFINITION_TEMPLATE*) &__TIB_java_lang_Class;
74     c->flags = XMLVM_TYPE_PRIMITIVE;
75     XMLVM_MEMCPY(c->vtable, __TIB_java_lang_Object.vtable, sizeof(__TIB_java_lang_Object.vtable));
76 }
77 
__INIT_boolean()78 void __INIT_boolean()
79 {
80     init_primitive_class(&__TIB_boolean, "boolean");
81 }
82 
__INIT_byte()83 void __INIT_byte()
84 {
85     init_primitive_class(&__TIB_byte, "byte");
86 }
87 
__INIT_char()88 void __INIT_char()
89 {
90     init_primitive_class(&__TIB_char, "char");
91 }
92 
__INIT_short()93 void __INIT_short()
94 {
95     init_primitive_class(&__TIB_short, "short");
96 }
97 
__INIT_int()98 void __INIT_int()
99 {
100     init_primitive_class(&__TIB_int, "int");
101 }
102 
__INIT_long()103 void __INIT_long()
104 {
105     init_primitive_class(&__TIB_long, "long");
106 }
107 
__INIT_float()108 void __INIT_float()
109 {
110     init_primitive_class(&__TIB_float, "float");
111 }
112 
__INIT_double()113 void __INIT_double()
114 {
115     init_primitive_class(&__TIB_double, "double");
116 }
117 
__INIT_void()118 void __INIT_void()
119 {
120     init_primitive_class(&__TIB_void, "void");
121 }
122 
123 //XMLVM_END_NATIVE_IMPLEMENTATION
124 
java_lang_Class_initNativeLayer__()125 void java_lang_Class_initNativeLayer__()
126 {
127     //XMLVM_BEGIN_NATIVE[java_lang_Class_initNativeLayer__]
128     __INIT_boolean();
129     __INIT_byte();
130     __INIT_char();
131     __INIT_short();
132     __INIT_int();
133     __INIT_long();
134     __INIT_float();
135     __INIT_double();
136     __INIT_void();
137 
138     __CLASS_boolean = XMLVM_CREATE_CLASS_OBJECT(&__TIB_boolean);
139     __CLASS_byte = XMLVM_CREATE_CLASS_OBJECT(&__TIB_byte);
140     __CLASS_char = XMLVM_CREATE_CLASS_OBJECT(&__TIB_char);
141     __CLASS_short = XMLVM_CREATE_CLASS_OBJECT(&__TIB_short);
142     __CLASS_int = XMLVM_CREATE_CLASS_OBJECT(&__TIB_int);
143     __CLASS_long = XMLVM_CREATE_CLASS_OBJECT(&__TIB_long);
144     __CLASS_float = XMLVM_CREATE_CLASS_OBJECT(&__TIB_float);
145     __CLASS_double = XMLVM_CREATE_CLASS_OBJECT(&__TIB_double);
146     __CLASS_void = XMLVM_CREATE_CLASS_OBJECT(&__TIB_void);
147 
148     __CLASS_boolean_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_boolean);
149     __CLASS_byte_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_byte);
150     __CLASS_char_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_char);
151     __CLASS_short_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_short);
152     __CLASS_int_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_int);
153     __CLASS_long_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_long);
154     __CLASS_float_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_float);
155     __CLASS_double_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_double);
156 
157     __CLASS_boolean_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_boolean_1ARRAY);
158     __CLASS_byte_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_byte_1ARRAY);
159     __CLASS_char_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_char_1ARRAY);
160     __CLASS_short_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_short_1ARRAY);
161     __CLASS_int_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_int_1ARRAY);
162     __CLASS_long_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_long_1ARRAY);
163     __CLASS_float_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_float_1ARRAY);
164     __CLASS_double_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_double_1ARRAY);
165 
166     __CLASS_boolean_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_boolean_2ARRAY);
167     __CLASS_byte_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_byte_2ARRAY);
168     __CLASS_char_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_char_2ARRAY);
169     __CLASS_short_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_short_2ARRAY);
170     __CLASS_int_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_int_2ARRAY);
171     __CLASS_long_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_long_2ARRAY);
172     __CLASS_float_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_float_2ARRAY);
173     __CLASS_double_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_double_2ARRAY);
174     //XMLVM_END_NATIVE
175 }
176 
java_lang_Class_getStackClasses___int_boolean(JAVA_INT n1,JAVA_BOOLEAN n2)177 JAVA_OBJECT java_lang_Class_getStackClasses___int_boolean(JAVA_INT n1, JAVA_BOOLEAN n2)
178 {
179     //XMLVM_BEGIN_NATIVE[java_lang_Class_getStackClasses___int_boolean]
180     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
181     //XMLVM_END_NATIVE
182 }
183 
java_lang_Class_forName___java_lang_String_boolean_java_lang_ClassLoader(JAVA_OBJECT n1,JAVA_BOOLEAN n2,JAVA_OBJECT n3)184 JAVA_OBJECT java_lang_Class_forName___java_lang_String_boolean_java_lang_ClassLoader(JAVA_OBJECT n1, JAVA_BOOLEAN n2, JAVA_OBJECT n3)
185 {
186     //XMLVM_BEGIN_NATIVE[java_lang_Class_forName___java_lang_String_boolean_java_lang_ClassLoader]
187     static JAVA_OBJECT classMap = JAVA_NULL;
188     if (classMap == JAVA_NULL) {
189         classMap = XMLVMUtil_NEW_HashMap();
190     }
191     java_lang_Class* clazz = XMLVMUtil_HashMap_get(classMap, n1);
192     if (clazz != JAVA_NULL) {
193         return clazz;
194     }
195     int i = 0;
196     __TIB_DEFINITION_TEMPLATE* tib;
197     for (i = 0; i < __xmlvm_num_tib; i++) {
198         tib = __xmlvm_tib_list[i];
199         if (xmlvm_java_string_cmp(n1, tib->className)) {
200         	XMLVM_REFLECTION_USED(tib->className)
201             break;
202         }
203     }
204     if (i == __xmlvm_num_tib) {
205         // Class not found
206         XMLVM_THROW(java_lang_ClassNotFoundException)
207     }
208     if (!tib->classInitialized) {
209         Func_V initFunc = tib->classInitializer;
210         initFunc();
211         //TODO: static initializers should only be run if n2==true
212         //but can't skip initFunf here, since that initializes the core data structues
213     }
214     clazz = tib->clazz;
215     XMLVMUtil_HashMap_put(classMap, n1, clazz);
216     return clazz;
217     //XMLVM_END_NATIVE
218 }
219 
java_lang_Class_getClasses__(JAVA_OBJECT me)220 JAVA_OBJECT java_lang_Class_getClasses__(JAVA_OBJECT me)
221 {
222     //XMLVM_BEGIN_NATIVE[java_lang_Class_getClasses__]
223     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
224     //XMLVM_END_NATIVE
225 }
226 
java_lang_Class_verify__(JAVA_OBJECT me)227 void java_lang_Class_verify__(JAVA_OBJECT me)
228 {
229     //XMLVM_BEGIN_NATIVE[java_lang_Class_verify__]
230     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
231     //XMLVM_END_NATIVE
232 }
233 
java_lang_Class_getAnnotation___java_lang_Class(JAVA_OBJECT me,JAVA_OBJECT n1)234 JAVA_OBJECT java_lang_Class_getAnnotation___java_lang_Class(JAVA_OBJECT me, JAVA_OBJECT n1)
235 {
236     //XMLVM_BEGIN_NATIVE[java_lang_Class_getAnnotation___java_lang_Class]
237     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
238     //XMLVM_END_NATIVE
239 }
240 
java_lang_Class_getAnnotations__(JAVA_OBJECT me)241 JAVA_OBJECT java_lang_Class_getAnnotations__(JAVA_OBJECT me)
242 {
243     //XMLVM_BEGIN_NATIVE[java_lang_Class_getAnnotations__]
244     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
245     //XMLVM_END_NATIVE
246 }
247 
java_lang_Class_getComponentType__(JAVA_OBJECT me)248 JAVA_OBJECT java_lang_Class_getComponentType__(JAVA_OBJECT me)
249 {
250     //XMLVM_BEGIN_NATIVE[java_lang_Class_getComponentType__]
251     java_lang_Class* thiz = (java_lang_Class*) me;
252     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
253     if ((tib->flags & XMLVM_TYPE_ARRAY) == 0) {
254         // This is not an array
255         return JAVA_NULL;
256     }
257     return tib->baseType;
258     //XMLVM_END_NATIVE
259 }
260 
java_lang_Class_getConstructors__(JAVA_OBJECT me)261 JAVA_OBJECT java_lang_Class_getConstructors__(JAVA_OBJECT me)
262 {
263     //XMLVM_BEGIN_NATIVE[java_lang_Class_getConstructors__]
264     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
265     //XMLVM_END_NATIVE
266 }
267 
java_lang_Class_getDeclaredAnnotations__(JAVA_OBJECT me)268 JAVA_OBJECT java_lang_Class_getDeclaredAnnotations__(JAVA_OBJECT me)
269 {
270     //XMLVM_BEGIN_NATIVE[java_lang_Class_getDeclaredAnnotations__]
271     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
272     //XMLVM_END_NATIVE
273 }
274 
java_lang_Class_getDeclaredClasses__(JAVA_OBJECT me)275 JAVA_OBJECT java_lang_Class_getDeclaredClasses__(JAVA_OBJECT me)
276 {
277     //XMLVM_BEGIN_NATIVE[java_lang_Class_getDeclaredClasses__]
278     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
279     //XMLVM_END_NATIVE
280 }
281 
java_lang_Class_getDeclaredConstructors__(JAVA_OBJECT me)282 JAVA_OBJECT java_lang_Class_getDeclaredConstructors__(JAVA_OBJECT me)
283 {
284     //XMLVM_BEGIN_NATIVE[java_lang_Class_getDeclaredConstructors__]
285     java_lang_Class* thiz = (java_lang_Class*) me;
286     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
287     XMLVM_REFLECTION_USED(tib->className)
288     int numConstructors = tib->numDeclaredConstructors;
289     Func_OOO dispatcher = tib->constructorDispatcherFunc;
290     if (!__TIB_java_lang_reflect_Constructor.classInitialized) __INIT_java_lang_reflect_Constructor();
291     org_xmlvm_runtime_XMLVMArray* constructors = XMLVMArray_createSingleDimension(__CLASS_java_lang_reflect_Constructor, numConstructors);
292     JAVA_ARRAY_OBJECT* constructorArray = (JAVA_ARRAY_OBJECT*) constructors->fields.org_xmlvm_runtime_XMLVMArray.array_;
293     JAVA_INT slot = 0;
294     for (slot = 0; slot < numConstructors; slot++) {
295         java_lang_reflect_Constructor* constructor = __NEW_java_lang_reflect_Constructor();
296         XMLVM_CONSTRUCTOR_REFLECTION_DATA* currentConstructor = (tib->declaredConstructors) + slot;
297         int numParameters = currentConstructor->numParameterTypes;
298         org_xmlvm_runtime_XMLVMArray* parameters = XMLVMArray_createSingleDimension(__CLASS_java_lang_Class, numParameters);
299         JAVA_ARRAY_OBJECT* parameterArray = (JAVA_ARRAY_OBJECT*) parameters->fields.org_xmlvm_runtime_XMLVMArray.array_;
300         int j = 0;
301         JAVA_OBJECT** paramTypes = currentConstructor->parameterTypes;
302         for (j = 0; j < numParameters; j++) {
303             parameterArray[j] = *(paramTypes[j]);
304         }
305         JAVA_OBJECT*  checkedExceptions = JAVA_NULL;
306         int          numCheckedExceptions = 0;
307         int          modifiers = 0;
308         java_lang_String* signature = xmlvm_create_java_string(currentConstructor->signature);
309         JAVA_OBJECT  annotations = JAVA_NULL;
310         JAVA_OBJECT  parameterAnnotations = JAVA_NULL;
311         java_lang_reflect_Constructor___INIT____java_lang_Class_java_lang_Class_1ARRAY_java_lang_Class_1ARRAY_int_java_lang_Object_int_java_lang_String_byte_1ARRAY_byte_1ARRAY(constructor, tib->clazz, parameters, checkedExceptions, modifiers, dispatcher, slot, signature, annotations, parameterAnnotations);
312         constructorArray[slot] = constructor;
313     }
314     return constructors;
315     //XMLVM_END_NATIVE
316 }
317 
java_lang_Class_getDeclaredField___java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1)318 JAVA_OBJECT java_lang_Class_getDeclaredField___java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1)
319 {
320     //XMLVM_BEGIN_NATIVE[java_lang_Class_getDeclaredField___java_lang_String]
321     java_lang_Class* thiz = (java_lang_Class*) me;
322     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
323     XMLVM_REFLECTION_USED(tib->className)
324     int numFields = tib->numDeclaredFields;
325     if (!__TIB_java_lang_reflect_Field.classInitialized) __INIT_java_lang_reflect_Field();
326     int i = 0;
327     for (i = 0; i < numFields; i++) {
328         XMLVM_FIELD_REFLECTION_DATA* currentField = (tib->declaredFields) + i;
329         java_lang_String* name = xmlvm_create_java_string(currentField->name);
330         if(java_lang_Object_equals___java_lang_Object(name, n1))
331         {
332             java_lang_reflect_Field* field = __NEW_java_lang_reflect_Field();
333             java_lang_Class* declaringClass = tib->clazz;
334             java_lang_Class* type = *(currentField->type);
335             JAVA_INT modifiers = currentField->modifiers;
336             JAVA_INT offset = currentField->offset;
337             JAVA_OBJECT* address = currentField->address;
338             java_lang_String* signature = xmlvm_create_java_string(currentField->signature);
339             org_xmlvm_runtime_XMLVMArray* annotations = currentField->annotations;
340             java_lang_reflect_Field___INIT____java_lang_Class_java_lang_String_java_lang_Class_int_int_java_lang_Object_java_lang_String_byte_1ARRAY(field, declaringClass, name, type, modifiers, offset, address, signature, annotations);
341 
342             return field;
343         }
344     }
345 
346     XMLVM_THROW(java_lang_NoSuchFieldException)
347     //XMLVM_END_NATIVE
348 }
349 
java_lang_Class_getDeclaredFields__(JAVA_OBJECT me)350 JAVA_OBJECT java_lang_Class_getDeclaredFields__(JAVA_OBJECT me)
351 {
352     //XMLVM_BEGIN_NATIVE[java_lang_Class_getDeclaredFields__]
353     java_lang_Class* thiz = (java_lang_Class*) me;
354     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
355     XMLVM_REFLECTION_USED(tib->className)
356     int numFields = tib->numDeclaredFields;
357     if (!__TIB_java_lang_reflect_Field.classInitialized) __INIT_java_lang_reflect_Field();
358     org_xmlvm_runtime_XMLVMArray* fields = XMLVMArray_createSingleDimension(__CLASS_java_lang_reflect_Field, numFields);
359     JAVA_ARRAY_OBJECT* fieldsArray = (JAVA_ARRAY_OBJECT*) fields->fields.org_xmlvm_runtime_XMLVMArray.array_;
360     int i = 0;
361     for (i = 0; i < numFields; i++) {
362         java_lang_reflect_Field* field = __NEW_java_lang_reflect_Field();
363         XMLVM_FIELD_REFLECTION_DATA* currentField = (tib->declaredFields) + i;
364         java_lang_Class* declaringClass = tib->clazz;
365         java_lang_String* name = xmlvm_create_java_string(currentField->name);
366         java_lang_Class* type = *(currentField->type);
367         JAVA_INT modifiers = currentField->modifiers;
368         JAVA_INT offset = currentField->offset;
369         JAVA_OBJECT* address = currentField->address;
370         java_lang_String* signature = xmlvm_create_java_string(currentField->signature);
371         org_xmlvm_runtime_XMLVMArray* annotations = currentField->annotations;
372         java_lang_reflect_Field___INIT____java_lang_Class_java_lang_String_java_lang_Class_int_int_java_lang_Object_java_lang_String_byte_1ARRAY(field, declaringClass, name, type, modifiers, offset, address, signature, annotations);
373         fieldsArray[i] = field;
374     }
375     return fields;
376     //XMLVM_END_NATIVE
377 }
378 
java_lang_Class_getDeclaredMethods__(JAVA_OBJECT me)379 JAVA_OBJECT java_lang_Class_getDeclaredMethods__(JAVA_OBJECT me)
380 {
381     //XMLVM_BEGIN_NATIVE[java_lang_Class_getDeclaredMethods__]
382     java_lang_Class* thiz = (java_lang_Class*) me;
383     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
384     XMLVM_REFLECTION_USED(tib->className)
385     int numMethods = tib->numDeclaredMethods;
386     Func_OOOO dispatcher = tib->methodDispatcherFunc;
387     if (!__TIB_java_lang_reflect_Method.classInitialized) __INIT_java_lang_reflect_Method();
388     org_xmlvm_runtime_XMLVMArray* methods = XMLVMArray_createSingleDimension(__CLASS_java_lang_reflect_Method, numMethods);
389     JAVA_ARRAY_OBJECT* methodArray = (JAVA_ARRAY_OBJECT*) methods->fields.org_xmlvm_runtime_XMLVMArray.array_;
390     JAVA_INT slot = 0;
391     for (slot = 0; slot < numMethods; slot++) {
392         java_lang_reflect_Method* method = __NEW_java_lang_reflect_Method();
393         XMLVM_METHOD_REFLECTION_DATA* currentMethod = (tib->declaredMethods) + slot;
394         int numParameters = currentMethod->numParameterTypes;
395         org_xmlvm_runtime_XMLVMArray* parameters = XMLVMArray_createSingleDimension(__CLASS_java_lang_Class, numParameters);
396         JAVA_ARRAY_OBJECT* parameterArray = (JAVA_ARRAY_OBJECT*) parameters->fields.org_xmlvm_runtime_XMLVMArray.array_;
397         int j = 0;
398         JAVA_OBJECT** paramTypes = currentMethod->parameterTypes;
399         for (j = 0; j < numParameters; j++) {
400             parameterArray[j] = *(paramTypes[j]);
401         }
402         java_lang_String* name = xmlvm_create_java_string(currentMethod->name);
403         JAVA_OBJECT*  checkedExceptions = JAVA_NULL;
404         int          numCheckedExceptions = 0;
405         int          modifiers = 0;
406         java_lang_String* signature = xmlvm_create_java_string(currentMethod->signature);
407         JAVA_OBJECT  annotations = JAVA_NULL;
408         JAVA_OBJECT  parameterAnnotations = JAVA_NULL;
409         java_lang_reflect_Method___INIT____java_lang_String_java_lang_Class_java_lang_Class_1ARRAY_java_lang_Class_1ARRAY_int_java_lang_Object_int_java_lang_String_byte_1ARRAY_byte_1ARRAY(method, name, tib->clazz, parameters, checkedExceptions, modifiers, dispatcher, slot, signature, annotations, parameterAnnotations);
410         methodArray[slot] = method;
411     }
412     return methods;
413     //XMLVM_END_NATIVE
414 }
415 
java_lang_Class_getEnclosingClass__(JAVA_OBJECT me)416 JAVA_OBJECT java_lang_Class_getEnclosingClass__(JAVA_OBJECT me)
417 {
418     //XMLVM_BEGIN_NATIVE[java_lang_Class_getEnclosingClass__]
419     java_lang_Class* thiz = (java_lang_Class*) me;
420     __TIB_DEFINITION_java_lang_Object* tib = (__TIB_DEFINITION_java_lang_Object*) thiz->fields.java_lang_Class.tib_;
421     XMLVM_REFLECTION_USED(tib->className)
422     if(!tib->enclosingClassName)
423         return JAVA_NULL;
424     else
425         return java_lang_Class_forName___java_lang_String(xmlvm_create_java_string(tib->enclosingClassName));
426     //XMLVM_END_NATIVE
427 }
428 
java_lang_Class_getEnclosingConstructor__(JAVA_OBJECT me)429 JAVA_OBJECT java_lang_Class_getEnclosingConstructor__(JAVA_OBJECT me)
430 {
431     //XMLVM_BEGIN_NATIVE[java_lang_Class_getEnclosingConstructor__]
432     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
433     //XMLVM_END_NATIVE
434 }
435 
java_lang_Class_getEnclosingMethod__(JAVA_OBJECT me)436 JAVA_OBJECT java_lang_Class_getEnclosingMethod__(JAVA_OBJECT me)
437 {
438     //XMLVM_BEGIN_NATIVE[java_lang_Class_getEnclosingMethod__]
439     java_lang_Class* thiz = (java_lang_Class*) me;
440     __TIB_DEFINITION_java_lang_Class* tib = (__TIB_DEFINITION_java_lang_Class*) thiz->fields.java_lang_Class.tib_;
441     XMLVM_REFLECTION_USED(tib->className)
442     java_lang_Class* enclosingClass=java_lang_Class_getEnclosingClass__(me);
443 
444     if(enclosingClass!=JAVA_NULL)
445     {
446         if(tib->enclosingMethodName!=JAVA_NULL)
447         {
448             org_xmlvm_runtime_XMLVMArray* methods=java_lang_Class_getDeclaredMethods__(enclosingClass);
449             JAVA_ARRAY_OBJECT* methodArray = (JAVA_ARRAY_OBJECT*) methods->fields.org_xmlvm_runtime_XMLVMArray.array_;
450 
451             for (int i=0;i<methods->fields.org_xmlvm_runtime_XMLVMArray.length_;i++)
452             {
453                 java_lang_reflect_Method* method=methodArray[i];
454 
455                 java_lang_String* methodName=java_lang_reflect_Method_getName__(method);
456 
457                 //this is just a quick hack, we need to check for parameters etc...
458                 if(strstr(tib->enclosingMethodName, xmlvm_java_string_to_const_char(methodName)))
459                 {
460                     return method;
461                 }
462             }
463         }
464     }
465     return JAVA_NULL;
466     //XMLVM_END_NATIVE
467 }
468 
java_lang_Class_getEnumConstants__(JAVA_OBJECT me)469 JAVA_OBJECT java_lang_Class_getEnumConstants__(JAVA_OBJECT me)
470 {
471     //XMLVM_BEGIN_NATIVE[java_lang_Class_getEnumConstants__]
472     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
473     //XMLVM_END_NATIVE
474 }
475 
java_lang_Class_getField___java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1)476 JAVA_OBJECT java_lang_Class_getField___java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1)
477 {
478     //XMLVM_BEGIN_NATIVE[java_lang_Class_getField___java_lang_String]
479     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
480     //XMLVM_END_NATIVE
481 }
482 
java_lang_Class_getFields__(JAVA_OBJECT me)483 JAVA_OBJECT java_lang_Class_getFields__(JAVA_OBJECT me)
484 {
485     //XMLVM_BEGIN_NATIVE[java_lang_Class_getFields__]
486     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
487     //XMLVM_END_NATIVE
488 }
489 
java_lang_Class_getInterfaces__(JAVA_OBJECT me)490 JAVA_OBJECT java_lang_Class_getInterfaces__(JAVA_OBJECT me)
491 {
492     //XMLVM_BEGIN_NATIVE[java_lang_Class_getInterfaces__]
493     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
494     //XMLVM_END_NATIVE
495 }
496 
java_lang_Class_getModifiers__(JAVA_OBJECT me)497 JAVA_INT java_lang_Class_getModifiers__(JAVA_OBJECT me)
498 {
499     //XMLVM_BEGIN_NATIVE[java_lang_Class_getModifiers__]
500     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
501     //XMLVM_END_NATIVE
502 }
503 
java_lang_Class_getName__(JAVA_OBJECT me)504 JAVA_OBJECT java_lang_Class_getName__(JAVA_OBJECT me)
505 {
506     //XMLVM_BEGIN_NATIVE[java_lang_Class_getName__]
507     //TODO not quite correct
508     java_lang_Class* thiz = (java_lang_Class*) me;
509     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
510     XMLVM_REFLECTION_USED(tib->className)
511     return xmlvm_create_java_string(tib->className);
512     //XMLVM_END_NATIVE
513 }
514 
java_lang_Class_getSimpleName__(JAVA_OBJECT me)515 JAVA_OBJECT java_lang_Class_getSimpleName__(JAVA_OBJECT me)
516 {
517     //XMLVM_BEGIN_NATIVE[java_lang_Class_getSimpleName__]
518     //TODO not quite correct
519     java_lang_Class* thiz = (java_lang_Class*) me;
520     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
521     XMLVM_REFLECTION_USED(tib->className)
522     return xmlvm_create_java_string(tib->className);
523     //XMLVM_END_NATIVE
524 }
525 
java_lang_Class_getProtectionDomain__(JAVA_OBJECT me)526 JAVA_OBJECT java_lang_Class_getProtectionDomain__(JAVA_OBJECT me)
527 {
528     //XMLVM_BEGIN_NATIVE[java_lang_Class_getProtectionDomain__]
529     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
530     //XMLVM_END_NATIVE
531 }
532 
java_lang_Class_getPDImpl__(JAVA_OBJECT me)533 JAVA_OBJECT java_lang_Class_getPDImpl__(JAVA_OBJECT me)
534 {
535     //XMLVM_BEGIN_NATIVE[java_lang_Class_getPDImpl__]
536     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
537     //XMLVM_END_NATIVE
538 }
539 
java_lang_Class_getSigners__(JAVA_OBJECT me)540 JAVA_OBJECT java_lang_Class_getSigners__(JAVA_OBJECT me)
541 {
542     //XMLVM_BEGIN_NATIVE[java_lang_Class_getSigners__]
543     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
544     //XMLVM_END_NATIVE
545 }
546 
java_lang_Class_getSuperclass__(JAVA_OBJECT me)547 JAVA_OBJECT java_lang_Class_getSuperclass__(JAVA_OBJECT me)
548 {
549     //XMLVM_BEGIN_NATIVE[java_lang_Class_getSuperclass__]
550     java_lang_Class* thiz = (java_lang_Class*) me;
551     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
552     XMLVM_REFLECTION_USED(tib->className)
553     __TIB_DEFINITION_TEMPLATE* baseTIP = tib->extends;
554     if (baseTIP == JAVA_NULL) {
555         return JAVA_NULL;
556     }
557     return baseTIP->clazz;
558     //XMLVM_END_NATIVE
559 }
560 
java_lang_Class_isAnnotation__(JAVA_OBJECT me)561 JAVA_BOOLEAN java_lang_Class_isAnnotation__(JAVA_OBJECT me)
562 {
563     //XMLVM_BEGIN_NATIVE[java_lang_Class_isAnnotation__]
564     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
565     //XMLVM_END_NATIVE
566 }
567 
java_lang_Class_isAnnotationPresent___java_lang_Class(JAVA_OBJECT me,JAVA_OBJECT n1)568 JAVA_BOOLEAN java_lang_Class_isAnnotationPresent___java_lang_Class(JAVA_OBJECT me, JAVA_OBJECT n1)
569 {
570     //XMLVM_BEGIN_NATIVE[java_lang_Class_isAnnotationPresent___java_lang_Class]
571     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
572     //XMLVM_END_NATIVE
573 }
574 
java_lang_Class_isAnonymousClass__(JAVA_OBJECT me)575 JAVA_BOOLEAN java_lang_Class_isAnonymousClass__(JAVA_OBJECT me)
576 {
577     //XMLVM_BEGIN_NATIVE[java_lang_Class_isAnonymousClass__]
578     java_lang_Class* thiz = (java_lang_Class*) me;
579     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
580     XMLVM_REFLECTION_USED(tib->className)
581     //TODO correct check for anonymous
582     return 0;
583     //XMLVM_END_NATIVE
584 }
585 
java_lang_Class_isArray__(JAVA_OBJECT me)586 JAVA_BOOLEAN java_lang_Class_isArray__(JAVA_OBJECT me)
587 {
588     //XMLVM_BEGIN_NATIVE[java_lang_Class_isArray__]
589     java_lang_Class* thiz = (java_lang_Class*) me;
590     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
591     XMLVM_REFLECTION_USED(tib->className)
592     return (tib->flags & XMLVM_TYPE_ARRAY) != 0;
593     //XMLVM_END_NATIVE
594 }
595 
java_lang_Class_isAssignableFrom___java_lang_Class(JAVA_OBJECT me,JAVA_OBJECT n1)596 JAVA_BOOLEAN java_lang_Class_isAssignableFrom___java_lang_Class(JAVA_OBJECT me, JAVA_OBJECT n1)
597 {
598     //XMLVM_BEGIN_NATIVE[java_lang_Class_isAssignableFrom___java_lang_Class]
599     java_lang_Class* thiz = (java_lang_Class*) me;
600     java_lang_Class* that = (java_lang_Class*) n1;
601 
602     // check parameters
603     if (!that)
604     {
605         XMLVM_THROW_WITH_CSTRING(java_lang_NullPointerException, "fromClazz argument");
606     }
607 
608     // if primitive class
609     if (java_lang_Class_isPrimitive__(thiz))
610         return thiz==that;
611 
612     // if non primitive
613     java_lang_Class* compareTo=thiz;
614     while(compareTo!=JAVA_NULL)
615     {
616         if (compareTo==that)
617             return 1;
618         compareTo = java_lang_Class_getSuperclass__(compareTo);
619     }
620     return 0;
621 
622 
623     //XMLVM_END_NATIVE
624 }
625 
java_lang_Class_isEnum__(JAVA_OBJECT me)626 JAVA_BOOLEAN java_lang_Class_isEnum__(JAVA_OBJECT me)
627 {
628     //XMLVM_BEGIN_NATIVE[java_lang_Class_isEnum__]
629     java_lang_Class* thiz = (java_lang_Class*) me;
630     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
631     return (tib->flags & XMLVM_TYPE_ENUM) != 0;
632     //XMLVM_END_NATIVE
633 }
634 
java_lang_Class_isInstance___java_lang_Object(JAVA_OBJECT me,JAVA_OBJECT n1)635 JAVA_BOOLEAN java_lang_Class_isInstance___java_lang_Object(JAVA_OBJECT me, JAVA_OBJECT n1)
636 {
637     //XMLVM_BEGIN_NATIVE[java_lang_Class_isInstance___java_lang_Object]
638     return XMLVM_ISA(n1, me);
639     //XMLVM_END_NATIVE
640 }
641 
java_lang_Class_isInterface__(JAVA_OBJECT me)642 JAVA_BOOLEAN java_lang_Class_isInterface__(JAVA_OBJECT me)
643 {
644     //XMLVM_BEGIN_NATIVE[java_lang_Class_isInterface__]
645     java_lang_Class* thiz = (java_lang_Class*) me;
646     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
647     XMLVM_REFLECTION_USED(tib->className)
648     return (tib->flags & XMLVM_TYPE_INTERFACE) != 0;
649     //XMLVM_END_NATIVE
650 }
651 
java_lang_Class_isLocalClass__(JAVA_OBJECT me)652 JAVA_BOOLEAN java_lang_Class_isLocalClass__(JAVA_OBJECT me)
653 {
654     //XMLVM_BEGIN_NATIVE[java_lang_Class_isLocalClass__]
655     java_lang_Class* thiz = (java_lang_Class*) me;
656     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
657     //TODO correct check for local
658     return 0;
659     //XMLVM_END_NATIVE
660 }
661 
java_lang_Class_isMemberClass__(JAVA_OBJECT me)662 JAVA_BOOLEAN java_lang_Class_isMemberClass__(JAVA_OBJECT me)
663 {
664     //XMLVM_BEGIN_NATIVE[java_lang_Class_isMemberClass__]
665     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
666     //XMLVM_END_NATIVE
667 }
668 
java_lang_Class_isPrimitive__(JAVA_OBJECT me)669 JAVA_BOOLEAN java_lang_Class_isPrimitive__(JAVA_OBJECT me)
670 {
671     //XMLVM_BEGIN_NATIVE[java_lang_Class_isPrimitive__]
672     java_lang_Class* thiz = (java_lang_Class*) me;
673     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
674     return (tib->flags & XMLVM_TYPE_PRIMITIVE) != 0;
675     //XMLVM_END_NATIVE
676 }
677 
java_lang_Class_isSynthetic__(JAVA_OBJECT me)678 JAVA_BOOLEAN java_lang_Class_isSynthetic__(JAVA_OBJECT me)
679 {
680     //XMLVM_BEGIN_NATIVE[java_lang_Class_isSynthetic__]
681     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
682     //XMLVM_END_NATIVE
683 }
684 
java_lang_Class_newInstance__(JAVA_OBJECT me)685 JAVA_OBJECT java_lang_Class_newInstance__(JAVA_OBJECT me)
686 {
687     //XMLVM_BEGIN_NATIVE[java_lang_Class_newInstance__]
688     java_lang_Class* thiz = (java_lang_Class*) me;
689     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
690     XMLVM_REFLECTION_USED(tib->className)
691     Func_O func = tib->newInstanceFunc;
692     return (*func)();
693     //XMLVM_END_NATIVE
694 }
695 
java_lang_Class_getPackageString__(JAVA_OBJECT me)696 JAVA_OBJECT java_lang_Class_getPackageString__(JAVA_OBJECT me)
697 {
698     //XMLVM_BEGIN_NATIVE[java_lang_Class_getPackageString__]
699     java_lang_Class* thiz = (java_lang_Class*) me;
700     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
701     XMLVM_REFLECTION_USED(tib->className)
702     return tib->packageName?xmlvm_create_java_string(tib->packageName):JAVA_NULL;
703     //XMLVM_END_NATIVE
704 }
705 
java_lang_Class_desiredAssertionStatus__(JAVA_OBJECT me)706 JAVA_BOOLEAN java_lang_Class_desiredAssertionStatus__(JAVA_OBJECT me)
707 {
708     //XMLVM_BEGIN_NATIVE[java_lang_Class_desiredAssertionStatus__]
709     return 0;
710     //XMLVM_END_NATIVE
711 }
712 
java_lang_Class_asSubclass___java_lang_Class(JAVA_OBJECT me,JAVA_OBJECT n1)713 JAVA_OBJECT java_lang_Class_asSubclass___java_lang_Class(JAVA_OBJECT me, JAVA_OBJECT n1)
714 {
715     //XMLVM_BEGIN_NATIVE[java_lang_Class_asSubclass___java_lang_Class]
716     XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
717     //XMLVM_END_NATIVE
718 }
719 
java_lang_Class_getSignatureAttribute__(JAVA_OBJECT me)720 JAVA_OBJECT java_lang_Class_getSignatureAttribute__(JAVA_OBJECT me)
721 {
722     //XMLVM_BEGIN_NATIVE[java_lang_Class_getSignatureAttribute__]
723     java_lang_Class* thiz = (java_lang_Class*) me;
724     __TIB_DEFINITION_TEMPLATE* tib = (__TIB_DEFINITION_TEMPLATE*) thiz->fields.java_lang_Class.tib_;
725     XMLVM_REFLECTION_USED(tib->className)
726     return tib->signature?xmlvm_create_java_string(tib->signature):JAVA_NULL;
727     //XMLVM_END_NATIVE
728 }
729 
730 
xmlvm_init_native_java_lang_Class()731 void xmlvm_init_native_java_lang_Class()
732 {
733     //XMLVM_BEGIN_NATIVE_IMPLEMENTATION_INIT
734     //XMLVM_END_NATIVE_IMPLEMENTATION_INIT
735 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getClasses__
736     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getClasses__] =
737         (VTABLE_PTR) java_lang_Class_getClasses__;
738 #endif
739 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_verify__
740     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_verify__] =
741         (VTABLE_PTR) java_lang_Class_verify__;
742 #endif
743 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getAnnotation___java_lang_Class
744     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getAnnotation___java_lang_Class] =
745         (VTABLE_PTR) java_lang_Class_getAnnotation___java_lang_Class;
746 #endif
747 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getAnnotations__
748     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getAnnotations__] =
749         (VTABLE_PTR) java_lang_Class_getAnnotations__;
750 #endif
751 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getComponentType__
752     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getComponentType__] =
753         (VTABLE_PTR) java_lang_Class_getComponentType__;
754 #endif
755 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getConstructors__
756     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getConstructors__] =
757         (VTABLE_PTR) java_lang_Class_getConstructors__;
758 #endif
759 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredAnnotations__
760     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredAnnotations__] =
761         (VTABLE_PTR) java_lang_Class_getDeclaredAnnotations__;
762 #endif
763 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredClasses__
764     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredClasses__] =
765         (VTABLE_PTR) java_lang_Class_getDeclaredClasses__;
766 #endif
767 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredConstructors__
768     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredConstructors__] =
769         (VTABLE_PTR) java_lang_Class_getDeclaredConstructors__;
770 #endif
771 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredField___java_lang_String
772     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredField___java_lang_String] =
773         (VTABLE_PTR) java_lang_Class_getDeclaredField___java_lang_String;
774 #endif
775 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredFields__
776     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredFields__] =
777         (VTABLE_PTR) java_lang_Class_getDeclaredFields__;
778 #endif
779 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredMethods__
780     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getDeclaredMethods__] =
781         (VTABLE_PTR) java_lang_Class_getDeclaredMethods__;
782 #endif
783 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getEnclosingClass__
784     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getEnclosingClass__] =
785         (VTABLE_PTR) java_lang_Class_getEnclosingClass__;
786 #endif
787 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getEnclosingConstructor__
788     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getEnclosingConstructor__] =
789         (VTABLE_PTR) java_lang_Class_getEnclosingConstructor__;
790 #endif
791 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getEnclosingMethod__
792     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getEnclosingMethod__] =
793         (VTABLE_PTR) java_lang_Class_getEnclosingMethod__;
794 #endif
795 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getEnumConstants__
796     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getEnumConstants__] =
797         (VTABLE_PTR) java_lang_Class_getEnumConstants__;
798 #endif
799 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getField___java_lang_String
800     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getField___java_lang_String] =
801         (VTABLE_PTR) java_lang_Class_getField___java_lang_String;
802 #endif
803 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getFields__
804     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getFields__] =
805         (VTABLE_PTR) java_lang_Class_getFields__;
806 #endif
807 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getInterfaces__
808     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getInterfaces__] =
809         (VTABLE_PTR) java_lang_Class_getInterfaces__;
810 #endif
811 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getModifiers__
812     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getModifiers__] =
813         (VTABLE_PTR) java_lang_Class_getModifiers__;
814 #endif
815 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getName__
816     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getName__] =
817         (VTABLE_PTR) java_lang_Class_getName__;
818 #endif
819 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getSimpleName__
820     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getSimpleName__] =
821         (VTABLE_PTR) java_lang_Class_getSimpleName__;
822 #endif
823 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getProtectionDomain__
824     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getProtectionDomain__] =
825         (VTABLE_PTR) java_lang_Class_getProtectionDomain__;
826 #endif
827 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getPDImpl__
828     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getPDImpl__] =
829         (VTABLE_PTR) java_lang_Class_getPDImpl__;
830 #endif
831 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getSigners__
832     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getSigners__] =
833         (VTABLE_PTR) java_lang_Class_getSigners__;
834 #endif
835 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_getSuperclass__
836     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_getSuperclass__] =
837         (VTABLE_PTR) java_lang_Class_getSuperclass__;
838 #endif
839 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isAnnotation__
840     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isAnnotation__] =
841         (VTABLE_PTR) java_lang_Class_isAnnotation__;
842 #endif
843 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isAnnotationPresent___java_lang_Class
844     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isAnnotationPresent___java_lang_Class] =
845         (VTABLE_PTR) java_lang_Class_isAnnotationPresent___java_lang_Class;
846 #endif
847 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isAnonymousClass__
848     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isAnonymousClass__] =
849         (VTABLE_PTR) java_lang_Class_isAnonymousClass__;
850 #endif
851 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isArray__
852     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isArray__] =
853         (VTABLE_PTR) java_lang_Class_isArray__;
854 #endif
855 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isAssignableFrom___java_lang_Class
856     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isAssignableFrom___java_lang_Class] =
857         (VTABLE_PTR) java_lang_Class_isAssignableFrom___java_lang_Class;
858 #endif
859 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isEnum__
860     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isEnum__] =
861         (VTABLE_PTR) java_lang_Class_isEnum__;
862 #endif
863 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isInstance___java_lang_Object
864     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isInstance___java_lang_Object] =
865         (VTABLE_PTR) java_lang_Class_isInstance___java_lang_Object;
866 #endif
867 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isInterface__
868     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isInterface__] =
869         (VTABLE_PTR) java_lang_Class_isInterface__;
870 #endif
871 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isLocalClass__
872     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isLocalClass__] =
873         (VTABLE_PTR) java_lang_Class_isLocalClass__;
874 #endif
875 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isMemberClass__
876     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isMemberClass__] =
877         (VTABLE_PTR) java_lang_Class_isMemberClass__;
878 #endif
879 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isPrimitive__
880     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isPrimitive__] =
881         (VTABLE_PTR) java_lang_Class_isPrimitive__;
882 #endif
883 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_isSynthetic__
884     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_isSynthetic__] =
885         (VTABLE_PTR) java_lang_Class_isSynthetic__;
886 #endif
887 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_newInstance__
888     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_newInstance__] =
889         (VTABLE_PTR) java_lang_Class_newInstance__;
890 #endif
891 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_desiredAssertionStatus__
892     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_desiredAssertionStatus__] =
893         (VTABLE_PTR) java_lang_Class_desiredAssertionStatus__;
894 #endif
895 #ifdef XMLVM_VTABLE_IDX_java_lang_Class_asSubclass___java_lang_Class
896     __TIB_java_lang_Class.vtable[XMLVM_VTABLE_IDX_java_lang_Class_asSubclass___java_lang_Class] =
897         (VTABLE_PTR) java_lang_Class_asSubclass___java_lang_Class;
898 #endif
899 }
900