1181 set_vm_result_2(NULL); |
1181 set_vm_result_2(NULL); |
1182 set_vframe_array_head(NULL); |
1182 set_vframe_array_head(NULL); |
1183 set_vframe_array_last(NULL); |
1183 set_vframe_array_last(NULL); |
1184 set_deferred_locals(NULL); |
1184 set_deferred_locals(NULL); |
1185 set_deopt_mark(NULL); |
1185 set_deopt_mark(NULL); |
|
1186 set_deopt_nmethod(NULL); |
1186 clear_must_deopt_id(); |
1187 clear_must_deopt_id(); |
1187 set_monitor_chunks(NULL); |
1188 set_monitor_chunks(NULL); |
1188 set_next(NULL); |
1189 set_next(NULL); |
1189 set_thread_state(_thread_new); |
1190 set_thread_state(_thread_new); |
1190 _terminated = _not_terminated; |
1191 _terminated = _not_terminated; |
1642 // Flush G1-related queues. |
1643 // Flush G1-related queues. |
1643 void JavaThread::flush_barrier_queues() { |
1644 void JavaThread::flush_barrier_queues() { |
1644 satb_mark_queue().flush(); |
1645 satb_mark_queue().flush(); |
1645 dirty_card_queue().flush(); |
1646 dirty_card_queue().flush(); |
1646 } |
1647 } |
1647 #endif |
1648 |
|
1649 void JavaThread::initialize_queues() { |
|
1650 assert(!SafepointSynchronize::is_at_safepoint(), |
|
1651 "we should not be at a safepoint"); |
|
1652 |
|
1653 ObjPtrQueue& satb_queue = satb_mark_queue(); |
|
1654 SATBMarkQueueSet& satb_queue_set = satb_mark_queue_set(); |
|
1655 // The SATB queue should have been constructed with its active |
|
1656 // field set to false. |
|
1657 assert(!satb_queue.is_active(), "SATB queue should not be active"); |
|
1658 assert(satb_queue.is_empty(), "SATB queue should be empty"); |
|
1659 // If we are creating the thread during a marking cycle, we should |
|
1660 // set the active field of the SATB queue to true. |
|
1661 if (satb_queue_set.is_active()) { |
|
1662 satb_queue.set_active(true); |
|
1663 } |
|
1664 |
|
1665 DirtyCardQueue& dirty_queue = dirty_card_queue(); |
|
1666 // The dirty card queue should have been constructed with its |
|
1667 // active field set to true. |
|
1668 assert(dirty_queue.is_active(), "dirty card queue should be active"); |
|
1669 } |
|
1670 #endif // !SERIALGC |
1648 |
1671 |
1649 void JavaThread::cleanup_failed_attach_current_thread() { |
1672 void JavaThread::cleanup_failed_attach_current_thread() { |
1650 if (get_thread_profiler() != NULL) { |
1673 if (get_thread_profiler() != NULL) { |
1651 get_thread_profiler()->disengage(); |
1674 get_thread_profiler()->disengage(); |
1652 ResourceMark rm; |
1675 ResourceMark rm; |
3627 |
3650 |
3628 |
3651 |
3629 void Threads::add(JavaThread* p, bool force_daemon) { |
3652 void Threads::add(JavaThread* p, bool force_daemon) { |
3630 // The threads lock must be owned at this point |
3653 // The threads lock must be owned at this point |
3631 assert_locked_or_safepoint(Threads_lock); |
3654 assert_locked_or_safepoint(Threads_lock); |
|
3655 |
|
3656 // See the comment for this method in thread.hpp for its purpose and |
|
3657 // why it is called here. |
|
3658 p->initialize_queues(); |
3632 p->set_next(_thread_list); |
3659 p->set_next(_thread_list); |
3633 _thread_list = p; |
3660 _thread_list = p; |
3634 _number_of_threads++; |
3661 _number_of_threads++; |
3635 oop threadObj = p->threadObj(); |
3662 oop threadObj = p->threadObj(); |
3636 bool daemon = true; |
3663 bool daemon = true; |