src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hs-gc-g1-mmap Sdiff src/share/vm/gc_implementation/g1

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

Print this page




6790     if (hr->isHumongous()) {
6791       // Code roots should never be attached to a humongous region
6792       assert(hrrs->strong_code_roots_list_length() == 0, "sanity");
6793       return false;
6794     }
6795 
6796     if (hr->in_collection_set()) {
6797       // Don't mark code roots into regions in the collection set here.
6798       // They will be marked when we scan them.
6799       return false;
6800     }
6801 
6802     MarkStrongCodeRootCodeBlobClosure cb_cl(_g1h->concurrent_mark(), hr, _worker_id);
6803     hr->strong_code_roots_do(&cb_cl);
6804     return false;
6805   }
6806 };
6807 
6808 void G1CollectedHeap::mark_strong_code_roots(uint worker_id) {
6809   MarkStrongCodeRootsHRClosure cl(this, worker_id);

6810   heap_region_par_iterate_chunked(&cl,
6811                                   worker_id,
6812                                   workers()->active_workers(),
6813                                   HeapRegion::ParMarkRootClaimValue);



6814 }
6815 
6816 class RebuildStrongCodeRootClosure: public CodeBlobClosure {
6817   G1CollectedHeap* _g1h;
6818 
6819 public:
6820   RebuildStrongCodeRootClosure(G1CollectedHeap* g1h) :
6821     _g1h(g1h) {}
6822 
6823   void do_code_blob(CodeBlob* cb) {
6824     nmethod* nm = (cb != NULL) ? cb->as_nmethod_or_null() : NULL;
6825     if (nm == NULL) {
6826       return;
6827     }
6828 
6829     if (ScavengeRootsInCode && nm->detect_scavenge_root_oops()) {
6830       _g1h->register_nmethod(nm);
6831     }
6832   }
6833 };


6790     if (hr->isHumongous()) {
6791       // Code roots should never be attached to a humongous region
6792       assert(hrrs->strong_code_roots_list_length() == 0, "sanity");
6793       return false;
6794     }
6795 
6796     if (hr->in_collection_set()) {
6797       // Don't mark code roots into regions in the collection set here.
6798       // They will be marked when we scan them.
6799       return false;
6800     }
6801 
6802     MarkStrongCodeRootCodeBlobClosure cb_cl(_g1h->concurrent_mark(), hr, _worker_id);
6803     hr->strong_code_roots_do(&cb_cl);
6804     return false;
6805   }
6806 };
6807 
6808 void G1CollectedHeap::mark_strong_code_roots(uint worker_id) {
6809   MarkStrongCodeRootsHRClosure cl(this, worker_id);
6810   if (G1CollectedHeap::use_parallel_gc_threads()) {
6811     heap_region_par_iterate_chunked(&cl,
6812                                     worker_id,
6813                                     workers()->active_workers(),
6814                                     HeapRegion::ParMarkRootClaimValue);
6815   } else {
6816     heap_region_iterate(&cl);
6817   }
6818 }
6819 
6820 class RebuildStrongCodeRootClosure: public CodeBlobClosure {
6821   G1CollectedHeap* _g1h;
6822 
6823 public:
6824   RebuildStrongCodeRootClosure(G1CollectedHeap* g1h) :
6825     _g1h(g1h) {}
6826 
6827   void do_code_blob(CodeBlob* cb) {
6828     nmethod* nm = (cb != NULL) ? cb->as_nmethod_or_null() : NULL;
6829     if (nm == NULL) {
6830       return;
6831     }
6832 
6833     if (ScavengeRootsInCode && nm->detect_scavenge_root_oops()) {
6834       _g1h->register_nmethod(nm);
6835     }
6836   }
6837 };
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File