--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-06-23 11:37:40.790048948 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-06-23 11:37:40.655044778 +0200 @@ -3458,13 +3458,11 @@ _root_processor->evacuate_roots(pss->closures(), worker_id); - G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, pss); - // We pass a weak code blobs closure to the remembered set scanning because we want to avoid // treating the nmethods visited to act as roots for concurrent marking. // We only want to make sure that the oops in the nmethods are adjusted with regard to the // objects copied by the current evacuation. - _g1h->g1_rem_set()->oops_into_collection_set_do(&push_heap_rs_cl, + _g1h->g1_rem_set()->oops_into_collection_set_do(pss, pss->closures()->weak_codeblobs(), worker_id); --- old/src/share/vm/gc/g1/g1CollectedHeap.hpp 2017-06-23 11:37:41.472070015 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.hpp 2017-06-23 11:37:41.340065937 +0200 @@ -1134,6 +1134,7 @@ // set. Assumes that the reference points into the heap. inline bool is_in_cset(const HeapRegion *hr); inline bool is_in_cset(oop obj); + inline bool is_in_cset(HeapWord* addr); inline bool is_in_cset_or_humongous(const oop obj); --- old/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp 2017-06-23 11:37:42.145090804 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp 2017-06-23 11:37:42.014086757 +0200 @@ -139,7 +139,11 @@ } inline bool G1CollectedHeap::is_in_cset(oop obj) { - return _in_cset_fast_test.is_in_cset((HeapWord*)obj); + return is_in_cset((HeapWord*)obj); +} + +inline bool G1CollectedHeap::is_in_cset(HeapWord* addr) { + return _in_cset_fast_test.is_in_cset(addr); } bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) { --- old/src/share/vm/gc/g1/g1OopClosures.hpp 2017-06-23 11:37:42.784110542 +0200 +++ new/src/share/vm/gc/g1/g1OopClosures.hpp 2017-06-23 11:37:42.655106557 +0200 @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_G1_G1OOPCLOSURES_HPP #define SHARE_VM_GC_G1_G1OOPCLOSURES_HPP +#include "gc/g1/g1InCSetState.hpp" #include "memory/iterator.hpp" #include "oops/markOop.hpp" @@ -55,15 +56,40 @@ G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); ~G1ParClosureSuper() { } + template + inline void prefetch_and_push(T* p, oop const obj); + + template + inline void handle_non_cset_obj_common(InCSetState const state, T* p, oop const obj); public: // This closure needs special handling for InstanceRefKlass. virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; } }; -class G1ParPushHeapRSClosure : public G1ParClosureSuper { +// Used during the Update RS phase to refine remaining cards in the DCQ during garbage collection. +class G1ScanObjsDuringUpdateRSClosure: public G1ParClosureSuper { + uint _worker_i; + bool _has_refs_into_cset; + +public: + G1ScanObjsDuringUpdateRSClosure(G1CollectedHeap* g1h, + G1ParScanThreadState* pss, + uint worker_i) : + G1ParClosureSuper(g1h, pss), _has_refs_into_cset(false), _worker_i(worker_i) { } + + void reset_has_refs_into_cset() { _has_refs_into_cset = false; } + bool has_refs_into_cset() const { return _has_refs_into_cset; } + + template void do_oop_nv(T* p); + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + virtual void do_oop(oop* p) { do_oop_nv(p); } +}; + +// Used during the Scan RS phase to scan cards from the remembered set during garbage collection. +class G1ScanObjsDuringScanRSClosure : public G1ParClosureSuper { public: - G1ParPushHeapRSClosure(G1CollectedHeap* g1, - G1ParScanThreadState* par_scan_state): + G1ScanObjsDuringScanRSClosure(G1CollectedHeap* g1, + G1ParScanThreadState* par_scan_state): G1ParClosureSuper(g1, par_scan_state) { } template void do_oop_nv(T* p); @@ -71,9 +97,10 @@ virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -class G1ParScanClosure : public G1ParClosureSuper { +// This closure is applied to the fields of the objects that have just been copied during evacuation. +class G1ScanEvacuatedObjClosure : public G1ParClosureSuper { public: - G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : + G1ScanEvacuatedObjClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : G1ParClosureSuper(g1, par_scan_state) { } template void do_oop_nv(T* p); @@ -186,42 +213,7 @@ template void do_oop_nv(T* p); virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - virtual void do_oop(oop* p) { do_oop_nv(p); } -}; - -class G1UpdateRSOrPushRefOopClosure: public ExtendedOopClosure { - G1CollectedHeap* _g1; - HeapRegion* _from; - G1ParPushHeapRSClosure* _push_ref_cl; - bool _record_refs_into_cset; - uint _worker_i; - bool _has_refs_into_cset; - -public: - G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h, - G1ParPushHeapRSClosure* push_ref_cl, - bool record_refs_into_cset, - uint worker_i = 0); - - void set_from(HeapRegion* from) { - assert(from != NULL, "from region must be non-NULL"); - _from = from; - } - - bool self_forwarded(oop obj) { - markOop m = obj->mark(); - bool result = (m->is_marked() && ((oop)m->decode_pointer() == obj)); - return result; - } - - bool has_refs_into_cset() const { return _has_refs_into_cset; } - - template inline void do_oop_nv(T* p); - virtual inline void do_oop(narrowOop* p); - virtual inline void do_oop(oop* p); - - // This closure needs special handling for InstanceRefKlass. - virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; } + virtual void do_oop(oop* p) { do_oop_nv(p); } }; #endif // SHARE_VM_GC_G1_G1OOPCLOSURES_HPP --- old/src/share/vm/gc/g1/g1OopClosures.inline.hpp 2017-06-23 11:37:43.422130250 +0200 +++ new/src/share/vm/gc/g1/g1OopClosures.inline.hpp 2017-06-23 11:37:43.293126265 +0200 @@ -36,61 +36,51 @@ #include "memory/iterator.inline.hpp" #include "runtime/prefetch.inline.hpp" -// This closure is applied to the fields of the objects that have just been copied. template -inline void G1ParScanClosure::do_oop_nv(T* p) { - T heap_oop = oopDesc::load_heap_oop(p); +inline void G1ParClosureSuper::prefetch_and_push(T* p, const oop obj) { + // We're not going to even bother checking whether the object is + // already forwarded or not, as this usually causes an immediate + // stall. We'll try to prefetch the object (for write, given that + // we might need to install the forwarding reference) and we'll + // get back to it when pop it from the queue + Prefetch::write(obj->mark_addr(), 0); + Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - const InCSetState state = _g1->in_cset_state(obj); - if (state.is_in_cset()) { - // We're not going to even bother checking whether the object is - // already forwarded or not, as this usually causes an immediate - // stall. We'll try to prefetch the object (for write, given that - // we might need to install the forwarding reference) and we'll - // get back to it when pop it from the queue - Prefetch::write(obj->mark_addr(), 0); - Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); - - // slightly paranoid test; I'm trying to catch potential - // problems before we go into push_on_queue to know where the - // problem is coming from - assert((obj == oopDesc::load_decode_heap_oop(p)) || - (obj->is_forwarded() && - obj->forwardee() == oopDesc::load_decode_heap_oop(p)), - "p should still be pointing to obj or to its forwardee"); - - _par_scan_state->push_on_queue(p); - } else { - if (state.is_humongous()) { - _g1->set_humongous_is_live(obj); - } else if (state.is_ext()) { - _par_scan_state->do_oop_ext(p); - } - _par_scan_state->update_rs(_from, p, obj); - } + // slightly paranoid test; I'm trying to catch potential + // problems before we go into push_on_queue to know where the + // problem is coming from + assert((obj == oopDesc::load_decode_heap_oop(p)) || + (obj->is_forwarded() && + obj->forwardee() == oopDesc::load_decode_heap_oop(p)), + "p should still be pointing to obj or to its forwardee"); + + _par_scan_state->push_on_queue(p); +} + +template +inline void G1ParClosureSuper::handle_non_cset_obj_common(InCSetState const state, T* p, oop const obj) { + if (state.is_humongous()) { + _g1->set_humongous_is_live(obj); + } else if (state.is_ext()) { + _par_scan_state->do_oop_ext(p); } } template -inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) { +inline void G1ScanEvacuatedObjClosure::do_oop_nv(T* p) { T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - const InCSetState state = _g1->in_cset_state(obj); - if (state.is_in_cset_or_humongous()) { - Prefetch::write(obj->mark_addr(), 0); - Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); - - // Place on the references queue - _par_scan_state->push_on_queue(p); - } else if (state.is_ext()) { - _par_scan_state->do_oop_ext(p); - } else { - assert(!_g1->is_in_cset(obj), "checking"); - } + if (oopDesc::is_null(heap_oop)) { + return; + } + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + const InCSetState state = _g1->in_cset_state(obj); + if (state.is_in_cset()) { + prefetch_and_push(p, obj); + } else { + handle_non_cset_obj_common(state, p, obj); + + _par_scan_state->update_rs(_from, p, obj); } } @@ -145,10 +135,10 @@ // Normally this closure should only be called with cross-region references. // But since Java threads are manipulating the references concurrently and we // reload the values things may have changed. - // This check lets slip through references from a humongous continues region + // Also this check lets slip through references from a humongous continues region // to its humongous start region, as they are in different regions, and adds a - // remembered set entry. This is benign (apart from memory usage), as this - // closure is never called during evacuation. + // remembered set entry. This is benign (apart from memory usage), as we never + // try to either evacuate or eager reclaim humonguous arrays of j.l.O. return; } @@ -159,79 +149,50 @@ } template -inline void G1UpdateRSOrPushRefOopClosure::do_oop_nv(T* p) { - oop obj = oopDesc::load_decode_heap_oop(p); - if (obj == NULL) { +inline void G1ScanObjsDuringUpdateRSClosure::do_oop_nv(T* p) { + T o = oopDesc::load_heap_oop(p); + if (oopDesc::is_null(o)) { return; } + oop obj = oopDesc::decode_heap_oop_not_null(o); -#ifdef ASSERT - // can't do because of races - // assert(obj == NULL || obj->is_oop(), "expected an oop"); - assert(check_obj_alignment(obj), "not oop aligned"); - assert(_g1->is_in_reserved(obj), "must be in heap"); -#endif // ASSERT + check_obj_during_refinement(p, obj); - assert(_from != NULL, "from region must be non-NULL"); - assert(_from->is_in_reserved(p) || - (_from->is_humongous() && - _g1->heap_region_containing(p)->is_humongous() && - _from->humongous_start_region() == _g1->heap_region_containing(p)->humongous_start_region()), - "p " PTR_FORMAT " is not in the same region %u or part of the correct humongous object starting at region %u.", - p2i(p), _from->hrm_index(), _from->humongous_start_region()->hrm_index()); + assert(!_g1->is_in_cset((HeapWord*)p), "Oop originates from " PTR_FORMAT " (region: %u) which is in the collection set.", p2i(p), _g1->addr_to_region((HeapWord*)p)); + const InCSetState state = _g1->in_cset_state(obj); + if (state.is_in_cset()) { + // Since the source is always from outside the collection set, here we implicitly know + // that this is a cross-region reference too. + prefetch_and_push(p, obj); - HeapRegion* to = _g1->heap_region_containing(obj); - if (_from == to) { - // Normally this closure should only be called with cross-region references. - // But since Java threads are manipulating the references concurrently and we - // reload the values things may have changed. - // Also this check lets slip through references from a humongous continues region - // to its humongous start region, as they are in different regions, and adds a - // remembered set entry. This is benign (apart from memory usage), as we never - // try to either evacuate or eager reclaim these kind of regions. - return; + _has_refs_into_cset = true; + } else { + HeapRegion* to = _g1->heap_region_containing(obj); + if (_from == to) { + return; + } + + handle_non_cset_obj_common(state, p, obj); + + to->rem_set()->add_reference(p, _worker_i); } +} - // The _record_refs_into_cset flag is true during the RSet - // updating part of an evacuation pause. It is false at all - // other times: - // * rebuilding the remembered sets after a full GC - // * during concurrent refinement. - // * updating the remembered sets of regions in the collection - // set in the event of an evacuation failure (when deferred - // updates are enabled). - - if (_record_refs_into_cset && to->in_collection_set()) { - // We are recording references that point into the collection - // set and this particular reference does exactly that... - // If the referenced object has already been forwarded - // to itself, we are handling an evacuation failure and - // we have already visited/tried to copy this object - // there is no need to retry. - if (!self_forwarded(obj)) { - assert(_push_ref_cl != NULL, "should not be null"); - // Push the reference in the refs queue of the G1ParScanThreadState - // instance for this worker thread. - _push_ref_cl->do_oop(p); - } - _has_refs_into_cset = true; +template +inline void G1ScanObjsDuringScanRSClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (oopDesc::is_null(heap_oop)) { + return; + } + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - // Deferred updates to the CSet are either discarded (in the normal case), - // or processed (if an evacuation failure occurs) at the end - // of the collection. - // See G1RemSet::cleanup_after_oops_into_collection_set_do(). + const InCSetState state = _g1->in_cset_state(obj); + if (state.is_in_cset()) { + prefetch_and_push(p, obj); } else { - // We either don't care about pushing references that point into the - // collection set (i.e. we're not during an evacuation pause) _or_ - // the reference doesn't point into the collection set. Either way - // we add the reference directly to the RSet of the region containing - // the referenced object. - assert(to->rem_set() != NULL, "Need per-region 'into' remsets."); - to->rem_set()->add_reference(p, _worker_i); + handle_non_cset_obj_common(state, p, obj); } } -void G1UpdateRSOrPushRefOopClosure::do_oop(oop* p) { do_oop_nv(p); } -void G1UpdateRSOrPushRefOopClosure::do_oop(narrowOop* p) { do_oop_nv(p); } template void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) { --- old/src/share/vm/gc/g1/g1ParScanThreadState.hpp 2017-06-23 11:37:44.052149710 +0200 +++ new/src/share/vm/gc/g1/g1ParScanThreadState.hpp 2017-06-23 11:37:43.922145695 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -54,7 +54,7 @@ InCSetState _dest[InCSetState::Num]; // Local tenuring threshold. uint _tenuring_threshold; - G1ParScanClosure _scanner; + G1ScanEvacuatedObjClosure _scanner; int _hash_seed; uint _worker_id; --- old/src/share/vm/gc/g1/g1RemSet.cpp 2017-06-23 11:37:44.675168955 +0200 +++ new/src/share/vm/gc/g1/g1RemSet.cpp 2017-06-23 11:37:44.546164970 +0200 @@ -327,11 +327,11 @@ } G1ScanRSClosure::G1ScanRSClosure(G1RemSetScanState* scan_state, - G1ParPushHeapRSClosure* push_heap_cl, + G1ScanObjsDuringScanRSClosure* scan_obj_on_card, CodeBlobClosure* code_root_cl, uint worker_i) : _scan_state(scan_state), - _push_heap_cl(push_heap_cl), + _scan_objs_on_card_cl(scan_obj_on_card), _code_root_cl(code_root_cl), _strong_code_root_scan_time_sec(0.0), _cards_claimed(0), @@ -353,8 +353,8 @@ // but they're benign), which reduces the number of duplicate // scans (the rsets of the regions in the cset can intersect). _ct_bs->set_card_claimed(index); - _push_heap_cl->set_region(r); - r->oops_on_card_seq_iterate_careful(mr, _push_heap_cl); + _scan_objs_on_card_cl->set_region(r); + r->oops_on_card_seq_iterate_careful(mr, _scan_objs_on_card_cl); _cards_scanned++; } } @@ -413,7 +413,7 @@ return false; } -void G1RemSet::scan_rem_set(G1ParPushHeapRSClosure* oops_in_heap_closure, +void G1RemSet::scan_rem_set(G1ScanObjsDuringScanRSClosure* oops_in_heap_closure, CodeBlobClosure* heap_region_codeblobs, uint worker_i) { double rs_time_start = os::elapsedTime(); @@ -441,11 +441,11 @@ class RefineRecordRefsIntoCSCardTableEntryClosure: public CardTableEntryClosure { G1RemSet* _g1rs; DirtyCardQueue* _into_cset_dcq; - G1ParPushHeapRSClosure* _cl; + G1ScanObjsDuringUpdateRSClosure* _cl; public: RefineRecordRefsIntoCSCardTableEntryClosure(G1CollectedHeap* g1h, DirtyCardQueue* into_cset_dcq, - G1ParPushHeapRSClosure* cl) : + G1ScanObjsDuringUpdateRSClosure* cl) : _g1rs(g1h->g1_rem_set()), _into_cset_dcq(into_cset_dcq), _cl(cl) {} @@ -455,9 +455,8 @@ // is during RSet updating within an evacuation pause. // In this case worker_i should be the id of a GC worker thread. assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause"); - assert(worker_i < ParallelGCThreads, "should be a GC worker"); - if (_g1rs->refine_card_during_gc(card_ptr, worker_i, _cl)) { + if (_g1rs->refine_card_during_gc(card_ptr, _cl)) { // 'card_ptr' contains references that point into the collection // set. We need to record the card in the DCQS // (_into_cset_dirty_card_queue_set) @@ -471,7 +470,7 @@ }; void G1RemSet::update_rem_set(DirtyCardQueue* into_cset_dcq, - G1ParPushHeapRSClosure* oops_in_heap_closure, + G1ScanObjsDuringUpdateRSClosure* oops_in_heap_closure, uint worker_i) { RefineRecordRefsIntoCSCardTableEntryClosure into_cset_update_rs_cl(_g1, into_cset_dcq, oops_in_heap_closure); @@ -489,7 +488,7 @@ HeapRegionRemSet::cleanup(); } -void G1RemSet::oops_into_collection_set_do(G1ParPushHeapRSClosure* cl, +void G1RemSet::oops_into_collection_set_do(G1ParScanThreadState* pss, CodeBlobClosure* heap_region_codeblobs, uint worker_i) { // A DirtyCardQueue that is used to hold cards containing references @@ -503,8 +502,14 @@ // DirtyCardQueueSet that is used to manage RSet updates DirtyCardQueue into_cset_dcq(&_into_cset_dirty_card_queue_set); - update_rem_set(&into_cset_dcq, cl, worker_i); - scan_rem_set(cl, heap_region_codeblobs, worker_i);; + { + G1ScanObjsDuringUpdateRSClosure cl(_g1, pss, worker_i); + update_rem_set(&into_cset_dcq, &cl, worker_i); + } + { + G1ScanObjsDuringScanRSClosure cl(_g1, pss); + scan_rem_set(&cl, heap_region_codeblobs, worker_i);; + } } void G1RemSet::prepare_for_oops_into_collection_set_do() { @@ -579,17 +584,6 @@ #endif } -G1UpdateRSOrPushRefOopClosure::G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h, - G1ParPushHeapRSClosure* push_ref_cl, - bool record_refs_into_cset, - uint worker_i) : - _g1(g1h), - _from(NULL), - _record_refs_into_cset(record_refs_into_cset), - _has_refs_into_cset(false), - _push_ref_cl(push_ref_cl), - _worker_i(worker_i) { } - void G1RemSet::refine_card_concurrently(jbyte* card_ptr, uint worker_i) { assert(!_g1->is_gc_active(), "Only call concurrently"); @@ -740,8 +734,7 @@ } bool G1RemSet::refine_card_during_gc(jbyte* card_ptr, - uint worker_i, - G1ParPushHeapRSClosure* oops_in_heap_closure) { + G1ScanObjsDuringUpdateRSClosure* oops_in_heap_closure) { assert(_g1->is_gc_active(), "Only call during GC"); check_card_ptr(card_ptr, _ct_bs); @@ -775,19 +768,14 @@ MemRegion dirty_region(card_start, MIN2(scan_limit, card_end)); assert(!dirty_region.is_empty(), "sanity"); - G1UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1, - oops_in_heap_closure, - true, - worker_i); - update_rs_oop_cl.set_from(r); + oops_in_heap_closure->set_region(r); + oops_in_heap_closure->reset_has_refs_into_cset(); - bool card_processed = - r->oops_on_card_seq_iterate_careful(dirty_region, - &update_rs_oop_cl); + bool card_processed = r->oops_on_card_seq_iterate_careful(dirty_region, oops_in_heap_closure); assert(card_processed, "must be"); _conc_refine_cards++; - return update_rs_oop_cl.has_refs_into_cset(); + return oops_in_heap_closure->has_refs_into_cset(); } void G1RemSet::print_periodic_summary_info(const char* header, uint period_count) { --- old/src/share/vm/gc/g1/g1RemSet.hpp 2017-06-23 11:37:45.315188724 +0200 +++ new/src/share/vm/gc/g1/g1RemSet.hpp 2017-06-23 11:37:45.187184770 +0200 @@ -41,10 +41,12 @@ class CodeBlobClosure; class G1CollectedHeap; class G1HotCardCache; -class G1ParPushHeapRSClosure; class G1RemSetScanState; +class G1ParScanThreadState; class G1Policy; class G1SATBCardTableModRefBS; +class G1ScanObjsDuringScanRSClosure; +class G1ScanObjsDuringUpdateRSClosure; class HeapRegionClaimer; // A G1RemSet in which each heap region has a rem set that records the @@ -94,21 +96,12 @@ G1HotCardCache* hot_card_cache); ~G1RemSet(); - // Invoke "cl->do_oop" on all pointers into the collection set - // from objects in regions outside the collection set (having - // invoked "cl->set_region" to set the "from" region correctly - // beforehand.) + // Process all oops in the collection set from the cards in the refinement buffers and + // remembered sets using pss. // - // Apply non_heap_roots on the oops of the unmarked nmethods - // on the strong code roots list for each region in the - // collection set. - // - // The "worker_i" param is for the parallel case where the id - // of the worker thread calling this function can be helpful in - // partitioning the work to be done. It should be the same as - // the "i" passed to the calling thread's work(i) function. - // In the sequential case this param will be ignored. - void oops_into_collection_set_do(G1ParPushHeapRSClosure* cl, + // Further applies heap_region_codeblobs on the oops of the unmarked nmethods on the strong code + // roots list for each region in the collection set. + void oops_into_collection_set_do(G1ParScanThreadState* pss, CodeBlobClosure* heap_region_codeblobs, uint worker_i); @@ -120,7 +113,7 @@ void prepare_for_oops_into_collection_set_do(); void cleanup_after_oops_into_collection_set_do(); - void scan_rem_set(G1ParPushHeapRSClosure* oops_in_heap_closure, + void scan_rem_set(G1ScanObjsDuringScanRSClosure* oops_in_heap_closure, CodeBlobClosure* heap_region_codeblobs, uint worker_i); @@ -128,7 +121,7 @@ // Flush remaining refinement buffers into the remembered set, // applying oops_in_heap_closure on the references found. - void update_rem_set(DirtyCardQueue* into_cset_dcq, G1ParPushHeapRSClosure* oops_in_heap_closure, uint worker_i); + void update_rem_set(DirtyCardQueue* into_cset_dcq, G1ScanObjsDuringUpdateRSClosure* oops_in_heap_closure, uint worker_i); // Record, if necessary, the fact that *p (where "p" is in region "from", // which is required to be non-NULL) has changed to a new non-NULL value. @@ -149,8 +142,7 @@ // Refine the card corresponding to "card_ptr". Returns "true" if the given card contains // oops that have references into the current collection set. bool refine_card_during_gc(jbyte* card_ptr, - uint worker_i, - G1ParPushHeapRSClosure* oops_in_heap_closure); + G1ScanObjsDuringUpdateRSClosure* oops_in_heap_closure); // Print accumulated summary info from the start of the VM. void print_summary_info(); @@ -188,7 +180,7 @@ G1CollectedHeap* _g1h; - G1ParPushHeapRSClosure* _push_heap_cl; + G1ScanObjsDuringScanRSClosure* _scan_objs_on_card_cl; CodeBlobClosure* _code_root_cl; G1BlockOffsetTable* _bot; @@ -202,7 +194,7 @@ void scan_strong_code_roots(HeapRegion* r); public: G1ScanRSClosure(G1RemSetScanState* scan_state, - G1ParPushHeapRSClosure* push_heap_cl, + G1ScanObjsDuringScanRSClosure* scan_obj_on_card, CodeBlobClosure* code_root_cl, uint worker_i); --- old/src/share/vm/gc/g1/g1RootProcessor.hpp 2017-06-23 11:37:45.941208061 +0200 +++ new/src/share/vm/gc/g1/g1RootProcessor.hpp 2017-06-23 11:37:45.810204014 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -34,7 +34,6 @@ class G1CollectedHeap; class G1EvacuationRootClosures; class G1GCPhaseTimes; -class G1ParPushHeapRSClosure; class G1RootClosures; class Monitor; class OopClosure; --- old/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp 2017-06-23 11:37:46.563227274 +0200 +++ new/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp 2017-06-23 11:37:46.433223259 +0200 @@ -32,19 +32,19 @@ // Forward declarations. -class G1ParScanClosure; -class G1ParPushHeapRSClosure; +class G1ScanEvacuatedObjClosure; -class G1UpdateRSOrPushRefOopClosure; +class G1ScanObjsDuringUpdateRSClosure; +class G1ScanObjsDuringScanRSClosure; class G1ConcurrentRefineOopClosure; class G1CMOopClosure; class G1RootRegionScanClosure; #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ - f(G1ParScanClosure,_nv) \ - f(G1ParPushHeapRSClosure,_nv) \ - f(G1UpdateRSOrPushRefOopClosure,_nv) \ + f(G1ScanEvacuatedObjClosure,_nv) \ + f(G1ScanObjsDuringUpdateRSClosure,_nv) \ + f(G1ScanObjsDuringScanRSClosure,_nv) \ f(G1ConcurrentRefineOopClosure,_nv) \ f(G1CMOopClosure,_nv) \ f(G1RootRegionScanClosure,_nv)