mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8178363: Incorrect check for nmethod re-registration in C1
Reviewed-by: stefank, rbackman
This commit is contained in:
parent
f7277d87d5
commit
221d948b51
1 changed files with 4 additions and 3 deletions
|
@ -1221,12 +1221,13 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
||||||
|
|
||||||
// If we are patching in a non-perm oop, make sure the nmethod
|
// If we are patching in a non-perm oop, make sure the nmethod
|
||||||
// is on the right list.
|
// is on the right list.
|
||||||
if (ScavengeRootsInCode && ((mirror.not_null() && mirror()->is_scavengable()) ||
|
if (ScavengeRootsInCode) {
|
||||||
(appendix.not_null() && appendix->is_scavengable()))) {
|
|
||||||
MutexLockerEx ml_code (CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
MutexLockerEx ml_code (CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||||
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
|
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
|
||||||
guarantee(nm != NULL, "only nmethods can contain non-perm oops");
|
guarantee(nm != NULL, "only nmethods can contain non-perm oops");
|
||||||
if (!nm->on_scavenge_root_list()) {
|
if (!nm->on_scavenge_root_list() &&
|
||||||
|
((mirror.not_null() && mirror()->is_scavengable()) ||
|
||||||
|
(appendix.not_null() && appendix->is_scavengable()))) {
|
||||||
CodeCache::add_scavenge_root_nmethod(nm);
|
CodeCache::add_scavenge_root_nmethod(nm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue