1 #include "xmlvm.h"
2 #include "java_io_PrintStream.h"
3 #include "java_lang_Class.h"
4 #include "java_lang_ClassLoader.h"
5 #include "java_lang_Long.h"
6 #include "java_lang_StackTraceElement.h"
7 #include "java_lang_String.h"
8 #include "java_lang_StringBuilder.h"
9 #include "java_lang_System.h"
10 #include "java_lang_Thread_State.h"
11 #include "java_lang_Thread_UncaughtExceptionHandler.h"
12 #include "java_lang_ThreadGroup.h"
13 #include "java_lang_Throwable.h"
14 #include "java_util_HashMap.h"
15 #include "java_util_Map.h"
16 #include "org_xmlvm_runtime_Condition.h"
17 #include "org_xmlvm_runtime_Mutex.h"
18 
19 #include "java_lang_Thread.h"
20 
21 #define XMLVM_CURRENT_CLASS_NAME Thread
22 #define XMLVM_CURRENT_PKG_CLASS_NAME java_lang_Thread
23 
24 __TIB_DEFINITION_java_lang_Thread __TIB_java_lang_Thread = {
25     0, // classInitializationBegan
26     0, // classInitialized
27     -1, // initializerThreadId
28     __INIT_java_lang_Thread, // classInitializer
29     "java.lang.Thread", // className
30     "java.lang", // package
31     JAVA_NULL, // enclosingClassName
32     JAVA_NULL, // enclosingMethodName
33     JAVA_NULL, // signature
34     (__TIB_DEFINITION_TEMPLATE*) &__TIB_java_lang_Object, // extends
35     sizeof(java_lang_Thread), // sizeInstance
36     XMLVM_TYPE_CLASS};
37 
38 JAVA_OBJECT __CLASS_java_lang_Thread;
39 JAVA_OBJECT __CLASS_java_lang_Thread_1ARRAY;
40 JAVA_OBJECT __CLASS_java_lang_Thread_2ARRAY;
41 JAVA_OBJECT __CLASS_java_lang_Thread_3ARRAY;
42 //XMLVM_BEGIN_IMPLEMENTATION
43 //XMLVM_END_IMPLEMENTATION
44 
45 static JAVA_OBJECT _STATIC_java_lang_Thread_threadSafetyMutex;
46 static JAVA_LONG _STATIC_java_lang_Thread_nextThreadId;
47 static JAVA_INT _STATIC_java_lang_Thread_numberOfActiveNonDaemonThreads;
48 static JAVA_OBJECT _STATIC_java_lang_Thread_threadMap;
49 static JAVA_OBJECT _STATIC_java_lang_Thread_mainThreadGroup;
50 static JAVA_INT _STATIC_java_lang_Thread_MAX_PRIORITY;
51 static JAVA_INT _STATIC_java_lang_Thread_MIN_PRIORITY;
52 static JAVA_INT _STATIC_java_lang_Thread_NORM_PRIORITY;
53 
54 #include "xmlvm-reflection.h"
55 
56 static XMLVM_FIELD_REFLECTION_DATA __field_reflection_data[] = {
57 };
58 
59 static XMLVM_CONSTRUCTOR_REFLECTION_DATA __constructor_reflection_data[] = {
60 };
61 
constructor_dispatcher(JAVA_OBJECT constructor,JAVA_OBJECT arguments)62 static JAVA_OBJECT constructor_dispatcher(JAVA_OBJECT constructor, JAVA_OBJECT arguments)
63 {
64     XMLVM_NOT_IMPLEMENTED();
65 }
66 
67 static XMLVM_METHOD_REFLECTION_DATA __method_reflection_data[] = {
68 };
69 
method_dispatcher(JAVA_OBJECT method,JAVA_OBJECT receiver,JAVA_OBJECT arguments)70 static JAVA_OBJECT method_dispatcher(JAVA_OBJECT method, JAVA_OBJECT receiver, JAVA_OBJECT arguments)
71 {
72     XMLVM_NOT_IMPLEMENTED();
73 }
74 
__INIT_java_lang_Thread()75 void __INIT_java_lang_Thread()
76 {
77     staticInitializerLock(&__TIB_java_lang_Thread);
78 
79     // While the static initializer mutex is locked, locally store the value of
80     // whether class initialization began or not
81     int initBegan = __TIB_java_lang_Thread.classInitializationBegan;
82 
83     // Whether or not class initialization had already began, it has begun now
84     __TIB_java_lang_Thread.classInitializationBegan = 1;
85 
86     staticInitializerUnlock(&__TIB_java_lang_Thread);
87 
88     JAVA_LONG curThreadId = (JAVA_LONG)pthread_self();
89     if (initBegan) {
90         if (__TIB_java_lang_Thread.initializerThreadId != curThreadId) {
91             // Busy wait until the other thread finishes initializing this class
92             while (!__TIB_java_lang_Thread.classInitialized) {
93                 // do nothing
94             }
95         }
96     } else {
97         __TIB_java_lang_Thread.initializerThreadId = curThreadId;
98         XMLVM_CLASS_USED("java.lang.Thread")
99         __INIT_IMPL_java_lang_Thread();
100     }
101 }
102 
__INIT_IMPL_java_lang_Thread()103 void __INIT_IMPL_java_lang_Thread()
104 {
105     // Initialize base class if necessary
106     XMLVM_CLASS_INIT(java_lang_Object)
107     __TIB_java_lang_Thread.newInstanceFunc = __NEW_INSTANCE_java_lang_Thread;
108     // Copy vtable from base class
109     XMLVM_MEMCPY(__TIB_java_lang_Thread.vtable, __TIB_java_lang_Object.vtable, sizeof(__TIB_java_lang_Object.vtable));
110     // Initialize vtable for this class
111     __TIB_java_lang_Thread.vtable[1] = (VTABLE_PTR) &java_lang_Thread_equals___java_lang_Object;
112     __TIB_java_lang_Thread.vtable[6] = (VTABLE_PTR) &java_lang_Thread_run__;
113     __TIB_java_lang_Thread.vtable[5] = (VTABLE_PTR) &java_lang_Thread_toString__;
114     xmlvm_init_native_java_lang_Thread();
115     // Initialize interface information
116     __TIB_java_lang_Thread.numImplementedInterfaces = 1;
117     __TIB_java_lang_Thread.implementedInterfaces = (__TIB_DEFINITION_TEMPLATE* (*)[1]) XMLVM_MALLOC(sizeof(__TIB_DEFINITION_TEMPLATE*) * 1);
118 
119     // Initialize interfaces if necessary and assign tib to implementedInterfaces
120 
121     XMLVM_CLASS_INIT(java_lang_Runnable)
122 
123     __TIB_java_lang_Thread.implementedInterfaces[0][0] = &__TIB_java_lang_Runnable;
124     // Initialize itable for this class
125     __TIB_java_lang_Thread.itableBegin = &__TIB_java_lang_Thread.itable[0];
126     __TIB_java_lang_Thread.itable[XMLVM_ITABLE_IDX_java_lang_Runnable_run__] = __TIB_java_lang_Thread.vtable[6];
127 
128     _STATIC_java_lang_Thread_threadSafetyMutex = (org_xmlvm_runtime_Mutex*) JAVA_NULL;
129     _STATIC_java_lang_Thread_nextThreadId = 0;
130     _STATIC_java_lang_Thread_numberOfActiveNonDaemonThreads = 0;
131     _STATIC_java_lang_Thread_threadMap = (java_util_Map*) JAVA_NULL;
132     _STATIC_java_lang_Thread_mainThreadGroup = (java_lang_ThreadGroup*) JAVA_NULL;
133     _STATIC_java_lang_Thread_MAX_PRIORITY = 10;
134     _STATIC_java_lang_Thread_MIN_PRIORITY = 1;
135     _STATIC_java_lang_Thread_NORM_PRIORITY = 5;
136 
137     __TIB_java_lang_Thread.declaredFields = &__field_reflection_data[0];
138     __TIB_java_lang_Thread.numDeclaredFields = sizeof(__field_reflection_data) / sizeof(XMLVM_FIELD_REFLECTION_DATA);
139     __TIB_java_lang_Thread.constructorDispatcherFunc = constructor_dispatcher;
140     __TIB_java_lang_Thread.declaredConstructors = &__constructor_reflection_data[0];
141     __TIB_java_lang_Thread.numDeclaredConstructors = sizeof(__constructor_reflection_data) / sizeof(XMLVM_CONSTRUCTOR_REFLECTION_DATA);
142     __TIB_java_lang_Thread.methodDispatcherFunc = method_dispatcher;
143     __TIB_java_lang_Thread.declaredMethods = &__method_reflection_data[0];
144     __TIB_java_lang_Thread.numDeclaredMethods = sizeof(__method_reflection_data) / sizeof(XMLVM_METHOD_REFLECTION_DATA);
145     __CLASS_java_lang_Thread = XMLVM_CREATE_CLASS_OBJECT(&__TIB_java_lang_Thread);
146     __TIB_java_lang_Thread.clazz = __CLASS_java_lang_Thread;
147     __TIB_java_lang_Thread.baseType = JAVA_NULL;
148     __CLASS_java_lang_Thread_1ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_java_lang_Thread);
149     __CLASS_java_lang_Thread_2ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_java_lang_Thread_1ARRAY);
150     __CLASS_java_lang_Thread_3ARRAY = XMLVM_CREATE_ARRAY_CLASS_OBJECT(__CLASS_java_lang_Thread_2ARRAY);
151     java_lang_Thread___CLINIT_();
152     //XMLVM_BEGIN_WRAPPER[__INIT_java_lang_Thread]
153     //XMLVM_END_WRAPPER
154 
155     __TIB_java_lang_Thread.classInitialized = 1;
156 }
157 
__DELETE_java_lang_Thread(void * me,void * client_data)158 void __DELETE_java_lang_Thread(void* me, void* client_data)
159 {
160     //XMLVM_BEGIN_WRAPPER[__DELETE_java_lang_Thread]
161     //XMLVM_END_WRAPPER
162 }
163 
__INIT_INSTANCE_MEMBERS_java_lang_Thread(JAVA_OBJECT me,int derivedClassWillRegisterFinalizer)164 void __INIT_INSTANCE_MEMBERS_java_lang_Thread(JAVA_OBJECT me, int derivedClassWillRegisterFinalizer)
165 {
166     __INIT_INSTANCE_MEMBERS_java_lang_Object(me, 0 || derivedClassWillRegisterFinalizer);
167     ((java_lang_Thread*) me)->fields.java_lang_Thread.xmlvmExceptionEnv_ = (java_lang_Object*) JAVA_NULL;
168     ((java_lang_Thread*) me)->fields.java_lang_Thread.xmlvmException_ = (java_lang_Object*) JAVA_NULL;
169     ((java_lang_Thread*) me)->fields.java_lang_Thread.ptBuffers_ = (java_lang_Object*) JAVA_NULL;
170     ((java_lang_Thread*) me)->fields.java_lang_Thread.threadId_ = 0;
171     ((java_lang_Thread*) me)->fields.java_lang_Thread.threadName_ = (java_lang_String*) JAVA_NULL;
172     ((java_lang_Thread*) me)->fields.java_lang_Thread.priority_ = 0;
173     ((java_lang_Thread*) me)->fields.java_lang_Thread.daemon_ = 0;
174     ((java_lang_Thread*) me)->fields.java_lang_Thread.alive_ = 0;
175     ((java_lang_Thread*) me)->fields.java_lang_Thread.targetRunnable_ = (java_lang_Runnable*) JAVA_NULL;
176     ((java_lang_Thread*) me)->fields.java_lang_Thread.threadGroup_ = (java_lang_ThreadGroup*) JAVA_NULL;
177     ((java_lang_Thread*) me)->fields.java_lang_Thread.threadState_ = (java_lang_Thread_State*) JAVA_NULL;
178     ((java_lang_Thread*) me)->fields.java_lang_Thread.interrupted_ = 0;
179     ((java_lang_Thread*) me)->fields.java_lang_Thread.waitingCondition_ = (org_xmlvm_runtime_Condition*) JAVA_NULL;
180     ((java_lang_Thread*) me)->fields.java_lang_Thread.threadLocalMap_ = (java_util_Map*) JAVA_NULL;
181     ((java_lang_Thread*) me)->fields.java_lang_Thread.nativeThreadId_ = 0;
182     ((java_lang_Thread*) me)->fields.java_lang_Thread.action_ = (java_lang_Runnable*) JAVA_NULL;
183     //XMLVM_BEGIN_WRAPPER[__INIT_INSTANCE_MEMBERS_java_lang_Thread]
184     //XMLVM_END_WRAPPER
185 }
186 
__NEW_java_lang_Thread()187 JAVA_OBJECT __NEW_java_lang_Thread()
188 {    XMLVM_CLASS_INIT(java_lang_Thread)
189 java_lang_Thread* me = (java_lang_Thread*) XMLVM_MALLOC(sizeof(java_lang_Thread));
190     me->tib = &__TIB_java_lang_Thread;
191     __INIT_INSTANCE_MEMBERS_java_lang_Thread(me, 0);
192     //XMLVM_BEGIN_WRAPPER[__NEW_java_lang_Thread]
193     //XMLVM_END_WRAPPER
194     return me;
195 }
196 
__NEW_INSTANCE_java_lang_Thread()197 JAVA_OBJECT __NEW_INSTANCE_java_lang_Thread()
198 {
199     JAVA_OBJECT me = JAVA_NULL;
200     me = __NEW_java_lang_Thread();
201     java_lang_Thread___INIT___(me);
202     return me;
203 }
204 
java_lang_Thread_GET_threadSafetyMutex()205 JAVA_OBJECT java_lang_Thread_GET_threadSafetyMutex()
206 {
207     XMLVM_CLASS_INIT(java_lang_Thread)
208     return _STATIC_java_lang_Thread_threadSafetyMutex;
209 }
210 
java_lang_Thread_PUT_threadSafetyMutex(JAVA_OBJECT v)211 void java_lang_Thread_PUT_threadSafetyMutex(JAVA_OBJECT v)
212 {
213     XMLVM_CLASS_INIT(java_lang_Thread)
214 _STATIC_java_lang_Thread_threadSafetyMutex = v;
215 }
216 
java_lang_Thread_GET_nextThreadId()217 JAVA_LONG java_lang_Thread_GET_nextThreadId()
218 {
219     XMLVM_CLASS_INIT(java_lang_Thread)
220     return _STATIC_java_lang_Thread_nextThreadId;
221 }
222 
java_lang_Thread_PUT_nextThreadId(JAVA_LONG v)223 void java_lang_Thread_PUT_nextThreadId(JAVA_LONG v)
224 {
225     XMLVM_CLASS_INIT(java_lang_Thread)
226 _STATIC_java_lang_Thread_nextThreadId = v;
227 }
228 
java_lang_Thread_GET_numberOfActiveNonDaemonThreads()229 JAVA_INT java_lang_Thread_GET_numberOfActiveNonDaemonThreads()
230 {
231     XMLVM_CLASS_INIT(java_lang_Thread)
232     return _STATIC_java_lang_Thread_numberOfActiveNonDaemonThreads;
233 }
234 
java_lang_Thread_PUT_numberOfActiveNonDaemonThreads(JAVA_INT v)235 void java_lang_Thread_PUT_numberOfActiveNonDaemonThreads(JAVA_INT v)
236 {
237     XMLVM_CLASS_INIT(java_lang_Thread)
238 _STATIC_java_lang_Thread_numberOfActiveNonDaemonThreads = v;
239 }
240 
java_lang_Thread_GET_threadMap()241 JAVA_OBJECT java_lang_Thread_GET_threadMap()
242 {
243     XMLVM_CLASS_INIT(java_lang_Thread)
244     return _STATIC_java_lang_Thread_threadMap;
245 }
246 
java_lang_Thread_PUT_threadMap(JAVA_OBJECT v)247 void java_lang_Thread_PUT_threadMap(JAVA_OBJECT v)
248 {
249     XMLVM_CLASS_INIT(java_lang_Thread)
250 _STATIC_java_lang_Thread_threadMap = v;
251 }
252 
java_lang_Thread_GET_mainThreadGroup()253 JAVA_OBJECT java_lang_Thread_GET_mainThreadGroup()
254 {
255     XMLVM_CLASS_INIT(java_lang_Thread)
256     return _STATIC_java_lang_Thread_mainThreadGroup;
257 }
258 
java_lang_Thread_PUT_mainThreadGroup(JAVA_OBJECT v)259 void java_lang_Thread_PUT_mainThreadGroup(JAVA_OBJECT v)
260 {
261     XMLVM_CLASS_INIT(java_lang_Thread)
262 _STATIC_java_lang_Thread_mainThreadGroup = v;
263 }
264 
java_lang_Thread_GET_MAX_PRIORITY()265 JAVA_INT java_lang_Thread_GET_MAX_PRIORITY()
266 {
267     XMLVM_CLASS_INIT(java_lang_Thread)
268     return _STATIC_java_lang_Thread_MAX_PRIORITY;
269 }
270 
java_lang_Thread_PUT_MAX_PRIORITY(JAVA_INT v)271 void java_lang_Thread_PUT_MAX_PRIORITY(JAVA_INT v)
272 {
273     XMLVM_CLASS_INIT(java_lang_Thread)
274 _STATIC_java_lang_Thread_MAX_PRIORITY = v;
275 }
276 
java_lang_Thread_GET_MIN_PRIORITY()277 JAVA_INT java_lang_Thread_GET_MIN_PRIORITY()
278 {
279     XMLVM_CLASS_INIT(java_lang_Thread)
280     return _STATIC_java_lang_Thread_MIN_PRIORITY;
281 }
282 
java_lang_Thread_PUT_MIN_PRIORITY(JAVA_INT v)283 void java_lang_Thread_PUT_MIN_PRIORITY(JAVA_INT v)
284 {
285     XMLVM_CLASS_INIT(java_lang_Thread)
286 _STATIC_java_lang_Thread_MIN_PRIORITY = v;
287 }
288 
java_lang_Thread_GET_NORM_PRIORITY()289 JAVA_INT java_lang_Thread_GET_NORM_PRIORITY()
290 {
291     XMLVM_CLASS_INIT(java_lang_Thread)
292     return _STATIC_java_lang_Thread_NORM_PRIORITY;
293 }
294 
java_lang_Thread_PUT_NORM_PRIORITY(JAVA_INT v)295 void java_lang_Thread_PUT_NORM_PRIORITY(JAVA_INT v)
296 {
297     XMLVM_CLASS_INIT(java_lang_Thread)
298 _STATIC_java_lang_Thread_NORM_PRIORITY = v;
299 }
300 
java_lang_Thread_getNextThreadId__()301 JAVA_LONG java_lang_Thread_getNextThreadId__()
302 {
303     XMLVM_CLASS_INIT(java_lang_Thread)
304     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getNextThreadId__]
305     XMLVM_ENTER_METHOD("java.lang.Thread", "getNextThreadId", "?")
306     XMLVMElem _r0;
307     XMLVMElem _r1;
308     XMLVMElem _r2;
309     XMLVMElem _r3;
310     XMLVM_SOURCE_POSITION("Thread.java", 120)
311     _r2.o = java_lang_Thread_GET_threadSafetyMutex();
312     XMLVM_CHECK_NPE(2)
313     org_xmlvm_runtime_Mutex_lock__(_r2.o);
314     XMLVM_SOURCE_POSITION("Thread.java", 121)
315     _r0.l = java_lang_Thread_GET_nextThreadId();
316     _r2.l = 1;
317     _r2.l = _r2.l + _r0.l;
318     java_lang_Thread_PUT_nextThreadId( _r2.l);
319     XMLVM_SOURCE_POSITION("Thread.java", 122)
320     _r2.o = java_lang_Thread_GET_threadSafetyMutex();
321     XMLVM_CHECK_NPE(2)
322     org_xmlvm_runtime_Mutex_unlock__(_r2.o);
323     XMLVM_SOURCE_POSITION("Thread.java", 123)
324     XMLVM_EXIT_METHOD()
325     return _r0.l;
326     //XMLVM_END_WRAPPER
327 }
328 
java_lang_Thread_addSelfToMap__(JAVA_OBJECT me)329 void java_lang_Thread_addSelfToMap__(JAVA_OBJECT me)
330 {
331     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_addSelfToMap__]
332     XMLVM_ENTER_METHOD("java.lang.Thread", "addSelfToMap", "?")
333     XMLVMElem _r0;
334     XMLVMElem _r1;
335     XMLVMElem _r2;
336     XMLVMElem _r3;
337     _r3.o = me;
338     XMLVM_SOURCE_POSITION("Thread.java", 159)
339     _r0.o = java_lang_Thread_GET_threadSafetyMutex();
340     XMLVM_CHECK_NPE(0)
341     org_xmlvm_runtime_Mutex_lock__(_r0.o);
342     XMLVM_SOURCE_POSITION("Thread.java", 161)
343     _r0.o = java_lang_Thread_GET_threadMap();
344     XMLVM_CHECK_NPE(3)
345     _r1.l = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.nativeThreadId_;
346     _r1.o = java_lang_Long_valueOf___long(_r1.l);
347     XMLVM_CHECK_NPE(0)
348     (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT, JAVA_OBJECT)) *(((java_lang_Object*)_r0.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_util_Map_put___java_lang_Object_java_lang_Object])(_r0.o, _r1.o, _r3.o);
349     XMLVM_SOURCE_POSITION("Thread.java", 163)
350     _r0.o = java_lang_Thread_GET_threadSafetyMutex();
351     XMLVM_CHECK_NPE(0)
352     org_xmlvm_runtime_Mutex_unlock__(_r0.o);
353     XMLVM_SOURCE_POSITION("Thread.java", 164)
354     XMLVM_EXIT_METHOD()
355     return;
356     //XMLVM_END_WRAPPER
357 }
358 
java_lang_Thread_removeSelfFromMap__(JAVA_OBJECT me)359 void java_lang_Thread_removeSelfFromMap__(JAVA_OBJECT me)
360 {
361     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_removeSelfFromMap__]
362     XMLVM_ENTER_METHOD("java.lang.Thread", "removeSelfFromMap", "?")
363     XMLVMElem _r0;
364     XMLVMElem _r1;
365     XMLVMElem _r2;
366     XMLVMElem _r3;
367     _r3.o = me;
368     XMLVM_SOURCE_POSITION("Thread.java", 167)
369     _r0.o = java_lang_Thread_GET_threadSafetyMutex();
370     XMLVM_CHECK_NPE(0)
371     org_xmlvm_runtime_Mutex_lock__(_r0.o);
372     XMLVM_SOURCE_POSITION("Thread.java", 169)
373     _r0.o = java_lang_Thread_GET_threadMap();
374     XMLVM_CHECK_NPE(3)
375     _r1.l = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.nativeThreadId_;
376     _r1.o = java_lang_Long_valueOf___long(_r1.l);
377     XMLVM_CHECK_NPE(0)
378     (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT)) *(((java_lang_Object*)_r0.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_util_Map_remove___java_lang_Object])(_r0.o, _r1.o);
379     XMLVM_SOURCE_POSITION("Thread.java", 171)
380     _r0.o = java_lang_Thread_GET_threadSafetyMutex();
381     XMLVM_CHECK_NPE(0)
382     org_xmlvm_runtime_Mutex_unlock__(_r0.o);
383     XMLVM_SOURCE_POSITION("Thread.java", 172)
384     XMLVM_EXIT_METHOD()
385     return;
386     //XMLVM_END_WRAPPER
387 }
388 
java_lang_Thread_getNativeThreadId__(JAVA_OBJECT me)389 JAVA_LONG java_lang_Thread_getNativeThreadId__(JAVA_OBJECT me)
390 {
391     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getNativeThreadId__]
392     XMLVM_ENTER_METHOD("java.lang.Thread", "getNativeThreadId", "?")
393     XMLVMElem _r0;
394     XMLVMElem _r1;
395     XMLVMElem _r2;
396     _r2.o = me;
397     XMLVM_SOURCE_POSITION("Thread.java", 177)
398     XMLVM_CHECK_NPE(2)
399     _r0.l = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.nativeThreadId_;
400     XMLVM_EXIT_METHOD()
401     return _r0.l;
402     //XMLVM_END_WRAPPER
403 }
404 
java_lang_Thread___INIT____long(JAVA_OBJECT me,JAVA_LONG n1)405 void java_lang_Thread___INIT____long(JAVA_OBJECT me, JAVA_LONG n1)
406 {
407     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____long]
408     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
409     XMLVMElem _r0;
410     XMLVMElem _r1;
411     XMLVMElem _r2;
412     XMLVMElem _r3;
413     XMLVMElem _r4;
414     _r2.o = me;
415     _r3.l = n1;
416     _r1.i = 0;
417     XMLVM_SOURCE_POSITION("Thread.java", 186)
418     XMLVM_CHECK_NPE(2)
419     java_lang_Object___INIT___(_r2.o);
420     XMLVM_SOURCE_POSITION("Thread.java", 131)
421     _r0.i = 5;
422     XMLVM_CHECK_NPE(2)
423     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.priority_ = _r0.i;
424     XMLVM_SOURCE_POSITION("Thread.java", 132)
425     XMLVM_CHECK_NPE(2)
426     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r1.i;
427     XMLVM_SOURCE_POSITION("Thread.java", 133)
428     XMLVM_CHECK_NPE(2)
429     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.alive_ = _r1.i;
430     XMLVM_SOURCE_POSITION("Thread.java", 137)
431     _r0.o = java_lang_Thread_State_GET_NEW();
432     XMLVM_CHECK_NPE(2)
433     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
434     XMLVM_SOURCE_POSITION("Thread.java", 143)
435     _r0.o = __NEW_java_util_HashMap();
436     XMLVM_CHECK_NPE(0)
437     java_util_HashMap___INIT___(_r0.o);
438     XMLVM_CHECK_NPE(2)
439     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
440     XMLVM_SOURCE_POSITION("Thread.java", 187)
441     XMLVM_CHECK_NPE(2)
442     java_lang_Thread_initMainThread__(_r2.o);
443     XMLVM_SOURCE_POSITION("Thread.java", 189)
444     XMLVM_CHECK_NPE(2)
445     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.nativeThreadId_ = _r3.l;
446     XMLVM_SOURCE_POSITION("Thread.java", 192)
447     XMLVM_CHECK_NPE(2)
448     java_lang_Thread_addSelfToMap__(_r2.o);
449     XMLVM_SOURCE_POSITION("Thread.java", 194)
450     _r0.l = 1;
451     XMLVM_CHECK_NPE(2)
452     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadId_ = _r0.l;
453     XMLVM_SOURCE_POSITION("Thread.java", 195)
454     // "main"
455     _r0.o = xmlvm_create_java_string_from_pool(663);
456     XMLVM_CHECK_NPE(2)
457     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadName_ = _r0.o;
458     XMLVM_SOURCE_POSITION("Thread.java", 197)
459     _r0.o = java_lang_Thread_GET_mainThreadGroup();
460     XMLVM_CHECK_NPE(2)
461     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadGroup_ = _r0.o;
462     XMLVM_SOURCE_POSITION("Thread.java", 198)
463     XMLVM_CHECK_NPE(2)
464     _r0.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadGroup_;
465     XMLVM_CHECK_NPE(0)
466     java_lang_ThreadGroup_add___java_lang_Thread(_r0.o, _r2.o);
467     XMLVM_SOURCE_POSITION("Thread.java", 199)
468     XMLVM_EXIT_METHOD()
469     return;
470     //XMLVM_END_WRAPPER
471 }
472 
473 //XMLVM_NATIVE[void java_lang_Thread_initMainThread__(JAVA_OBJECT me)]
474 
java_lang_Thread_getThread___long(JAVA_LONG n1)475 JAVA_OBJECT java_lang_Thread_getThread___long(JAVA_LONG n1)
476 {
477     XMLVM_CLASS_INIT(java_lang_Thread)
478     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getThread___long]
479     XMLVM_ENTER_METHOD("java.lang.Thread", "getThread", "?")
480     XMLVMElem _r0;
481     XMLVMElem _r1;
482     XMLVMElem _r2;
483     XMLVMElem _r3;
484     XMLVMElem _r4;
485     _r3.l = n1;
486     XMLVM_SOURCE_POSITION("Thread.java", 211)
487     _r0.o = JAVA_NULL;
488     XMLVM_SOURCE_POSITION("Thread.java", 212)
489     _r1.o = java_lang_Thread_GET_threadSafetyMutex();
490     XMLVM_CHECK_NPE(1)
491     org_xmlvm_runtime_Mutex_lock__(_r1.o);
492     XMLVM_SOURCE_POSITION("Thread.java", 214)
493     _r1.o = java_lang_Thread_GET_threadMap();
494     _r2.o = java_lang_Long_valueOf___long(_r3.l);
495     XMLVM_CHECK_NPE(1)
496     _r0.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT)) *(((java_lang_Object*)_r1.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_util_Map_get___java_lang_Object])(_r1.o, _r2.o);
497     _r0.o = _r0.o;
498     XMLVM_SOURCE_POSITION("Thread.java", 216)
499     _r1.o = java_lang_Thread_GET_threadSafetyMutex();
500     XMLVM_CHECK_NPE(1)
501     org_xmlvm_runtime_Mutex_unlock__(_r1.o);
502     XMLVM_SOURCE_POSITION("Thread.java", 218)
503     if (_r0.o != JAVA_NULL) goto label30;
504     XMLVM_SOURCE_POSITION("Thread.java", 221)
505     _r0.o = __NEW_java_lang_Thread();
506     XMLVM_CHECK_NPE(0)
507     java_lang_Thread___INIT____long(_r0.o, _r3.l);
508     label30:;
509     XMLVM_SOURCE_POSITION("Thread.java", 223)
510     XMLVM_EXIT_METHOD()
511     return _r0.o;
512     //XMLVM_END_WRAPPER
513 }
514 
java_lang_Thread_equals___java_lang_Object(JAVA_OBJECT me,JAVA_OBJECT n1)515 JAVA_BOOLEAN java_lang_Thread_equals___java_lang_Object(JAVA_OBJECT me, JAVA_OBJECT n1)
516 {
517     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_equals___java_lang_Object]
518     XMLVM_ENTER_METHOD("java.lang.Thread", "equals", "?")
519     XMLVMElem _r0;
520     XMLVMElem _r1;
521     XMLVMElem _r2;
522     XMLVMElem _r3;
523     XMLVMElem _r4;
524     XMLVMElem _r5;
525     XMLVMElem _r6;
526     XMLVMElem _r7;
527     XMLVMElem _r8;
528     _r7.o = me;
529     _r8.o = n1;
530     XMLVM_SOURCE_POSITION("Thread.java", 227)
531     _r1.i = 0;
532     XMLVM_SOURCE_POSITION("Thread.java", 228)
533     XMLVM_CLASS_INIT(java_lang_Thread)
534     _r3.i = XMLVM_ISA(_r8.o, __CLASS_java_lang_Thread);
535     if (_r3.i == 0) goto label19;
536     XMLVM_SOURCE_POSITION("Thread.java", 229)
537     _r0 = _r8;
538     _r0.o = _r0.o;
539     _r2 = _r0;
540     XMLVM_SOURCE_POSITION("Thread.java", 230)
541     XMLVM_CHECK_NPE(7)
542     _r3.l = ((java_lang_Thread*) _r7.o)->fields.java_lang_Thread.nativeThreadId_;
543     XMLVM_CHECK_NPE(2)
544     _r5.l = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.nativeThreadId_;
545     _r3.i = _r3.l > _r5.l ? 1 : (_r3.l == _r5.l ? 0 : -1);
546     if (_r3.i != 0) goto label20;
547     _r3.i = 1;
548     _r1 = _r3;
549     label19:;
550     XMLVM_SOURCE_POSITION("Thread.java", 232)
551     XMLVM_EXIT_METHOD()
552     return _r1.i;
553     label20:;
554     _r3.i = 0;
555     _r1 = _r3;
556     goto label19;
557     //XMLVM_END_WRAPPER
558 }
559 
java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2,JAVA_OBJECT n3)560 void java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2, JAVA_OBJECT n3)
561 {
562     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String]
563     XMLVM_ENTER_METHOD("java.lang.Thread", "initThread", "?")
564     XMLVMElem _r0;
565     XMLVMElem _r1;
566     XMLVMElem _r2;
567     XMLVMElem _r3;
568     XMLVMElem _r4;
569     XMLVMElem _r5;
570     XMLVMElem _r6;
571     _r3.o = me;
572     _r4.o = n1;
573     _r5.o = n2;
574     _r6.o = n3;
575     XMLVM_SOURCE_POSITION("Thread.java", 259)
576     XMLVM_CHECK_NPE(3)
577     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.targetRunnable_ = _r5.o;
578     XMLVM_SOURCE_POSITION("Thread.java", 260)
579     _r0.l = java_lang_Thread_getNextThreadId__();
580     XMLVM_CHECK_NPE(3)
581     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadId_ = _r0.l;
582     XMLVM_SOURCE_POSITION("Thread.java", 262)
583     if (_r6.o != JAVA_NULL) goto label46;
584     XMLVM_SOURCE_POSITION("Thread.java", 263)
585     _r0.o = __NEW_java_lang_StringBuilder();
586     XMLVM_CHECK_NPE(0)
587     java_lang_StringBuilder___INIT___(_r0.o);
588     // "Thread-"
589     _r1.o = xmlvm_create_java_string_from_pool(802);
590     XMLVM_CHECK_NPE(0)
591     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
592     XMLVM_CHECK_NPE(3)
593     _r1.l = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadId_;
594     XMLVM_CHECK_NPE(0)
595     _r0.o = java_lang_StringBuilder_append___long(_r0.o, _r1.l);
596     //java_lang_StringBuilder_toString__[5]
597     XMLVM_CHECK_NPE(0)
598     _r0.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_StringBuilder*) _r0.o)->tib->vtable[5])(_r0.o);
599     XMLVM_CHECK_NPE(3)
600     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadName_ = _r0.o;
601     label33:;
602     XMLVM_SOURCE_POSITION("Thread.java", 268)
603     if (_r4.o != JAVA_NULL) goto label49;
604     XMLVM_SOURCE_POSITION("Thread.java", 270)
605     _r0.o = java_lang_Thread_currentThread__();
606     XMLVM_CHECK_NPE(0)
607     _r0.o = java_lang_Thread_getThreadGroup__(_r0.o);
608     XMLVM_CHECK_NPE(3)
609     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadGroup_ = _r0.o;
610     label45:;
611     XMLVM_SOURCE_POSITION("Thread.java", 274)
612     XMLVM_EXIT_METHOD()
613     return;
614     label46:;
615     XMLVM_SOURCE_POSITION("Thread.java", 265)
616     XMLVM_CHECK_NPE(3)
617     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadName_ = _r6.o;
618     goto label33;
619     label49:;
620     XMLVM_SOURCE_POSITION("Thread.java", 272)
621     XMLVM_CHECK_NPE(3)
622     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadGroup_ = _r4.o;
623     goto label45;
624     //XMLVM_END_WRAPPER
625 }
626 
java_lang_Thread___INIT___(JAVA_OBJECT me)627 void java_lang_Thread___INIT___(JAVA_OBJECT me)
628 {
629     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT___]
630     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
631     XMLVMElem _r0;
632     XMLVMElem _r1;
633     XMLVMElem _r2;
634     XMLVMElem _r3;
635     _r3.o = me;
636     _r2.i = 0;
637     _r1.o = JAVA_NULL;
638     XMLVM_SOURCE_POSITION("Thread.java", 283)
639     XMLVM_CHECK_NPE(3)
640     java_lang_Object___INIT___(_r3.o);
641     XMLVM_SOURCE_POSITION("Thread.java", 131)
642     _r0.i = 5;
643     XMLVM_CHECK_NPE(3)
644     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.priority_ = _r0.i;
645     XMLVM_SOURCE_POSITION("Thread.java", 132)
646     XMLVM_CHECK_NPE(3)
647     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.daemon_ = _r2.i;
648     XMLVM_SOURCE_POSITION("Thread.java", 133)
649     XMLVM_CHECK_NPE(3)
650     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.alive_ = _r2.i;
651     XMLVM_SOURCE_POSITION("Thread.java", 137)
652     _r0.o = java_lang_Thread_State_GET_NEW();
653     XMLVM_CHECK_NPE(3)
654     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadState_ = _r0.o;
655     XMLVM_SOURCE_POSITION("Thread.java", 143)
656     _r0.o = __NEW_java_util_HashMap();
657     XMLVM_CHECK_NPE(0)
658     java_util_HashMap___INIT___(_r0.o);
659     XMLVM_CHECK_NPE(3)
660     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
661     XMLVM_SOURCE_POSITION("Thread.java", 284)
662     XMLVM_CHECK_NPE(3)
663     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r3.o, _r1.o, _r1.o, _r1.o);
664     XMLVM_SOURCE_POSITION("Thread.java", 285)
665     XMLVM_EXIT_METHOD()
666     return;
667     //XMLVM_END_WRAPPER
668 }
669 
java_lang_Thread___INIT____java_lang_Runnable(JAVA_OBJECT me,JAVA_OBJECT n1)670 void java_lang_Thread___INIT____java_lang_Runnable(JAVA_OBJECT me, JAVA_OBJECT n1)
671 {
672     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_Runnable]
673     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
674     XMLVMElem _r0;
675     XMLVMElem _r1;
676     XMLVMElem _r2;
677     XMLVMElem _r3;
678     XMLVMElem _r4;
679     _r3.o = me;
680     _r4.o = n1;
681     _r2.o = JAVA_NULL;
682     _r1.i = 0;
683     XMLVM_SOURCE_POSITION("Thread.java", 297)
684     XMLVM_CHECK_NPE(3)
685     java_lang_Object___INIT___(_r3.o);
686     XMLVM_SOURCE_POSITION("Thread.java", 131)
687     _r0.i = 5;
688     XMLVM_CHECK_NPE(3)
689     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.priority_ = _r0.i;
690     XMLVM_SOURCE_POSITION("Thread.java", 132)
691     XMLVM_CHECK_NPE(3)
692     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.daemon_ = _r1.i;
693     XMLVM_SOURCE_POSITION("Thread.java", 133)
694     XMLVM_CHECK_NPE(3)
695     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.alive_ = _r1.i;
696     XMLVM_SOURCE_POSITION("Thread.java", 137)
697     _r0.o = java_lang_Thread_State_GET_NEW();
698     XMLVM_CHECK_NPE(3)
699     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadState_ = _r0.o;
700     XMLVM_SOURCE_POSITION("Thread.java", 143)
701     _r0.o = __NEW_java_util_HashMap();
702     XMLVM_CHECK_NPE(0)
703     java_util_HashMap___INIT___(_r0.o);
704     XMLVM_CHECK_NPE(3)
705     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
706     XMLVM_SOURCE_POSITION("Thread.java", 298)
707     XMLVM_CHECK_NPE(3)
708     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r3.o, _r2.o, _r4.o, _r2.o);
709     XMLVM_SOURCE_POSITION("Thread.java", 299)
710     XMLVM_EXIT_METHOD()
711     return;
712     //XMLVM_END_WRAPPER
713 }
714 
java_lang_Thread___INIT____java_lang_Runnable_java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2)715 void java_lang_Thread___INIT____java_lang_Runnable_java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2)
716 {
717     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_Runnable_java_lang_String]
718     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
719     XMLVMElem _r0;
720     XMLVMElem _r1;
721     XMLVMElem _r2;
722     XMLVMElem _r3;
723     XMLVMElem _r4;
724     _r2.o = me;
725     _r3.o = n1;
726     _r4.o = n2;
727     _r1.i = 0;
728     XMLVM_SOURCE_POSITION("Thread.java", 312)
729     XMLVM_CHECK_NPE(2)
730     java_lang_Object___INIT___(_r2.o);
731     XMLVM_SOURCE_POSITION("Thread.java", 131)
732     _r0.i = 5;
733     XMLVM_CHECK_NPE(2)
734     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.priority_ = _r0.i;
735     XMLVM_SOURCE_POSITION("Thread.java", 132)
736     XMLVM_CHECK_NPE(2)
737     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r1.i;
738     XMLVM_SOURCE_POSITION("Thread.java", 133)
739     XMLVM_CHECK_NPE(2)
740     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.alive_ = _r1.i;
741     XMLVM_SOURCE_POSITION("Thread.java", 137)
742     _r0.o = java_lang_Thread_State_GET_NEW();
743     XMLVM_CHECK_NPE(2)
744     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
745     XMLVM_SOURCE_POSITION("Thread.java", 143)
746     _r0.o = __NEW_java_util_HashMap();
747     XMLVM_CHECK_NPE(0)
748     java_util_HashMap___INIT___(_r0.o);
749     XMLVM_CHECK_NPE(2)
750     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
751     XMLVM_SOURCE_POSITION("Thread.java", 313)
752     _r0.o = JAVA_NULL;
753     XMLVM_CHECK_NPE(2)
754     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r2.o, _r0.o, _r3.o, _r4.o);
755     XMLVM_SOURCE_POSITION("Thread.java", 314)
756     XMLVM_EXIT_METHOD()
757     return;
758     //XMLVM_END_WRAPPER
759 }
760 
java_lang_Thread___INIT____java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1)761 void java_lang_Thread___INIT____java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1)
762 {
763     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_String]
764     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
765     XMLVMElem _r0;
766     XMLVMElem _r1;
767     XMLVMElem _r2;
768     XMLVMElem _r3;
769     XMLVMElem _r4;
770     _r3.o = me;
771     _r4.o = n1;
772     _r2.o = JAVA_NULL;
773     _r1.i = 0;
774     XMLVM_SOURCE_POSITION("Thread.java", 325)
775     XMLVM_CHECK_NPE(3)
776     java_lang_Object___INIT___(_r3.o);
777     XMLVM_SOURCE_POSITION("Thread.java", 131)
778     _r0.i = 5;
779     XMLVM_CHECK_NPE(3)
780     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.priority_ = _r0.i;
781     XMLVM_SOURCE_POSITION("Thread.java", 132)
782     XMLVM_CHECK_NPE(3)
783     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.daemon_ = _r1.i;
784     XMLVM_SOURCE_POSITION("Thread.java", 133)
785     XMLVM_CHECK_NPE(3)
786     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.alive_ = _r1.i;
787     XMLVM_SOURCE_POSITION("Thread.java", 137)
788     _r0.o = java_lang_Thread_State_GET_NEW();
789     XMLVM_CHECK_NPE(3)
790     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadState_ = _r0.o;
791     XMLVM_SOURCE_POSITION("Thread.java", 143)
792     _r0.o = __NEW_java_util_HashMap();
793     XMLVM_CHECK_NPE(0)
794     java_util_HashMap___INIT___(_r0.o);
795     XMLVM_CHECK_NPE(3)
796     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
797     XMLVM_SOURCE_POSITION("Thread.java", 326)
798     XMLVM_CHECK_NPE(3)
799     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r3.o, _r2.o, _r2.o, _r4.o);
800     XMLVM_SOURCE_POSITION("Thread.java", 327)
801     XMLVM_EXIT_METHOD()
802     return;
803     //XMLVM_END_WRAPPER
804 }
805 
java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2)806 void java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2)
807 {
808     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable]
809     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
810     XMLVMElem _r0;
811     XMLVMElem _r1;
812     XMLVMElem _r2;
813     XMLVMElem _r3;
814     XMLVMElem _r4;
815     _r2.o = me;
816     _r3.o = n1;
817     _r4.o = n2;
818     _r1.i = 0;
819     XMLVM_SOURCE_POSITION("Thread.java", 345)
820     XMLVM_CHECK_NPE(2)
821     java_lang_Object___INIT___(_r2.o);
822     XMLVM_SOURCE_POSITION("Thread.java", 131)
823     _r0.i = 5;
824     XMLVM_CHECK_NPE(2)
825     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.priority_ = _r0.i;
826     XMLVM_SOURCE_POSITION("Thread.java", 132)
827     XMLVM_CHECK_NPE(2)
828     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r1.i;
829     XMLVM_SOURCE_POSITION("Thread.java", 133)
830     XMLVM_CHECK_NPE(2)
831     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.alive_ = _r1.i;
832     XMLVM_SOURCE_POSITION("Thread.java", 137)
833     _r0.o = java_lang_Thread_State_GET_NEW();
834     XMLVM_CHECK_NPE(2)
835     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
836     XMLVM_SOURCE_POSITION("Thread.java", 143)
837     _r0.o = __NEW_java_util_HashMap();
838     XMLVM_CHECK_NPE(0)
839     java_util_HashMap___INIT___(_r0.o);
840     XMLVM_CHECK_NPE(2)
841     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
842     XMLVM_SOURCE_POSITION("Thread.java", 346)
843     _r0.o = JAVA_NULL;
844     XMLVM_CHECK_NPE(2)
845     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r2.o, _r3.o, _r4.o, _r0.o);
846     XMLVM_SOURCE_POSITION("Thread.java", 347)
847     XMLVM_EXIT_METHOD()
848     return;
849     //XMLVM_END_WRAPPER
850 }
851 
java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable_java_lang_String_long(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2,JAVA_OBJECT n3,JAVA_LONG n4)852 void java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable_java_lang_String_long(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2, JAVA_OBJECT n3, JAVA_LONG n4)
853 {
854     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable_java_lang_String_long]
855     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
856     XMLVMElem _r0;
857     XMLVMElem _r1;
858     XMLVMElem _r2;
859     XMLVMElem _r3;
860     XMLVMElem _r4;
861     XMLVMElem _r5;
862     XMLVMElem _r6;
863     XMLVMElem _r7;
864     _r2.o = me;
865     _r3.o = n1;
866     _r4.o = n2;
867     _r5.o = n3;
868     _r6.l = n4;
869     _r1.i = 0;
870     XMLVM_SOURCE_POSITION("Thread.java", 367)
871     XMLVM_CHECK_NPE(2)
872     java_lang_Object___INIT___(_r2.o);
873     XMLVM_SOURCE_POSITION("Thread.java", 131)
874     _r0.i = 5;
875     XMLVM_CHECK_NPE(2)
876     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.priority_ = _r0.i;
877     XMLVM_SOURCE_POSITION("Thread.java", 132)
878     XMLVM_CHECK_NPE(2)
879     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r1.i;
880     XMLVM_SOURCE_POSITION("Thread.java", 133)
881     XMLVM_CHECK_NPE(2)
882     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.alive_ = _r1.i;
883     XMLVM_SOURCE_POSITION("Thread.java", 137)
884     _r0.o = java_lang_Thread_State_GET_NEW();
885     XMLVM_CHECK_NPE(2)
886     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
887     XMLVM_SOURCE_POSITION("Thread.java", 143)
888     _r0.o = __NEW_java_util_HashMap();
889     XMLVM_CHECK_NPE(0)
890     java_util_HashMap___INIT___(_r0.o);
891     XMLVM_CHECK_NPE(2)
892     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
893     XMLVM_SOURCE_POSITION("Thread.java", 368)
894     XMLVM_CHECK_NPE(2)
895     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r2.o, _r3.o, _r4.o, _r5.o);
896     XMLVM_SOURCE_POSITION("Thread.java", 369)
897     XMLVM_EXIT_METHOD()
898     return;
899     //XMLVM_END_WRAPPER
900 }
901 
java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2,JAVA_OBJECT n3)902 void java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2, JAVA_OBJECT n3)
903 {
904     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_Runnable_java_lang_String]
905     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
906     XMLVMElem _r0;
907     XMLVMElem _r1;
908     XMLVMElem _r2;
909     XMLVMElem _r3;
910     XMLVMElem _r4;
911     XMLVMElem _r5;
912     _r2.o = me;
913     _r3.o = n1;
914     _r4.o = n2;
915     _r5.o = n3;
916     _r1.i = 0;
917     XMLVM_SOURCE_POSITION("Thread.java", 388)
918     XMLVM_CHECK_NPE(2)
919     java_lang_Object___INIT___(_r2.o);
920     XMLVM_SOURCE_POSITION("Thread.java", 131)
921     _r0.i = 5;
922     XMLVM_CHECK_NPE(2)
923     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.priority_ = _r0.i;
924     XMLVM_SOURCE_POSITION("Thread.java", 132)
925     XMLVM_CHECK_NPE(2)
926     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r1.i;
927     XMLVM_SOURCE_POSITION("Thread.java", 133)
928     XMLVM_CHECK_NPE(2)
929     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.alive_ = _r1.i;
930     XMLVM_SOURCE_POSITION("Thread.java", 137)
931     _r0.o = java_lang_Thread_State_GET_NEW();
932     XMLVM_CHECK_NPE(2)
933     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
934     XMLVM_SOURCE_POSITION("Thread.java", 143)
935     _r0.o = __NEW_java_util_HashMap();
936     XMLVM_CHECK_NPE(0)
937     java_util_HashMap___INIT___(_r0.o);
938     XMLVM_CHECK_NPE(2)
939     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
940     XMLVM_SOURCE_POSITION("Thread.java", 389)
941     XMLVM_CHECK_NPE(2)
942     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r2.o, _r3.o, _r4.o, _r5.o);
943     XMLVM_SOURCE_POSITION("Thread.java", 390)
944     XMLVM_EXIT_METHOD()
945     return;
946     //XMLVM_END_WRAPPER
947 }
948 
java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2)949 void java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2)
950 {
951     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___INIT____java_lang_ThreadGroup_java_lang_String]
952     XMLVM_ENTER_METHOD("java.lang.Thread", "<init>", "?")
953     XMLVMElem _r0;
954     XMLVMElem _r1;
955     XMLVMElem _r2;
956     XMLVMElem _r3;
957     XMLVMElem _r4;
958     _r2.o = me;
959     _r3.o = n1;
960     _r4.o = n2;
961     _r1.i = 0;
962     XMLVM_SOURCE_POSITION("Thread.java", 406)
963     XMLVM_CHECK_NPE(2)
964     java_lang_Object___INIT___(_r2.o);
965     XMLVM_SOURCE_POSITION("Thread.java", 131)
966     _r0.i = 5;
967     XMLVM_CHECK_NPE(2)
968     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.priority_ = _r0.i;
969     XMLVM_SOURCE_POSITION("Thread.java", 132)
970     XMLVM_CHECK_NPE(2)
971     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r1.i;
972     XMLVM_SOURCE_POSITION("Thread.java", 133)
973     XMLVM_CHECK_NPE(2)
974     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.alive_ = _r1.i;
975     XMLVM_SOURCE_POSITION("Thread.java", 137)
976     _r0.o = java_lang_Thread_State_GET_NEW();
977     XMLVM_CHECK_NPE(2)
978     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
979     XMLVM_SOURCE_POSITION("Thread.java", 143)
980     _r0.o = __NEW_java_util_HashMap();
981     XMLVM_CHECK_NPE(0)
982     java_util_HashMap___INIT___(_r0.o);
983     XMLVM_CHECK_NPE(2)
984     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadLocalMap_ = _r0.o;
985     XMLVM_SOURCE_POSITION("Thread.java", 407)
986     _r0.o = JAVA_NULL;
987     XMLVM_CHECK_NPE(2)
988     java_lang_Thread_initThread___java_lang_ThreadGroup_java_lang_Runnable_java_lang_String(_r2.o, _r3.o, _r0.o, _r4.o);
989     XMLVM_SOURCE_POSITION("Thread.java", 408)
990     XMLVM_EXIT_METHOD()
991     return;
992     //XMLVM_END_WRAPPER
993 }
994 
java_lang_Thread_setInterruptAction___java_lang_Runnable(JAVA_OBJECT me,JAVA_OBJECT n1)995 void java_lang_Thread_setInterruptAction___java_lang_Runnable(JAVA_OBJECT me, JAVA_OBJECT n1)
996 {
997     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_setInterruptAction___java_lang_Runnable]
998     XMLVM_ENTER_METHOD("java.lang.Thread", "setInterruptAction", "?")
999     XMLVMElem _r0;
1000     XMLVMElem _r1;
1001     _r0.o = me;
1002     _r1.o = n1;
1003     XMLVM_SOURCE_POSITION("Thread.java", 423)
1004     XMLVM_CHECK_NPE(0)
1005     ((java_lang_Thread*) _r0.o)->fields.java_lang_Thread.action_ = _r1.o;
1006     XMLVM_SOURCE_POSITION("Thread.java", 424)
1007     XMLVM_EXIT_METHOD()
1008     return;
1009     //XMLVM_END_WRAPPER
1010 }
1011 
1012 //XMLVM_NATIVE[JAVA_INT java_lang_Thread_activeCount__()]
1013 
1014 //XMLVM_NATIVE[void java_lang_Thread_checkAccess__(JAVA_OBJECT me)]
1015 
1016 //XMLVM_NATIVE[JAVA_INT java_lang_Thread_countStackFrames__(JAVA_OBJECT me)]
1017 
java_lang_Thread_currentThread__()1018 JAVA_OBJECT java_lang_Thread_currentThread__()
1019 {
1020     XMLVM_CLASS_INIT(java_lang_Thread)
1021     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_currentThread__]
1022     XMLVM_ENTER_METHOD("java.lang.Thread", "currentThread", "?")
1023     XMLVMElem _r0;
1024     XMLVMElem _r1;
1025     XMLVM_SOURCE_POSITION("Thread.java", 466)
1026     _r0.l = java_lang_Thread_getCurrentThreadNativeId__();
1027     _r0.o = java_lang_Thread_getThread___long(_r0.l);
1028     XMLVM_EXIT_METHOD()
1029     return _r0.o;
1030     //XMLVM_END_WRAPPER
1031 }
1032 
1033 //XMLVM_NATIVE[JAVA_LONG java_lang_Thread_getCurrentThreadNativeId__()]
1034 
1035 //XMLVM_NATIVE[void java_lang_Thread_destroy__(JAVA_OBJECT me)]
1036 
1037 //XMLVM_NATIVE[void java_lang_Thread_dumpStack__()]
1038 
1039 //XMLVM_NATIVE[JAVA_INT java_lang_Thread_enumerate___java_lang_Thread_1ARRAY(JAVA_OBJECT n1)]
1040 
1041 //XMLVM_NATIVE[JAVA_OBJECT java_lang_Thread_getAllStackTraces__()]
1042 
1043 //XMLVM_NATIVE[JAVA_OBJECT java_lang_Thread_getContextClassLoader__(JAVA_OBJECT me)]
1044 
1045 //XMLVM_NATIVE[JAVA_OBJECT java_lang_Thread_getDefaultUncaughtExceptionHandler__()]
1046 
java_lang_Thread_getId__(JAVA_OBJECT me)1047 JAVA_LONG java_lang_Thread_getId__(JAVA_OBJECT me)
1048 {
1049     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getId__]
1050     XMLVM_ENTER_METHOD("java.lang.Thread", "getId", "?")
1051     XMLVMElem _r0;
1052     XMLVMElem _r1;
1053     XMLVMElem _r2;
1054     _r2.o = me;
1055     XMLVM_SOURCE_POSITION("Thread.java", 566)
1056     XMLVM_CHECK_NPE(2)
1057     _r0.l = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadId_;
1058     XMLVM_EXIT_METHOD()
1059     return _r0.l;
1060     //XMLVM_END_WRAPPER
1061 }
1062 
java_lang_Thread_getName__(JAVA_OBJECT me)1063 JAVA_OBJECT java_lang_Thread_getName__(JAVA_OBJECT me)
1064 {
1065     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getName__]
1066     XMLVM_ENTER_METHOD("java.lang.Thread", "getName", "?")
1067     XMLVMElem _r0;
1068     XMLVMElem _r1;
1069     _r1.o = me;
1070     XMLVM_SOURCE_POSITION("Thread.java", 575)
1071     XMLVM_CHECK_NPE(1)
1072     _r0.o = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.threadName_;
1073     XMLVM_EXIT_METHOD()
1074     return _r0.o;
1075     //XMLVM_END_WRAPPER
1076 }
1077 
java_lang_Thread_getPriority__(JAVA_OBJECT me)1078 JAVA_INT java_lang_Thread_getPriority__(JAVA_OBJECT me)
1079 {
1080     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getPriority__]
1081     XMLVM_ENTER_METHOD("java.lang.Thread", "getPriority", "?")
1082     XMLVMElem _r0;
1083     XMLVMElem _r1;
1084     _r1.o = me;
1085     XMLVM_SOURCE_POSITION("Thread.java", 585)
1086     XMLVM_CHECK_NPE(1)
1087     _r0.i = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.priority_;
1088     XMLVM_EXIT_METHOD()
1089     return _r0.i;
1090     //XMLVM_END_WRAPPER
1091 }
1092 
1093 //XMLVM_NATIVE[JAVA_OBJECT java_lang_Thread_getStackTrace__(JAVA_OBJECT me)]
1094 
java_lang_Thread_getState__(JAVA_OBJECT me)1095 JAVA_OBJECT java_lang_Thread_getState__(JAVA_OBJECT me)
1096 {
1097     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getState__]
1098     XMLVM_ENTER_METHOD("java.lang.Thread", "getState", "?")
1099     volatile XMLVMElem _r0;
1100     volatile XMLVMElem _r1;
1101     volatile XMLVMElem _r2;
1102     _r2.o = me;
1103     XMLVM_SOURCE_POSITION("Thread.java", 612)
1104     java_lang_Object_acquireLockRecursive__(_r2.o);
1105     XMLVM_TRY_BEGIN(w5666aaac57b1b4)
1106     // Begin try
1107     _r0.o = java_lang_System_GET_out();
1108     // "Thread.getState() is not fully implemented. Specifically, you will not currently find BLOCKED, WAITING and TIMED_WAITING."
1109     _r1.o = xmlvm_create_java_string_from_pool(803);
1110     XMLVM_CHECK_NPE(0)
1111     java_io_PrintStream_println___java_lang_String(_r0.o, _r1.o);
1112     XMLVM_SOURCE_POSITION("Thread.java", 613)
1113     XMLVM_CHECK_NPE(2)
1114     _r0.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_;
1115     // End try
1116     XMLVM_TRY_END
1117     XMLVM_CATCH_BEGIN(w5666aaac57b1b4)
1118         XMLVM_CATCH_SPECIFIC(w5666aaac57b1b4,java_lang_Object,12)
1119     XMLVM_CATCH_END(w5666aaac57b1b4)
1120     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac57b1b4)
1121     java_lang_Object_releaseLockRecursive__(_r2.o);
1122     XMLVM_EXIT_METHOD()
1123     return _r0.o;
1124     label12:;
1125     java_lang_Thread* curThread_w5666aaac57b1b8 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1126     _r0.o = curThread_w5666aaac57b1b8->fields.java_lang_Thread.xmlvmException_;
1127     java_lang_Object_releaseLockRecursive__(_r2.o);
1128     XMLVM_THROW_CUSTOM(_r0.o)
1129     //XMLVM_END_WRAPPER
1130 }
1131 
java_lang_Thread_getThreadGroup__(JAVA_OBJECT me)1132 JAVA_OBJECT java_lang_Thread_getThreadGroup__(JAVA_OBJECT me)
1133 {
1134     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getThreadGroup__]
1135     XMLVM_ENTER_METHOD("java.lang.Thread", "getThreadGroup", "?")
1136     XMLVMElem _r0;
1137     XMLVMElem _r1;
1138     _r1.o = me;
1139     XMLVM_SOURCE_POSITION("Thread.java", 622)
1140     XMLVM_CHECK_NPE(1)
1141     _r0.o = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.threadGroup_;
1142     XMLVM_EXIT_METHOD()
1143     return _r0.o;
1144     //XMLVM_END_WRAPPER
1145 }
1146 
java_lang_Thread_getThreadLocal___java_lang_ThreadLocal(JAVA_OBJECT me,JAVA_OBJECT n1)1147 JAVA_OBJECT java_lang_Thread_getThreadLocal___java_lang_ThreadLocal(JAVA_OBJECT me, JAVA_OBJECT n1)
1148 {
1149     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_getThreadLocal___java_lang_ThreadLocal]
1150     XMLVM_ENTER_METHOD("java.lang.Thread", "getThreadLocal", "?")
1151     XMLVMElem _r0;
1152     XMLVMElem _r1;
1153     XMLVMElem _r2;
1154     _r1.o = me;
1155     _r2.o = n1;
1156     XMLVM_SOURCE_POSITION("Thread.java", 636)
1157     XMLVM_CHECK_NPE(1)
1158     _r0.o = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.threadLocalMap_;
1159     XMLVM_CHECK_NPE(0)
1160     _r0.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT)) *(((java_lang_Object*)_r0.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_util_Map_get___java_lang_Object])(_r0.o, _r2.o);
1161     XMLVM_EXIT_METHOD()
1162     return _r0.o;
1163     //XMLVM_END_WRAPPER
1164 }
1165 
1166 //XMLVM_NATIVE[JAVA_OBJECT java_lang_Thread_getUncaughtExceptionHandler__(JAVA_OBJECT me)]
1167 
java_lang_Thread_interrupt__(JAVA_OBJECT me)1168 void java_lang_Thread_interrupt__(JAVA_OBJECT me)
1169 {
1170     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_interrupt__]
1171     XMLVM_ENTER_METHOD("java.lang.Thread", "interrupt", "?")
1172     volatile XMLVMElem _r0;
1173     volatile XMLVMElem _r1;
1174     volatile XMLVMElem _r2;
1175     _r2.o = me;
1176     XMLVM_SOURCE_POSITION("Thread.java", 680)
1177     XMLVM_CHECK_NPE(2)
1178     _r1.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.action_;
1179     if (_r1.o == JAVA_NULL) goto label9;
1180     XMLVM_SOURCE_POSITION("Thread.java", 681)
1181     XMLVM_CHECK_NPE(2)
1182     _r1.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.action_;
1183     XMLVM_CHECK_NPE(1)
1184     (*(void (*)(JAVA_OBJECT)) *(((java_lang_Object*)_r1.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_lang_Runnable_run__])(_r1.o);
1185     label9:;
1186     XMLVM_SOURCE_POSITION("Thread.java", 684)
1187     _r0.o = JAVA_NULL;
1188     XMLVM_SOURCE_POSITION("Thread.java", 685)
1189     java_lang_Object_acquireLockRecursive__(_r2.o);
1190     XMLVM_SOURCE_POSITION("Thread.java", 686)
1191     _r1.i = 1;
1192     XMLVM_TRY_BEGIN(w5666aaac61b1c15)
1193     // Begin try
1194     XMLVM_CHECK_NPE(2)
1195     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.interrupted_ = _r1.i;
1196     XMLVM_SOURCE_POSITION("Thread.java", 688)
1197     XMLVM_CHECK_NPE(2)
1198     _r1.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.waitingCondition_;
1199     if (_r1.o == JAVA_NULL) { XMLVM_MEMCPY(curThread_w5666aaac61b1c15->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac61b1c15, sizeof(XMLVM_JMP_BUF)); goto label20; };
1200     XMLVM_SOURCE_POSITION("Thread.java", 689)
1201     XMLVM_CHECK_NPE(2)
1202     _r0.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.waitingCondition_;
1203     // End try
1204     XMLVM_TRY_END
1205     XMLVM_CATCH_BEGIN(w5666aaac61b1c15)
1206         XMLVM_CATCH_SPECIFIC(w5666aaac61b1c15,java_lang_Object,31)
1207     XMLVM_CATCH_END(w5666aaac61b1c15)
1208     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac61b1c15)
1209     label20:;
1210     XMLVM_TRY_BEGIN(w5666aaac61b1c17)
1211     // Begin try
1212     XMLVM_SOURCE_POSITION("Thread.java", 691)
1213     java_lang_Object_releaseLockRecursive__(_r2.o);
1214     // End try
1215     XMLVM_TRY_END
1216     XMLVM_CATCH_BEGIN(w5666aaac61b1c17)
1217         XMLVM_CATCH_SPECIFIC(w5666aaac61b1c17,java_lang_Object,31)
1218     XMLVM_CATCH_END(w5666aaac61b1c17)
1219     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac61b1c17)
1220     XMLVM_SOURCE_POSITION("Thread.java", 695)
1221     if (_r0.o == JAVA_NULL) goto label30;
1222     XMLVM_SOURCE_POSITION("Thread.java", 696)
1223     XMLVM_CHECK_NPE(0)
1224     _r1.o = org_xmlvm_runtime_Condition_getSynchronizedObject__(_r0.o);
1225     XMLVM_CHECK_NPE(1)
1226     java_lang_Object_interruptWait___org_xmlvm_runtime_Condition(_r1.o, _r0.o);
1227     label30:;
1228     XMLVM_SOURCE_POSITION("Thread.java", 698)
1229     XMLVM_EXIT_METHOD()
1230     return;
1231     label31:;
1232     java_lang_Thread* curThread_w5666aaac61b1c27 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1233     _r1.o = curThread_w5666aaac61b1c27->fields.java_lang_Thread.xmlvmException_;
1234     XMLVM_TRY_BEGIN(w5666aaac61b1c28)
1235     // Begin try
1236     java_lang_Object_releaseLockRecursive__(_r2.o);
1237     // End try
1238     XMLVM_TRY_END
1239     XMLVM_CATCH_BEGIN(w5666aaac61b1c28)
1240         XMLVM_CATCH_SPECIFIC(w5666aaac61b1c28,java_lang_Object,31)
1241     XMLVM_CATCH_END(w5666aaac61b1c28)
1242     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac61b1c28)
1243     XMLVM_THROW_CUSTOM(_r1.o)
1244     //XMLVM_END_WRAPPER
1245 }
1246 
java_lang_Thread_interrupted__()1247 JAVA_BOOLEAN java_lang_Thread_interrupted__()
1248 {
1249     XMLVM_CLASS_INIT(java_lang_Thread)
1250     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_interrupted__]
1251     XMLVM_ENTER_METHOD("java.lang.Thread", "interrupted", "?")
1252     volatile XMLVMElem _r0;
1253     volatile XMLVMElem _r1;
1254     volatile XMLVMElem _r2;
1255     XMLVM_SOURCE_POSITION("Thread.java", 712)
1256     _r1.i = 0;
1257     XMLVM_SOURCE_POSITION("Thread.java", 713)
1258     _r0.o = java_lang_Thread_currentThread__();
1259     XMLVM_SOURCE_POSITION("Thread.java", 714)
1260     java_lang_Object_acquireLockRecursive__(_r0.o);
1261     XMLVM_TRY_BEGIN(w5666aaac62b1b7)
1262     // Begin try
1263     XMLVM_SOURCE_POSITION("Thread.java", 715)
1264     XMLVM_CHECK_NPE(0)
1265     _r1.i = java_lang_Thread_isInterrupted__(_r0.o);
1266     _r2.i = 0;
1267     XMLVM_SOURCE_POSITION("Thread.java", 716)
1268     XMLVM_CHECK_NPE(0)
1269     ((java_lang_Thread*) _r0.o)->fields.java_lang_Thread.interrupted_ = _r2.i;
1270     XMLVM_SOURCE_POSITION("Thread.java", 717)
1271     java_lang_Object_releaseLockRecursive__(_r0.o);
1272     XMLVM_SOURCE_POSITION("Thread.java", 718)
1273     XMLVM_MEMCPY(curThread_w5666aaac62b1b7->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac62b1b7, sizeof(XMLVM_JMP_BUF));
1274     XMLVM_EXIT_METHOD()
1275     return _r1.i;
1276     // End try
1277     XMLVM_TRY_END
1278     XMLVM_CATCH_BEGIN(w5666aaac62b1b7)
1279         XMLVM_CATCH_SPECIFIC(w5666aaac62b1b7,java_lang_Object,15)
1280     XMLVM_CATCH_END(w5666aaac62b1b7)
1281     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac62b1b7)
1282     label15:;
1283     XMLVM_TRY_BEGIN(w5666aaac62b1b9)
1284     // Begin try
1285     java_lang_Thread* curThread_w5666aaac62b1b9aa = (java_lang_Thread*)java_lang_Thread_currentThread__();
1286     _r2.o = curThread_w5666aaac62b1b9aa->fields.java_lang_Thread.xmlvmException_;
1287     java_lang_Object_releaseLockRecursive__(_r0.o);
1288     // End try
1289     XMLVM_TRY_END
1290     XMLVM_CATCH_BEGIN(w5666aaac62b1b9)
1291         XMLVM_CATCH_SPECIFIC(w5666aaac62b1b9,java_lang_Object,15)
1292     XMLVM_CATCH_END(w5666aaac62b1b9)
1293     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac62b1b9)
1294     XMLVM_THROW_CUSTOM(_r2.o)
1295     //XMLVM_END_WRAPPER
1296 }
1297 
java_lang_Thread_isAlive__(JAVA_OBJECT me)1298 JAVA_BOOLEAN java_lang_Thread_isAlive__(JAVA_OBJECT me)
1299 {
1300     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_isAlive__]
1301     XMLVM_ENTER_METHOD("java.lang.Thread", "isAlive", "?")
1302     volatile XMLVMElem _r0;
1303     volatile XMLVMElem _r1;
1304     _r1.o = me;
1305     XMLVM_SOURCE_POSITION("Thread.java", 731)
1306     java_lang_Object_acquireLockRecursive__(_r1.o);
1307     XMLVM_TRY_BEGIN(w5666aaac63b1b4)
1308     // Begin try
1309     XMLVM_CHECK_NPE(1)
1310     _r0.i = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.alive_;
1311     // End try
1312     XMLVM_TRY_END
1313     XMLVM_CATCH_BEGIN(w5666aaac63b1b4)
1314         XMLVM_CATCH_SPECIFIC(w5666aaac63b1b4,java_lang_Object,5)
1315     XMLVM_CATCH_END(w5666aaac63b1b4)
1316     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac63b1b4)
1317     java_lang_Object_releaseLockRecursive__(_r1.o);
1318     XMLVM_EXIT_METHOD()
1319     return _r0.i;
1320     label5:;
1321     java_lang_Thread* curThread_w5666aaac63b1b8 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1322     _r0.o = curThread_w5666aaac63b1b8->fields.java_lang_Thread.xmlvmException_;
1323     java_lang_Object_releaseLockRecursive__(_r1.o);
1324     XMLVM_THROW_CUSTOM(_r0.o)
1325     //XMLVM_END_WRAPPER
1326 }
1327 
java_lang_Thread_isDaemon__(JAVA_OBJECT me)1328 JAVA_BOOLEAN java_lang_Thread_isDaemon__(JAVA_OBJECT me)
1329 {
1330     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_isDaemon__]
1331     XMLVM_ENTER_METHOD("java.lang.Thread", "isDaemon", "?")
1332     volatile XMLVMElem _r0;
1333     volatile XMLVMElem _r1;
1334     _r1.o = me;
1335     XMLVM_SOURCE_POSITION("Thread.java", 745)
1336     java_lang_Object_acquireLockRecursive__(_r1.o);
1337     XMLVM_TRY_BEGIN(w5666aaac64b1b4)
1338     // Begin try
1339     XMLVM_CHECK_NPE(1)
1340     _r0.i = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.daemon_;
1341     // End try
1342     XMLVM_TRY_END
1343     XMLVM_CATCH_BEGIN(w5666aaac64b1b4)
1344         XMLVM_CATCH_SPECIFIC(w5666aaac64b1b4,java_lang_Object,5)
1345     XMLVM_CATCH_END(w5666aaac64b1b4)
1346     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac64b1b4)
1347     java_lang_Object_releaseLockRecursive__(_r1.o);
1348     XMLVM_EXIT_METHOD()
1349     return _r0.i;
1350     label5:;
1351     java_lang_Thread* curThread_w5666aaac64b1b8 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1352     _r0.o = curThread_w5666aaac64b1b8->fields.java_lang_Thread.xmlvmException_;
1353     java_lang_Object_releaseLockRecursive__(_r1.o);
1354     XMLVM_THROW_CUSTOM(_r0.o)
1355     //XMLVM_END_WRAPPER
1356 }
1357 
java_lang_Thread_isInterrupted__(JAVA_OBJECT me)1358 JAVA_BOOLEAN java_lang_Thread_isInterrupted__(JAVA_OBJECT me)
1359 {
1360     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_isInterrupted__]
1361     XMLVM_ENTER_METHOD("java.lang.Thread", "isInterrupted", "?")
1362     volatile XMLVMElem _r0;
1363     volatile XMLVMElem _r1;
1364     volatile XMLVMElem _r2;
1365     _r2.o = me;
1366     XMLVM_SOURCE_POSITION("Thread.java", 758)
1367     _r0.i = 0;
1368     XMLVM_SOURCE_POSITION("Thread.java", 759)
1369     java_lang_Object_acquireLockRecursive__(_r2.o);
1370     XMLVM_TRY_BEGIN(w5666aaac65b1b6)
1371     // Begin try
1372     XMLVM_SOURCE_POSITION("Thread.java", 760)
1373     XMLVM_CHECK_NPE(2)
1374     _r0.i = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.interrupted_;
1375     XMLVM_SOURCE_POSITION("Thread.java", 761)
1376     java_lang_Object_releaseLockRecursive__(_r2.o);
1377     XMLVM_SOURCE_POSITION("Thread.java", 762)
1378     XMLVM_MEMCPY(curThread_w5666aaac65b1b6->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac65b1b6, sizeof(XMLVM_JMP_BUF));
1379     XMLVM_EXIT_METHOD()
1380     return _r0.i;
1381     // End try
1382     XMLVM_TRY_END
1383     XMLVM_CATCH_BEGIN(w5666aaac65b1b6)
1384         XMLVM_CATCH_SPECIFIC(w5666aaac65b1b6,java_lang_Object,6)
1385     XMLVM_CATCH_END(w5666aaac65b1b6)
1386     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac65b1b6)
1387     label6:;
1388     XMLVM_TRY_BEGIN(w5666aaac65b1b8)
1389     // Begin try
1390     java_lang_Thread* curThread_w5666aaac65b1b8aa = (java_lang_Thread*)java_lang_Thread_currentThread__();
1391     _r1.o = curThread_w5666aaac65b1b8aa->fields.java_lang_Thread.xmlvmException_;
1392     java_lang_Object_releaseLockRecursive__(_r2.o);
1393     // End try
1394     XMLVM_TRY_END
1395     XMLVM_CATCH_BEGIN(w5666aaac65b1b8)
1396         XMLVM_CATCH_SPECIFIC(w5666aaac65b1b8,java_lang_Object,6)
1397     XMLVM_CATCH_END(w5666aaac65b1b8)
1398     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac65b1b8)
1399     XMLVM_THROW_CUSTOM(_r1.o)
1400     //XMLVM_END_WRAPPER
1401 }
1402 
java_lang_Thread_join__(JAVA_OBJECT me)1403 void java_lang_Thread_join__(JAVA_OBJECT me)
1404 {
1405     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_join__]
1406     XMLVM_ENTER_METHOD("java.lang.Thread", "join", "?")
1407     XMLVMElem _r0;
1408     XMLVMElem _r1;
1409     XMLVMElem _r2;
1410     _r2.o = me;
1411     XMLVM_SOURCE_POSITION("Thread.java", 775)
1412     _r0.l = 0;
1413     XMLVM_CHECK_NPE(2)
1414     java_lang_Thread_join___long(_r2.o, _r0.l);
1415     XMLVM_SOURCE_POSITION("Thread.java", 776)
1416     XMLVM_EXIT_METHOD()
1417     return;
1418     //XMLVM_END_WRAPPER
1419 }
1420 
java_lang_Thread_join___long(JAVA_OBJECT me,JAVA_LONG n1)1421 void java_lang_Thread_join___long(JAVA_OBJECT me, JAVA_LONG n1)
1422 {
1423     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_join___long]
1424     XMLVM_ENTER_METHOD("java.lang.Thread", "join", "?")
1425     volatile XMLVMElem _r0;
1426     volatile XMLVMElem _r1;
1427     volatile XMLVMElem _r2;
1428     volatile XMLVMElem _r3;
1429     volatile XMLVMElem _r4;
1430     volatile XMLVMElem _r5;
1431     volatile XMLVMElem _r6;
1432     volatile XMLVMElem _r7;
1433     volatile XMLVMElem _r8;
1434     volatile XMLVMElem _r9;
1435     volatile XMLVMElem _r10;
1436     volatile XMLVMElem _r11;
1437     volatile XMLVMElem _r12;
1438     volatile XMLVMElem _r13;
1439     _r11.o = me;
1440     _r12.l = n1;
1441     _r9.l = 0;
1442     XMLVM_SOURCE_POSITION("Thread.java", 790)
1443     java_lang_Object_acquireLockRecursive__(_r11.o);
1444     XMLVM_TRY_BEGIN(w5666aaac67b1b6)
1445     // Begin try
1446     _r0.l = java_lang_System_currentTimeMillis__();
1447     _r5.l = 0;
1448     _r7.i = _r12.l > _r9.l ? 1 : (_r12.l == _r9.l ? 0 : -1);
1449     if (_r7.i >= 0) { XMLVM_MEMCPY(curThread_w5666aaac67b1b6->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1b6, sizeof(XMLVM_JMP_BUF)); goto label24; };
1450     XMLVM_SOURCE_POSITION("Thread.java", 793)
1451     XMLVM_SOURCE_POSITION("Thread.java", 794)
1452 
1453 
1454     // Red class access removed: java.lang.IllegalArgumentException::new-instance
1455     XMLVM_RED_CLASS_DEPENDENCY();
1456     // "timeout value is negative"
1457     _r8.o = xmlvm_create_java_string_from_pool(804);
1458 
1459 
1460     // Red class access removed: java.lang.IllegalArgumentException::<init>
1461     XMLVM_RED_CLASS_DEPENDENCY();
1462     XMLVM_THROW_CUSTOM(_r7.o)
1463     // End try
1464     XMLVM_TRY_END
1465     XMLVM_CATCH_BEGIN(w5666aaac67b1b6)
1466         XMLVM_CATCH_SPECIFIC(w5666aaac67b1b6,java_lang_Object,21)
1467     XMLVM_CATCH_END(w5666aaac67b1b6)
1468     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac67b1b6)
1469     label21:;
1470     java_lang_Thread* curThread_w5666aaac67b1b8 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1471     _r7.o = curThread_w5666aaac67b1b8->fields.java_lang_Thread.xmlvmException_;
1472     java_lang_Object_releaseLockRecursive__(_r11.o);
1473     XMLVM_THROW_CUSTOM(_r7.o)
1474     label24:;
1475     XMLVM_SOURCE_POSITION("Thread.java", 797)
1476     _r7.i = _r12.l > _r9.l ? 1 : (_r12.l == _r9.l ? 0 : -1);
1477     if (_r7.i != 0) goto label38;
1478     label28:;
1479     XMLVM_TRY_BEGIN(w5666aaac67b1c16)
1480     // Begin try
1481     XMLVM_SOURCE_POSITION("Thread.java", 798)
1482     XMLVM_CHECK_NPE(11)
1483     _r7.i = java_lang_Thread_isAlive__(_r11.o);
1484     if (_r7.i == 0) { XMLVM_MEMCPY(curThread_w5666aaac67b1c16->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1c16, sizeof(XMLVM_JMP_BUF)); goto label65; };
1485     XMLVM_SOURCE_POSITION("Thread.java", 800)
1486     XMLVM_CHECK_NPE(11)
1487     java_lang_Object_wait__(_r11.o);
1488     { XMLVM_MEMCPY(curThread_w5666aaac67b1c16->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1c16, sizeof(XMLVM_JMP_BUF)); goto label28; };
1489     XMLVM_SOURCE_POSITION("Thread.java", 803)
1490     // End try
1491     XMLVM_TRY_END
1492     XMLVM_CATCH_BEGIN(w5666aaac67b1c16)
1493         XMLVM_CATCH_SPECIFIC(w5666aaac67b1c16,java_lang_Object,21)
1494     XMLVM_CATCH_END(w5666aaac67b1c16)
1495     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac67b1c16)
1496     label38:;
1497     XMLVM_TRY_BEGIN(w5666aaac67b1c18)
1498     // Begin try
1499     _r4.i = 0;
1500     // End try
1501     XMLVM_TRY_END
1502     XMLVM_CATCH_BEGIN(w5666aaac67b1c18)
1503         XMLVM_CATCH_SPECIFIC(w5666aaac67b1c18,java_lang_Object,21)
1504     XMLVM_CATCH_END(w5666aaac67b1c18)
1505     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac67b1c18)
1506     label39:;
1507     XMLVM_TRY_BEGIN(w5666aaac67b1c20)
1508     // Begin try
1509     XMLVM_SOURCE_POSITION("Thread.java", 804)
1510     if (_r4.i != 0) { XMLVM_MEMCPY(curThread_w5666aaac67b1c20->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1c20, sizeof(XMLVM_JMP_BUF)); goto label65; };
1511     XMLVM_CHECK_NPE(11)
1512     _r7.i = java_lang_Thread_isAlive__(_r11.o);
1513     if (_r7.i == 0) { XMLVM_MEMCPY(curThread_w5666aaac67b1c20->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1c20, sizeof(XMLVM_JMP_BUF)); goto label65; };
1514     XMLVM_SOURCE_POSITION("Thread.java", 805)
1515     _r2.l = _r12.l - _r5.l;
1516     _r7.i = _r2.l > _r9.l ? 1 : (_r2.l == _r9.l ? 0 : -1);
1517     if (_r7.i > 0) { XMLVM_MEMCPY(curThread_w5666aaac67b1c20->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1c20, sizeof(XMLVM_JMP_BUF)); goto label55; };
1518     XMLVM_SOURCE_POSITION("Thread.java", 806)
1519     XMLVM_SOURCE_POSITION("Thread.java", 807)
1520     _r4.i = 1;
1521     { XMLVM_MEMCPY(curThread_w5666aaac67b1c20->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac67b1c20, sizeof(XMLVM_JMP_BUF)); goto label39; };
1522     XMLVM_SOURCE_POSITION("Thread.java", 810)
1523     // End try
1524     XMLVM_TRY_END
1525     XMLVM_CATCH_BEGIN(w5666aaac67b1c20)
1526         XMLVM_CATCH_SPECIFIC(w5666aaac67b1c20,java_lang_Object,21)
1527     XMLVM_CATCH_END(w5666aaac67b1c20)
1528     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac67b1c20)
1529     label55:;
1530     XMLVM_TRY_BEGIN(w5666aaac67b1c22)
1531     // Begin try
1532     XMLVM_CHECK_NPE(11)
1533     java_lang_Object_wait___long(_r11.o, _r2.l);
1534     XMLVM_SOURCE_POSITION("Thread.java", 811)
1535     _r7.l = java_lang_System_currentTimeMillis__();
1536     // End try
1537     XMLVM_TRY_END
1538     XMLVM_CATCH_BEGIN(w5666aaac67b1c22)
1539         XMLVM_CATCH_SPECIFIC(w5666aaac67b1c22,java_lang_Object,21)
1540     XMLVM_CATCH_END(w5666aaac67b1c22)
1541     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac67b1c22)
1542     _r5.l = _r7.l - _r0.l;
1543     goto label39;
1544     label65:;
1545     XMLVM_SOURCE_POSITION("Thread.java", 815)
1546     java_lang_Object_releaseLockRecursive__(_r11.o);
1547     XMLVM_EXIT_METHOD()
1548     return;
1549     //XMLVM_END_WRAPPER
1550 }
1551 
1552 //XMLVM_NATIVE[void java_lang_Thread_join___long_int(JAVA_OBJECT me, JAVA_LONG n1, JAVA_INT n2)]
1553 
1554 //XMLVM_NATIVE[void java_lang_Thread_resume__(JAVA_OBJECT me)]
1555 
java_lang_Thread_run0___long(JAVA_OBJECT me,JAVA_LONG n1)1556 void java_lang_Thread_run0___long(JAVA_OBJECT me, JAVA_LONG n1)
1557 {
1558     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_run0___long]
1559     XMLVM_ENTER_METHOD("java.lang.Thread", "run0", "?")
1560     volatile XMLVMElem _r0;
1561     volatile XMLVMElem _r1;
1562     volatile XMLVMElem _r2;
1563     volatile XMLVMElem _r3;
1564     volatile XMLVMElem _r4;
1565     volatile XMLVMElem _r5;
1566     volatile XMLVMElem _r6;
1567     volatile XMLVMElem _r7;
1568     volatile XMLVMElem _r8;
1569     _r6.o = me;
1570     _r7.l = n1;
1571     // "Exception in thread \042"
1572     _r5.o = xmlvm_create_java_string_from_pool(805);
1573     // "\042 "
1574     _r4.o = xmlvm_create_java_string_from_pool(806);
1575     XMLVM_SOURCE_POSITION("Thread.java", 854)
1576     XMLVM_CHECK_NPE(6)
1577     ((java_lang_Thread*) _r6.o)->fields.java_lang_Thread.nativeThreadId_ = _r7.l;
1578     XMLVM_SOURCE_POSITION("Thread.java", 855)
1579     XMLVM_CHECK_NPE(6)
1580     java_lang_Thread_addSelfToMap__(_r6.o);
1581     XMLVM_SOURCE_POSITION("Thread.java", 857)
1582     java_lang_Object_acquireLockRecursive__(_r6.o);
1583     XMLVM_SOURCE_POSITION("Thread.java", 858)
1584     _r1.i = 1;
1585     XMLVM_TRY_BEGIN(w5666aaac70b1c13)
1586     // Begin try
1587     XMLVM_CHECK_NPE(6)
1588     ((java_lang_Thread*) _r6.o)->fields.java_lang_Thread.alive_ = _r1.i;
1589     XMLVM_SOURCE_POSITION("Thread.java", 859)
1590     java_lang_Object_releaseLockRecursive__(_r6.o);
1591     // End try
1592     XMLVM_TRY_END
1593     XMLVM_CATCH_BEGIN(w5666aaac70b1c13)
1594         XMLVM_CATCH_SPECIFIC(w5666aaac70b1c13,java_lang_Object,41)
1595     XMLVM_CATCH_END(w5666aaac70b1c13)
1596     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac70b1c13)
1597     XMLVM_TRY_BEGIN(w5666aaac70b1c14)
1598     // Begin try
1599     XMLVM_SOURCE_POSITION("Thread.java", 862)
1600     XMLVM_CHECK_NPE(6)
1601     _r1.o = ((java_lang_Thread*) _r6.o)->fields.java_lang_Thread.targetRunnable_;
1602     if (_r1.o != JAVA_NULL) { XMLVM_MEMCPY(curThread_w5666aaac70b1c14->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac70b1c14, sizeof(XMLVM_JMP_BUF)); goto label44; };
1603     XMLVM_SOURCE_POSITION("Thread.java", 863)
1604     //java_lang_Thread_run__[6]
1605     XMLVM_CHECK_NPE(6)
1606     (*(void (*)(JAVA_OBJECT)) ((java_lang_Thread*) _r6.o)->tib->vtable[6])(_r6.o);
1607     // End try
1608     XMLVM_TRY_END
1609     XMLVM_CATCH_BEGIN(w5666aaac70b1c14)
1610         XMLVM_CATCH_SPECIFIC(w5666aaac70b1c14,java_lang_Throwable,50)
1611     XMLVM_CATCH_END(w5666aaac70b1c14)
1612     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac70b1c14)
1613     label21:;
1614     XMLVM_SOURCE_POSITION("Thread.java", 877)
1615     java_lang_Object_acquireLockRecursive__(_r6.o);
1616     XMLVM_SOURCE_POSITION("Thread.java", 878)
1617     _r1.i = 0;
1618     XMLVM_TRY_BEGIN(w5666aaac70b1c20)
1619     // Begin try
1620     XMLVM_CHECK_NPE(6)
1621     ((java_lang_Thread*) _r6.o)->fields.java_lang_Thread.alive_ = _r1.i;
1622     XMLVM_SOURCE_POSITION("Thread.java", 881)
1623     XMLVM_CHECK_NPE(6)
1624     java_lang_Object_notifyAll__(_r6.o);
1625     XMLVM_SOURCE_POSITION("Thread.java", 882)
1626     java_lang_Object_releaseLockRecursive__(_r6.o);
1627     // End try
1628     XMLVM_TRY_END
1629     XMLVM_CATCH_BEGIN(w5666aaac70b1c20)
1630         XMLVM_CATCH_SPECIFIC(w5666aaac70b1c20,java_lang_Object,158)
1631     XMLVM_CATCH_END(w5666aaac70b1c20)
1632     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac70b1c20)
1633     XMLVM_SOURCE_POSITION("Thread.java", 884)
1634     XMLVM_CHECK_NPE(6)
1635     java_lang_Thread_removeSelfFromMap__(_r6.o);
1636     XMLVM_SOURCE_POSITION("Thread.java", 886)
1637     XMLVM_CHECK_NPE(6)
1638     _r1.o = ((java_lang_Thread*) _r6.o)->fields.java_lang_Thread.threadGroup_;
1639     XMLVM_CHECK_NPE(1)
1640     java_lang_ThreadGroup_remove___java_lang_Thread(_r1.o, _r6.o);
1641     XMLVM_SOURCE_POSITION("Thread.java", 888)
1642     XMLVM_CHECK_NPE(6)
1643     java_lang_Thread_threadTerminating__(_r6.o);
1644     XMLVM_SOURCE_POSITION("Thread.java", 889)
1645     XMLVM_EXIT_METHOD()
1646     return;
1647     label41:;
1648     java_lang_Thread* curThread_w5666aaac70b1c31 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1649     _r1.o = curThread_w5666aaac70b1c31->fields.java_lang_Thread.xmlvmException_;
1650     XMLVM_TRY_BEGIN(w5666aaac70b1c32)
1651     // Begin try
1652     java_lang_Object_releaseLockRecursive__(_r6.o);
1653     // End try
1654     XMLVM_TRY_END
1655     XMLVM_CATCH_BEGIN(w5666aaac70b1c32)
1656         XMLVM_CATCH_SPECIFIC(w5666aaac70b1c32,java_lang_Object,41)
1657     XMLVM_CATCH_END(w5666aaac70b1c32)
1658     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac70b1c32)
1659     XMLVM_THROW_CUSTOM(_r1.o)
1660     label44:;
1661     XMLVM_TRY_BEGIN(w5666aaac70b1c35)
1662     // Begin try
1663     XMLVM_SOURCE_POSITION("Thread.java", 865)
1664     XMLVM_CHECK_NPE(6)
1665     _r1.o = ((java_lang_Thread*) _r6.o)->fields.java_lang_Thread.targetRunnable_;
1666     XMLVM_CHECK_NPE(1)
1667     (*(void (*)(JAVA_OBJECT)) *(((java_lang_Object*)_r1.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_lang_Runnable_run__])(_r1.o);
1668     // End try
1669     XMLVM_TRY_END
1670     XMLVM_CATCH_BEGIN(w5666aaac70b1c35)
1671         XMLVM_CATCH_SPECIFIC(w5666aaac70b1c35,java_lang_Throwable,50)
1672     XMLVM_CATCH_END(w5666aaac70b1c35)
1673     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac70b1c35)
1674     goto label21;
1675     label50:;
1676     XMLVM_SOURCE_POSITION("Thread.java", 867)
1677     java_lang_Thread* curThread_w5666aaac70b1c39 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1678     _r1.o = curThread_w5666aaac70b1c39->fields.java_lang_Thread.xmlvmException_;
1679     _r0 = _r1;
1680     XMLVM_SOURCE_POSITION("Thread.java", 868)
1681     _r1.i = java_lang_Thread_stackTracesEnabled__();
1682     if (_r1.i == 0) goto label96;
1683     XMLVM_SOURCE_POSITION("Thread.java", 869)
1684     _r1.o = java_lang_System_GET_out();
1685     _r2.o = __NEW_java_lang_StringBuilder();
1686     XMLVM_CHECK_NPE(2)
1687     java_lang_StringBuilder___INIT___(_r2.o);
1688     // "Exception in thread \042"
1689     _r3.o = xmlvm_create_java_string_from_pool(805);
1690     XMLVM_CHECK_NPE(2)
1691     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r5.o);
1692     XMLVM_CHECK_NPE(6)
1693     _r3.o = java_lang_Thread_getName__(_r6.o);
1694     XMLVM_CHECK_NPE(2)
1695     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r3.o);
1696     // "\042 "
1697     _r3.o = xmlvm_create_java_string_from_pool(806);
1698     XMLVM_CHECK_NPE(2)
1699     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r4.o);
1700     //java_lang_StringBuilder_toString__[5]
1701     XMLVM_CHECK_NPE(2)
1702     _r2.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_StringBuilder*) _r2.o)->tib->vtable[5])(_r2.o);
1703     XMLVM_CHECK_NPE(1)
1704     java_io_PrintStream_print___java_lang_String(_r1.o, _r2.o);
1705     XMLVM_SOURCE_POSITION("Thread.java", 870)
1706     XMLVM_CHECK_NPE(0)
1707     java_lang_Throwable_printStackTrace__(_r0.o);
1708     goto label21;
1709     label96:;
1710     XMLVM_SOURCE_POSITION("Thread.java", 872)
1711     _r1.o = java_lang_System_GET_out();
1712     _r2.o = __NEW_java_lang_StringBuilder();
1713     XMLVM_CHECK_NPE(2)
1714     java_lang_StringBuilder___INIT___(_r2.o);
1715     // "Exception in thread \042"
1716     _r3.o = xmlvm_create_java_string_from_pool(805);
1717     XMLVM_CHECK_NPE(2)
1718     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r5.o);
1719     XMLVM_CHECK_NPE(6)
1720     _r3.o = java_lang_Thread_getName__(_r6.o);
1721     XMLVM_CHECK_NPE(2)
1722     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r3.o);
1723     // "\042 "
1724     _r3.o = xmlvm_create_java_string_from_pool(806);
1725     XMLVM_CHECK_NPE(2)
1726     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r4.o);
1727     //java_lang_Object_getClass__[3]
1728     XMLVM_CHECK_NPE(0)
1729     _r3.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_Object*) _r0.o)->tib->vtable[3])(_r0.o);
1730     XMLVM_CHECK_NPE(3)
1731     _r3.o = java_lang_Class_getName__(_r3.o);
1732     XMLVM_CHECK_NPE(2)
1733     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r3.o);
1734     // ": "
1735     _r3.o = xmlvm_create_java_string_from_pool(49);
1736     XMLVM_CHECK_NPE(2)
1737     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r3.o);
1738     //java_lang_Throwable_getMessage__[7]
1739     XMLVM_CHECK_NPE(0)
1740     _r3.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_Throwable*) _r0.o)->tib->vtable[7])(_r0.o);
1741     XMLVM_CHECK_NPE(2)
1742     _r2.o = java_lang_StringBuilder_append___java_lang_String(_r2.o, _r3.o);
1743     //java_lang_StringBuilder_toString__[5]
1744     XMLVM_CHECK_NPE(2)
1745     _r2.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_StringBuilder*) _r2.o)->tib->vtable[5])(_r2.o);
1746     XMLVM_CHECK_NPE(1)
1747     java_io_PrintStream_println___java_lang_String(_r1.o, _r2.o);
1748     goto label21;
1749     label158:;
1750     java_lang_Thread* curThread_w5666aaac70b1c81 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1751     _r1.o = curThread_w5666aaac70b1c81->fields.java_lang_Thread.xmlvmException_;
1752     XMLVM_TRY_BEGIN(w5666aaac70b1c82)
1753     // Begin try
1754     java_lang_Object_releaseLockRecursive__(_r6.o);
1755     // End try
1756     XMLVM_TRY_END
1757     XMLVM_CATCH_BEGIN(w5666aaac70b1c82)
1758         XMLVM_CATCH_SPECIFIC(w5666aaac70b1c82,java_lang_Object,158)
1759     XMLVM_CATCH_END(w5666aaac70b1c82)
1760     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac70b1c82)
1761     XMLVM_THROW_CUSTOM(_r1.o)
1762     //XMLVM_END_WRAPPER
1763 }
1764 
1765 //XMLVM_NATIVE[JAVA_BOOLEAN java_lang_Thread_stackTracesEnabled__()]
1766 
java_lang_Thread_threadTerminating__(JAVA_OBJECT me)1767 void java_lang_Thread_threadTerminating__(JAVA_OBJECT me)
1768 {
1769     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_threadTerminating__]
1770     XMLVM_ENTER_METHOD("java.lang.Thread", "threadTerminating", "?")
1771     volatile XMLVMElem _r0;
1772     volatile XMLVMElem _r1;
1773     volatile XMLVMElem _r2;
1774     volatile XMLVMElem _r3;
1775     _r3.o = me;
1776     XMLVM_SOURCE_POSITION("Thread.java", 894)
1777     java_lang_Object_acquireLockRecursive__(_r3.o);
1778     XMLVM_TRY_BEGIN(w5666aaac72b1b4)
1779     // Begin try
1780     XMLVM_SOURCE_POSITION("Thread.java", 895)
1781     _r0.o = java_lang_Thread_State_GET_TERMINATED();
1782     XMLVM_CHECK_NPE(3)
1783     ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadState_ = _r0.o;
1784     XMLVM_SOURCE_POSITION("Thread.java", 896)
1785     java_lang_Object_releaseLockRecursive__(_r3.o);
1786     // End try
1787     XMLVM_TRY_END
1788     XMLVM_CATCH_BEGIN(w5666aaac72b1b4)
1789         XMLVM_CATCH_SPECIFIC(w5666aaac72b1b4,java_lang_Object,29)
1790     XMLVM_CATCH_END(w5666aaac72b1b4)
1791     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac72b1b4)
1792     XMLVM_SOURCE_POSITION("Thread.java", 900)
1793     XMLVM_CHECK_NPE(3)
1794     _r0.i = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.daemon_;
1795     if (_r0.i != 0) goto label28;
1796     XMLVM_SOURCE_POSITION("Thread.java", 901)
1797     XMLVM_CLASS_INIT(java_lang_Thread)
1798     _r0.o = __CLASS_java_lang_Thread;
1799     java_lang_Object_acquireLockRecursive__(_r0.o);
1800     XMLVM_TRY_BEGIN(w5666aaac72b1c11)
1801     // Begin try
1802     XMLVM_SOURCE_POSITION("Thread.java", 902)
1803     _r1.i = java_lang_Thread_GET_numberOfActiveNonDaemonThreads();
1804     _r2.i = 1;
1805     _r1.i = _r1.i - _r2.i;
1806     java_lang_Thread_PUT_numberOfActiveNonDaemonThreads( _r1.i);
1807     XMLVM_SOURCE_POSITION("Thread.java", 904)
1808     _r1.i = java_lang_Thread_GET_numberOfActiveNonDaemonThreads();
1809     if (_r1.i != 0) { XMLVM_MEMCPY(curThread_w5666aaac72b1c11->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac72b1c11, sizeof(XMLVM_JMP_BUF)); goto label27; };
1810     XMLVM_SOURCE_POSITION("Thread.java", 905)
1811     _r1.i = 0;
1812     java_lang_System_exit___int(_r1.i);
1813     // End try
1814     XMLVM_TRY_END
1815     XMLVM_CATCH_BEGIN(w5666aaac72b1c11)
1816         XMLVM_CATCH_SPECIFIC(w5666aaac72b1c11,java_lang_Object,32)
1817     XMLVM_CATCH_END(w5666aaac72b1c11)
1818     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac72b1c11)
1819     label27:;
1820     XMLVM_TRY_BEGIN(w5666aaac72b1c13)
1821     // Begin try
1822     XMLVM_SOURCE_POSITION("Thread.java", 907)
1823     java_lang_Object_releaseLockRecursive__(_r0.o);
1824     // End try
1825     XMLVM_TRY_END
1826     XMLVM_CATCH_BEGIN(w5666aaac72b1c13)
1827         XMLVM_CATCH_SPECIFIC(w5666aaac72b1c13,java_lang_Object,32)
1828     XMLVM_CATCH_END(w5666aaac72b1c13)
1829     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac72b1c13)
1830     label28:;
1831     XMLVM_SOURCE_POSITION("Thread.java", 909)
1832     XMLVM_EXIT_METHOD()
1833     return;
1834     label29:;
1835     java_lang_Thread* curThread_w5666aaac72b1c18 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1836     _r0.o = curThread_w5666aaac72b1c18->fields.java_lang_Thread.xmlvmException_;
1837     XMLVM_TRY_BEGIN(w5666aaac72b1c19)
1838     // Begin try
1839     java_lang_Object_releaseLockRecursive__(_r3.o);
1840     // End try
1841     XMLVM_TRY_END
1842     XMLVM_CATCH_BEGIN(w5666aaac72b1c19)
1843         XMLVM_CATCH_SPECIFIC(w5666aaac72b1c19,java_lang_Object,29)
1844     XMLVM_CATCH_END(w5666aaac72b1c19)
1845     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac72b1c19)
1846     XMLVM_THROW_CUSTOM(_r0.o)
1847     label32:;
1848     java_lang_Thread* curThread_w5666aaac72b1c22 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1849     _r1.o = curThread_w5666aaac72b1c22->fields.java_lang_Thread.xmlvmException_;
1850     XMLVM_TRY_BEGIN(w5666aaac72b1c23)
1851     // Begin try
1852     java_lang_Object_releaseLockRecursive__(_r0.o);
1853     // End try
1854     XMLVM_TRY_END
1855     XMLVM_CATCH_BEGIN(w5666aaac72b1c23)
1856         XMLVM_CATCH_SPECIFIC(w5666aaac72b1c23,java_lang_Object,32)
1857     XMLVM_CATCH_END(w5666aaac72b1c23)
1858     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac72b1c23)
1859     XMLVM_THROW_CUSTOM(_r1.o)
1860     //XMLVM_END_WRAPPER
1861 }
1862 
java_lang_Thread_run__(JAVA_OBJECT me)1863 void java_lang_Thread_run__(JAVA_OBJECT me)
1864 {
1865     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_run__]
1866     XMLVM_ENTER_METHOD("java.lang.Thread", "run", "?")
1867     XMLVMElem _r0;
1868     _r0.o = me;
1869     XMLVM_SOURCE_POSITION("Thread.java", 919)
1870     XMLVM_EXIT_METHOD()
1871     return;
1872     //XMLVM_END_WRAPPER
1873 }
1874 
1875 //XMLVM_NATIVE[void java_lang_Thread_setContextClassLoader___java_lang_ClassLoader(JAVA_OBJECT me, JAVA_OBJECT n1)]
1876 
java_lang_Thread_setDaemon___boolean(JAVA_OBJECT me,JAVA_BOOLEAN n1)1877 void java_lang_Thread_setDaemon___boolean(JAVA_OBJECT me, JAVA_BOOLEAN n1)
1878 {
1879     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_setDaemon___boolean]
1880     XMLVM_ENTER_METHOD("java.lang.Thread", "setDaemon", "?")
1881     volatile XMLVMElem _r0;
1882     volatile XMLVMElem _r1;
1883     volatile XMLVMElem _r2;
1884     volatile XMLVMElem _r3;
1885     _r2.o = me;
1886     _r3.i = n1;
1887     XMLVM_SOURCE_POSITION("Thread.java", 946)
1888     java_lang_Object_acquireLockRecursive__(_r2.o);
1889     XMLVM_TRY_BEGIN(w5666aaac75b1b5)
1890     // Begin try
1891     XMLVM_CHECK_NPE(2)
1892     _r0.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_;
1893     _r1.o = java_lang_Thread_State_GET_NEW();
1894     if (_r0.o == _r1.o) { XMLVM_MEMCPY(curThread_w5666aaac75b1b5->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac75b1b5, sizeof(XMLVM_JMP_BUF)); goto label16; };
1895     XMLVM_SOURCE_POSITION("Thread.java", 947)
1896 
1897 
1898     // Red class access removed: java.lang.IllegalThreadStateException::new-instance
1899     XMLVM_RED_CLASS_DEPENDENCY();
1900 
1901 
1902     // Red class access removed: java.lang.IllegalThreadStateException::<init>
1903     XMLVM_RED_CLASS_DEPENDENCY();
1904     XMLVM_THROW_CUSTOM(_r0.o)
1905     // End try
1906     XMLVM_TRY_END
1907     XMLVM_CATCH_BEGIN(w5666aaac75b1b5)
1908         XMLVM_CATCH_SPECIFIC(w5666aaac75b1b5,java_lang_Object,13)
1909     XMLVM_CATCH_END(w5666aaac75b1b5)
1910     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac75b1b5)
1911     label13:;
1912     java_lang_Thread* curThread_w5666aaac75b1b7 = (java_lang_Thread*)java_lang_Thread_currentThread__();
1913     _r0.o = curThread_w5666aaac75b1b7->fields.java_lang_Thread.xmlvmException_;
1914     java_lang_Object_releaseLockRecursive__(_r2.o);
1915     XMLVM_THROW_CUSTOM(_r0.o)
1916     label16:;
1917     XMLVM_TRY_BEGIN(w5666aaac75b1c11)
1918     // Begin try
1919     XMLVM_SOURCE_POSITION("Thread.java", 949)
1920     XMLVM_CHECK_NPE(2)
1921     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_ = _r3.i;
1922     // End try
1923     XMLVM_TRY_END
1924     XMLVM_CATCH_BEGIN(w5666aaac75b1c11)
1925         XMLVM_CATCH_SPECIFIC(w5666aaac75b1c11,java_lang_Object,13)
1926     XMLVM_CATCH_END(w5666aaac75b1c11)
1927     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac75b1c11)
1928     XMLVM_SOURCE_POSITION("Thread.java", 950)
1929     java_lang_Object_releaseLockRecursive__(_r2.o);
1930     XMLVM_EXIT_METHOD()
1931     return;
1932     //XMLVM_END_WRAPPER
1933 }
1934 
1935 //XMLVM_NATIVE[void java_lang_Thread_setDefaultUncaughtExceptionHandler___java_lang_Thread_UncaughtExceptionHandler(JAVA_OBJECT n1)]
1936 
java_lang_Thread_setName___java_lang_String(JAVA_OBJECT me,JAVA_OBJECT n1)1937 void java_lang_Thread_setName___java_lang_String(JAVA_OBJECT me, JAVA_OBJECT n1)
1938 {
1939     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_setName___java_lang_String]
1940     XMLVM_ENTER_METHOD("java.lang.Thread", "setName", "?")
1941     XMLVMElem _r0;
1942     XMLVMElem _r1;
1943     _r0.o = me;
1944     _r1.o = n1;
1945     XMLVM_SOURCE_POSITION("Thread.java", 977)
1946     XMLVM_CHECK_NPE(0)
1947     ((java_lang_Thread*) _r0.o)->fields.java_lang_Thread.threadName_ = _r1.o;
1948     XMLVM_SOURCE_POSITION("Thread.java", 978)
1949     XMLVM_EXIT_METHOD()
1950     return;
1951     //XMLVM_END_WRAPPER
1952 }
1953 
1954 //XMLVM_NATIVE[void java_lang_Thread_setPriority___int(JAVA_OBJECT me, JAVA_INT n1)]
1955 
java_lang_Thread_setThreadLocal___java_lang_ThreadLocal_java_lang_Object(JAVA_OBJECT me,JAVA_OBJECT n1,JAVA_OBJECT n2)1956 void java_lang_Thread_setThreadLocal___java_lang_ThreadLocal_java_lang_Object(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2)
1957 {
1958     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_setThreadLocal___java_lang_ThreadLocal_java_lang_Object]
1959     XMLVM_ENTER_METHOD("java.lang.Thread", "setThreadLocal", "?")
1960     XMLVMElem _r0;
1961     XMLVMElem _r1;
1962     XMLVMElem _r2;
1963     XMLVMElem _r3;
1964     _r1.o = me;
1965     _r2.o = n1;
1966     _r3.o = n2;
1967     XMLVM_SOURCE_POSITION("Thread.java", 1008)
1968     XMLVM_CHECK_NPE(1)
1969     _r0.o = ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.threadLocalMap_;
1970     XMLVM_CHECK_NPE(0)
1971     (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT, JAVA_OBJECT)) *(((java_lang_Object*)_r0.o)->tib->itableBegin)[XMLVM_ITABLE_IDX_java_util_Map_put___java_lang_Object_java_lang_Object])(_r0.o, _r2.o, _r3.o);
1972     XMLVM_SOURCE_POSITION("Thread.java", 1009)
1973     XMLVM_EXIT_METHOD()
1974     return;
1975     //XMLVM_END_WRAPPER
1976 }
1977 
1978 //XMLVM_NATIVE[void java_lang_Thread_setUncaughtExceptionHandler___java_lang_Thread_UncaughtExceptionHandler(JAVA_OBJECT me, JAVA_OBJECT n1)]
1979 
java_lang_Thread_sleep___long(JAVA_LONG n1)1980 void java_lang_Thread_sleep___long(JAVA_LONG n1)
1981 {
1982     XMLVM_CLASS_INIT(java_lang_Thread)
1983     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_sleep___long]
1984     XMLVM_ENTER_METHOD("java.lang.Thread", "sleep", "?")
1985     volatile XMLVMElem _r0;
1986     volatile XMLVMElem _r1;
1987     volatile XMLVMElem _r2;
1988     volatile XMLVMElem _r3;
1989     volatile XMLVMElem _r4;
1990     _r3.l = n1;
1991     XMLVM_SOURCE_POSITION("Thread.java", 1037)
1992     _r1.l = 0;
1993     _r1.i = _r3.l > _r1.l ? 1 : (_r3.l == _r1.l ? 0 : -1);
1994     if (_r1.i == 0) goto label16;
1995     XMLVM_SOURCE_POSITION("Thread.java", 1038)
1996     _r0.o = __NEW_java_lang_Object();
1997     XMLVM_CHECK_NPE(0)
1998     java_lang_Object___INIT___(_r0.o);
1999     XMLVM_SOURCE_POSITION("Thread.java", 1039)
2000     java_lang_Object_acquireLockRecursive__(_r0.o);
2001     XMLVM_TRY_BEGIN(w5666aaac81b1c11)
2002     // Begin try
2003     XMLVM_SOURCE_POSITION("Thread.java", 1040)
2004     XMLVM_CHECK_NPE(0)
2005     java_lang_Object_wait___long(_r0.o, _r3.l);
2006     XMLVM_SOURCE_POSITION("Thread.java", 1041)
2007     java_lang_Object_releaseLockRecursive__(_r0.o);
2008     // End try
2009     XMLVM_TRY_END
2010     XMLVM_CATCH_BEGIN(w5666aaac81b1c11)
2011         XMLVM_CATCH_SPECIFIC(w5666aaac81b1c11,java_lang_Object,17)
2012     XMLVM_CATCH_END(w5666aaac81b1c11)
2013     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac81b1c11)
2014     label16:;
2015     XMLVM_TRY_BEGIN(w5666aaac81b1c13)
2016     // Begin try
2017     XMLVM_SOURCE_POSITION("Thread.java", 1043)
2018     XMLVM_MEMCPY(curThread_w5666aaac81b1c13->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac81b1c13, sizeof(XMLVM_JMP_BUF));
2019     XMLVM_EXIT_METHOD()
2020     return;
2021     // End try
2022     XMLVM_TRY_END
2023     XMLVM_CATCH_BEGIN(w5666aaac81b1c13)
2024         XMLVM_CATCH_SPECIFIC(w5666aaac81b1c13,java_lang_Object,17)
2025     XMLVM_CATCH_END(w5666aaac81b1c13)
2026     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac81b1c13)
2027     label17:;
2028     XMLVM_TRY_BEGIN(w5666aaac81b1c15)
2029     // Begin try
2030     java_lang_Thread* curThread_w5666aaac81b1c15aa = (java_lang_Thread*)java_lang_Thread_currentThread__();
2031     _r1.o = curThread_w5666aaac81b1c15aa->fields.java_lang_Thread.xmlvmException_;
2032     java_lang_Object_releaseLockRecursive__(_r0.o);
2033     // End try
2034     XMLVM_TRY_END
2035     XMLVM_CATCH_BEGIN(w5666aaac81b1c15)
2036         XMLVM_CATCH_SPECIFIC(w5666aaac81b1c15,java_lang_Object,17)
2037     XMLVM_CATCH_END(w5666aaac81b1c15)
2038     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac81b1c15)
2039     XMLVM_THROW_CUSTOM(_r1.o)
2040     //XMLVM_END_WRAPPER
2041 }
2042 
java_lang_Thread_sleep___long_int(JAVA_LONG n1,JAVA_INT n2)2043 void java_lang_Thread_sleep___long_int(JAVA_LONG n1, JAVA_INT n2)
2044 {
2045     XMLVM_CLASS_INIT(java_lang_Thread)
2046     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_sleep___long_int]
2047     XMLVM_ENTER_METHOD("java.lang.Thread", "sleep", "?")
2048     XMLVMElem _r0;
2049     XMLVMElem _r1;
2050     XMLVMElem _r2;
2051     XMLVMElem _r3;
2052     XMLVMElem _r4;
2053     XMLVMElem _r5;
2054     XMLVMElem _r6;
2055     XMLVMElem _r7;
2056     _r5.l = n1;
2057     _r7.i = n2;
2058     _r3.l = 1;
2059     _r1.l = 0;
2060     XMLVM_SOURCE_POSITION("Thread.java", 1060)
2061     _r0.i = _r5.l > _r1.l ? 1 : (_r5.l == _r1.l ? 0 : -1);
2062     if (_r0.i >= 0) goto label16;
2063     XMLVM_SOURCE_POSITION("Thread.java", 1061)
2064 
2065 
2066     // Red class access removed: java.lang.IllegalArgumentException::new-instance
2067     XMLVM_RED_CLASS_DEPENDENCY();
2068     // "sleep milliseconds must be greater than or equal to zero"
2069     _r1.o = xmlvm_create_java_string_from_pool(807);
2070 
2071 
2072     // Red class access removed: java.lang.IllegalArgumentException::<init>
2073     XMLVM_RED_CLASS_DEPENDENCY();
2074     XMLVM_THROW_CUSTOM(_r0.o)
2075     label16:;
2076     XMLVM_SOURCE_POSITION("Thread.java", 1062)
2077     if (_r7.i < 0) goto label23;
2078     _r0.i = 1000000;
2079     if (_r7.i < _r0.i) goto label31;
2080     label23:;
2081     XMLVM_SOURCE_POSITION("Thread.java", 1063)
2082 
2083 
2084     // Red class access removed: java.lang.IllegalArgumentException::new-instance
2085     XMLVM_RED_CLASS_DEPENDENCY();
2086     // "sleep nanoseconds must be greater than or equal to zero and less than 1000000"
2087     _r1.o = xmlvm_create_java_string_from_pool(808);
2088 
2089 
2090     // Red class access removed: java.lang.IllegalArgumentException::<init>
2091     XMLVM_RED_CLASS_DEPENDENCY();
2092     XMLVM_THROW_CUSTOM(_r0.o)
2093     label31:;
2094     XMLVM_SOURCE_POSITION("Thread.java", 1066)
2095     _r0.i = _r5.l > _r1.l ? 1 : (_r5.l == _r1.l ? 0 : -1);
2096     if (_r0.i != 0) goto label41;
2097     if (_r7.i == 0) goto label41;
2098     XMLVM_SOURCE_POSITION("Thread.java", 1067)
2099     java_lang_Thread_sleep___long(_r3.l);
2100     label40:;
2101     XMLVM_SOURCE_POSITION("Thread.java", 1074)
2102     XMLVM_EXIT_METHOD()
2103     return;
2104     label41:;
2105     XMLVM_SOURCE_POSITION("Thread.java", 1069)
2106     _r0.i = 500000;
2107     if (_r7.i < _r0.i) goto label47;
2108     XMLVM_SOURCE_POSITION("Thread.java", 1070)
2109     _r5.l = _r5.l + _r3.l;
2110     label47:;
2111     XMLVM_SOURCE_POSITION("Thread.java", 1072)
2112     java_lang_Thread_sleep___long(_r5.l);
2113     goto label40;
2114     //XMLVM_END_WRAPPER
2115 }
2116 
java_lang_Thread_start__(JAVA_OBJECT me)2117 void java_lang_Thread_start__(JAVA_OBJECT me)
2118 {
2119     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_start__]
2120     XMLVM_ENTER_METHOD("java.lang.Thread", "start", "?")
2121     volatile XMLVMElem _r0;
2122     volatile XMLVMElem _r1;
2123     volatile XMLVMElem _r2;
2124     _r2.o = me;
2125     XMLVM_SOURCE_POSITION("Thread.java", 1085)
2126     java_lang_Object_acquireLockRecursive__(_r2.o);
2127     XMLVM_TRY_BEGIN(w5666aaac83b1b4)
2128     // Begin try
2129     XMLVM_SOURCE_POSITION("Thread.java", 1086)
2130     XMLVM_CHECK_NPE(2)
2131     _r0.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_;
2132     _r1.o = java_lang_Thread_State_GET_NEW();
2133     if (_r0.o == _r1.o) { XMLVM_MEMCPY(curThread_w5666aaac83b1b4->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac83b1b4, sizeof(XMLVM_JMP_BUF)); goto label16; };
2134     XMLVM_SOURCE_POSITION("Thread.java", 1087)
2135 
2136 
2137     // Red class access removed: java.lang.IllegalThreadStateException::new-instance
2138     XMLVM_RED_CLASS_DEPENDENCY();
2139 
2140 
2141     // Red class access removed: java.lang.IllegalThreadStateException::<init>
2142     XMLVM_RED_CLASS_DEPENDENCY();
2143     XMLVM_THROW_CUSTOM(_r0.o)
2144     // End try
2145     XMLVM_TRY_END
2146     XMLVM_CATCH_BEGIN(w5666aaac83b1b4)
2147         XMLVM_CATCH_SPECIFIC(w5666aaac83b1b4,java_lang_Object,13)
2148     XMLVM_CATCH_END(w5666aaac83b1b4)
2149     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac83b1b4)
2150     label13:;
2151     XMLVM_TRY_BEGIN(w5666aaac83b1b6)
2152     // Begin try
2153     XMLVM_SOURCE_POSITION("Thread.java", 1090)
2154     java_lang_Thread* curThread_w5666aaac83b1b6ab1 = (java_lang_Thread*)java_lang_Thread_currentThread__();
2155     _r0.o = curThread_w5666aaac83b1b6ab1->fields.java_lang_Thread.xmlvmException_;
2156     java_lang_Object_releaseLockRecursive__(_r2.o);
2157     // End try
2158     XMLVM_TRY_END
2159     XMLVM_CATCH_BEGIN(w5666aaac83b1b6)
2160         XMLVM_CATCH_SPECIFIC(w5666aaac83b1b6,java_lang_Object,13)
2161     XMLVM_CATCH_END(w5666aaac83b1b6)
2162     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac83b1b6)
2163     XMLVM_THROW_CUSTOM(_r0.o)
2164     label16:;
2165     XMLVM_TRY_BEGIN(w5666aaac83b1b9)
2166     // Begin try
2167     XMLVM_SOURCE_POSITION("Thread.java", 1089)
2168     _r0.o = java_lang_Thread_State_GET_RUNNABLE();
2169     XMLVM_CHECK_NPE(2)
2170     ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadState_ = _r0.o;
2171     java_lang_Object_releaseLockRecursive__(_r2.o);
2172     // End try
2173     XMLVM_TRY_END
2174     XMLVM_CATCH_BEGIN(w5666aaac83b1b9)
2175         XMLVM_CATCH_SPECIFIC(w5666aaac83b1b9,java_lang_Object,13)
2176     XMLVM_CATCH_END(w5666aaac83b1b9)
2177     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac83b1b9)
2178     XMLVM_SOURCE_POSITION("Thread.java", 1094)
2179     XMLVM_CHECK_NPE(2)
2180     _r0.i = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.daemon_;
2181     if (_r0.i != 0) goto label35;
2182     XMLVM_SOURCE_POSITION("Thread.java", 1095)
2183     XMLVM_CLASS_INIT(java_lang_Thread)
2184     _r0.o = __CLASS_java_lang_Thread;
2185     java_lang_Object_acquireLockRecursive__(_r0.o);
2186     XMLVM_TRY_BEGIN(w5666aaac83b1c16)
2187     // Begin try
2188     XMLVM_SOURCE_POSITION("Thread.java", 1096)
2189     _r1.i = java_lang_Thread_GET_numberOfActiveNonDaemonThreads();
2190     _r1.i = _r1.i + 1;
2191     java_lang_Thread_PUT_numberOfActiveNonDaemonThreads( _r1.i);
2192     XMLVM_SOURCE_POSITION("Thread.java", 1097)
2193     java_lang_Object_releaseLockRecursive__(_r0.o);
2194     // End try
2195     XMLVM_TRY_END
2196     XMLVM_CATCH_BEGIN(w5666aaac83b1c16)
2197         XMLVM_CATCH_SPECIFIC(w5666aaac83b1c16,java_lang_Object,44)
2198     XMLVM_CATCH_END(w5666aaac83b1c16)
2199     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac83b1c16)
2200     label35:;
2201     XMLVM_SOURCE_POSITION("Thread.java", 1099)
2202     XMLVM_CHECK_NPE(2)
2203     _r0.o = ((java_lang_Thread*) _r2.o)->fields.java_lang_Thread.threadGroup_;
2204     XMLVM_CHECK_NPE(0)
2205     java_lang_ThreadGroup_add___java_lang_Thread(_r0.o, _r2.o);
2206     XMLVM_SOURCE_POSITION("Thread.java", 1100)
2207     XMLVM_CHECK_NPE(2)
2208     java_lang_Thread_start0__(_r2.o);
2209     XMLVM_SOURCE_POSITION("Thread.java", 1101)
2210     XMLVM_EXIT_METHOD()
2211     return;
2212     label44:;
2213     java_lang_Thread* curThread_w5666aaac83b1c26 = (java_lang_Thread*)java_lang_Thread_currentThread__();
2214     _r1.o = curThread_w5666aaac83b1c26->fields.java_lang_Thread.xmlvmException_;
2215     XMLVM_TRY_BEGIN(w5666aaac83b1c27)
2216     // Begin try
2217     java_lang_Object_releaseLockRecursive__(_r0.o);
2218     // End try
2219     XMLVM_TRY_END
2220     XMLVM_CATCH_BEGIN(w5666aaac83b1c27)
2221         XMLVM_CATCH_SPECIFIC(w5666aaac83b1c27,java_lang_Object,44)
2222     XMLVM_CATCH_END(w5666aaac83b1c27)
2223     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac83b1c27)
2224     XMLVM_THROW_CUSTOM(_r1.o)
2225     //XMLVM_END_WRAPPER
2226 }
2227 
2228 //XMLVM_NATIVE[void java_lang_Thread_start0__(JAVA_OBJECT me)]
2229 
2230 //XMLVM_NATIVE[void java_lang_Thread_stop__(JAVA_OBJECT me)]
2231 
2232 //XMLVM_NATIVE[void java_lang_Thread_stop___java_lang_Throwable(JAVA_OBJECT me, JAVA_OBJECT n1)]
2233 
2234 //XMLVM_NATIVE[void java_lang_Thread_suspend__(JAVA_OBJECT me)]
2235 
java_lang_Thread_toString__(JAVA_OBJECT me)2236 JAVA_OBJECT java_lang_Thread_toString__(JAVA_OBJECT me)
2237 {
2238     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_toString__]
2239     XMLVM_ENTER_METHOD("java.lang.Thread", "toString", "?")
2240     XMLVMElem _r0;
2241     XMLVMElem _r1;
2242     XMLVMElem _r2;
2243     XMLVMElem _r3;
2244     _r3.o = me;
2245     // ","
2246     _r2.o = xmlvm_create_java_string_from_pool(24);
2247     XMLVM_SOURCE_POSITION("Thread.java", 1158)
2248     _r0.o = __NEW_java_lang_StringBuilder();
2249     XMLVM_CHECK_NPE(0)
2250     java_lang_StringBuilder___INIT___(_r0.o);
2251     // "Thread["
2252     _r1.o = xmlvm_create_java_string_from_pool(809);
2253     XMLVM_CHECK_NPE(0)
2254     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
2255     XMLVM_CHECK_NPE(3)
2256     _r1.o = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadName_;
2257     XMLVM_CHECK_NPE(0)
2258     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
2259     // ","
2260     _r1.o = xmlvm_create_java_string_from_pool(24);
2261     XMLVM_CHECK_NPE(0)
2262     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r2.o);
2263     XMLVM_CHECK_NPE(3)
2264     _r1.i = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.priority_;
2265     XMLVM_CHECK_NPE(0)
2266     _r0.o = java_lang_StringBuilder_append___int(_r0.o, _r1.i);
2267     // ","
2268     _r1.o = xmlvm_create_java_string_from_pool(24);
2269     XMLVM_CHECK_NPE(0)
2270     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r2.o);
2271     XMLVM_CHECK_NPE(3)
2272     _r1.o = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadGroup_;
2273     if (_r1.o != JAVA_NULL) goto label58;
2274     // ""
2275     _r1.o = xmlvm_create_java_string_from_pool(21);
2276     label43:;
2277     XMLVM_CHECK_NPE(0)
2278     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
2279     // "]"
2280     _r1.o = xmlvm_create_java_string_from_pool(183);
2281     XMLVM_CHECK_NPE(0)
2282     _r0.o = java_lang_StringBuilder_append___java_lang_String(_r0.o, _r1.o);
2283     //java_lang_StringBuilder_toString__[5]
2284     XMLVM_CHECK_NPE(0)
2285     _r0.o = (*(JAVA_OBJECT (*)(JAVA_OBJECT)) ((java_lang_StringBuilder*) _r0.o)->tib->vtable[5])(_r0.o);
2286     XMLVM_EXIT_METHOD()
2287     return _r0.o;
2288     label58:;
2289     XMLVM_CHECK_NPE(3)
2290     _r1.o = ((java_lang_Thread*) _r3.o)->fields.java_lang_Thread.threadGroup_;
2291     XMLVM_CHECK_NPE(1)
2292     _r1.o = java_lang_ThreadGroup_getName__(_r1.o);
2293     goto label43;
2294     //XMLVM_END_WRAPPER
2295 }
2296 
2297 //XMLVM_NATIVE[void java_lang_Thread_yield__()]
2298 
2299 //XMLVM_NATIVE[JAVA_BOOLEAN java_lang_Thread_holdsLock___java_lang_Object(JAVA_OBJECT n1)]
2300 
java_lang_Thread_setWaitingCondition___org_xmlvm_runtime_Condition(JAVA_OBJECT me,JAVA_OBJECT n1)2301 void java_lang_Thread_setWaitingCondition___org_xmlvm_runtime_Condition(JAVA_OBJECT me, JAVA_OBJECT n1)
2302 {
2303     //XMLVM_BEGIN_WRAPPER[java_lang_Thread_setWaitingCondition___org_xmlvm_runtime_Condition]
2304     XMLVM_ENTER_METHOD("java.lang.Thread", "setWaitingCondition", "?")
2305     volatile XMLVMElem _r0;
2306     volatile XMLVMElem _r1;
2307     volatile XMLVMElem _r2;
2308     _r1.o = me;
2309     _r2.o = n1;
2310     XMLVM_SOURCE_POSITION("Thread.java", 1201)
2311     java_lang_Object_acquireLockRecursive__(_r1.o);
2312     XMLVM_TRY_BEGIN(w5666aaac91b1b5)
2313     // Begin try
2314     XMLVM_SOURCE_POSITION("Thread.java", 1202)
2315     XMLVM_CHECK_NPE(1)
2316     ((java_lang_Thread*) _r1.o)->fields.java_lang_Thread.waitingCondition_ = _r2.o;
2317     XMLVM_SOURCE_POSITION("Thread.java", 1203)
2318     java_lang_Object_releaseLockRecursive__(_r1.o);
2319     XMLVM_SOURCE_POSITION("Thread.java", 1204)
2320     XMLVM_MEMCPY(curThread_w5666aaac91b1b5->fields.java_lang_Thread.xmlvmExceptionEnv_, local_env_w5666aaac91b1b5, sizeof(XMLVM_JMP_BUF));
2321     XMLVM_EXIT_METHOD()
2322     return;
2323     // End try
2324     XMLVM_TRY_END
2325     XMLVM_CATCH_BEGIN(w5666aaac91b1b5)
2326         XMLVM_CATCH_SPECIFIC(w5666aaac91b1b5,java_lang_Object,5)
2327     XMLVM_CATCH_END(w5666aaac91b1b5)
2328     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac91b1b5)
2329     label5:;
2330     XMLVM_TRY_BEGIN(w5666aaac91b1b7)
2331     // Begin try
2332     java_lang_Thread* curThread_w5666aaac91b1b7aa = (java_lang_Thread*)java_lang_Thread_currentThread__();
2333     _r0.o = curThread_w5666aaac91b1b7aa->fields.java_lang_Thread.xmlvmException_;
2334     java_lang_Object_releaseLockRecursive__(_r1.o);
2335     // End try
2336     XMLVM_TRY_END
2337     XMLVM_CATCH_BEGIN(w5666aaac91b1b7)
2338         XMLVM_CATCH_SPECIFIC(w5666aaac91b1b7,java_lang_Object,5)
2339     XMLVM_CATCH_END(w5666aaac91b1b7)
2340     XMLVM_RESTORE_EXCEPTION_ENV(w5666aaac91b1b7)
2341     XMLVM_THROW_CUSTOM(_r0.o)
2342     //XMLVM_END_WRAPPER
2343 }
2344 
java_lang_Thread___CLINIT_()2345 void java_lang_Thread___CLINIT_()
2346 {
2347     //XMLVM_BEGIN_WRAPPER[java_lang_Thread___CLINIT___]
2348     XMLVM_ENTER_METHOD("java.lang.Thread", "<clinit>", "?")
2349     XMLVMElem _r0;
2350     XMLVMElem _r1;
2351     XMLVM_SOURCE_POSITION("Thread.java", 115)
2352     _r0.o = __NEW_org_xmlvm_runtime_Mutex();
2353     XMLVM_CHECK_NPE(0)
2354     org_xmlvm_runtime_Mutex___INIT___(_r0.o);
2355     java_lang_Thread_PUT_threadSafetyMutex( _r0.o);
2356     XMLVM_SOURCE_POSITION("Thread.java", 118)
2357     _r0.l = 2;
2358     java_lang_Thread_PUT_nextThreadId( _r0.l);
2359     XMLVM_SOURCE_POSITION("Thread.java", 127)
2360     _r0.i = 1;
2361     java_lang_Thread_PUT_numberOfActiveNonDaemonThreads( _r0.i);
2362     XMLVM_SOURCE_POSITION("Thread.java", 148)
2363     _r0.o = __NEW_java_util_HashMap();
2364     XMLVM_CHECK_NPE(0)
2365     java_util_HashMap___INIT___(_r0.o);
2366     java_lang_Thread_PUT_threadMap( _r0.o);
2367     XMLVM_SOURCE_POSITION("Thread.java", 153)
2368     _r1.o = __NEW_java_lang_ThreadGroup();
2369     _r0.o = JAVA_NULL;
2370     _r0.o = _r0.o;
2371     XMLVM_CHECK_NPE(1)
2372     java_lang_ThreadGroup___INIT____java_lang_ThreadGroup(_r1.o, _r0.o);
2373     java_lang_Thread_PUT_mainThreadGroup( _r1.o);
2374     XMLVM_EXIT_METHOD()
2375     return;
2376     //XMLVM_END_WRAPPER
2377 }
2378 
2379