Mercurial > hg > graal-jvmci-8
annotate src/share/vm/gc_implementation/g1/g1OopClosures.hpp @ 20417:d35872270666
8057658: Enable G1 FullGC extensions
Summary: Refactored the G1 FullGC code to enable it to be extended.
Reviewed-by: mgerdin, brutisso
author | sjohanss |
---|---|
date | Tue, 09 Sep 2014 00:05:25 +0200 |
parents | 2c6ef90f030a |
children | 7848fc12602b c132be0fb74d b554c7fa9478 |
rev | line source |
---|---|
342 | 1 /* |
17650
5a9a209853bf
6991197: G1: specialize deal_with_reference() for narrowOop*
tschatzl
parents:
17636
diff
changeset
|
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
342 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1261
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1261
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1261
diff
changeset
|
21 * questions. |
342 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP | |
27 | |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
28 #include "memory/iterator.hpp" |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
29 |
342 | 30 class HeapRegion; |
31 class G1CollectedHeap; | |
32 class G1RemSet; | |
33 class ConcurrentMark; | |
34 class DirtyCardToOopClosure; | |
35 class CMBitMap; | |
36 class CMMarkStack; | |
37 class G1ParScanThreadState; | |
3771 | 38 class CMTask; |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
39 class ReferenceProcessor; |
342 | 40 |
41 // A class that scans oops in a given heap region (much as OopsInGenClosure | |
42 // scans oops in a generation.) | |
17636
889068b9a088
8027746: Remove do_gen_barrier template parameter in G1ParCopyClosure
tschatzl
parents:
12316
diff
changeset
|
43 class OopsInHeapRegionClosure: public ExtendedOopClosure { |
342 | 44 protected: |
45 HeapRegion* _from; | |
46 public: | |
3765
ae5b2f1dcf12
7045662: G1: OopsInHeapRegionClosure::set_region() should not be virtual
tonyp
parents:
1972
diff
changeset
|
47 void set_region(HeapRegion* from) { _from = from; } |
342 | 48 }; |
49 | |
50 class G1ParClosureSuper : public OopsInHeapRegionClosure { | |
51 protected: | |
52 G1CollectedHeap* _g1; | |
53 G1ParScanThreadState* _par_scan_state; | |
4836
d30fa85f9994
6484965: G1: piggy-back liveness accounting phase on marking
johnc
parents:
4787
diff
changeset
|
54 uint _worker_id; |
342 | 55 public: |
20225
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
56 // Initializes the instance, leaving _par_scan_state uninitialized. Must be done |
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
57 // later using the set_par_scan_thread_state() method. |
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
58 G1ParClosureSuper(G1CollectedHeap* g1); |
342 | 59 G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); |
60 bool apply_to_weak_ref_discovered_field() { return true; } | |
20225
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
61 |
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
62 void set_par_scan_thread_state(G1ParScanThreadState* par_scan_state); |
342 | 63 }; |
64 | |
1261 | 65 class G1ParPushHeapRSClosure : public G1ParClosureSuper { |
66 public: | |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
67 G1ParPushHeapRSClosure(G1CollectedHeap* g1, |
3983
811ec3d0833b
7097053: G1: assert(da ? referent->is_oop() : referent->is_oop_or_null()) failed: referenceProcessor.cpp:1054
johnc
parents:
3979
diff
changeset
|
68 G1ParScanThreadState* par_scan_state): |
811ec3d0833b
7097053: G1: assert(da ? referent->is_oop() : referent->is_oop_or_null()) failed: referenceProcessor.cpp:1054
johnc
parents:
3979
diff
changeset
|
69 G1ParClosureSuper(g1, par_scan_state) { } |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
70 |
1261 | 71 template <class T> void do_oop_nv(T* p); |
72 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
73 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
74 }; | |
75 | |
342 | 76 class G1ParScanClosure : public G1ParClosureSuper { |
77 public: | |
20225
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
78 G1ParScanClosure(G1CollectedHeap* g1, ReferenceProcessor* rp) : |
cd43876f692e
8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate
tschatzl
parents:
17844
diff
changeset
|
79 G1ParClosureSuper(g1) { |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
80 assert(_ref_processor == NULL, "sanity"); |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
81 _ref_processor = rp; |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
82 } |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
83 |
845
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
84 template <class T> void do_oop_nv(T* p); |
342 | 85 virtual void do_oop(oop* p) { do_oop_nv(p); } |
86 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
87 }; | |
88 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
89 // Add back base class for metadata |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
90 class G1ParCopyHelper : public G1ParClosureSuper { |
17687
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
91 protected: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
92 Klass* _scanned_klass; |
17687
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
93 ConcurrentMark* _cm; |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
94 |
17687
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
95 // Mark the object if it's not already marked. This is used to mark |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
96 // objects pointed to by roots that are guaranteed not to move |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
97 // during the GC (i.e., non-CSet objects). It is MT-safe. |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
98 void mark_object(oop obj); |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
99 |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
100 // Mark the object if it's not already marked. This is used to mark |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
101 // objects pointed to by roots that have been forwarded during a |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
102 // GC. It is MT-safe. |
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
103 void mark_forwarded_object(oop from_obj, oop to_obj); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
104 public: |
17687
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
105 G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
106 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
107 void set_scanned_klass(Klass* k) { _scanned_klass = k; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
108 template <class T> void do_klass_barrier(T* p, oop new_obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
109 }; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
110 |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
111 template <G1Barrier barrier, G1Mark do_mark_object> |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
112 class G1ParCopyClosure : public G1ParCopyHelper { |
17689
5d492d192cbf
8035329: Move G1ParCopyClosure::copy_to_survivor_space into G1ParScanThreadState
tschatzl
parents:
17687
diff
changeset
|
113 private: |
5987 | 114 template <class T> void do_oop_work(T* p); |
342 | 115 |
116 public: | |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
117 G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state, |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
118 ReferenceProcessor* rp) : |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
119 G1ParCopyHelper(g1, par_scan_state) { |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
120 assert(_ref_processor == NULL, "sanity"); |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
121 } |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
122 |
17687
86b64209f715
8027559: Decrease code size and templatizing in G1ParCopyClosure::do_oop_work
tschatzl
parents:
17650
diff
changeset
|
123 template <class T> void do_oop_nv(T* p) { do_oop_work(p); } |
342 | 124 virtual void do_oop(oop* p) { do_oop_nv(p); } |
125 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
126 |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
127 G1CollectedHeap* g1() { return _g1; }; |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
128 G1ParScanThreadState* pss() { return _par_scan_state; } |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
129 ReferenceProcessor* rp() { return _ref_processor; }; |
342 | 130 }; |
131 | |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
132 typedef G1ParCopyClosure<G1BarrierNone, G1MarkNone> G1ParScanExtRootClosure; |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
133 typedef G1ParCopyClosure<G1BarrierNone, G1MarkFromRoot> G1ParScanAndMarkExtRootClosure; |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
134 typedef G1ParCopyClosure<G1BarrierNone, G1MarkPromotedFromRoot> G1ParScanAndMarkWeakExtRootClosure; |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
135 // We use a separate closure to handle references during evacuation |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
136 // failure processing. |
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
137 |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
138 typedef G1ParCopyClosure<G1BarrierEvac, G1MarkNone> G1ParScanHeapEvacFailureClosure; |
342 | 139 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
140 class FilterIntoCSClosure: public ExtendedOopClosure { |
342 | 141 G1CollectedHeap* _g1; |
142 OopClosure* _oc; | |
143 DirtyCardToOopClosure* _dcto_cl; | |
144 public: | |
145 FilterIntoCSClosure( DirtyCardToOopClosure* dcto_cl, | |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
146 G1CollectedHeap* g1, |
3983
811ec3d0833b
7097053: G1: assert(da ? referent->is_oop() : referent->is_oop_or_null()) failed: referenceProcessor.cpp:1054
johnc
parents:
3979
diff
changeset
|
147 OopClosure* oc) : |
811ec3d0833b
7097053: G1: assert(da ? referent->is_oop() : referent->is_oop_or_null()) failed: referenceProcessor.cpp:1054
johnc
parents:
3979
diff
changeset
|
148 _dcto_cl(dcto_cl), _g1(g1), _oc(oc) { } |
3979
4dfb2df418f2
6484982: G1: process references during evacuation pauses
johnc
parents:
3973
diff
changeset
|
149 |
845
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
150 template <class T> void do_oop_nv(T* p); |
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
151 virtual void do_oop(oop* p) { do_oop_nv(p); } |
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
152 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
342 | 153 bool apply_to_weak_ref_discovered_field() { return true; } |
154 }; | |
155 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
156 class FilterOutOfRegionClosure: public ExtendedOopClosure { |
342 | 157 HeapWord* _r_bottom; |
158 HeapWord* _r_end; | |
159 OopClosure* _oc; | |
160 public: | |
161 FilterOutOfRegionClosure(HeapRegion* r, OopClosure* oc); | |
845
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
162 template <class T> void do_oop_nv(T* p); |
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
163 virtual void do_oop(oop* p) { do_oop_nv(p); } |
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
579
diff
changeset
|
164 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
342 | 165 bool apply_to_weak_ref_discovered_field() { return true; } |
166 }; | |
1972 | 167 |
3771 | 168 // Closure for iterating over object fields during concurrent marking |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
169 class G1CMOopClosure : public MetadataAwareOopClosure { |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
170 protected: |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
171 ConcurrentMark* _cm; |
4837
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
172 private: |
3771 | 173 G1CollectedHeap* _g1h; |
174 CMTask* _task; | |
175 public: | |
176 G1CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task); | |
177 template <class T> void do_oop_nv(T* p); | |
178 virtual void do_oop( oop* p) { do_oop_nv(p); } | |
179 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
180 }; | |
181 | |
4837
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
182 // Closure to scan the root regions during concurrent marking |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
20225
diff
changeset
|
183 class G1RootRegionScanClosure : public MetadataAwareOopClosure { |
4837
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
184 private: |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
185 G1CollectedHeap* _g1h; |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
186 ConcurrentMark* _cm; |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
187 uint _worker_id; |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
188 public: |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
189 G1RootRegionScanClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
190 uint worker_id) : |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
191 _g1h(g1h), _cm(cm), _worker_id(worker_id) { } |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
192 template <class T> void do_oop_nv(T* p); |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
193 virtual void do_oop( oop* p) { do_oop_nv(p); } |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
194 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
195 }; |
eff609af17d7
7127706: G1: re-enable survivors during the initial-mark pause
tonyp
parents:
4836
diff
changeset
|
196 |
4839 | 197 // Closure that applies the given two closures in sequence. |
198 // Used by the RSet refinement code (when updating RSets | |
199 // during an evacuation pause) to record cards containing | |
200 // pointers into the collection set. | |
201 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
202 class G1Mux2Closure : public ExtendedOopClosure { |
4839 | 203 OopClosure* _c1; |
204 OopClosure* _c2; | |
205 public: | |
206 G1Mux2Closure(OopClosure *c1, OopClosure *c2); | |
207 template <class T> void do_oop_nv(T* p); | |
208 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
209 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
210 }; | |
211 | |
212 // A closure that returns true if it is actually applied | |
213 // to a reference | |
214 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
215 class G1TriggerClosure : public ExtendedOopClosure { |
4839 | 216 bool _triggered; |
217 public: | |
218 G1TriggerClosure(); | |
219 bool triggered() const { return _triggered; } | |
220 template <class T> void do_oop_nv(T* p); | |
221 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
222 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
223 }; | |
224 | |
225 // A closure which uses a triggering closure to determine | |
226 // whether to apply an oop closure. | |
227 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
228 class G1InvokeIfNotTriggeredClosure: public ExtendedOopClosure { |
4839 | 229 G1TriggerClosure* _trigger_cl; |
230 OopClosure* _oop_cl; | |
231 public: | |
232 G1InvokeIfNotTriggeredClosure(G1TriggerClosure* t, OopClosure* oc); | |
233 template <class T> void do_oop_nv(T* p); | |
234 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
235 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
236 }; | |
237 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6254
diff
changeset
|
238 class G1UpdateRSOrPushRefOopClosure: public ExtendedOopClosure { |
4839 | 239 G1CollectedHeap* _g1; |
240 G1RemSet* _g1_rem_set; | |
241 HeapRegion* _from; | |
242 OopsInHeapRegionClosure* _push_ref_cl; | |
243 bool _record_refs_into_cset; | |
17844
8847586c9037
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
17759
diff
changeset
|
244 uint _worker_i; |
4839 | 245 |
246 public: | |
247 G1UpdateRSOrPushRefOopClosure(G1CollectedHeap* g1h, | |
248 G1RemSet* rs, | |
249 OopsInHeapRegionClosure* push_ref_cl, | |
250 bool record_refs_into_cset, | |
17844
8847586c9037
8016302: Change type of the number of GC workers to unsigned int (2)
vkempik
parents:
17759
diff
changeset
|
251 uint worker_i = 0); |
4839 | 252 |
253 void set_from(HeapRegion* from) { | |
254 assert(from != NULL, "from region must be non-NULL"); | |
255 _from = from; | |
256 } | |
257 | |
258 bool self_forwarded(oop obj) { | |
259 bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); | |
260 return result; | |
261 } | |
262 | |
263 bool apply_to_weak_ref_discovered_field() { return true; } | |
264 | |
265 template <class T> void do_oop_nv(T* p); | |
266 virtual void do_oop(narrowOop* p) { do_oop_nv(p); } | |
267 virtual void do_oop(oop* p) { do_oop_nv(p); } | |
268 }; | |
269 | |
1972 | 270 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP |