# HG changeset patch # User pliden # Date 1403534621 -7200 # Node ID fd81a5764900f72a994fec4824b34bab479a9dfb # Parent 0982ec23da03d077f02dd8e9ff292e456101b8cb 8046231: G1: Code root location ... from nmethod ... not in strong code roots for region Reviewed-by: tschatzl, ehelin diff -r 0982ec23da03 -r fd81a5764900 src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Thu Jun 19 13:31:14 2014 +0200 +++ b/src/share/vm/code/nmethod.cpp Mon Jun 23 16:43:41 2014 +0200 @@ -688,8 +688,10 @@ _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); code_buffer->copy_values_to(this); - if (ScavengeRootsInCode && detect_scavenge_root_oops()) { - CodeCache::add_scavenge_root_nmethod(this); + if (ScavengeRootsInCode) { + if (detect_scavenge_root_oops()) { + CodeCache::add_scavenge_root_nmethod(this); + } Universe::heap()->register_nmethod(this); } debug_only(verify_scavenge_root_oops()); @@ -773,8 +775,10 @@ _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); code_buffer->copy_values_to(this); - if (ScavengeRootsInCode && detect_scavenge_root_oops()) { - CodeCache::add_scavenge_root_nmethod(this); + if (ScavengeRootsInCode) { + if (detect_scavenge_root_oops()) { + CodeCache::add_scavenge_root_nmethod(this); + } Universe::heap()->register_nmethod(this); } DEBUG_ONLY(verify_scavenge_root_oops();) @@ -889,8 +893,10 @@ code_buffer->copy_values_to(this); debug_info->copy_to(this); dependencies->copy_to(this); - if (ScavengeRootsInCode && detect_scavenge_root_oops()) { - CodeCache::add_scavenge_root_nmethod(this); + if (ScavengeRootsInCode) { + if (detect_scavenge_root_oops()) { + CodeCache::add_scavenge_root_nmethod(this); + } Universe::heap()->register_nmethod(this); } debug_only(verify_scavenge_root_oops()); diff -r 0982ec23da03 -r fd81a5764900 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Jun 19 13:31:14 2014 +0200 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Jun 23 16:43:41 2014 +0200 @@ -6950,7 +6950,7 @@ return; } - if (ScavengeRootsInCode && nm->detect_scavenge_root_oops()) { + if (ScavengeRootsInCode) { _g1h->register_nmethod(nm); } }