src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page
rev 6559 : 8046231: G1: Code root location ... from nmethod ... not in strong code roots for region
Reviewed-by:


6976                                     workers()->active_workers(),
6977                                     HeapRegion::ParMarkRootClaimValue);
6978   } else {
6979     heap_region_iterate(&cl);
6980   }
6981 }
6982 
6983 class RebuildStrongCodeRootClosure: public CodeBlobClosure {
6984   G1CollectedHeap* _g1h;
6985 
6986 public:
6987   RebuildStrongCodeRootClosure(G1CollectedHeap* g1h) :
6988     _g1h(g1h) {}
6989 
6990   void do_code_blob(CodeBlob* cb) {
6991     nmethod* nm = (cb != NULL) ? cb->as_nmethod_or_null() : NULL;
6992     if (nm == NULL) {
6993       return;
6994     }
6995 
6996     if (ScavengeRootsInCode && nm->detect_scavenge_root_oops()) {
6997       _g1h->register_nmethod(nm);
6998     }
6999   }
7000 };
7001 
7002 void G1CollectedHeap::rebuild_strong_code_roots() {
7003   RebuildStrongCodeRootClosure blob_cl(this);
7004   CodeCache::blobs_do(&blob_cl);
7005 }


6976                                     workers()->active_workers(),
6977                                     HeapRegion::ParMarkRootClaimValue);
6978   } else {
6979     heap_region_iterate(&cl);
6980   }
6981 }
6982 
6983 class RebuildStrongCodeRootClosure: public CodeBlobClosure {
6984   G1CollectedHeap* _g1h;
6985 
6986 public:
6987   RebuildStrongCodeRootClosure(G1CollectedHeap* g1h) :
6988     _g1h(g1h) {}
6989 
6990   void do_code_blob(CodeBlob* cb) {
6991     nmethod* nm = (cb != NULL) ? cb->as_nmethod_or_null() : NULL;
6992     if (nm == NULL) {
6993       return;
6994     }
6995 
6996     if (ScavengeRootsInCode) {
6997       _g1h->register_nmethod(nm);
6998     }
6999   }
7000 };
7001 
7002 void G1CollectedHeap::rebuild_strong_code_roots() {
7003   RebuildStrongCodeRootClosure blob_cl(this);
7004   CodeCache::blobs_do(&blob_cl);
7005 }