1.1 --- a/src/share/vm/runtime/thread.cpp Fri Sep 26 13:33:15 2008 -0400 1.2 +++ b/src/share/vm/runtime/thread.cpp Tue Sep 30 12:24:27 2008 -0400 1.3 @@ -1138,6 +1138,10 @@ 1.4 1.5 void JavaThread::initialize() { 1.6 // Initialize fields 1.7 + 1.8 + // Set the claimed par_id to -1 (ie not claiming any par_ids) 1.9 + set_claimed_par_id(-1); 1.10 + 1.11 set_saved_exception_pc(NULL); 1.12 set_threadObj(NULL); 1.13 _anchor.clear(); 1.14 @@ -1209,7 +1213,18 @@ 1.15 pd_initialize(); 1.16 } 1.17 1.18 -JavaThread::JavaThread(bool is_attaching) : Thread() { 1.19 +#ifndef SERIALGC 1.20 +SATBMarkQueueSet JavaThread::_satb_mark_queue_set; 1.21 +DirtyCardQueueSet JavaThread::_dirty_card_queue_set; 1.22 +#endif // !SERIALGC 1.23 + 1.24 +JavaThread::JavaThread(bool is_attaching) : 1.25 + Thread() 1.26 +#ifndef SERIALGC 1.27 + , _satb_mark_queue(&_satb_mark_queue_set), 1.28 + _dirty_card_queue(&_dirty_card_queue_set) 1.29 +#endif // !SERIALGC 1.30 +{ 1.31 initialize(); 1.32 _is_attaching = is_attaching; 1.33 } 1.34 @@ -1255,7 +1270,13 @@ 1.35 // Remove this ifdef when C1 is ported to the compiler interface. 1.36 static void compiler_thread_entry(JavaThread* thread, TRAPS); 1.37 1.38 -JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz) : Thread() { 1.39 +JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz) : 1.40 + Thread() 1.41 +#ifndef SERIALGC 1.42 + , _satb_mark_queue(&_satb_mark_queue_set), 1.43 + _dirty_card_queue(&_dirty_card_queue_set) 1.44 +#endif // !SERIALGC 1.45 +{ 1.46 if (TraceThreadEvents) { 1.47 tty->print_cr("creating thread %p", this); 1.48 } 1.49 @@ -3067,9 +3088,14 @@ 1.50 1.51 #ifndef SERIALGC 1.52 // Support for ConcurrentMarkSweep. This should be cleaned up 1.53 - // and better encapsulated. XXX YSR 1.54 - if (UseConcMarkSweepGC) { 1.55 - ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD); 1.56 + // and better encapsulated. The ugly nested if test would go away 1.57 + // once things are properly refactored. XXX YSR 1.58 + if (UseConcMarkSweepGC || UseG1GC) { 1.59 + if (UseConcMarkSweepGC) { 1.60 + ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD); 1.61 + } else { 1.62 + ConcurrentMarkThread::makeSurrogateLockerThread(THREAD); 1.63 + } 1.64 if (HAS_PENDING_EXCEPTION) { 1.65 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION)); 1.66 }