Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp @ 21209:629cc690c4c6
Fix instanceof with checking arrays of interface
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Thu, 30 Apr 2015 18:09:36 +0200 |
parents | 7848fc12602b |
children |
rev | line source |
---|---|
0 | 1 /* |
14223
de6a9e811145
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
11975
diff
changeset
|
2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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:
994
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
994
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:
994
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP | |
27 | |
28 #include "memory/genOopClosures.hpp" | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
29 #include "memory/iterator.hpp" |
1972 | 30 |
0 | 31 ///////////////////////////////////////////////////////////////// |
32 // Closures used by ConcurrentMarkSweepGeneration's collector | |
33 ///////////////////////////////////////////////////////////////// | |
34 class ConcurrentMarkSweepGeneration; | |
35 class CMSBitMap; | |
36 class CMSMarkStack; | |
37 class CMSCollector; | |
38 class MarkFromRootsClosure; | |
39 class Par_MarkFromRootsClosure; | |
40 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
41 // Decode the oop and call do_oop on it. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
42 #define DO_OOP_WORK_DEFN \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
43 void do_oop(oop obj); \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
44 template <class T> inline void do_oop_work(T* p) { \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
45 T heap_oop = oopDesc::load_heap_oop(p); \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
46 if (!oopDesc::is_null(heap_oop)) { \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
47 oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
48 do_oop(obj); \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
49 } \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
50 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
51 |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
52 // TODO: This duplication of the MetadataAwareOopClosure class is only needed |
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
53 // because some CMS OopClosures derive from OopsInGenClosure. It would be |
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
54 // good to get rid of them completely. |
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
55 class MetadataAwareOopsInGenClosure: public OopsInGenClosure { |
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
56 KlassToOopClosure _klass_closure; |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
57 public: |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
58 MetadataAwareOopsInGenClosure() { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
59 _klass_closure.initialize(this); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
60 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
61 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
62 virtual bool do_metadata() { return do_metadata_nv(); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
63 inline bool do_metadata_nv() { return true; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
64 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
65 virtual void do_klass(Klass* k); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
66 void do_klass_nv(Klass* k); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
67 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
68 virtual void do_class_loader_data(ClassLoaderData* cld); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
69 }; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
70 |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
71 class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
72 private: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
73 const MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
74 CMSBitMap* _bitMap; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
75 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
76 DO_OOP_WORK_DEFN |
0 | 77 public: |
994
753cf9794df9
6885169: merge of 4957990 and 6863023 causes conflict on do_nmethods
jrose
parents:
993
diff
changeset
|
78 MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
79 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
80 virtual void do_oop(narrowOop* p); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
81 |
0 | 82 Prefetch::style prefetch_style() { |
83 return Prefetch::do_read; | |
84 } | |
85 }; | |
86 | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
87 class Par_MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { |
11975 | 88 private: |
89 const MemRegion _span; | |
90 CMSBitMap* _bitMap; | |
91 protected: | |
92 DO_OOP_WORK_DEFN | |
93 public: | |
94 Par_MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap); | |
95 virtual void do_oop(oop* p); | |
96 virtual void do_oop(narrowOop* p); | |
97 | |
98 Prefetch::style prefetch_style() { | |
99 return Prefetch::do_read; | |
100 } | |
101 }; | |
102 | |
0 | 103 // A variant of the above used in certain kinds of CMS |
104 // marking verification. | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
105 class MarkRefsIntoVerifyClosure: public MetadataAwareOopsInGenClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
106 private: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
107 const MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
108 CMSBitMap* _verification_bm; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
109 CMSBitMap* _cms_bm; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
110 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
111 DO_OOP_WORK_DEFN |
0 | 112 public: |
113 MarkRefsIntoVerifyClosure(MemRegion span, CMSBitMap* verification_bm, | |
994
753cf9794df9
6885169: merge of 4957990 and 6863023 causes conflict on do_nmethods
jrose
parents:
993
diff
changeset
|
114 CMSBitMap* cms_bm); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
115 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
116 virtual void do_oop(narrowOop* p); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
117 |
0 | 118 Prefetch::style prefetch_style() { |
119 return Prefetch::do_read; | |
120 } | |
121 }; | |
122 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
123 // The non-parallel version (the parallel version appears further below). |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
124 class PushAndMarkClosure: public MetadataAwareOopClosure { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
125 private: |
935 | 126 CMSCollector* _collector; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
127 MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
128 CMSBitMap* _bit_map; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
129 CMSBitMap* _mod_union_table; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
130 CMSMarkStack* _mark_stack; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
131 bool _concurrent_precleaning; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
132 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
133 DO_OOP_WORK_DEFN |
0 | 134 public: |
135 PushAndMarkClosure(CMSCollector* collector, | |
136 MemRegion span, | |
137 ReferenceProcessor* rp, | |
138 CMSBitMap* bit_map, | |
139 CMSBitMap* mod_union_table, | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
140 CMSMarkStack* mark_stack, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
141 bool concurrent_precleaning); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
142 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
143 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
144 inline void do_oop_nv(oop* p) { PushAndMarkClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
145 inline void do_oop_nv(narrowOop* p) { PushAndMarkClosure::do_oop_work(p); } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
146 |
0 | 147 Prefetch::style prefetch_style() { |
148 return Prefetch::do_read; | |
149 } | |
150 }; | |
151 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
152 // In the parallel case, the bit map and the |
0 | 153 // reference processor are currently all shared. Access to |
154 // these shared mutable structures must use appropriate | |
155 // synchronization (for instance, via CAS). The marking stack | |
156 // used in the non-parallel case above is here replaced with | |
157 // an OopTaskQueue structure to allow efficient work stealing. | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
158 class Par_PushAndMarkClosure: public MetadataAwareOopClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
159 private: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
160 CMSCollector* _collector; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
161 MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
162 CMSBitMap* _bit_map; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
163 OopTaskQueue* _work_queue; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
164 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
165 DO_OOP_WORK_DEFN |
0 | 166 public: |
167 Par_PushAndMarkClosure(CMSCollector* collector, | |
168 MemRegion span, | |
169 ReferenceProcessor* rp, | |
170 CMSBitMap* bit_map, | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
171 OopTaskQueue* work_queue); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
172 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
173 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
174 inline void do_oop_nv(oop* p) { Par_PushAndMarkClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
175 inline void do_oop_nv(narrowOop* p) { Par_PushAndMarkClosure::do_oop_work(p); } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
176 |
0 | 177 Prefetch::style prefetch_style() { |
178 return Prefetch::do_read; | |
179 } | |
180 }; | |
181 | |
182 // The non-parallel version (the parallel version appears further below). | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
183 class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
184 private: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
185 MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
186 CMSBitMap* _bit_map; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
187 CMSMarkStack* _mark_stack; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
188 PushAndMarkClosure _pushAndMarkClosure; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
189 CMSCollector* _collector; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
190 Mutex* _freelistLock; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
191 bool _yield; |
0 | 192 // Whether closure is being used for concurrent precleaning |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
193 bool _concurrent_precleaning; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
194 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
195 DO_OOP_WORK_DEFN |
0 | 196 public: |
197 MarkRefsIntoAndScanClosure(MemRegion span, | |
198 ReferenceProcessor* rp, | |
199 CMSBitMap* bit_map, | |
200 CMSBitMap* mod_union_table, | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
201 CMSMarkStack* mark_stack, |
0 | 202 CMSCollector* collector, |
203 bool should_yield, | |
204 bool concurrent_precleaning); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
205 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
206 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
207 inline void do_oop_nv(oop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
208 inline void do_oop_nv(narrowOop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
209 |
0 | 210 Prefetch::style prefetch_style() { |
211 return Prefetch::do_read; | |
212 } | |
213 void set_freelistLock(Mutex* m) { | |
214 _freelistLock = m; | |
215 } | |
216 | |
217 private: | |
218 inline void do_yield_check(); | |
219 void do_yield_work(); | |
220 bool take_from_overflow_list(); | |
221 }; | |
222 | |
223 // Tn this, the parallel avatar of MarkRefsIntoAndScanClosure, the revisit | |
224 // stack and the bitMap are shared, so access needs to be suitably | |
225 // sycnhronized. An OopTaskQueue structure, supporting efficient | |
226 // workstealing, replaces a CMSMarkStack for storing grey objects. | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
227 class Par_MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
228 private: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
229 MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
230 CMSBitMap* _bit_map; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
231 OopTaskQueue* _work_queue; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
232 const uint _low_water_mark; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
233 Par_PushAndMarkClosure _par_pushAndMarkClosure; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
234 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
235 DO_OOP_WORK_DEFN |
0 | 236 public: |
237 Par_MarkRefsIntoAndScanClosure(CMSCollector* collector, | |
238 MemRegion span, | |
239 ReferenceProcessor* rp, | |
240 CMSBitMap* bit_map, | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
241 OopTaskQueue* work_queue); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
242 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
243 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
244 inline void do_oop_nv(oop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
245 inline void do_oop_nv(narrowOop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
246 |
0 | 247 Prefetch::style prefetch_style() { |
248 return Prefetch::do_read; | |
249 } | |
250 void trim_queue(uint size); | |
251 }; | |
252 | |
253 // This closure is used during the concurrent marking phase | |
254 // following the first checkpoint. Its use is buried in | |
255 // the closure MarkFromRootsClosure. | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
256 class PushOrMarkClosure: public MetadataAwareOopClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
257 private: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
258 CMSCollector* _collector; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
259 MemRegion _span; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
260 CMSBitMap* _bitMap; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
261 CMSMarkStack* _markStack; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
262 HeapWord* const _finger; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
263 MarkFromRootsClosure* const |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
264 _parent; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
265 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
266 DO_OOP_WORK_DEFN |
0 | 267 public: |
268 PushOrMarkClosure(CMSCollector* cms_collector, | |
269 MemRegion span, | |
270 CMSBitMap* bitMap, | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
271 CMSMarkStack* markStack, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
272 HeapWord* finger, |
0 | 273 MarkFromRootsClosure* parent); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
274 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
275 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
276 inline void do_oop_nv(oop* p) { PushOrMarkClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
277 inline void do_oop_nv(narrowOop* p) { PushOrMarkClosure::do_oop_work(p); } |
941 | 278 |
0 | 279 // Deal with a stack overflow condition |
280 void handle_stack_overflow(HeapWord* lost); | |
281 private: | |
282 inline void do_yield_check(); | |
283 }; | |
284 | |
285 // A parallel (MT) version of the above. | |
286 // This closure is used during the concurrent marking phase | |
287 // following the first checkpoint. Its use is buried in | |
288 // the closure Par_MarkFromRootsClosure. | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
289 class Par_PushOrMarkClosure: public MetadataAwareOopClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
290 private: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
291 CMSCollector* _collector; |
0 | 292 MemRegion _whole_span; |
293 MemRegion _span; // local chunk | |
294 CMSBitMap* _bit_map; | |
295 OopTaskQueue* _work_queue; | |
296 CMSMarkStack* _overflow_stack; | |
297 HeapWord* const _finger; | |
298 HeapWord** const _global_finger_addr; | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
299 Par_MarkFromRootsClosure* const |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
300 _parent; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
301 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
302 DO_OOP_WORK_DEFN |
0 | 303 public: |
304 Par_PushOrMarkClosure(CMSCollector* cms_collector, | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
305 MemRegion span, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
306 CMSBitMap* bit_map, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
307 OopTaskQueue* work_queue, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
308 CMSMarkStack* mark_stack, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
309 HeapWord* finger, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
310 HeapWord** global_finger_addr, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
311 Par_MarkFromRootsClosure* parent); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
312 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
313 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
314 inline void do_oop_nv(oop* p) { Par_PushOrMarkClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
315 inline void do_oop_nv(narrowOop* p) { Par_PushOrMarkClosure::do_oop_work(p); } |
941 | 316 |
0 | 317 // Deal with a stack overflow condition |
318 void handle_stack_overflow(HeapWord* lost); | |
319 private: | |
320 inline void do_yield_check(); | |
321 }; | |
322 | |
323 // For objects in CMS generation, this closure marks | |
324 // given objects (transitively) as being reachable/live. | |
325 // This is currently used during the (weak) reference object | |
452
00b023ae2d78
6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents:
143
diff
changeset
|
326 // processing phase of the CMS final checkpoint step, as |
00b023ae2d78
6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents:
143
diff
changeset
|
327 // well as during the concurrent precleaning of the discovered |
00b023ae2d78
6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents:
143
diff
changeset
|
328 // reference lists. |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
329 class CMSKeepAliveClosure: public MetadataAwareOopClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
330 private: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
331 CMSCollector* _collector; |
143
b5489bb705c9
6662086: 6u4+, 7b11+: CMS never clears referents when -XX:+ParallelRefProcEnabled
ysr
parents:
113
diff
changeset
|
332 const MemRegion _span; |
0 | 333 CMSMarkStack* _mark_stack; |
334 CMSBitMap* _bit_map; | |
452
00b023ae2d78
6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents:
143
diff
changeset
|
335 bool _concurrent_precleaning; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
336 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
337 DO_OOP_WORK_DEFN |
0 | 338 public: |
339 CMSKeepAliveClosure(CMSCollector* collector, MemRegion span, | |
452
00b023ae2d78
6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents:
143
diff
changeset
|
340 CMSBitMap* bit_map, CMSMarkStack* mark_stack, |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
341 bool cpc); |
452
00b023ae2d78
6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents:
143
diff
changeset
|
342 bool concurrent_precleaning() const { return _concurrent_precleaning; } |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
343 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
344 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
345 inline void do_oop_nv(oop* p) { CMSKeepAliveClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
346 inline void do_oop_nv(narrowOop* p) { CMSKeepAliveClosure::do_oop_work(p); } |
0 | 347 }; |
348 | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
349 class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
350 private: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
351 CMSCollector* _collector; |
0 | 352 MemRegion _span; |
353 OopTaskQueue* _work_queue; | |
354 CMSBitMap* _bit_map; | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
355 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
356 DO_OOP_WORK_DEFN |
0 | 357 public: |
358 CMSInnerParMarkAndPushClosure(CMSCollector* collector, | |
359 MemRegion span, CMSBitMap* bit_map, | |
935 | 360 OopTaskQueue* work_queue); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
361 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
362 virtual void do_oop(narrowOop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
363 inline void do_oop_nv(oop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
364 inline void do_oop_nv(narrowOop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); } |
0 | 365 }; |
366 | |
367 // A parallel (MT) version of the above, used when | |
368 // reference processing is parallel; the only difference | |
369 // is in the do_oop method. | |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
14223
diff
changeset
|
370 class CMSParKeepAliveClosure: public MetadataAwareOopClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
371 private: |
0 | 372 MemRegion _span; |
373 OopTaskQueue* _work_queue; | |
374 CMSBitMap* _bit_map; | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
375 CMSInnerParMarkAndPushClosure |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
376 _mark_and_push; |
0 | 377 const uint _low_water_mark; |
378 void trim_queue(uint max); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
379 protected: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
380 DO_OOP_WORK_DEFN |
0 | 381 public: |
382 CMSParKeepAliveClosure(CMSCollector* collector, MemRegion span, | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
383 CMSBitMap* bit_map, OopTaskQueue* work_queue); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
384 virtual void do_oop(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
385 virtual void do_oop(narrowOop* p); |
0 | 386 }; |
1972 | 387 |
388 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP |