< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

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

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