8185141: Generalize scavengeable nmethod root handling

Reviewed-by: tschatzl, pliden, rkennke
This commit is contained in:
Erik Österlund 2017-10-13 15:08:56 +02:00
parent 34622112b6
commit ebf1633bd2
13 changed files with 73 additions and 86 deletions

View file

@ -1221,11 +1221,6 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
MutexLockerEx ml_code (CodeCache_lock, Mutex::_no_safepoint_check_flag);
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
guarantee(nm != NULL, "only nmethods can contain non-perm oops");
if (!nm->on_scavenge_root_list() &&
((mirror.not_null() && mirror()->is_scavengable()) ||
(appendix.not_null() && appendix->is_scavengable()))) {
CodeCache::add_scavenge_root_nmethod(nm);
}
// Since we've patched some oops in the nmethod,
// (re)register it with the heap.