# HG changeset patch # User Tom Rodriguez # Date 1399075390 25200 # Node ID 07fac8558d7b05488b128843afda1d9a60e47956 # Parent 8f09b84f325f7d48e0d216ece87378533de65f78 update state flag after initialization to allow other compiler threads to execute diff -r 8f09b84f325f -r 07fac8558d7b src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Fri May 02 16:12:07 2014 -0700 +++ b/src/share/vm/compiler/compileBroker.cpp Fri May 02 17:03:10 2014 -0700 @@ -516,7 +516,8 @@ if (_osr_bci != CompileBroker::standard_entry_bci) { log->print(" osr_bci='%d'", _osr_bci); } - if (_comp_level != CompLevel_highest_tier) { + // Always print the level in tiered. + if (_comp_level != CompLevel_highest_tier || TieredCompilation) { log->print(" level='%d'", _comp_level); } if (_is_blocking) { diff -r 8f09b84f325f -r 07fac8558d7b src/share/vm/graal/graalCompiler.cpp --- a/src/share/vm/graal/graalCompiler.cpp Fri May 02 16:12:07 2014 -0700 +++ b/src/share/vm/graal/graalCompiler.cpp Fri May 02 17:03:10 2014 -0700 @@ -58,12 +58,18 @@ NOT_LP64(error("check TLAB allocation code for address space conflicts")); BufferBlob* buffer_blob = initialize_buffer_blob(); - if (buffer_blob == NULL) { - // If we are called from JNI_CreateJavaVM we cannot use set_state yet because it takes a lock. - // set_state(failed); - } else { - // set_state(initialized); +#ifdef COMPILERGRAAL + if (!UseGraalCompilationQueue) { + // This path is used for initialization both by the native queue and the graal queue + // but set_state acquired a lock which might not be safe during JVM_CreateJavaVM, so + // only update the state flag for the native queue. + if (buffer_blob == NULL) { + set_state(failed); + } else { + set_state(initialized); + } } +#endif JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment(); jclass klass = env->FindClass("com/oracle/graal/hotspot/bridge/CompilerToVMImpl");