--- old/src/share/vm/gc/g1/g1OopClosures.hpp 2017-02-24 15:17:49.048702817 +0100 +++ new/src/share/vm/gc/g1/g1OopClosures.hpp 2017-02-24 15:17:48.937699487 +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 @@ -143,29 +143,6 @@ void do_klass(Klass* klass); }; -class FilterIntoCSClosure: public OopClosure { - G1CollectedHeap* _g1; - OopClosure* _oc; -public: - FilterIntoCSClosure(G1CollectedHeap* g1, OopClosure* oc) : _g1(g1), _oc(oc) { } - - template void do_oop_work(T* p); - virtual void do_oop(oop* p) { do_oop_work(p); } - virtual void do_oop(narrowOop* p) { do_oop_work(p); } -}; - -class FilterOutOfRegionClosure: public ExtendedOopClosure { - HeapWord* _r_bottom; - HeapWord* _r_end; - OopClosure* _oc; -public: - FilterOutOfRegionClosure(HeapRegion* r, OopClosure* oc); - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - bool apply_to_weak_ref_discovered_field() { return true; } -}; - // Closure for iterating over object fields during concurrent marking class G1CMOopClosure : public MetadataAwareOopClosure { protected: @@ -193,58 +170,16 @@ virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -// Closure that applies the given two closures in sequence. -// Used by the RSet refinement code (when updating RSets -// during an evacuation pause) to record cards containing -// pointers into the collection set. - -class G1Mux2Closure : public OopClosure { - OopClosure* _c1; - OopClosure* _c2; -public: - G1Mux2Closure(OopClosure *c1, OopClosure *c2); - template inline void do_oop_work(T* p); - virtual inline void do_oop(oop* p); - virtual inline void do_oop(narrowOop* p); -}; - -// A closure that returns true if it is actually applied -// to a reference - -class G1TriggerClosure : public OopClosure { - bool _triggered; -public: - G1TriggerClosure(); - bool triggered() const { return _triggered; } - template inline void do_oop_work(T* p); - virtual inline void do_oop(oop* p); - virtual inline void do_oop(narrowOop* p); -}; - -// A closure which uses a triggering closure to determine -// whether to apply an oop closure. - -class G1InvokeIfNotTriggeredClosure: public OopClosure { - G1TriggerClosure* _trigger_cl; - OopClosure* _oop_cl; -public: - G1InvokeIfNotTriggeredClosure(G1TriggerClosure* t, OopClosure* oc); - template inline void do_oop_work(T* p); - virtual inline void do_oop(oop* p); - virtual inline void do_oop(narrowOop* p); -}; - -class G1UpdateRSOrPushRefOopClosure: public OopClosure { +class G1UpdateRSOrPushRefOopClosure: public ExtendedOopClosure { G1CollectedHeap* _g1; - G1RemSet* _g1_rem_set; HeapRegion* _from; G1ParPushHeapRSClosure* _push_ref_cl; bool _record_refs_into_cset; uint _worker_i; + bool _has_refs_into_cset; public: G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h, - G1RemSet* rs, G1ParPushHeapRSClosure* push_ref_cl, bool record_refs_into_cset, uint worker_i = 0); @@ -254,13 +189,17 @@ _from = from; } + bool apply_to_weak_ref_discovered_field() { return true; } + bool self_forwarded(oop obj) { markOop m = obj->mark(); bool result = (m->is_marked() && ((oop)m->decode_pointer() == obj)); return result; } - template inline void do_oop_work(T* p); + 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); };