1354 // Log the unloading.
1355 log_state_change();
1356
1357 #if INCLUDE_JVMCI
1358 // The method can only be unloaded after the pointer to the installed code
1359 // Java wrapper is no longer alive. Here we need to clear out this weak
1360 // reference to the dead object. Nulling out the reference has to happen
1361 // after the method is unregistered since the original value may be still
1362 // tracked by the rset.
1363 maybe_invalidate_installed_code();
1364 // Clear these out after the nmethod has been unregistered and any
1365 // updates to the InstalledCode instance have been performed.
1366 _jvmci_installed_code = NULL;
1367 _speculation_log = NULL;
1368 #endif
1369
1370 // The Method* is gone at this point
1371 assert(_method == NULL, "Tautology");
1372
1373 set_osr_link(NULL);
1374 //set_scavenge_root_link(NULL); // done by prune_scavenge_root_nmethods
1375 NMethodSweeper::report_state_change(this);
1376 }
1377
1378 void nmethod::invalidate_osr_method() {
1379 assert(_entry_bci != InvocationEntryBci, "wrong kind of nmethod");
1380 // Remove from list of active nmethods
1381 if (method() != NULL)
1382 method()->method_holder()->remove_osr_nmethod(this);
1383 }
1384
1385 void nmethod::log_state_change() const {
1386 if (LogCompilation) {
1387 if (xtty != NULL) {
1388 ttyLocker ttyl; // keep the following output all in one block
1389 if (_state == unloaded) {
1390 xtty->begin_elem("make_unloaded thread='" UINTX_FORMAT "'",
1391 os::current_thread_id());
1392 } else {
1393 xtty->begin_elem("make_not_entrant thread='" UINTX_FORMAT "'%s",
1394 os::current_thread_id(),
|
1354 // Log the unloading.
1355 log_state_change();
1356
1357 #if INCLUDE_JVMCI
1358 // The method can only be unloaded after the pointer to the installed code
1359 // Java wrapper is no longer alive. Here we need to clear out this weak
1360 // reference to the dead object. Nulling out the reference has to happen
1361 // after the method is unregistered since the original value may be still
1362 // tracked by the rset.
1363 maybe_invalidate_installed_code();
1364 // Clear these out after the nmethod has been unregistered and any
1365 // updates to the InstalledCode instance have been performed.
1366 _jvmci_installed_code = NULL;
1367 _speculation_log = NULL;
1368 #endif
1369
1370 // The Method* is gone at this point
1371 assert(_method == NULL, "Tautology");
1372
1373 set_osr_link(NULL);
1374 NMethodSweeper::report_state_change(this);
1375 }
1376
1377 void nmethod::invalidate_osr_method() {
1378 assert(_entry_bci != InvocationEntryBci, "wrong kind of nmethod");
1379 // Remove from list of active nmethods
1380 if (method() != NULL)
1381 method()->method_holder()->remove_osr_nmethod(this);
1382 }
1383
1384 void nmethod::log_state_change() const {
1385 if (LogCompilation) {
1386 if (xtty != NULL) {
1387 ttyLocker ttyl; // keep the following output all in one block
1388 if (_state == unloaded) {
1389 xtty->begin_elem("make_unloaded thread='" UINTX_FORMAT "'",
1390 os::current_thread_id());
1391 } else {
1392 xtty->begin_elem("make_not_entrant thread='" UINTX_FORMAT "'%s",
1393 os::current_thread_id(),
|