7028374: race in fix_oop_relocations for scavengeable nmethods

Reviewed-by: kvn
This commit is contained in:
Tom Rodriguez 2011-03-18 15:52:42 -07:00
parent 0317c7c485
commit f5ef48f3b9
11 changed files with 115 additions and 13 deletions

View file

@ -337,7 +337,6 @@ void CodeCache::scavenge_root_nmethods_do(CodeBlobClosure* f) {
if (is_live) {
// Perform cur->oops_do(f), maybe just once per nmethod.
f->do_code_blob(cur);
cur->fix_oop_relocations();
}
}
@ -552,6 +551,19 @@ void CodeCache::gc_epilogue() {
}
void CodeCache::verify_oops() {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
VerifyOopClosure voc;
FOR_ALL_ALIVE_BLOBS(cb) {
if (cb->is_nmethod()) {
nmethod *nm = (nmethod*)cb;
nm->oops_do(&voc);
nm->verify_oop_relocations();
}
}
}
address CodeCache::first_address() {
assert_locked_or_safepoint(CodeCache_lock);
return (address)_heap->begin();