< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page




1056     // We now know that this compilation is not pending, complete,
1057     // or prohibited.  Assign a compile_id to this compilation
1058     // and check to see if it is in our [Start..Stop) range.
1059     int compile_id = assign_compile_id(method, osr_bci);
1060     if (compile_id == 0) {
1061       // The compilation falls outside the allowed range.
1062       return;
1063     }
1064 
1065 #if INCLUDE_JVMCI
1066     if (UseJVMCICompiler && blocking) {
1067       // Don't allow blocking compiles for requests triggered by JVMCI.
1068       if (thread->is_Compiler_thread()) {
1069         blocking = false;
1070       }
1071 
1072       if (!UseJVMCINativeLibrary) {
1073         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1074         vframeStream vfst((JavaThread*) thread);
1075         for (; !vfst.at_end(); vfst.next()) {
1076           if (vfst.method()->is_static_initializer() ||
1077               (vfst.method()->method_holder()->is_subclass_of(SystemDictionary::ClassLoader_klass()) &&
1078                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1079             blocking = false;
1080             break;
1081           }
1082         }
1083       }
1084 
1085       // Don't allow blocking compilation requests to JVMCI
1086       // if JVMCI itself is not yet initialized
1087       if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1088         blocking = false;
1089       }
1090 
1091       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1092       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1093       // such as the DestroyJavaVM thread.
1094       if (JVMCI::shutdown_called()) {
1095         blocking = false;
1096       }




1056     // We now know that this compilation is not pending, complete,
1057     // or prohibited.  Assign a compile_id to this compilation
1058     // and check to see if it is in our [Start..Stop) range.
1059     int compile_id = assign_compile_id(method, osr_bci);
1060     if (compile_id == 0) {
1061       // The compilation falls outside the allowed range.
1062       return;
1063     }
1064 
1065 #if INCLUDE_JVMCI
1066     if (UseJVMCICompiler && blocking) {
1067       // Don't allow blocking compiles for requests triggered by JVMCI.
1068       if (thread->is_Compiler_thread()) {
1069         blocking = false;
1070       }
1071 
1072       if (!UseJVMCINativeLibrary) {
1073         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1074         vframeStream vfst((JavaThread*) thread);
1075         for (; !vfst.at_end(); vfst.next()) {
1076         if (vfst.method()->is_class_initializer() ||
1077               (vfst.method()->method_holder()->is_subclass_of(SystemDictionary::ClassLoader_klass()) &&
1078                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1079             blocking = false;
1080             break;
1081           }
1082         }
1083       }
1084 
1085       // Don't allow blocking compilation requests to JVMCI
1086       // if JVMCI itself is not yet initialized
1087       if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1088         blocking = false;
1089       }
1090 
1091       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1092       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1093       // such as the DestroyJavaVM thread.
1094       if (JVMCI::shutdown_called()) {
1095         blocking = false;
1096       }


< prev index next >