Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/parNew/parOopClosures.hpp @ 18408:2c3666f44855
Truffle: initial commit of object API implementation
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Tue, 18 Nov 2014 23:19:43 +0100 |
parents | 9766f73e770d |
children |
rev | line source |
---|---|
0 | 1 /* |
12029
9766f73e770d
8022880: False sharing between PSPromotionManager instances
stefank
parents:
6725
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:
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" | |
12029
9766f73e770d
8022880: False sharing between PSPromotionManager instances
stefank
parents:
6725
diff
changeset
|
29 #include "memory/padded.hpp" |
1972 | 30 |
0 | 31 // Closures for ParNewGeneration |
32 | |
33 class ParScanThreadState; | |
34 class ParNewGeneration; | |
1665 | 35 typedef Padded<OopTaskQueue> ObjToScanQueue; |
6197 | 36 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet; |
0 | 37 class ParallelTaskTerminator; |
38 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6197
diff
changeset
|
39 class ParScanClosure: public OopsInKlassOrGenClosure { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
40 protected: |
0 | 41 ParScanThreadState* _par_scan_state; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
42 ParNewGeneration* _g; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
43 HeapWord* _boundary; |
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 par_do_barrier(T* p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
45 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
|
46 bool gc_barrier, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
47 bool root_scan); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
48 public: |
0 | 49 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state); |
50 }; | |
51 | |
52 class ParScanWithBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
53 public: |
0 | 54 ParScanWithBarrierClosure(ParNewGeneration* g, |
55 ParScanThreadState* par_scan_state) : | |
56 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
|
57 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
|
58 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
|
59 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
|
60 inline void do_oop_nv(narrowOop* p); |
0 | 61 }; |
62 | |
63 class ParScanWithoutBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
64 public: |
0 | 65 ParScanWithoutBarrierClosure(ParNewGeneration* g, |
66 ParScanThreadState* par_scan_state) : | |
67 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
|
68 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
|
69 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
|
70 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
|
71 inline void do_oop_nv(narrowOop* p); |
0 | 72 }; |
73 | |
74 class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
75 public: |
0 | 76 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g, |
77 ParScanThreadState* par_scan_state) : | |
78 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
|
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); |
0 | 81 }; |
82 | |
83 class ParRootScanWithoutBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
84 public: |
0 | 85 ParRootScanWithoutBarrierClosure(ParNewGeneration* g, |
86 ParScanThreadState* par_scan_state) : | |
87 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
|
88 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
|
89 virtual void do_oop(narrowOop* p); |
0 | 90 }; |
91 | |
92 class ParScanWeakRefClosure: public ScanWeakRefClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
93 protected: |
0 | 94 ParScanThreadState* _par_scan_state; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
95 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
|
96 public: |
0 | 97 ParScanWeakRefClosure(ParNewGeneration* g, |
98 ParScanThreadState* par_scan_state); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
99 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
|
100 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
|
101 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
|
102 inline void do_oop_nv(narrowOop* p); |
0 | 103 }; |
104 | |
105 class ParEvacuateFollowersClosure: public VoidClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
106 private: |
0 | 107 ParScanThreadState* _par_scan_state; |
108 ParScanThreadState* par_scan_state() { return _par_scan_state; } | |
109 | |
110 // We want to preserve the specific types here (rather than "OopClosure") | |
111 // for later de-virtualization of do_oop calls. | |
112 ParScanWithoutBarrierClosure* _to_space_closure; | |
113 ParScanWithoutBarrierClosure* to_space_closure() { | |
114 return _to_space_closure; | |
115 } | |
116 ParRootScanWithoutBarrierClosure* _to_space_root_closure; | |
117 ParRootScanWithoutBarrierClosure* to_space_root_closure() { | |
118 return _to_space_root_closure; | |
119 } | |
120 | |
121 ParScanWithBarrierClosure* _old_gen_closure; | |
122 ParScanWithBarrierClosure* old_gen_closure () { | |
123 return _old_gen_closure; | |
124 } | |
125 ParRootScanWithBarrierTwoGensClosure* _old_gen_root_closure; | |
126 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure () { | |
127 return _old_gen_root_closure; | |
128 } | |
129 | |
130 ParNewGeneration* _par_gen; | |
131 ParNewGeneration* par_gen() { return _par_gen; } | |
132 | |
133 ObjToScanQueueSet* _task_queues; | |
134 ObjToScanQueueSet* task_queues() { return _task_queues; } | |
135 | |
136 ParallelTaskTerminator* _terminator; | |
137 ParallelTaskTerminator* terminator() { return _terminator; } | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
138 public: |
0 | 139 ParEvacuateFollowersClosure( |
140 ParScanThreadState* par_scan_state_, | |
141 ParScanWithoutBarrierClosure* to_space_closure_, | |
142 ParScanWithBarrierClosure* old_gen_closure_, | |
143 ParRootScanWithoutBarrierClosure* to_space_root_closure_, | |
144 ParNewGeneration* par_gen_, | |
145 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_, | |
146 ObjToScanQueueSet* task_queues_, | |
147 ParallelTaskTerminator* terminator_); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
148 virtual void do_void(); |
0 | 149 }; |
1972 | 150 |
151 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP |