< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

1261     // or prohibited.  Assign a compile_id to this compilation
1262     // and check to see if it is in our [Start..Stop) range.
1263     int compile_id = assign_compile_id(method, osr_bci);
1264     if (compile_id == 0) {
1265       // The compilation falls outside the allowed range.
1266       return;
1267     }
1268 
1269 #if INCLUDE_JVMCI
1270     if (UseJVMCICompiler && blocking) {
1271       // Don't allow blocking compiles for requests triggered by JVMCI.
1272       if (thread->is_Compiler_thread()) {
1273         blocking = false;
1274       }
1275 
1276       // In libjvmci, JVMCI initialization should not deadlock with other threads
1277       if (!UseJVMCINativeLibrary) {
1278         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1279         vframeStream vfst(JavaThread::cast(thread));
1280         for (; !vfst.at_end(); vfst.next()) {
1281           if (vfst.method()->is_static_initializer() ||
1282               (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1283                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1284             blocking = false;
1285             break;
1286           }
1287         }
1288 
1289         // Don't allow blocking compilation requests to JVMCI
1290         // if JVMCI itself is not yet initialized
1291         if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1292           blocking = false;
1293         }
1294       }
1295 
1296       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1297       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1298       // such as the DestroyJavaVM thread.
1299       if (JVMCI::in_shutdown()) {
1300         blocking = false;
1301       }

1261     // or prohibited.  Assign a compile_id to this compilation
1262     // and check to see if it is in our [Start..Stop) range.
1263     int compile_id = assign_compile_id(method, osr_bci);
1264     if (compile_id == 0) {
1265       // The compilation falls outside the allowed range.
1266       return;
1267     }
1268 
1269 #if INCLUDE_JVMCI
1270     if (UseJVMCICompiler && blocking) {
1271       // Don't allow blocking compiles for requests triggered by JVMCI.
1272       if (thread->is_Compiler_thread()) {
1273         blocking = false;
1274       }
1275 
1276       // In libjvmci, JVMCI initialization should not deadlock with other threads
1277       if (!UseJVMCINativeLibrary) {
1278         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1279         vframeStream vfst(JavaThread::cast(thread));
1280         for (; !vfst.at_end(); vfst.next()) {
1281         if (vfst.method()->is_class_initializer() ||
1282               (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1283                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1284             blocking = false;
1285             break;
1286           }
1287         }
1288 
1289         // Don't allow blocking compilation requests to JVMCI
1290         // if JVMCI itself is not yet initialized
1291         if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1292           blocking = false;
1293         }
1294       }
1295 
1296       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1297       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1298       // such as the DestroyJavaVM thread.
1299       if (JVMCI::in_shutdown()) {
1300         blocking = false;
1301       }
< prev index next >