Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/thread.cpp @ 15463:a20be10ad437
made Graal work with the HotSpot compiler queue and compiler threads, enabled by -XX:-UseGraalCompilationQueue
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 02 May 2014 00:36:27 +0200 |
parents | b68a693a7ad4 |
children | 66a9286203a2 |
comparison
equal
deleted
inserted
replaced
15462:05d3f069cff2 | 15463:a20be10ad437 |
---|---|
2251 assert(Threads_lock->is_locked(), "Threads_lock should be locked by safepoint code"); | 2251 assert(Threads_lock->is_locked(), "Threads_lock should be locked by safepoint code"); |
2252 assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped"); | 2252 assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped"); |
2253 | 2253 |
2254 // Do not throw asynchronous exceptions against the compiler thread | 2254 // Do not throw asynchronous exceptions against the compiler thread |
2255 // (the compiler thread should not be a Java thread -- fix in 1.4.2) | 2255 // (the compiler thread should not be a Java thread -- fix in 1.4.2) |
2256 if (is_Compiler_thread()) return; | 2256 if (!can_call_java()) return; |
2257 | 2257 |
2258 { | 2258 { |
2259 // Actually throw the Throwable against the target Thread - however | 2259 // Actually throw the Throwable against the target Thread - however |
2260 // only if there is no thread death exception installed already. | 2260 // only if there is no thread death exception installed already. |
2261 if (_pending_async_exception == NULL || !_pending_async_exception->is_a(SystemDictionary::ThreadDeath_klass())) { | 2261 if (_pending_async_exception == NULL || !_pending_async_exception->is_a(SystemDictionary::ThreadDeath_klass())) { |
3308 | 3308 |
3309 #ifndef PRODUCT | 3309 #ifndef PRODUCT |
3310 _ideal_graph_printer = NULL; | 3310 _ideal_graph_printer = NULL; |
3311 #endif | 3311 #endif |
3312 } | 3312 } |
3313 | |
3314 #ifdef COMPILERGRAAL | |
3315 bool CompilerThread::can_call_java() const { | |
3316 return _compiler != NULL && _compiler->is_graal(); | |
3317 } | |
3318 #endif | |
3313 | 3319 |
3314 void CompilerThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { | 3320 void CompilerThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { |
3315 JavaThread::oops_do(f, cld_f, cf); | 3321 JavaThread::oops_do(f, cld_f, cf); |
3316 if (_scanned_nmethod != NULL && cf != NULL) { | 3322 if (_scanned_nmethod != NULL && cf != NULL) { |
3317 // Safepoints can occur when the sweeper is scanning an nmethod so | 3323 // Safepoints can occur when the sweeper is scanning an nmethod so |
4332 | 4338 |
4333 int i = 0; | 4339 int i = 0; |
4334 { | 4340 { |
4335 MutexLockerEx ml(doLock ? Threads_lock : NULL); | 4341 MutexLockerEx ml(doLock ? Threads_lock : NULL); |
4336 ALL_JAVA_THREADS(p) { | 4342 ALL_JAVA_THREADS(p) { |
4337 if (p->is_Compiler_thread()) continue; | 4343 if (!p->can_call_java()) continue; |
4338 | 4344 |
4339 address pending = (address)p->current_pending_monitor(); | 4345 address pending = (address)p->current_pending_monitor(); |
4340 if (pending == monitor) { // found a match | 4346 if (pending == monitor) { // found a match |
4341 if (i < count) result->append(p); // save the first count matches | 4347 if (i < count) result->append(p); // save the first count matches |
4342 i++; | 4348 i++; |