< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

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

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