< prev index next >

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page




 921     JVMCIENV->call_HotSpotJVMCIRuntime_shutdown(_HotSpotJVMCIRuntime_instance);
 922   }
 923 }
 924 
 925 void JVMCIRuntime::bootstrap_finished(TRAPS) {
 926   if (is_HotSpotJVMCIRuntime_initialized()) {
 927     THREAD_JVMCIENV(JavaThread::current());
 928     JVMCIENV->call_HotSpotJVMCIRuntime_bootstrapFinished(_HotSpotJVMCIRuntime_instance, JVMCIENV);
 929   }
 930 }
 931 
 932 void JVMCIRuntime::describe_pending_hotspot_exception(JavaThread* THREAD, bool clear) {
 933   if (HAS_PENDING_EXCEPTION) {
 934     Handle exception(THREAD, PENDING_EXCEPTION);
 935     const char* exception_file = THREAD->exception_file();
 936     int exception_line = THREAD->exception_line();
 937     CLEAR_PENDING_EXCEPTION;
 938     if (exception->is_a(SystemDictionary::ThreadDeath_klass())) {
 939       // Don't print anything if we are being killed.
 940     } else {


 941       java_lang_Throwable::print_stack_trace(exception, tty);
 942 
 943       // Clear and ignore any exceptions raised during printing
 944       CLEAR_PENDING_EXCEPTION;
 945     }
 946     if (!clear) {
 947       THREAD->set_pending_exception(exception(), exception_file, exception_line);
 948     }
 949   }
 950 }
 951 
 952 
 953 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) {
 954   JavaThread* THREAD = JavaThread::current();
 955 
 956   static volatile int report_error = 0;
 957   if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
 958     // Only report an error once
 959     tty->print_raw_cr(message);
 960     if (JVMCIENV != NULL) {


1322   }
1323 
1324   // Dependencies must be checked when the system dictionary changes
1325   // or if we don't know whether it has changed (i.e., compile_state == NULL).
1326   bool counter_changed = compile_state == NULL || compile_state->system_dictionary_modification_counter() != SystemDictionary::number_of_modifications();
1327   CompileTask* task = compile_state == NULL ? NULL : compile_state->task();
1328   Dependencies::DepType result = dependencies->validate_dependencies(task, counter_changed, failure_detail);
1329   if (result == Dependencies::end_marker) {
1330     return JVMCI::ok;
1331   }
1332 
1333   if (!Dependencies::is_klass_type(result) || counter_changed) {
1334     return JVMCI::dependencies_failed;
1335   }
1336   // The dependencies were invalid at the time of installation
1337   // without any intervening modification of the system
1338   // dictionary.  That means they were invalidly constructed.
1339   return JVMCI::dependencies_invalid;
1340 }
1341 
1342 // Reports a pending exception and exits the VM.
1343 static void fatal_exception_in_compile(JVMCIEnv* JVMCIENV, JavaThread* thread, const char* msg) {
1344   // Only report a fatal JVMCI compilation exception once
1345   static volatile int report_init_failure = 0;
1346   if (!report_init_failure && Atomic::cmpxchg(1, &report_init_failure, 0) == 0) {
1347       tty->print_cr("%s:", msg);
1348       JVMCIENV->describe_pending_exception(true);
1349   }
1350   JVMCIENV->clear_pending_exception();
1351   before_exit(thread);
1352   vm_exit(-1);
1353 }
1354 
1355 void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, const methodHandle& method, int entry_bci) {
1356   JVMCI_EXCEPTION_CONTEXT
1357 
1358   JVMCICompileState* compile_state = JVMCIENV->compile_state();
1359 
1360   bool is_osr = entry_bci != InvocationEntryBci;
1361   if (compiler->is_bootstrapping() && is_osr) {
1362     // no OSR compilations during bootstrap - the compiler is just too slow at this point,
1363     // and we know that there are no endless loops
1364     compile_state->set_failure(true, "No OSR during boostrap");
1365     return;
1366   }
1367   if (JVMCI::shutdown_called()) {
1368     compile_state->set_failure(false, "Avoiding compilation during shutdown");
1369     return;
1370   }
1371 
1372   HandleMark hm;
1373   JVMCIObject receiver = get_HotSpotJVMCIRuntime(JVMCIENV);
1374   if (JVMCIENV->has_pending_exception()) {
1375     fatal_exception_in_compile(JVMCIENV, thread, "Exception during HotSpotJVMCIRuntime initialization");


1376   }
1377   JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV);
1378   if (JVMCIENV->has_pending_exception()) {
1379     JVMCIENV->describe_pending_exception(true);
1380     compile_state->set_failure(false, "exception getting JVMCI wrapper method");
1381     return;
1382   }
1383 
1384   JVMCIObject result_object = JVMCIENV->call_HotSpotJVMCIRuntime_compileMethod(receiver, jvmci_method, entry_bci,
1385                                                                      (jlong) compile_state, compile_state->task()->compile_id());
1386   if (!JVMCIENV->has_pending_exception()) {
1387     if (result_object.is_non_null()) {
1388       JVMCIObject failure_message = JVMCIENV->get_HotSpotCompilationRequestResult_failureMessage(result_object);
1389       if (failure_message.is_non_null()) {
1390         // Copy failure reason into resource memory first ...
1391         const char* failure_reason = JVMCIENV->as_utf8_string(failure_message);
1392         // ... and then into the C heap.
1393         failure_reason = os::strdup(failure_reason, mtJVMCI);
1394         bool retryable = JVMCIENV->get_HotSpotCompilationRequestResult_retry(result_object) != 0;
1395         compile_state->set_failure(retryable, failure_reason, true);
1396       } else {
1397         if (compile_state->task()->code() == NULL) {
1398           compile_state->set_failure(true, "no nmethod produced");
1399         } else {
1400           compile_state->task()->set_num_inlined_bytecodes(JVMCIENV->get_HotSpotCompilationRequestResult_inlinedBytecodes(result_object));
1401           compiler->inc_methods_compiled();
1402         }
1403       }
1404     } else {
1405       assert(false, "JVMCICompiler.compileMethod should always return non-null");
1406     }
1407   } else {
1408     // An uncaught exception here implies failure during compiler initialization.
1409     // The only sensible thing to do here is to exit the VM.
1410     fatal_exception_in_compile(JVMCIENV, thread, "Exception during JVMCI compiler initialization");


1411   }
1412   if (compiler->is_bootstrapping()) {
1413     compiler->set_bootstrap_compilation_request_handled();
1414   }
1415 }
1416 
1417 
1418 // ------------------------------------------------------------------
1419 JVMCI::CodeInstallResult JVMCIRuntime::register_method(JVMCIEnv* JVMCIENV,
1420                                 const methodHandle& method,
1421                                 nmethod*& nm,
1422                                 int entry_bci,
1423                                 CodeOffsets* offsets,
1424                                 int orig_pc_offset,
1425                                 CodeBuffer* code_buffer,
1426                                 int frame_words,
1427                                 OopMapSet* oop_map_set,
1428                                 ExceptionHandlerTable* handler_table,
1429                                 ImplicitExceptionTable* implicit_exception_table,
1430                                 AbstractCompiler* compiler,
1431                                 DebugInformationRecorder* debug_info,
1432                                 Dependencies* dependencies,
1433                                 int compile_id,
1434                                 bool has_unsafe_access,
1435                                 bool has_wide_vector,
1436                                 JVMCIObject compiled_code,
1437                                 JVMCIObject nmethod_mirror,
1438                                 FailedSpeculation** failed_speculations,
1439                                 char* speculations,
1440                                 int speculations_len) {
1441   JVMCI_EXCEPTION_CONTEXT;
1442   nm = NULL;
1443   int comp_level = CompLevel_full_optimization;
1444   char* failure_detail = NULL;
1445 
1446   bool install_default = JVMCIENV->get_HotSpotNmethod_isDefault(nmethod_mirror) != 0;
1447   assert(JVMCIENV->isa_HotSpotNmethod(nmethod_mirror), "must be");
1448   JVMCIObject name = JVMCIENV->get_InstalledCode_name(nmethod_mirror);
1449   const char* nmethod_mirror_name = name.is_null() ? NULL : JVMCIENV->as_utf8_string(name);


1479     // Check for {class loads, evolution, breakpoints} during compilation
1480     result = validate_compile_task_dependencies(dependencies, JVMCIENV->compile_state(), &failure_detail);
1481     if (result != JVMCI::ok) {
1482       // While not a true deoptimization, it is a preemptive decompile.
1483       MethodData* mdp = method()->method_data();
1484       if (mdp != NULL) {
1485         mdp->inc_decompile_count();
1486 #ifdef ASSERT
1487         if (mdp->decompile_count() > (uint)PerMethodRecompilationCutoff) {
1488           ResourceMark m;
1489           tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string());
1490         }
1491 #endif
1492       }
1493 
1494       // All buffers in the CodeBuffer are allocated in the CodeCache.
1495       // If the code buffer is created on each compile attempt
1496       // as in C2, then it must be freed.
1497       //code_buffer->free_blob();
1498     } else {

1499       nm =  nmethod::new_nmethod(method,
1500                                  compile_id,
1501                                  entry_bci,
1502                                  offsets,
1503                                  orig_pc_offset,
1504                                  debug_info, dependencies, code_buffer,
1505                                  frame_words, oop_map_set,
1506                                  handler_table, implicit_exception_table,
1507                                  compiler, comp_level,
1508                                  speculations, speculations_len,
1509                                  nmethod_mirror_index, nmethod_mirror_name, failed_speculations);
1510 
1511 
1512       // Free codeBlobs
1513       if (nm == NULL) {
1514         // The CodeCache is full.  Print out warning and disable compilation.
1515         {
1516           MutexUnlocker ml(Compile_lock);
1517           MutexUnlocker locker(MethodCompileQueue_lock);
1518           CompileBroker::handle_full_code_cache(CodeCache::get_code_blob_type(comp_level));
1519         }
1520       } else {
1521         nm->set_has_unsafe_access(has_unsafe_access);
1522         nm->set_has_wide_vectors(has_wide_vector);
1523 
1524         // Record successful registration.
1525         // (Put nm into the task handle *before* publishing to the Java heap.)
1526         if (JVMCIENV->compile_state() != NULL) {
1527           JVMCIENV->compile_state()->task()->set_code(nm);
1528         }
1529 
1530         JVMCINMethodData* data = nm->jvmci_nmethod_data();
1531         assert(data != NULL, "must be");
1532         if (install_default) {
1533           assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm) == NULL, "must be");
1534           if (entry_bci == InvocationEntryBci) {
1535             if (TieredCompilation) {
1536               // If there is an old version we're done with it
1537               CompiledMethod* old = method->code();
1538               if (TraceMethodReplacement && old != NULL) {
1539                 ResourceMark rm;
1540                 char *method_name = method->name_and_sig_as_C_string();
1541                 tty->print_cr("Replacing method %s", method_name);
1542               }
1543               if (old != NULL ) {
1544                 old->make_not_entrant();
1545               }
1546             }
1547 
1548             LogTarget(Info, nmethod, install) lt;
1549             if (lt.is_enabled()) {
1550               ResourceMark rm;
1551               char *method_name = method->name_and_sig_as_C_string();
1552               lt.print("Installing method (%d) %s [entry point: %p]",
1553                         comp_level, method_name, nm->entry_point());


1554             }
1555             // Allow the code to be executed
1556             method->set_code(method, nm);
1557           } else {
1558             LogTarget(Info, nmethod, install) lt;
1559             if (lt.is_enabled()) {
1560               ResourceMark rm;
1561               char *method_name = method->name_and_sig_as_C_string();
1562               lt.print("Installing osr method (%d) %s @ %d",
1563                         comp_level, method_name, entry_bci);



1564             }
1565             InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
1566           }
1567         } else {
1568           assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm) == HotSpotJVMCI::resolve(nmethod_mirror), "must be");
1569         }
1570         nm->make_in_use();
1571       }
1572       result = nm != NULL ? JVMCI::ok :JVMCI::cache_full;
1573     }
1574   }
1575 
1576   // String creation must be done outside lock
1577   if (failure_detail != NULL) {
1578     // A failure to allocate the string is silently ignored.
1579     JVMCIObject message = JVMCIENV->create_string(failure_detail, JVMCIENV);
1580     JVMCIENV->set_HotSpotCompiledNmethod_installationFailureMessage(compiled_code, message);
1581   }
1582 
1583   // JVMTI -- compiled method notification (must be done outside lock)


 921     JVMCIENV->call_HotSpotJVMCIRuntime_shutdown(_HotSpotJVMCIRuntime_instance);
 922   }
 923 }
 924 
 925 void JVMCIRuntime::bootstrap_finished(TRAPS) {
 926   if (is_HotSpotJVMCIRuntime_initialized()) {
 927     THREAD_JVMCIENV(JavaThread::current());
 928     JVMCIENV->call_HotSpotJVMCIRuntime_bootstrapFinished(_HotSpotJVMCIRuntime_instance, JVMCIENV);
 929   }
 930 }
 931 
 932 void JVMCIRuntime::describe_pending_hotspot_exception(JavaThread* THREAD, bool clear) {
 933   if (HAS_PENDING_EXCEPTION) {
 934     Handle exception(THREAD, PENDING_EXCEPTION);
 935     const char* exception_file = THREAD->exception_file();
 936     int exception_line = THREAD->exception_line();
 937     CLEAR_PENDING_EXCEPTION;
 938     if (exception->is_a(SystemDictionary::ThreadDeath_klass())) {
 939       // Don't print anything if we are being killed.
 940     } else {
 941       java_lang_Throwable::print(exception(), tty);
 942       tty->cr();
 943       java_lang_Throwable::print_stack_trace(exception, tty);
 944 
 945       // Clear and ignore any exceptions raised during printing
 946       CLEAR_PENDING_EXCEPTION;
 947     }
 948     if (!clear) {
 949       THREAD->set_pending_exception(exception(), exception_file, exception_line);
 950     }
 951   }
 952 }
 953 
 954 
 955 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) {
 956   JavaThread* THREAD = JavaThread::current();
 957 
 958   static volatile int report_error = 0;
 959   if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
 960     // Only report an error once
 961     tty->print_raw_cr(message);
 962     if (JVMCIENV != NULL) {


1324   }
1325 
1326   // Dependencies must be checked when the system dictionary changes
1327   // or if we don't know whether it has changed (i.e., compile_state == NULL).
1328   bool counter_changed = compile_state == NULL || compile_state->system_dictionary_modification_counter() != SystemDictionary::number_of_modifications();
1329   CompileTask* task = compile_state == NULL ? NULL : compile_state->task();
1330   Dependencies::DepType result = dependencies->validate_dependencies(task, counter_changed, failure_detail);
1331   if (result == Dependencies::end_marker) {
1332     return JVMCI::ok;
1333   }
1334 
1335   if (!Dependencies::is_klass_type(result) || counter_changed) {
1336     return JVMCI::dependencies_failed;
1337   }
1338   // The dependencies were invalid at the time of installation
1339   // without any intervening modification of the system
1340   // dictionary.  That means they were invalidly constructed.
1341   return JVMCI::dependencies_invalid;
1342 }
1343 












1344 
1345 void JVMCIRuntime::compile_method(JVMCIEnv* JVMCIENV, JVMCICompiler* compiler, const methodHandle& method, int entry_bci) {
1346   JVMCI_EXCEPTION_CONTEXT
1347 
1348   JVMCICompileState* compile_state = JVMCIENV->compile_state();
1349 
1350   bool is_osr = entry_bci != InvocationEntryBci;
1351   if (compiler->is_bootstrapping() && is_osr) {
1352     // no OSR compilations during bootstrap - the compiler is just too slow at this point,
1353     // and we know that there are no endless loops
1354     compile_state->set_failure(true, "No OSR during boostrap");
1355     return;
1356   }
1357   if (JVMCI::shutdown_called()) {
1358     compile_state->set_failure(false, "Avoiding compilation during shutdown");
1359     return;
1360   }
1361 
1362   HandleMark hm;
1363   JVMCIObject receiver = get_HotSpotJVMCIRuntime(JVMCIENV);
1364   if (JVMCIENV->has_pending_exception()) {
1365     JVMCIENV->describe_pending_exception(true);
1366     compile_state->set_failure(false, "exception getting HotSpotJVMCIRuntime object");
1367     return;
1368   }
1369   JVMCIObject jvmci_method = JVMCIENV->get_jvmci_method(method, JVMCIENV);
1370   if (JVMCIENV->has_pending_exception()) {
1371     JVMCIENV->describe_pending_exception(true);
1372     compile_state->set_failure(false, "exception getting JVMCI wrapper method");
1373     return;
1374   }
1375 
1376   JVMCIObject result_object = JVMCIENV->call_HotSpotJVMCIRuntime_compileMethod(receiver, jvmci_method, entry_bci,
1377                                                                      (jlong) compile_state, compile_state->task()->compile_id());
1378   if (!JVMCIENV->has_pending_exception()) {
1379     if (result_object.is_non_null()) {
1380       JVMCIObject failure_message = JVMCIENV->get_HotSpotCompilationRequestResult_failureMessage(result_object);
1381       if (failure_message.is_non_null()) {
1382         // Copy failure reason into resource memory first ...
1383         const char* failure_reason = JVMCIENV->as_utf8_string(failure_message);
1384         // ... and then into the C heap.
1385         failure_reason = os::strdup(failure_reason, mtJVMCI);
1386         bool retryable = JVMCIENV->get_HotSpotCompilationRequestResult_retry(result_object) != 0;
1387         compile_state->set_failure(retryable, failure_reason, true);
1388       } else {
1389         if (compile_state->task()->code() == NULL) {
1390           compile_state->set_failure(true, "no nmethod produced");
1391         } else {
1392           compile_state->task()->set_num_inlined_bytecodes(JVMCIENV->get_HotSpotCompilationRequestResult_inlinedBytecodes(result_object));
1393           compiler->inc_methods_compiled();
1394         }
1395       }
1396     } else {
1397       assert(false, "JVMCICompiler.compileMethod should always return non-null");
1398     }
1399   } else {
1400     // An uncaught exception was thrown during compilation. Generally these
1401     // should be handled by the Java code in some useful way but if they leak
1402     // through to here report them instead of dying or silently ignoring them.
1403     JVMCIENV->describe_pending_exception(true);
1404     compile_state->set_failure(false, "unexpected exception thrown");
1405   }
1406   if (compiler->is_bootstrapping()) {
1407     compiler->set_bootstrap_compilation_request_handled();
1408   }
1409 }
1410 
1411 
1412 // ------------------------------------------------------------------
1413 JVMCI::CodeInstallResult JVMCIRuntime::register_method(JVMCIEnv* JVMCIENV,
1414                                 const methodHandle& method,
1415                                 nmethod*& nm,
1416                                 int entry_bci,
1417                                 CodeOffsets* offsets,
1418                                 int orig_pc_offset,
1419                                 CodeBuffer* code_buffer,
1420                                 int frame_words,
1421                                 OopMapSet* oop_map_set,
1422                                 ExceptionHandlerTable* handler_table,

1423                                 AbstractCompiler* compiler,
1424                                 DebugInformationRecorder* debug_info,
1425                                 Dependencies* dependencies,
1426                                 int compile_id,
1427                                 bool has_unsafe_access,
1428                                 bool has_wide_vector,
1429                                 JVMCIObject compiled_code,
1430                                 JVMCIObject nmethod_mirror,
1431                                 FailedSpeculation** failed_speculations,
1432                                 char* speculations,
1433                                 int speculations_len) {
1434   JVMCI_EXCEPTION_CONTEXT;
1435   nm = NULL;
1436   int comp_level = CompLevel_full_optimization;
1437   char* failure_detail = NULL;
1438 
1439   bool install_default = JVMCIENV->get_HotSpotNmethod_isDefault(nmethod_mirror) != 0;
1440   assert(JVMCIENV->isa_HotSpotNmethod(nmethod_mirror), "must be");
1441   JVMCIObject name = JVMCIENV->get_InstalledCode_name(nmethod_mirror);
1442   const char* nmethod_mirror_name = name.is_null() ? NULL : JVMCIENV->as_utf8_string(name);


1472     // Check for {class loads, evolution, breakpoints} during compilation
1473     result = validate_compile_task_dependencies(dependencies, JVMCIENV->compile_state(), &failure_detail);
1474     if (result != JVMCI::ok) {
1475       // While not a true deoptimization, it is a preemptive decompile.
1476       MethodData* mdp = method()->method_data();
1477       if (mdp != NULL) {
1478         mdp->inc_decompile_count();
1479 #ifdef ASSERT
1480         if (mdp->decompile_count() > (uint)PerMethodRecompilationCutoff) {
1481           ResourceMark m;
1482           tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string());
1483         }
1484 #endif
1485       }
1486 
1487       // All buffers in the CodeBuffer are allocated in the CodeCache.
1488       // If the code buffer is created on each compile attempt
1489       // as in C2, then it must be freed.
1490       //code_buffer->free_blob();
1491     } else {
1492       ImplicitExceptionTable implicit_tbl;
1493       nm =  nmethod::new_nmethod(method,
1494                                  compile_id,
1495                                  entry_bci,
1496                                  offsets,
1497                                  orig_pc_offset,
1498                                  debug_info, dependencies, code_buffer,
1499                                  frame_words, oop_map_set,
1500                                  handler_table, &implicit_tbl,
1501                                  compiler, comp_level,
1502                                  speculations, speculations_len,
1503                                  nmethod_mirror_index, nmethod_mirror_name, failed_speculations);
1504 
1505 
1506       // Free codeBlobs
1507       if (nm == NULL) {
1508         // The CodeCache is full.  Print out warning and disable compilation.
1509         {
1510           MutexUnlocker ml(Compile_lock);
1511           MutexUnlocker locker(MethodCompileQueue_lock);
1512           CompileBroker::handle_full_code_cache(CodeCache::get_code_blob_type(comp_level));
1513         }
1514       } else {
1515         nm->set_has_unsafe_access(has_unsafe_access);
1516         nm->set_has_wide_vectors(has_wide_vector);
1517 
1518         // Record successful registration.
1519         // (Put nm into the task handle *before* publishing to the Java heap.)
1520         if (JVMCIENV->compile_state() != NULL) {
1521           JVMCIENV->compile_state()->task()->set_code(nm);
1522         }
1523 
1524         JVMCINMethodData* data = nm->jvmci_nmethod_data();
1525         assert(data != NULL, "must be");
1526         if (install_default) {
1527           assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm) == NULL, "must be");
1528           if (entry_bci == InvocationEntryBci) {
1529             if (TieredCompilation) {
1530               // If there is an old version we're done with it
1531               CompiledMethod* old = method->code();
1532               if (TraceMethodReplacement && old != NULL) {
1533                 ResourceMark rm;
1534                 char *method_name = method->name_and_sig_as_C_string();
1535                 tty->print_cr("Replacing method %s", method_name);
1536               }
1537               if (old != NULL ) {
1538                 old->make_not_entrant();
1539               }
1540             }
1541             if (TraceNMethodInstalls) {


1542               ResourceMark rm;
1543               char *method_name = method->name_and_sig_as_C_string();
1544               ttyLocker ttyl;
1545               tty->print_cr("Installing method (%d) %s [entry point: %p]",
1546                             comp_level,
1547                             method_name, nm->entry_point());
1548             }
1549             // Allow the code to be executed
1550             method->set_code(method, nm);
1551           } else {
1552             if (TraceNMethodInstalls ) {

1553               ResourceMark rm;
1554               char *method_name = method->name_and_sig_as_C_string();
1555               ttyLocker ttyl;
1556               tty->print_cr("Installing osr method (%d) %s @ %d",
1557                             comp_level,
1558                             method_name,
1559                             entry_bci);
1560             }
1561             InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
1562           }
1563         } else {
1564           assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm) == HotSpotJVMCI::resolve(nmethod_mirror), "must be");
1565         }
1566         nm->make_in_use();
1567       }
1568       result = nm != NULL ? JVMCI::ok :JVMCI::cache_full;
1569     }
1570   }
1571 
1572   // String creation must be done outside lock
1573   if (failure_detail != NULL) {
1574     // A failure to allocate the string is silently ignored.
1575     JVMCIObject message = JVMCIENV->create_string(failure_detail, JVMCIENV);
1576     JVMCIENV->set_HotSpotCompiledNmethod_installationFailureMessage(compiled_code, message);
1577   }
1578 
1579   // JVMTI -- compiled method notification (must be done outside lock)
< prev index next >