< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

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

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