1 #include "xmlvm.h"
2 #include "java_lang_Class.h"
3 
4 #include "org_xmlvm_runtime_XMLVMArray.h"
5 
6 #define XMLVM_CURRENT_CLASS_NAME XMLVMArray
7 #define XMLVM_CURRENT_PKG_CLASS_NAME org_xmlvm_runtime_XMLVMArray
8 
9 __TIB_DEFINITION_org_xmlvm_runtime_XMLVMArray __TIB_org_xmlvm_runtime_XMLVMArray = {
10     0, // classInitializationBegan
11     0, // classInitialized
12     -1, // initializerThreadId
13     __INIT_org_xmlvm_runtime_XMLVMArray, // classInitializer
14     "org.xmlvm.runtime.XMLVMArray", // className
15     "org.xmlvm.runtime", // package
16     JAVA_NULL, // enclosingClassName
17     JAVA_NULL, // enclosingMethodName
18     JAVA_NULL, // signature
19     (__TIB_DEFINITION_TEMPLATE*) &__TIB_java_lang_Object, // extends
20     sizeof(org_xmlvm_runtime_XMLVMArray), // sizeInstance
21     XMLVM_TYPE_CLASS};
22 
23 JAVA_OBJECT __CLASS_org_xmlvm_runtime_XMLVMArray;
24 JAVA_OBJECT __CLASS_org_xmlvm_runtime_XMLVMArray_1ARRAY;
25 JAVA_OBJECT __CLASS_org_xmlvm_runtime_XMLVMArray_2ARRAY;
26 JAVA_OBJECT __CLASS_org_xmlvm_runtime_XMLVMArray_3ARRAY;
27 //XMLVM_BEGIN_IMPLEMENTATION
28 //XMLVM_END_IMPLEMENTATION
29 
30 static JAVA_LONG _STATIC_org_xmlvm_runtime_XMLVMArray_serialVersionUID;
31 
32 #include "xmlvm-reflection.h"
33 
34 static XMLVM_FIELD_REFLECTION_DATA __field_reflection_data[] = {
35     {"serialVersionUID",
36     &__CLASS_long,
37     0 | java_lang_reflect_Modifier_PRIVATE | java_lang_reflect_Modifier_STATIC,
38     0,
39     &_STATIC_org_xmlvm_runtime_XMLVMArray_serialVersionUID,
40     "",
41     JAVA_NULL},
42     {"type",
43     &__CLASS_java_lang_Class,
44     0 | java_lang_reflect_Modifier_PRIVATE,
45     XMLVM_OFFSETOF(org_xmlvm_runtime_XMLVMArray, fields.org_xmlvm_runtime_XMLVMArray.type_),
46     0,
47     "",
48     JAVA_NULL},
49     {"length",
50     &__CLASS_int,
51     0 | java_lang_reflect_Modifier_PRIVATE,
52     XMLVM_OFFSETOF(org_xmlvm_runtime_XMLVMArray, fields.org_xmlvm_runtime_XMLVMArray.length_),
53     0,
54     "",
55     JAVA_NULL},
56     {"array",
57     &__CLASS_java_lang_Object,
58     0 | java_lang_reflect_Modifier_PRIVATE,
59     XMLVM_OFFSETOF(org_xmlvm_runtime_XMLVMArray, fields.org_xmlvm_runtime_XMLVMArray.array_),
60     0,
61     "",
62     JAVA_NULL},
63 };
64 
65 static JAVA_OBJECT* __constructor0_arg_types[] = {
66     &__CLASS_java_lang_Class,
67     &__CLASS_int,
68     &__CLASS_java_lang_Object,
69 };
70 
71 static XMLVM_CONSTRUCTOR_REFLECTION_DATA __constructor_reflection_data[] = {
72     {&__constructor0_arg_types[0],
73     sizeof(__constructor0_arg_types) / sizeof(JAVA_OBJECT*),
74     JAVA_NULL,
75     0,
76     0,
77     "(Ljava/lang/Class;ILjava/lang/Object;)V",
78     JAVA_NULL,
79     JAVA_NULL},
80 };
81 
constructor_dispatcher(JAVA_OBJECT constructor,JAVA_OBJECT arguments)82 static JAVA_OBJECT constructor_dispatcher(JAVA_OBJECT constructor, JAVA_OBJECT arguments)
83 {
84     JAVA_OBJECT obj = __NEW_org_xmlvm_runtime_XMLVMArray();
85     java_lang_reflect_Constructor* c = (java_lang_reflect_Constructor*) constructor;
86     org_xmlvm_runtime_XMLVMArray* args = (org_xmlvm_runtime_XMLVMArray*) arguments;
87     JAVA_ARRAY_OBJECT* argsArray = (JAVA_ARRAY_OBJECT*) args->fields.org_xmlvm_runtime_XMLVMArray.array_;
88     switch (c->fields.java_lang_reflect_Constructor.slot_) {
89     case 0:
90         org_xmlvm_runtime_XMLVMArray___INIT____java_lang_Class_int_java_lang_Object(obj, argsArray[0], ((java_lang_Integer*) argsArray[1])->fields.java_lang_Integer.value_, argsArray[2]);
91         break;
92     default:
93         XMLVM_INTERNAL_ERROR();
94         break;
95     }
96     return obj;
97 }
98 
99 static JAVA_OBJECT* __method0_arg_types[] = {
100 };
101 
102 static JAVA_OBJECT* __method1_arg_types[] = {
103     &__CLASS_java_lang_Class,
104     &__CLASS_int,
105 };
106 
107 static JAVA_OBJECT* __method2_arg_types[] = {
108     &__CLASS_java_lang_Class,
109     &__CLASS_int,
110     &__CLASS_java_lang_Object,
111 };
112 
113 static JAVA_OBJECT* __method3_arg_types[] = {
114     &__CLASS_java_lang_Class,
115     &__CLASS_org_xmlvm_runtime_XMLVMArray,
116 };
117 
118 static JAVA_OBJECT* __method4_arg_types[] = {
119     &__CLASS_org_xmlvm_runtime_XMLVMArray,
120     &__CLASS_java_lang_Object,
121 };
122 
123 static JAVA_OBJECT* __method5_arg_types[] = {
124 };
125 
126 static XMLVM_METHOD_REFLECTION_DATA __method_reflection_data[] = {
127     {"initNativeLayer",
128     &__method0_arg_types[0],
129     sizeof(__method0_arg_types) / sizeof(JAVA_OBJECT*),
130     JAVA_NULL,
131     0,
132     0,
133     "()V",
134     JAVA_NULL,
135     JAVA_NULL},
136     {"createSingleDimension",
137     &__method1_arg_types[0],
138     sizeof(__method1_arg_types) / sizeof(JAVA_OBJECT*),
139     JAVA_NULL,
140     0,
141     0,
142     "(Ljava/lang/Class;I)Lorg/xmlvm/runtime/XMLVMArray;",
143     JAVA_NULL,
144     JAVA_NULL},
145     {"createSingleDimensionWithData",
146     &__method2_arg_types[0],
147     sizeof(__method2_arg_types) / sizeof(JAVA_OBJECT*),
148     JAVA_NULL,
149     0,
150     0,
151     "(Ljava/lang/Class;ILjava/lang/Object;)Lorg/xmlvm/runtime/XMLVMArray;",
152     JAVA_NULL,
153     JAVA_NULL},
154     {"createMultiDimensions",
155     &__method3_arg_types[0],
156     sizeof(__method3_arg_types) / sizeof(JAVA_OBJECT*),
157     JAVA_NULL,
158     0,
159     0,
160     "(Ljava/lang/Class;Lorg/xmlvm/runtime/XMLVMArray;)Lorg/xmlvm/runtime/XMLVMArray;",
161     JAVA_NULL,
162     JAVA_NULL},
163     {"fillArray",
164     &__method4_arg_types[0],
165     sizeof(__method4_arg_types) / sizeof(JAVA_OBJECT*),
166     JAVA_NULL,
167     0,
168     0,
169     "(Lorg/xmlvm/runtime/XMLVMArray;Ljava/lang/Object;)V",
170     JAVA_NULL,
171     JAVA_NULL},
172     {"clone",
173     &__method5_arg_types[0],
174     sizeof(__method5_arg_types) / sizeof(JAVA_OBJECT*),
175     JAVA_NULL,
176     0,
177     0,
178     "()Ljava/lang/Object;",
179     JAVA_NULL,
180     JAVA_NULL},
181 };
182 
method_dispatcher(JAVA_OBJECT method,JAVA_OBJECT receiver,JAVA_OBJECT arguments)183 static JAVA_OBJECT method_dispatcher(JAVA_OBJECT method, JAVA_OBJECT receiver, JAVA_OBJECT arguments)
184 {
185     JAVA_OBJECT result = JAVA_NULL;
186     java_lang_Object* obj = receiver;
187     java_lang_reflect_Method* m = (java_lang_reflect_Method*) method;
188     org_xmlvm_runtime_XMLVMArray* args = (org_xmlvm_runtime_XMLVMArray*) arguments;
189     JAVA_ARRAY_OBJECT* argsArray = (JAVA_ARRAY_OBJECT*) args->fields.org_xmlvm_runtime_XMLVMArray.array_;
190     XMLVMElem conversion;
191     switch (m->fields.java_lang_reflect_Method.slot_) {
192     case 0:
193         org_xmlvm_runtime_XMLVMArray_initNativeLayer__();
194         break;
195     case 1:
196         result = (JAVA_OBJECT) org_xmlvm_runtime_XMLVMArray_createSingleDimension___java_lang_Class_int(argsArray[0], ((java_lang_Integer*) argsArray[1])->fields.java_lang_Integer.value_);
197         break;
198     case 2:
199         result = (JAVA_OBJECT) org_xmlvm_runtime_XMLVMArray_createSingleDimensionWithData___java_lang_Class_int_java_lang_Object(argsArray[0], ((java_lang_Integer*) argsArray[1])->fields.java_lang_Integer.value_, argsArray[2]);
200         break;
201     case 3:
202         result = (JAVA_OBJECT) org_xmlvm_runtime_XMLVMArray_createMultiDimensions___java_lang_Class_org_xmlvm_runtime_XMLVMArray(argsArray[0], argsArray[1]);
203         break;
204     case 4:
205         org_xmlvm_runtime_XMLVMArray_fillArray___org_xmlvm_runtime_XMLVMArray_java_lang_Object(argsArray[0], argsArray[1]);
206         break;
207     case 5:
208         result = (JAVA_OBJECT) org_xmlvm_runtime_XMLVMArray_clone__(receiver);
209         break;
210     default:
211         XMLVM_INTERNAL_ERROR();
212         break;
213     }
214     return result;
215 }
216 
__INIT_org_xmlvm_runtime_XMLVMArray()217 void __INIT_org_xmlvm_runtime_XMLVMArray()
218 {
219     staticInitializerLock(&__TIB_org_xmlvm_runtime_XMLVMArray);
220 
221     // While the static initializer mutex is locked, locally store the value of
222     // whether class initialization began or not
223     int initBegan = __TIB_org_xmlvm_runtime_XMLVMArray.classInitializationBegan;
224 
225     // Whether or not class initialization had already began, it has begun now
226     __TIB_org_xmlvm_runtime_XMLVMArray.classInitializationBegan = 1;
227 
228     staticInitializerUnlock(&__TIB_org_xmlvm_runtime_XMLVMArray);
229 
230     JAVA_LONG curThreadId = (JAVA_LONG)pthread_self();
231     if (initBegan) {
232         if (__TIB_org_xmlvm_runtime_XMLVMArray.initializerThreadId != curThreadId) {
233             // Busy wait until the other thread finishes initializing this class
234             while (!__TIB_org_xmlvm_runtime_XMLVMArray.classInitialized) {
235                 // do nothing
236             }
237         }
238     } else {
239         __TIB_org_xmlvm_runtime_XMLVMArray.initializerThreadId = curThreadId;
240         XMLVM_CLASS_USED("org.xmlvm.runtime.XMLVMArray")
241         __INIT_IMPL_org_xmlvm_runtime_XMLVMArray();
242     }
243 }
244 
__INIT_IMPL_org_xmlvm_runtime_XMLVMArray()245 void __INIT_IMPL_org_xmlvm_runtime_XMLVMArray()
246 {
247     // Initialize base class if necessary
248     XMLVM_CLASS_INIT(java_lang_Object)
249     __TIB_org_xmlvm_runtime_XMLVMArray.newInstanceFunc = __NEW_INSTANCE_org_xmlvm_runtime_XMLVMArray;
250     // Copy vtable from base class
251     XMLVM_MEMCPY(__TIB_org_xmlvm_runtime_XMLVMArray.vtable, __TIB_java_lang_Object.vtable, sizeof(__TIB_java_lang_Object.vtable));
252     // Initialize vtable for this class
253     __TIB_org_xmlvm_runtime_XMLVMArray.vtable[0] = (VTABLE_PTR) &xmlvm_unimplemented_native_method;
254     xmlvm_init_native_org_xmlvm_runtime_XMLVMArray();
255     // Initialize interface information
256     __TIB_org_xmlvm_runtime_XMLVMArray.numImplementedInterfaces = 2;
257     __TIB_org_xmlvm_runtime_XMLVMArray.implementedInterfaces = (__TIB_DEFINITION_TEMPLATE* (*)[1]) XMLVM_MALLOC(sizeof(__TIB_DEFINITION_TEMPLATE*) * 2);
258 
259     // Initialize interfaces if necessary and assign tib to implementedInterfaces
260 
261     XMLVM_CLASS_INIT(java_io_Serializable)
262 
263     __TIB_org_xmlvm_runtime_XMLVMArray.implementedInterfaces[0][0] = &__TIB_java_io_Serializable;
264 
265     XMLVM_CLASS_INIT(java_lang_Cloneable)
266 
267     __TIB_org_xmlvm_runtime_XMLVMArray.implementedInterfaces[0][1] = &__TIB_java_lang_Cloneable;
268     // Initialize itable for this class
269     __TIB_org_xmlvm_runtime_XMLVMArray.itableBegin = &__TIB_org_xmlvm_runtime_XMLVMArray.itable[0];
270 
271     _STATIC_org_xmlvm_runtime_XMLVMArray_serialVersionUID = -7775139464511217031;
272 
273     __TIB_org_xmlvm_runtime_XMLVMArray.declaredFields = &__field_reflection_data[0];
274     __TIB_org_xmlvm_runtime_XMLVMArray.numDeclaredFields = sizeof(__field_reflection_data) / sizeof(XMLVM_FIELD_REFLECTION_DATA);
275     __TIB_org_xmlvm_runtime_XMLVMArray.constructorDispatcherFunc = constructor_dispatcher;
276     __TIB_org_xmlvm_runtime_XMLVMArray.declaredConstructors = &__constructor_reflection_data[0];
277     __TIB_org_xmlvm_runtime_XMLVMArray.numDeclaredConstructors = sizeof(__constructor_reflection_data) / sizeof(XMLVM_CONSTRUCTOR_REFLECTION_DATA);
278     __TIB_org_xmlvm_runtime_XMLVMArray.methodDispatcherFunc = method_dispatcher;
279     __TIB_org_xmlvm_runtime_XMLVMArray.declaredMethods = &__method_reflection_data[0];
280     __TIB_org_xmlvm_runtime_XMLVMArray.numDeclaredMethods = sizeof(__method_reflection_data) / sizeof(XMLVM_METHOD_REFLECTION_DATA);
281     __CLASS_org_xmlvm_runtime_XMLVMArray = XMLVM_CREATE_CLASS_OBJECT(&__TIB_org_xmlvm_runtime_XMLVMArray);
282     __TIB_org_xmlvm_runtime_XMLVMArray.clazz = __CLASS_org_xmlvm_runtime_XMLVMArray;
283     __TIB_org_xmlvm_runtime_XMLVMArray.baseType = JAVA_NULL;
284     __CLASS_org_xmlvm_runtime_XMLVMArray_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_org_xmlvm_runtime_XMLVMArray);
285     __CLASS_org_xmlvm_runtime_XMLVMArray_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_org_xmlvm_runtime_XMLVMArray_1ARRAY);
286     __CLASS_org_xmlvm_runtime_XMLVMArray_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_org_xmlvm_runtime_XMLVMArray_2ARRAY);
287     org_xmlvm_runtime_XMLVMArray___CLINIT_();
288     //XMLVM_BEGIN_WRAPPER[__INIT_org_xmlvm_runtime_XMLVMArray]
289     //XMLVM_END_WRAPPER
290 
291     __TIB_org_xmlvm_runtime_XMLVMArray.classInitialized = 1;
292 }
293 
__DELETE_org_xmlvm_runtime_XMLVMArray(void * me,void * client_data)294 void __DELETE_org_xmlvm_runtime_XMLVMArray(void* me, void* client_data)
295 {
296     //XMLVM_BEGIN_WRAPPER[__DELETE_org_xmlvm_runtime_XMLVMArray]
297     //XMLVM_END_WRAPPER
298 }
299 
__INIT_INSTANCE_MEMBERS_org_xmlvm_runtime_XMLVMArray(JAVA_OBJECT me,int derivedClassWillRegisterFinalizer)300 void __INIT_INSTANCE_MEMBERS_org_xmlvm_runtime_XMLVMArray(JAVA_OBJECT me, int derivedClassWillRegisterFinalizer)
301 {
302     __INIT_INSTANCE_MEMBERS_java_lang_Object(me, 0 || derivedClassWillRegisterFinalizer);
303     ((org_xmlvm_runtime_XMLVMArray*) me)->fields.org_xmlvm_runtime_XMLVMArray.type_ = (java_lang_Class*) JAVA_NULL;
304     ((org_xmlvm_runtime_XMLVMArray*) me)->fields.org_xmlvm_runtime_XMLVMArray.length_ = 0;
305     ((org_xmlvm_runtime_XMLVMArray*) me)->fields.org_xmlvm_runtime_XMLVMArray.array_ = (java_lang_Object*) JAVA_NULL;
306     //XMLVM_BEGIN_WRAPPER[__INIT_INSTANCE_MEMBERS_org_xmlvm_runtime_XMLVMArray]
307     //XMLVM_END_WRAPPER
308 }
309 
__NEW_org_xmlvm_runtime_XMLVMArray()310 JAVA_OBJECT __NEW_org_xmlvm_runtime_XMLVMArray()
311 {    XMLVM_CLASS_INIT(org_xmlvm_runtime_XMLVMArray)
312 org_xmlvm_runtime_XMLVMArray* me = (org_xmlvm_runtime_XMLVMArray*) XMLVM_MALLOC(sizeof(org_xmlvm_runtime_XMLVMArray));
313     me->tib = &__TIB_org_xmlvm_runtime_XMLVMArray;
314     __INIT_INSTANCE_MEMBERS_org_xmlvm_runtime_XMLVMArray(me, 0);
315     //XMLVM_BEGIN_WRAPPER[__NEW_org_xmlvm_runtime_XMLVMArray]
316     //XMLVM_END_WRAPPER
317     return me;
318 }
319 
__NEW_INSTANCE_org_xmlvm_runtime_XMLVMArray()320 JAVA_OBJECT __NEW_INSTANCE_org_xmlvm_runtime_XMLVMArray()
321 {
322     JAVA_OBJECT me = JAVA_NULL;
323     return me;
324 }
325 
org_xmlvm_runtime_XMLVMArray_GET_serialVersionUID()326 JAVA_LONG org_xmlvm_runtime_XMLVMArray_GET_serialVersionUID()
327 {
328     XMLVM_CLASS_INIT(org_xmlvm_runtime_XMLVMArray)
329     return _STATIC_org_xmlvm_runtime_XMLVMArray_serialVersionUID;
330 }
331 
org_xmlvm_runtime_XMLVMArray_PUT_serialVersionUID(JAVA_LONG v)332 void org_xmlvm_runtime_XMLVMArray_PUT_serialVersionUID(JAVA_LONG v)
333 {
334     XMLVM_CLASS_INIT(org_xmlvm_runtime_XMLVMArray)
335 _STATIC_org_xmlvm_runtime_XMLVMArray_serialVersionUID = v;
336 }
337 
338 //XMLVM_NATIVE[void org_xmlvm_runtime_XMLVMArray_initNativeLayer__()]
339 
org_xmlvm_runtime_XMLVMArray___INIT____java_lang_Class_int_java_lang_Object(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_INT n2,JAVA_OBJECT n3)340 void org_xmlvm_runtime_XMLVMArray___INIT____java_lang_Class_int_java_lang_Object(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_INT n2, JAVA_OBJECT n3)
341 {
342     //XMLVM_BEGIN_WRAPPER[org_xmlvm_runtime_XMLVMArray___INIT____java_lang_Class_int_java_lang_Object]
343     XMLVM_ENTER_METHOD("org.xmlvm.runtime.XMLVMArray", "<init>", "?")
344     XMLVMElem _r0;
345     XMLVMElem _r1;
346     XMLVMElem _r2;
347     XMLVMElem _r3;
348     _r0.o = me;
349     _r1.o = n1;
350     _r2.i = n2;
351     _r3.o = n3;
352     XMLVM_SOURCE_POSITION("XMLVMArray.java", 64)
353     XMLVM_CHECK_NPE(0)
354     java_lang_Object___INIT___(_r0.o);
355     XMLVM_SOURCE_POSITION("XMLVMArray.java", 65)
356     XMLVM_CHECK_NPE(0)
357     ((org_xmlvm_runtime_XMLVMArray*) _r0.o)->fields.org_xmlvm_runtime_XMLVMArray.type_ = _r1.o;
358     XMLVM_SOURCE_POSITION("XMLVMArray.java", 66)
359     XMLVM_CHECK_NPE(0)
360     ((org_xmlvm_runtime_XMLVMArray*) _r0.o)->fields.org_xmlvm_runtime_XMLVMArray.length_ = _r2.i;
361     XMLVM_SOURCE_POSITION("XMLVMArray.java", 67)
362     XMLVM_CHECK_NPE(0)
363     ((org_xmlvm_runtime_XMLVMArray*) _r0.o)->fields.org_xmlvm_runtime_XMLVMArray.array_ = _r3.o;
364     XMLVM_SOURCE_POSITION("XMLVMArray.java", 68)
365     XMLVM_EXIT_METHOD()
366     return;
367     //XMLVM_END_WRAPPER
368 }
369 
370 //XMLVM_NATIVE[JAVA_OBJECT org_xmlvm_runtime_XMLVMArray_createSingleDimension___java_lang_Class_int(JAVA_OBJECT n1, JAVA_INT n2)]
371 
372 //XMLVM_NATIVE[JAVA_OBJECT org_xmlvm_runtime_XMLVMArray_createSingleDimensionWithData___java_lang_Class_int_java_lang_Object(JAVA_OBJECT n1, JAVA_INT n2, JAVA_OBJECT n3)]
373 
374 //XMLVM_NATIVE[JAVA_OBJECT org_xmlvm_runtime_XMLVMArray_createMultiDimensions___java_lang_Class_org_xmlvm_runtime_XMLVMArray(JAVA_OBJECT n1, JAVA_OBJECT n2)]
375 
376 //XMLVM_NATIVE[void org_xmlvm_runtime_XMLVMArray_fillArray___org_xmlvm_runtime_XMLVMArray_java_lang_Object(JAVA_OBJECT n1, JAVA_OBJECT n2)]
377 
378 //XMLVM_NATIVE[JAVA_OBJECT org_xmlvm_runtime_XMLVMArray_clone__(JAVA_OBJECT me)]
379 
org_xmlvm_runtime_XMLVMArray___CLINIT_()380 void org_xmlvm_runtime_XMLVMArray___CLINIT_()
381 {
382     //XMLVM_BEGIN_WRAPPER[org_xmlvm_runtime_XMLVMArray___CLINIT___]
383     XMLVM_ENTER_METHOD("org.xmlvm.runtime.XMLVMArray", "<clinit>", "?")
384     XMLVM_SOURCE_POSITION("XMLVMArray.java", 60)
385     org_xmlvm_runtime_XMLVMArray_initNativeLayer__();
386     XMLVM_SOURCE_POSITION("XMLVMArray.java", 61)
387     XMLVM_EXIT_METHOD()
388     return;
389     //XMLVM_END_WRAPPER
390 }
391 
392