1191 // We now know that this compilation is not pending, complete,
1192 // or prohibited. Assign a compile_id to this compilation
1193 // and check to see if it is in our [Start..Stop) range.
1194 int compile_id = assign_compile_id(method, osr_bci);
1195 if (compile_id == 0) {
1196 // The compilation falls outside the allowed range.
1197 return;
1198 }
1199
1200 #if INCLUDE_JVMCI
1201 if (UseJVMCICompiler && blocking) {
1202 // Don't allow blocking compiles for requests triggered by JVMCI.
1203 if (thread->is_Compiler_thread()) {
1204 blocking = false;
1205 }
1206
1207 if (!UseJVMCINativeLibrary) {
1208 // Don't allow blocking compiles if inside a class initializer or while performing class loading
1209 vframeStream vfst(JavaThread::cast(thread));
1210 for (; !vfst.at_end(); vfst.next()) {
1211 if (vfst.method()->is_static_initializer() ||
1212 (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1213 vfst.method()->name() == vmSymbols::loadClass_name())) {
1214 blocking = false;
1215 break;
1216 }
1217 }
1218 }
1219
1220 // Don't allow blocking compilation requests to JVMCI
1221 // if JVMCI itself is not yet initialized
1222 if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1223 blocking = false;
1224 }
1225
1226 // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1227 // to avoid deadlock between compiler thread(s) and threads run at shutdown
1228 // such as the DestroyJavaVM thread.
1229 if (JVMCI::in_shutdown()) {
1230 blocking = false;
1231 }
|
1191 // We now know that this compilation is not pending, complete,
1192 // or prohibited. Assign a compile_id to this compilation
1193 // and check to see if it is in our [Start..Stop) range.
1194 int compile_id = assign_compile_id(method, osr_bci);
1195 if (compile_id == 0) {
1196 // The compilation falls outside the allowed range.
1197 return;
1198 }
1199
1200 #if INCLUDE_JVMCI
1201 if (UseJVMCICompiler && blocking) {
1202 // Don't allow blocking compiles for requests triggered by JVMCI.
1203 if (thread->is_Compiler_thread()) {
1204 blocking = false;
1205 }
1206
1207 if (!UseJVMCINativeLibrary) {
1208 // Don't allow blocking compiles if inside a class initializer or while performing class loading
1209 vframeStream vfst(JavaThread::cast(thread));
1210 for (; !vfst.at_end(); vfst.next()) {
1211 if (vfst.method()->is_class_initializer() ||
1212 (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1213 vfst.method()->name() == vmSymbols::loadClass_name())) {
1214 blocking = false;
1215 break;
1216 }
1217 }
1218 }
1219
1220 // Don't allow blocking compilation requests to JVMCI
1221 // if JVMCI itself is not yet initialized
1222 if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1223 blocking = false;
1224 }
1225
1226 // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1227 // to avoid deadlock between compiler thread(s) and threads run at shutdown
1228 // such as the DestroyJavaVM thread.
1229 if (JVMCI::in_shutdown()) {
1230 blocking = false;
1231 }
|