annotate src/share/vm/gc_implementation/parNew/parOopClosures.hpp @ 12029:9766f73e770d

8022880: False sharing between PSPromotionManager instances Summary: Pad the PSPromotionManager instances in the manager array. Reviewed-by: brutisso, jmasa
author stefank
date Fri, 31 May 2013 14:32:44 +0200
parents da91efe96a93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
28 #include "memory/genOopClosures.hpp"
12029
9766f73e770d 8022880: False sharing between PSPromotionManager instances
stefank
parents: 6725
diff changeset
29 #include "memory/padded.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Closures for ParNewGeneration
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class ParScanThreadState;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class ParNewGeneration;
1665
a93a9eda13f7 6962947: shared TaskQueue statistics
jcoomes
parents: 1552
diff changeset
35 typedef Padded<OopTaskQueue> ObjToScanQueue;
6197
d2a62e0f25eb 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 1972
diff changeset
36 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
37 class ParallelTaskTerminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
49 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state);
a61af66fc99e Initial load
duke
parents:
diff changeset
50 };
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
54 ParScanWithBarrierClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
55 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
61 };
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
65 ParScanWithoutBarrierClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
72 };
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
76 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
77 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
81 };
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
85 ParRootScanWithoutBarrierClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
86 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
90 };
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
97 ParScanWeakRefClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
103 };
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
107 ParScanThreadState* _par_scan_state;
a61af66fc99e Initial load
duke
parents:
diff changeset
108 ParScanThreadState* par_scan_state() { return _par_scan_state; }
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // We want to preserve the specific types here (rather than "OopClosure")
a61af66fc99e Initial load
duke
parents:
diff changeset
111 // for later de-virtualization of do_oop calls.
a61af66fc99e Initial load
duke
parents:
diff changeset
112 ParScanWithoutBarrierClosure* _to_space_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 ParScanWithoutBarrierClosure* to_space_closure() {
a61af66fc99e Initial load
duke
parents:
diff changeset
114 return _to_space_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 }
a61af66fc99e Initial load
duke
parents:
diff changeset
116 ParRootScanWithoutBarrierClosure* _to_space_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
117 ParRootScanWithoutBarrierClosure* to_space_root_closure() {
a61af66fc99e Initial load
duke
parents:
diff changeset
118 return _to_space_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
119 }
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 ParScanWithBarrierClosure* _old_gen_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 ParScanWithBarrierClosure* old_gen_closure () {
a61af66fc99e Initial load
duke
parents:
diff changeset
123 return _old_gen_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 }
a61af66fc99e Initial load
duke
parents:
diff changeset
125 ParRootScanWithBarrierTwoGensClosure* _old_gen_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure () {
a61af66fc99e Initial load
duke
parents:
diff changeset
127 return _old_gen_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 ParNewGeneration* _par_gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
131 ParNewGeneration* par_gen() { return _par_gen; }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 ObjToScanQueueSet* _task_queues;
a61af66fc99e Initial load
duke
parents:
diff changeset
134 ObjToScanQueueSet* task_queues() { return _task_queues; }
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 ParallelTaskTerminator* _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
139 ParEvacuateFollowersClosure(
a61af66fc99e Initial load
duke
parents:
diff changeset
140 ParScanThreadState* par_scan_state_,
a61af66fc99e Initial load
duke
parents:
diff changeset
141 ParScanWithoutBarrierClosure* to_space_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
142 ParScanWithBarrierClosure* old_gen_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
143 ParRootScanWithoutBarrierClosure* to_space_root_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
144 ParNewGeneration* par_gen_,
a61af66fc99e Initial load
duke
parents:
diff changeset
145 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
146 ObjToScanQueueSet* task_queues_,
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
149 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
150
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
151 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP