< prev index next >

src/hotspot/share/compiler/compileBroker.cpp

Print this page

1166     // We now know that this compilation is not pending, complete,
1167     // or prohibited.  Assign a compile_id to this compilation
1168     // and check to see if it is in our [Start..Stop) range.
1169     int compile_id = assign_compile_id(method, osr_bci);
1170     if (compile_id == 0) {
1171       // The compilation falls outside the allowed range.
1172       return;
1173     }
1174 
1175 #if INCLUDE_JVMCI
1176     if (UseJVMCICompiler && blocking) {
1177       // Don't allow blocking compiles for requests triggered by JVMCI.
1178       if (thread->is_Compiler_thread()) {
1179         blocking = false;
1180       }
1181 
1182       if (!UseJVMCINativeLibrary) {
1183         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1184         vframeStream vfst((JavaThread*) thread);
1185         for (; !vfst.at_end(); vfst.next()) {
1186           if (vfst.method()->is_static_initializer() ||
1187               (vfst.method()->method_holder()->is_subclass_of(SystemDictionary::ClassLoader_klass()) &&
1188                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1189             blocking = false;
1190             break;
1191           }
1192         }
1193       }
1194 
1195       // Don't allow blocking compilation requests to JVMCI
1196       // if JVMCI itself is not yet initialized
1197       if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1198         blocking = false;
1199       }
1200 
1201       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1202       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1203       // such as the DestroyJavaVM thread.
1204       if (JVMCI::in_shutdown()) {
1205         blocking = false;
1206       }

1166     // We now know that this compilation is not pending, complete,
1167     // or prohibited.  Assign a compile_id to this compilation
1168     // and check to see if it is in our [Start..Stop) range.
1169     int compile_id = assign_compile_id(method, osr_bci);
1170     if (compile_id == 0) {
1171       // The compilation falls outside the allowed range.
1172       return;
1173     }
1174 
1175 #if INCLUDE_JVMCI
1176     if (UseJVMCICompiler && blocking) {
1177       // Don't allow blocking compiles for requests triggered by JVMCI.
1178       if (thread->is_Compiler_thread()) {
1179         blocking = false;
1180       }
1181 
1182       if (!UseJVMCINativeLibrary) {
1183         // Don't allow blocking compiles if inside a class initializer or while performing class loading
1184         vframeStream vfst((JavaThread*) thread);
1185         for (; !vfst.at_end(); vfst.next()) {
1186         if (vfst.method()->is_class_initializer() ||
1187               (vfst.method()->method_holder()->is_subclass_of(SystemDictionary::ClassLoader_klass()) &&
1188                   vfst.method()->name() == vmSymbols::loadClass_name())) {
1189             blocking = false;
1190             break;
1191           }
1192         }
1193       }
1194 
1195       // Don't allow blocking compilation requests to JVMCI
1196       // if JVMCI itself is not yet initialized
1197       if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1198         blocking = false;
1199       }
1200 
1201       // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1202       // to avoid deadlock between compiler thread(s) and threads run at shutdown
1203       // such as the DestroyJavaVM thread.
1204       if (JVMCI::in_shutdown()) {
1205         blocking = false;
1206       }
< prev index next >