Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/parNew/parOopClosures.hpp @ 8090:2af22eb04623
Merge
author | vladidan |
---|---|
date | Thu, 21 Feb 2013 09:08:04 -0800 |
parents | da91efe96a93 |
children | 9766f73e770d |
rev | line source |
---|---|
0 | 1 /* |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6197
diff
changeset
|
2 * Copyright (c) 2007, 2012, 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:
113
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
113
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:
113
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP | |
27 | |
28 #include "memory/genOopClosures.hpp" | |
29 | |
0 | 30 // Closures for ParNewGeneration |
31 | |
32 class ParScanThreadState; | |
33 class ParNewGeneration; | |
1665 | 34 typedef Padded<OopTaskQueue> ObjToScanQueue; |
6197 | 35 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet; |
0 | 36 class ParallelTaskTerminator; |
37 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6197
diff
changeset
|
38 class ParScanClosure: public OopsInKlassOrGenClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
39 protected: |
0 | 40 ParScanThreadState* _par_scan_state; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
41 ParNewGeneration* _g; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
42 HeapWord* _boundary; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
43 template <class T> void inline par_do_barrier(T* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
44 template <class T> void inline 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 bool gc_barrier, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
46 bool root_scan); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
47 public: |
0 | 48 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state); |
49 }; | |
50 | |
51 class ParScanWithBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
52 public: |
0 | 53 ParScanWithBarrierClosure(ParNewGeneration* g, |
54 ParScanThreadState* par_scan_state) : | |
55 ParScanClosure(g, par_scan_state) {} | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
56 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
|
57 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
|
58 inline void do_oop_nv(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
59 inline void do_oop_nv(narrowOop* p); |
0 | 60 }; |
61 | |
62 class ParScanWithoutBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
63 public: |
0 | 64 ParScanWithoutBarrierClosure(ParNewGeneration* g, |
65 ParScanThreadState* par_scan_state) : | |
66 ParScanClosure(g, par_scan_state) {} | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
67 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
|
68 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
|
69 inline void do_oop_nv(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
70 inline void do_oop_nv(narrowOop* p); |
0 | 71 }; |
72 | |
73 class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
74 public: |
0 | 75 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g, |
76 ParScanThreadState* par_scan_state) : | |
77 ParScanClosure(g, par_scan_state) {} | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
78 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
|
79 virtual void do_oop(narrowOop* p); |
0 | 80 }; |
81 | |
82 class ParRootScanWithoutBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
83 public: |
0 | 84 ParRootScanWithoutBarrierClosure(ParNewGeneration* g, |
85 ParScanThreadState* par_scan_state) : | |
86 ParScanClosure(g, par_scan_state) {} | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
87 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
|
88 virtual void do_oop(narrowOop* p); |
0 | 89 }; |
90 | |
91 class ParScanWeakRefClosure: public ScanWeakRefClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
92 protected: |
0 | 93 ParScanThreadState* _par_scan_state; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
94 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
|
95 public: |
0 | 96 ParScanWeakRefClosure(ParNewGeneration* g, |
97 ParScanThreadState* par_scan_state); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
98 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
|
99 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
|
100 inline void do_oop_nv(oop* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
101 inline void do_oop_nv(narrowOop* p); |
0 | 102 }; |
103 | |
104 class ParEvacuateFollowersClosure: public VoidClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
105 private: |
0 | 106 ParScanThreadState* _par_scan_state; |
107 ParScanThreadState* par_scan_state() { return _par_scan_state; } | |
108 | |
109 // We want to preserve the specific types here (rather than "OopClosure") | |
110 // for later de-virtualization of do_oop calls. | |
111 ParScanWithoutBarrierClosure* _to_space_closure; | |
112 ParScanWithoutBarrierClosure* to_space_closure() { | |
113 return _to_space_closure; | |
114 } | |
115 ParRootScanWithoutBarrierClosure* _to_space_root_closure; | |
116 ParRootScanWithoutBarrierClosure* to_space_root_closure() { | |
117 return _to_space_root_closure; | |
118 } | |
119 | |
120 ParScanWithBarrierClosure* _old_gen_closure; | |
121 ParScanWithBarrierClosure* old_gen_closure () { | |
122 return _old_gen_closure; | |
123 } | |
124 ParRootScanWithBarrierTwoGensClosure* _old_gen_root_closure; | |
125 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure () { | |
126 return _old_gen_root_closure; | |
127 } | |
128 | |
129 ParNewGeneration* _par_gen; | |
130 ParNewGeneration* par_gen() { return _par_gen; } | |
131 | |
132 ObjToScanQueueSet* _task_queues; | |
133 ObjToScanQueueSet* task_queues() { return _task_queues; } | |
134 | |
135 ParallelTaskTerminator* _terminator; | |
136 ParallelTaskTerminator* terminator() { return _terminator; } | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
137 public: |
0 | 138 ParEvacuateFollowersClosure( |
139 ParScanThreadState* par_scan_state_, | |
140 ParScanWithoutBarrierClosure* to_space_closure_, | |
141 ParScanWithBarrierClosure* old_gen_closure_, | |
142 ParRootScanWithoutBarrierClosure* to_space_root_closure_, | |
143 ParNewGeneration* par_gen_, | |
144 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_, | |
145 ObjToScanQueueSet* task_queues_, | |
146 ParallelTaskTerminator* terminator_); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
147 virtual void do_void(); |
0 | 148 }; |
1972 | 149 |
150 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP |