< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

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

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