1269 // or prohibited. Assign a compile_id to this compilation
1270 // and check to see if it is in our [Start..Stop) range.
1271 int compile_id = assign_compile_id(method, osr_bci);
1272 if (compile_id == 0) {
1273 // The compilation falls outside the allowed range.
1274 return;
1275 }
1276
1277 #if INCLUDE_JVMCI
1278 if (UseJVMCICompiler && blocking) {
1279 // Don't allow blocking compiles for requests triggered by JVMCI.
1280 if (thread->is_Compiler_thread()) {
1281 blocking = false;
1282 }
1283
1284 // In libjvmci, JVMCI initialization should not deadlock with other threads
1285 if (!UseJVMCINativeLibrary) {
1286 // Don't allow blocking compiles if inside a class initializer or while performing class loading
1287 vframeStream vfst(JavaThread::cast(thread));
1288 for (; !vfst.at_end(); vfst.next()) {
1289 if (vfst.method()->is_static_initializer() ||
1290 (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1291 vfst.method()->name() == vmSymbols::loadClass_name())) {
1292 blocking = false;
1293 break;
1294 }
1295 }
1296
1297 // Don't allow blocking compilation requests to JVMCI
1298 // if JVMCI itself is not yet initialized
1299 if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1300 blocking = false;
1301 }
1302 }
1303
1304 // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1305 // to avoid deadlock between compiler thread(s) and threads run at shutdown
1306 // such as the DestroyJavaVM thread.
1307 if (JVMCI::in_shutdown()) {
1308 blocking = false;
1309 }
|
1269 // or prohibited. Assign a compile_id to this compilation
1270 // and check to see if it is in our [Start..Stop) range.
1271 int compile_id = assign_compile_id(method, osr_bci);
1272 if (compile_id == 0) {
1273 // The compilation falls outside the allowed range.
1274 return;
1275 }
1276
1277 #if INCLUDE_JVMCI
1278 if (UseJVMCICompiler && blocking) {
1279 // Don't allow blocking compiles for requests triggered by JVMCI.
1280 if (thread->is_Compiler_thread()) {
1281 blocking = false;
1282 }
1283
1284 // In libjvmci, JVMCI initialization should not deadlock with other threads
1285 if (!UseJVMCINativeLibrary) {
1286 // Don't allow blocking compiles if inside a class initializer or while performing class loading
1287 vframeStream vfst(JavaThread::cast(thread));
1288 for (; !vfst.at_end(); vfst.next()) {
1289 if (vfst.method()->is_class_initializer() ||
1290 (vfst.method()->method_holder()->is_subclass_of(vmClasses::ClassLoader_klass()) &&
1291 vfst.method()->name() == vmSymbols::loadClass_name())) {
1292 blocking = false;
1293 break;
1294 }
1295 }
1296
1297 // Don't allow blocking compilation requests to JVMCI
1298 // if JVMCI itself is not yet initialized
1299 if (!JVMCI::is_compiler_initialized() && compiler(comp_level)->is_jvmci()) {
1300 blocking = false;
1301 }
1302 }
1303
1304 // Don't allow blocking compilation requests if we are in JVMCIRuntime::shutdown
1305 // to avoid deadlock between compiler thread(s) and threads run at shutdown
1306 // such as the DestroyJavaVM thread.
1307 if (JVMCI::in_shutdown()) {
1308 blocking = false;
1309 }
|