--- old/src/share/vm/gc/g1/heapRegion.cpp 2017-02-24 15:17:51.282769851 +0100 +++ new/src/share/vm/gc/g1/heapRegion.cpp 2017-02-24 15:17:51.170766490 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,10 +55,6 @@ DirtyCardToOopClosure(hr, cl, precision, NULL), _hr(hr), _rs_scan(cl), _g1(g1) { } -FilterOutOfRegionClosure::FilterOutOfRegionClosure(HeapRegion* r, - OopClosure* oc) : - _r_bottom(r->bottom()), _r_end(r->end()), _oc(oc) { } - void HeapRegionDCTOC::walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top) { @@ -353,7 +349,7 @@ // special handling for concurrent processing encountering an // in-progress allocation. static bool do_oops_on_card_in_humongous(MemRegion mr, - FilterOutOfRegionClosure* cl, + G1UpdateRSOrPushRefOopClosure* cl, HeapRegion* hr, G1CollectedHeap* g1h) { assert(hr->is_humongous(), "precondition"); @@ -394,7 +390,7 @@ } bool HeapRegion::oops_on_card_seq_iterate_careful(MemRegion mr, - FilterOutOfRegionClosure* cl) { + G1UpdateRSOrPushRefOopClosure* cl) { assert(MemRegion(bottom(), end()).contains(mr), "Card region not in heap region"); G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -765,6 +761,21 @@ } }; +// Closure that applies the given two closures in sequence. +class G1Mux2Closure : public OopClosure { + OopClosure* _c1; + OopClosure* _c2; +public: + G1Mux2Closure(OopClosure *c1, OopClosure *c2) { _c1 = c1; _c2 = c2; } + template inline void do_oop_work(T* p) { + // Apply first closure; then apply the second. + _c1->do_oop(p); + _c2->do_oop(p); + } + virtual inline void do_oop(oop* p) { do_oop_work(p); } + virtual inline void do_oop(narrowOop* p) { do_oop_work(p); } +}; + // This really ought to be commoned up into OffsetTableContigSpace somehow. // We would need a mechanism to make that code skip dead objects.