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