--- old/src/share/vm/gc/g1/g1ConcurrentMark.cpp 2016-03-08 15:19:33.834140003 -0500 +++ new/src/share/vm/gc/g1/g1ConcurrentMark.cpp 2016-03-08 15:19:33.378114254 -0500 @@ -124,17 +124,17 @@ } // Closure used for clearing the given mark bitmap. -class ClearBitmapHRClosure : public HeapRegionClosure { +class ClearBitmapHRClosure : public AbortableHeapRegionClosure { private: G1ConcurrentMark* _cm; G1CMBitMap* _bitmap; bool _may_yield; // The closure may yield during iteration. If yielded, abort the iteration. public: - ClearBitmapHRClosure(G1ConcurrentMark* cm, G1CMBitMap* bitmap, bool may_yield) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) { + ClearBitmapHRClosure(G1ConcurrentMark* cm, G1CMBitMap* bitmap, bool may_yield) : AbortableHeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) { assert(!may_yield || cm != NULL, "CM must be non-NULL if this closure is expected to yield."); } - virtual bool doHeapRegion(HeapRegion* r) { + virtual bool doHeapRegionAbortable(HeapRegion* r) { size_t const chunk_size_in_words = M / HeapWordSize; HeapWord* cur = r->bottom(); @@ -726,14 +726,14 @@ guarantee(!g1h->collector_state()->mark_in_progress(), "invariant"); } -class CheckBitmapClearHRClosure : public HeapRegionClosure { +class CheckBitmapClearHRClosure : public AbortableHeapRegionClosure { G1CMBitMap* _bitmap; bool _error; public: CheckBitmapClearHRClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) { } - virtual bool doHeapRegion(HeapRegion* r) { + virtual bool doHeapRegionAbortable(HeapRegion* r) { // This closure can be called concurrently to the mutator, so we must make sure // that the result of the getNextMarkedWordAddress() call is compared to the // value passed to it as limit to detect any found bits. @@ -751,9 +751,8 @@ class NoteStartOfMarkHRClosure: public HeapRegionClosure { public: - bool doHeapRegion(HeapRegion* r) { + void doHeapRegion(HeapRegion* r) { r->note_start_of_marking(); - return false; } }; @@ -1205,7 +1204,7 @@ G1CMCountDataClosureBase(g1h, region_bm, card_bm), _bm(bm), _region_marked_bytes(0) { } - bool doHeapRegion(HeapRegion* hr) { + void doHeapRegion(HeapRegion* hr) { HeapWord* ntams = hr->next_top_at_mark_start(); HeapWord* start = hr->bottom(); @@ -1281,8 +1280,6 @@ // Set the marked bytes for the current region so that // it can be queried by a calling verification routine _region_marked_bytes = marked_bytes; - - return false; } size_t region_marked_bytes() const { return _region_marked_bytes; } @@ -1319,14 +1316,13 @@ int failures() const { return _failures; } - bool doHeapRegion(HeapRegion* hr) { + void doHeapRegion(HeapRegion* hr) { int failures = 0; // Call the CalcLiveObjectsClosure to walk the marking bitmap for // this region and set the corresponding bits in the expected region // and card bitmaps. - bool res = _calc_cl.doHeapRegion(hr); - assert(res == false, "should be continuing"); + _calc_cl.doHeapRegion(hr); // Verify the marked bytes for this region. size_t exp_marked_bytes = _calc_cl.region_marked_bytes(); @@ -1382,10 +1378,6 @@ } _failures += failures; - - // We could stop iteration over the heap when we - // find the first violating region by returning true. - return false; } }; @@ -1450,7 +1442,7 @@ BitMap* card_bm) : G1CMCountDataClosureBase(g1h, region_bm, card_bm) { } - bool doHeapRegion(HeapRegion* hr) { + void doHeapRegion(HeapRegion* hr) { HeapWord* ntams = hr->next_top_at_mark_start(); HeapWord* top = hr->top(); @@ -1489,8 +1481,6 @@ if (hr->next_marked_bytes() > 0) { set_bit_for_region(hr); } - - return false; } }; @@ -1546,9 +1536,9 @@ const uint old_regions_removed() { return _old_regions_removed; } const uint humongous_regions_removed() { return _humongous_regions_removed; } - bool doHeapRegion(HeapRegion *hr) { + void doHeapRegion(HeapRegion *hr) { if (hr->is_archive()) { - return false; + return; } // We use a claim value of zero here because all regions // were claimed with value 1 in the FinalCount task. @@ -1568,8 +1558,6 @@ } else { hr->rem_set()->do_cleanup_work(_hrrs_cleanup_task); } - - return false; } }; @@ -1592,7 +1580,6 @@ G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list, &hrrs_cleanup_task); _g1h->heap_region_par_iterate(&g1_note_end, worker_id, &_hrclaimer); - assert(g1_note_end.complete(), "Shouldn't have yielded!"); // Now update the lists _g1h->remove_from_old_sets(g1_note_end.old_regions_removed(), g1_note_end.humongous_regions_removed()); @@ -2441,7 +2428,7 @@ _ct_bs(barrier_set_cast(g1h->barrier_set())), _cm_card_bm(cm_card_bm), _max_worker_id(max_worker_id) { } - bool doHeapRegion(HeapRegion* hr) { + void doHeapRegion(HeapRegion* hr) { HeapWord* start = hr->bottom(); HeapWord* limit = hr->next_top_at_mark_start(); HeapWord* end = hr->end(); @@ -2456,7 +2443,7 @@ if (start == limit) { // NTAMS of this region has not been set so nothing to do. - return false; + return; } // 'start' should be in the heap. @@ -2514,9 +2501,6 @@ // Update the marked bytes for this region. hr->add_to_marked_bytes(marked_bytes); - - // Next heap region - return false; } }; @@ -3625,7 +3609,7 @@ *next_live_bytes = get_hum_bytes(&_hum_next_live_bytes); } -bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) { +void G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) { const char* type = r->get_type_str(); HeapWord* bottom = r->bottom(); HeapWord* end = r->end(); @@ -3675,8 +3659,6 @@ type, p2i(bottom), p2i(end), used_bytes, prev_live_bytes, next_live_bytes, gc_eff, remset_bytes, strong_code_roots_bytes); - - return false; } G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {