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 // In libjvmci, JVMCI initialization should not deadlock with other threads
1260 if (!UseJVMCINativeLibrary) {
1261 // Don't allow blocking compiles if inside a class initializer or while performing class loading
1262 vframeStream vfst(JavaThread::cast(thread));
1263 for (; !vfst.at_end(); vfst.next()) {
1264 if (vfst.method()->is_static_initializer() ||
1265 (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1266 vfst.method()->name() == vmSymbols::loadClass_name())) {
1267 blocking = false;
1268 break;
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
1279 // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1280 // to avoid deadlock between compiler thread(s) and threads run at shutdown
1281 // such as the DestroyJavaVM thread.
1282 if (JVMCI::in_shutdown()) {
1283 blocking = false;
1284 }
|
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 // In libjvmci, JVMCI initialization should not deadlock with other threads
1260 if (!UseJVMCINativeLibrary) {
1261 // Don't allow blocking compiles if inside a class initializer or while performing class loading
1262 vframeStream vfst(JavaThread::cast(thread));
1263 for (; !vfst.at_end(); vfst.next()) {
1264 if (vfst.method()->is_class_initializer() ||
1265 (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1266 vfst.method()->name() == vmSymbols::loadClass_name())) {
1267 blocking = false;
1268 break;
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
1279 // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1280 // to avoid deadlock between compiler thread(s) and threads run at shutdown
1281 // such as the DestroyJavaVM thread.
1282 if (JVMCI::in_shutdown()) {
1283 blocking = false;
1284 }
|