Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @ 6254:a2f7274eb6ef
7114678: G1: various small fixes, code cleanup, and refactoring
Summary: Various cleanups as a prelude to introducing iterators for HeapRegions.
Reviewed-by: johnc, brutisso
author | tonyp |
---|---|
date | Thu, 19 Jul 2012 15:15:54 -0700 |
parents | b632e80fc9dc |
children | da91efe96a93 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Tue Jul 17 12:24:05 2012 -0700 +++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Thu Jul 19 15:15:54 2012 -0700 @@ -262,18 +262,6 @@ } }; -// Finds the first HeapRegion. -class FindFirstRegionClosure: public HeapRegionClosure { - HeapRegion* _a_region; -public: - FindFirstRegionClosure() : _a_region(NULL) {} - bool doHeapRegion(HeapRegion* r) { - _a_region = r; - return true; - } - HeapRegion* result() { return _a_region; } -}; - void G1MarkSweep::mark_sweep_phase2() { // Now all live objects are marked, compute the new object addresses. @@ -294,9 +282,8 @@ TraceTime tm("phase 2", G1Log::fine() && Verbose, true, gclog_or_tty); GenMarkSweep::trace("2"); - FindFirstRegionClosure cl; - g1h->heap_region_iterate(&cl); - HeapRegion *r = cl.result(); + // find the first region + HeapRegion* r = g1h->region_at(0); CompactibleSpace* sp = r; if (r->isHumongous() && oop(r->bottom())->is_gc_marked()) { sp = r->next_compaction_space(); @@ -408,7 +395,3 @@ g1h->heap_region_iterate(&blk); } - -// Local Variables: *** -// c-indentation-style: gnu *** -// End: ***