< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

1231     // or prohibited.  Assign a compile_id to this compilation
1232     // and check to see if it is in our [Start..Stop) range.
1233     int compile_id = assign_compile_id(method, osr_bci);
1234     if (compile_id == 0) {
1235       // The compilation falls outside the allowed range.
1236       return;
1237     }
1238 
1239 #if INCLUDE_JVMCI
1240     if (UseJVMCICompiler && blocking) {
1241       // Don't allow blocking compiles for requests triggered by JVMCI.
1242       if (thread->is_Compiler_thread()) {
1243         blocking = false;
1244       }
1245 
1246       // In libjvmci, JVMCI initialization should not deadlock with other threads
1247       if (!UseJVMCINativeLibrary) {
1248         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1249         vframeStream vfst(JavaThread::cast(thread));
1250         for (; !vfst.at_end(); vfst.next()) {
1251           if (vfst.method()->is_static_initializer() ||
1252               (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1253                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1254             blocking = false;
1255             break;
1256           }
1257         }
1258 
1259         // Don't allow blocking compilation requests to JVMCI
1260         // if JVMCI itself is not yet initialized
1261         if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1262           blocking = false;
1263         }
1264       }
1265 
1266       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1267       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1268       // such as the DestroyJavaVM thread.
1269       if (JVMCI::in_shutdown()) {
1270         blocking = false;
1271       }

1231     // or prohibited.  Assign a compile_id to this compilation
1232     // and check to see if it is in our [Start..Stop) range.
1233     int compile_id = assign_compile_id(method, osr_bci);
1234     if (compile_id == 0) {
1235       // The compilation falls outside the allowed range.
1236       return;
1237     }
1238 
1239 #if INCLUDE_JVMCI
1240     if (UseJVMCICompiler && blocking) {
1241       // Don't allow blocking compiles for requests triggered by JVMCI.
1242       if (thread->is_Compiler_thread()) {
1243         blocking = false;
1244       }
1245 
1246       // In libjvmci, JVMCI initialization should not deadlock with other threads
1247       if (!UseJVMCINativeLibrary) {
1248         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1249         vframeStream vfst(JavaThread::cast(thread));
1250         for (; !vfst.at_end(); vfst.next()) {
1251         if (vfst.method()->is_class_initializer() ||
1252               (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1253                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1254             blocking = false;
1255             break;
1256           }
1257         }
1258 
1259         // Don't allow blocking compilation requests to JVMCI
1260         // if JVMCI itself is not yet initialized
1261         if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1262           blocking = false;
1263         }
1264       }
1265 
1266       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1267       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1268       // such as the DestroyJavaVM thread.
1269       if (JVMCI::in_shutdown()) {
1270         blocking = false;
1271       }
< prev index next >