Mercurial > hg > graal-compiler
diff src/share/vm/gc_implementation/g1/g1OopClosures.hpp @ 17687:86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
Summary: Move methods that are not dependent on any of G1ParCopyClosure's template parameters into G1ParCopyHelper. Further remove unused methods and members of the class hierarchy.
Reviewed-by: mgerdin, stefank
author | tschatzl |
---|---|
date | Wed, 26 Feb 2014 15:32:40 +0100 |
parents | 5a9a209853bf |
children | 97300b6165f8 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1OopClosures.hpp Wed Jan 08 13:20:33 2014 +0100 +++ b/src/share/vm/gc_implementation/g1/g1OopClosures.hpp Wed Feb 26 15:32:40 2014 +0100 @@ -48,12 +48,8 @@ class G1ParClosureSuper : public OopsInHeapRegionClosure { protected: G1CollectedHeap* _g1; - G1RemSet* _g1_rem; - ConcurrentMark* _cm; G1ParScanThreadState* _par_scan_state; uint _worker_id; - bool _during_initial_mark; - bool _mark_in_progress; public: G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); bool apply_to_weak_ref_discovered_field() { return true; } @@ -133,12 +129,21 @@ // Add back base class for metadata class G1ParCopyHelper : public G1ParClosureSuper { +protected: Klass* _scanned_klass; + ConcurrentMark* _cm; + // Mark the object if it's not already marked. This is used to mark + // objects pointed to by roots that are guaranteed not to move + // during the GC (i.e., non-CSet objects). It is MT-safe. + void mark_object(oop obj); + + // Mark the object if it's not already marked. This is used to mark + // objects pointed to by roots that have been forwarded during a + // GC. It is MT-safe. + void mark_forwarded_object(oop from_obj, oop to_obj); public: - G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : - _scanned_klass(NULL), - G1ParClosureSuper(g1, par_scan_state) {} + G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); void set_scanned_klass(Klass* k) { _scanned_klass = k; } template <class T> void do_klass_barrier(T* p, oop new_obj); @@ -150,16 +155,6 @@ template <class T> void do_oop_work(T* p); protected: - // Mark the object if it's not already marked. This is used to mark - // objects pointed to by roots that are guaranteed not to move - // during the GC (i.e., non-CSet objects). It is MT-safe. - void mark_object(oop obj); - - // Mark the object if it's not already marked. This is used to mark - // objects pointed to by roots that have been forwarded during a - // GC. It is MT-safe. - void mark_forwarded_object(oop from_obj, oop to_obj); - oop copy_to_survivor_space(oop obj); public: @@ -172,9 +167,7 @@ G1ParScanClosure* scanner() { return &_scanner; } - template <class T> void do_oop_nv(T* p) { - do_oop_work(p); - } + template <class T> void do_oop_nv(T* p) { do_oop_work(p); } virtual void do_oop(oop* p) { do_oop_nv(p); } virtual void do_oop(narrowOop* p) { do_oop_nv(p); } };