comparison src/share/vm/runtime/thread.cpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents cd0742ba123c
children 69fefd031e6c
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
1136 1136
1137 // A JavaThread is a normal Java thread 1137 // A JavaThread is a normal Java thread
1138 1138
1139 void JavaThread::initialize() { 1139 void JavaThread::initialize() {
1140 // Initialize fields 1140 // Initialize fields
1141
1142 // Set the claimed par_id to -1 (ie not claiming any par_ids)
1143 set_claimed_par_id(-1);
1144
1141 set_saved_exception_pc(NULL); 1145 set_saved_exception_pc(NULL);
1142 set_threadObj(NULL); 1146 set_threadObj(NULL);
1143 _anchor.clear(); 1147 _anchor.clear();
1144 set_entry_point(NULL); 1148 set_entry_point(NULL);
1145 set_jni_functions(jni_functions()); 1149 set_jni_functions(jni_functions());
1207 _popframe_preserved_args_size = 0; 1211 _popframe_preserved_args_size = 0;
1208 1212
1209 pd_initialize(); 1213 pd_initialize();
1210 } 1214 }
1211 1215
1212 JavaThread::JavaThread(bool is_attaching) : Thread() { 1216 #ifndef SERIALGC
1217 SATBMarkQueueSet JavaThread::_satb_mark_queue_set;
1218 DirtyCardQueueSet JavaThread::_dirty_card_queue_set;
1219 #endif // !SERIALGC
1220
1221 JavaThread::JavaThread(bool is_attaching) :
1222 Thread()
1223 #ifndef SERIALGC
1224 , _satb_mark_queue(&_satb_mark_queue_set),
1225 _dirty_card_queue(&_dirty_card_queue_set)
1226 #endif // !SERIALGC
1227 {
1213 initialize(); 1228 initialize();
1214 _is_attaching = is_attaching; 1229 _is_attaching = is_attaching;
1215 } 1230 }
1216 1231
1217 bool JavaThread::reguard_stack(address cur_sp) { 1232 bool JavaThread::reguard_stack(address cur_sp) {
1253 1268
1254 1269
1255 // Remove this ifdef when C1 is ported to the compiler interface. 1270 // Remove this ifdef when C1 is ported to the compiler interface.
1256 static void compiler_thread_entry(JavaThread* thread, TRAPS); 1271 static void compiler_thread_entry(JavaThread* thread, TRAPS);
1257 1272
1258 JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz) : Thread() { 1273 JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz) :
1274 Thread()
1275 #ifndef SERIALGC
1276 , _satb_mark_queue(&_satb_mark_queue_set),
1277 _dirty_card_queue(&_dirty_card_queue_set)
1278 #endif // !SERIALGC
1279 {
1259 if (TraceThreadEvents) { 1280 if (TraceThreadEvents) {
1260 tty->print_cr("creating thread %p", this); 1281 tty->print_cr("creating thread %p", this);
1261 } 1282 }
1262 initialize(); 1283 initialize();
1263 _is_attaching = false; 1284 _is_attaching = false;
3032 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION)); 3053 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
3033 } 3054 }
3034 3055
3035 #ifndef SERIALGC 3056 #ifndef SERIALGC
3036 // Support for ConcurrentMarkSweep. This should be cleaned up 3057 // Support for ConcurrentMarkSweep. This should be cleaned up
3037 // and better encapsulated. XXX YSR 3058 // and better encapsulated. The ugly nested if test would go away
3038 if (UseConcMarkSweepGC) { 3059 // once things are properly refactored. XXX YSR
3039 ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD); 3060 if (UseConcMarkSweepGC || UseG1GC) {
3061 if (UseConcMarkSweepGC) {
3062 ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD);
3063 } else {
3064 ConcurrentMarkThread::makeSurrogateLockerThread(THREAD);
3065 }
3040 if (HAS_PENDING_EXCEPTION) { 3066 if (HAS_PENDING_EXCEPTION) {
3041 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION)); 3067 vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
3042 } 3068 }
3043 } 3069 }
3044 #endif // SERIALGC 3070 #endif // SERIALGC