Mercurial > hg > truffle
comparison src/share/vm/runtime/thread.cpp @ 14489:f460c6926af7
Merge
author | ehelin |
---|---|
date | Tue, 25 Feb 2014 11:02:11 +0100 |
parents | be0ac0e8f6e7 28f281e8de1d |
children | d8041d695d19 c0774726073e |
comparison
equal
deleted
inserted
replaced
14488:60fd6d24f49f | 14489:f460c6926af7 |
---|---|
110 | 110 |
111 #ifdef DTRACE_ENABLED | 111 #ifdef DTRACE_ENABLED |
112 | 112 |
113 // Only bother with this argument setup if dtrace is available | 113 // Only bother with this argument setup if dtrace is available |
114 | 114 |
115 #ifndef USDT2 | |
116 HS_DTRACE_PROBE_DECL(hotspot, vm__init__begin); | |
117 HS_DTRACE_PROBE_DECL(hotspot, vm__init__end); | |
118 HS_DTRACE_PROBE_DECL5(hotspot, thread__start, char*, intptr_t, | |
119 intptr_t, intptr_t, bool); | |
120 HS_DTRACE_PROBE_DECL5(hotspot, thread__stop, char*, intptr_t, | |
121 intptr_t, intptr_t, bool); | |
122 | |
123 #define DTRACE_THREAD_PROBE(probe, javathread) \ | |
124 { \ | |
125 ResourceMark rm(this); \ | |
126 int len = 0; \ | |
127 const char* name = (javathread)->get_thread_name(); \ | |
128 len = strlen(name); \ | |
129 HS_DTRACE_PROBE5(hotspot, thread__##probe, \ | |
130 name, len, \ | |
131 java_lang_Thread::thread_id((javathread)->threadObj()), \ | |
132 (javathread)->osthread()->thread_id(), \ | |
133 java_lang_Thread::is_daemon((javathread)->threadObj())); \ | |
134 } | |
135 | |
136 #else /* USDT2 */ | |
137 | |
138 #define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_START | 115 #define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_START |
139 #define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_STOP | 116 #define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_STOP |
140 | 117 |
141 #define DTRACE_THREAD_PROBE(probe, javathread) \ | 118 #define DTRACE_THREAD_PROBE(probe, javathread) \ |
142 { \ | 119 { \ |
148 (char *) name, len, \ | 125 (char *) name, len, \ |
149 java_lang_Thread::thread_id((javathread)->threadObj()), \ | 126 java_lang_Thread::thread_id((javathread)->threadObj()), \ |
150 (uintptr_t) (javathread)->osthread()->thread_id(), \ | 127 (uintptr_t) (javathread)->osthread()->thread_id(), \ |
151 java_lang_Thread::is_daemon((javathread)->threadObj())); \ | 128 java_lang_Thread::is_daemon((javathread)->threadObj())); \ |
152 } | 129 } |
153 | |
154 #endif /* USDT2 */ | |
155 | 130 |
156 #else // ndef DTRACE_ENABLED | 131 #else // ndef DTRACE_ENABLED |
157 | 132 |
158 #define DTRACE_THREAD_PROBE(probe, javathread) | 133 #define DTRACE_THREAD_PROBE(probe, javathread) |
159 | 134 |
310 } | 285 } |
311 | 286 |
312 void Thread::record_stack_base_and_size() { | 287 void Thread::record_stack_base_and_size() { |
313 set_stack_base(os::current_stack_base()); | 288 set_stack_base(os::current_stack_base()); |
314 set_stack_size(os::current_stack_size()); | 289 set_stack_size(os::current_stack_size()); |
290 if (is_Java_thread()) { | |
291 ((JavaThread*) this)->set_stack_overflow_limit(); | |
292 } | |
315 // CR 7190089: on Solaris, primordial thread's stack is adjusted | 293 // CR 7190089: on Solaris, primordial thread's stack is adjusted |
316 // in initialize_thread(). Without the adjustment, stack size is | 294 // in initialize_thread(). Without the adjustment, stack size is |
317 // incorrect if stack is set to unlimited (ulimit -s unlimited). | 295 // incorrect if stack is set to unlimited (ulimit -s unlimited). |
318 // So far, only Solaris has real implementation of initialize_thread(). | 296 // So far, only Solaris has real implementation of initialize_thread(). |
319 // | 297 // |
3389 | 3367 |
3390 if (PauseAtStartup) { | 3368 if (PauseAtStartup) { |
3391 os::pause(); | 3369 os::pause(); |
3392 } | 3370 } |
3393 | 3371 |
3394 #ifndef USDT2 | |
3395 HS_DTRACE_PROBE(hotspot, vm__init__begin); | |
3396 #else /* USDT2 */ | |
3397 HOTSPOT_VM_INIT_BEGIN(); | 3372 HOTSPOT_VM_INIT_BEGIN(); |
3398 #endif /* USDT2 */ | |
3399 | 3373 |
3400 // Record VM creation timing statistics | 3374 // Record VM creation timing statistics |
3401 TraceVmCreationTime create_vm_timer; | 3375 TraceVmCreationTime create_vm_timer; |
3402 create_vm_timer.start(); | 3376 create_vm_timer.start(); |
3403 | 3377 |
3555 | 3529 |
3556 // Set flag that basic initialization has completed. Used by exceptions and various | 3530 // Set flag that basic initialization has completed. Used by exceptions and various |
3557 // debug stuff, that does not work until all basic classes have been initialized. | 3531 // debug stuff, that does not work until all basic classes have been initialized. |
3558 set_init_completed(); | 3532 set_init_completed(); |
3559 | 3533 |
3560 #ifndef USDT2 | |
3561 HS_DTRACE_PROBE(hotspot, vm__init__end); | |
3562 #else /* USDT2 */ | |
3563 HOTSPOT_VM_INIT_END(); | 3534 HOTSPOT_VM_INIT_END(); |
3564 #endif /* USDT2 */ | |
3565 | 3535 |
3566 // record VM initialization completion time | 3536 // record VM initialization completion time |
3567 #if INCLUDE_MANAGEMENT | 3537 #if INCLUDE_MANAGEMENT |
3568 Management::record_vm_init_completed(); | 3538 Management::record_vm_init_completed(); |
3569 #endif // INCLUDE_MANAGEMENT | 3539 #endif // INCLUDE_MANAGEMENT |