8040085: dtrace/jsdt tests crash on solaris. found an unadvertised bad scavengable oop in the code cache

Add CodeCache::add_scavenge_root_nmethod(this) to the dtrace-constructor of nmethod

Reviewed-by: roland, iveresov
This commit is contained in:
Albert Noll 2014-04-28 12:39:12 +02:00
parent 24be3e5628
commit ff3717e719
2 changed files with 13 additions and 8 deletions

View file

@ -750,7 +750,11 @@ nmethod::nmethod(
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
code_buffer->copy_values_to(this);
debug_only(verify_scavenge_root_oops());
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
Universe::heap()->register_nmethod(this);
}
DEBUG_ONLY(verify_scavenge_root_oops();)
CodeCache::commit(this);
}