Mercurial > hg > truffle
comparison src/share/vm/runtime/thread.cpp @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | 147162b27799 f2110083203d |
children | d55f24eac4b1 |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
79 #include "runtime/vm_operations.hpp" | 79 #include "runtime/vm_operations.hpp" |
80 #include "services/attachListener.hpp" | 80 #include "services/attachListener.hpp" |
81 #include "services/management.hpp" | 81 #include "services/management.hpp" |
82 #include "services/memTracker.hpp" | 82 #include "services/memTracker.hpp" |
83 #include "services/threadService.hpp" | 83 #include "services/threadService.hpp" |
84 #include "trace/traceEventTypes.hpp" | 84 #include "trace/tracing.hpp" |
85 #include "trace/traceMacros.hpp" | |
85 #include "utilities/defaultStream.hpp" | 86 #include "utilities/defaultStream.hpp" |
86 #include "utilities/dtrace.hpp" | 87 #include "utilities/dtrace.hpp" |
87 #include "utilities/events.hpp" | 88 #include "utilities/events.hpp" |
88 #include "utilities/preserveException.hpp" | 89 #include "utilities/preserveException.hpp" |
89 #include "utilities/macros.hpp" | 90 #include "utilities/macros.hpp" |
240 NOT_PRODUCT(_allow_safepoint_count = 0;) | 241 NOT_PRODUCT(_allow_safepoint_count = 0;) |
241 NOT_PRODUCT(_skip_gcalot = false;) | 242 NOT_PRODUCT(_skip_gcalot = false;) |
242 CHECK_UNHANDLED_OOPS_ONLY(_gc_locked_out_count = 0;) | 243 CHECK_UNHANDLED_OOPS_ONLY(_gc_locked_out_count = 0;) |
243 _jvmti_env_iteration_count = 0; | 244 _jvmti_env_iteration_count = 0; |
244 set_allocated_bytes(0); | 245 set_allocated_bytes(0); |
245 set_trace_buffer(NULL); | |
246 _vm_operation_started_count = 0; | 246 _vm_operation_started_count = 0; |
247 _vm_operation_completed_count = 0; | 247 _vm_operation_completed_count = 0; |
248 _current_pending_monitor = NULL; | 248 _current_pending_monitor = NULL; |
249 _current_pending_monitor_is_from_java = true; | 249 _current_pending_monitor_is_from_java = true; |
250 _current_waiting_monitor = NULL; | 250 _current_waiting_monitor = NULL; |
1666 | 1666 |
1667 if (JvmtiExport::should_post_thread_life()) { | 1667 if (JvmtiExport::should_post_thread_life()) { |
1668 JvmtiExport::post_thread_start(this); | 1668 JvmtiExport::post_thread_start(this); |
1669 } | 1669 } |
1670 | 1670 |
1671 EVENT_BEGIN(TraceEventThreadStart, event); | 1671 EventThreadStart event; |
1672 EVENT_COMMIT(event, | 1672 if (event.should_commit()) { |
1673 EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(this->threadObj()))); | 1673 event.set_javalangthread(java_lang_Thread::thread_id(this->threadObj())); |
1674 event.commit(); | |
1675 } | |
1674 | 1676 |
1675 // We call another function to do the rest so we are sure that the stack addresses used | 1677 // We call another function to do the rest so we are sure that the stack addresses used |
1676 // from there will be lower than the stack base just computed | 1678 // from there will be lower than the stack base just computed |
1677 thread_main_inner(); | 1679 thread_main_inner(); |
1678 | 1680 |
1798 } | 1800 } |
1799 } | 1801 } |
1800 | 1802 |
1801 // Called before the java thread exit since we want to read info | 1803 // Called before the java thread exit since we want to read info |
1802 // from java_lang_Thread object | 1804 // from java_lang_Thread object |
1803 EVENT_BEGIN(TraceEventThreadEnd, event); | 1805 EventThreadEnd event; |
1804 EVENT_COMMIT(event, | 1806 if (event.should_commit()) { |
1805 EVENT_SET(event, javalangthread, java_lang_Thread::thread_id(this->threadObj()))); | 1807 event.set_javalangthread(java_lang_Thread::thread_id(this->threadObj())); |
1808 event.commit(); | |
1809 } | |
1806 | 1810 |
1807 // Call after last event on thread | 1811 // Call after last event on thread |
1808 EVENT_THREAD_EXIT(this); | 1812 EVENT_THREAD_EXIT(this); |
1809 | 1813 |
1810 // Call Thread.exit(). We try 3 times in case we got another Thread.stop during | 1814 // Call Thread.exit(). We try 3 times in case we got another Thread.stop during |
3452 } | 3456 } |
3453 } | 3457 } |
3454 | 3458 |
3455 assert (Universe::is_fully_initialized(), "not initialized"); | 3459 assert (Universe::is_fully_initialized(), "not initialized"); |
3456 if (VerifyDuringStartup) { | 3460 if (VerifyDuringStartup) { |
3457 VM_Verify verify_op(false /* silent */); // make sure we're starting with a clean slate | 3461 // Make sure we're starting with a clean slate. |
3462 VM_Verify verify_op; | |
3458 VMThread::execute(&verify_op); | 3463 VMThread::execute(&verify_op); |
3459 } | 3464 } |
3460 | 3465 |
3461 EXCEPTION_MARK; | 3466 EXCEPTION_MARK; |
3462 | 3467 |
3652 } | 3657 } |
3653 | 3658 |
3654 // Notify JVMTI agents that VM initialization is complete - nop if no agents. | 3659 // Notify JVMTI agents that VM initialization is complete - nop if no agents. |
3655 JvmtiExport::post_vm_initialized(); | 3660 JvmtiExport::post_vm_initialized(); |
3656 | 3661 |
3657 if (!TRACE_START()) { | 3662 if (TRACE_START() != JNI_OK) { |
3658 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION)); | 3663 vm_exit_during_initialization("Failed to start tracing backend."); |
3659 } | 3664 } |
3660 | 3665 |
3661 if (CleanChunkPoolAsync) { | 3666 if (CleanChunkPoolAsync) { |
3662 Chunk::start_chunk_pool_cleaner_task(); | 3667 Chunk::start_chunk_pool_cleaner_task(); |
3663 } | 3668 } |