annotate src/share/vm/gc_implementation/parNew/parOopClosures.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents d2a62e0f25eb
children 9766f73e770d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
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
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"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
29
0
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // Closures for ParNewGeneration
a61af66fc99e Initial load
duke
parents:
diff changeset
31
a61af66fc99e Initial load
duke
parents:
diff changeset
32 class ParScanThreadState;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class ParNewGeneration;
1665
a93a9eda13f7 6962947: shared TaskQueue statistics
jcoomes
parents: 1552
diff changeset
34 typedef Padded<OopTaskQueue> ObjToScanQueue;
6197
d2a62e0f25eb 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 1972
diff changeset
35 typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class ParallelTaskTerminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
48 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state);
a61af66fc99e Initial load
duke
parents:
diff changeset
49 };
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
53 ParScanWithBarrierClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
54 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
60 };
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
64 ParScanWithoutBarrierClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
65 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
71 };
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
75 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
76 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
80 };
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
84 ParRootScanWithoutBarrierClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
85 ParScanThreadState* par_scan_state) :
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
89 };
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
96 ParScanWeakRefClosure(ParNewGeneration* g,
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
102 };
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
106 ParScanThreadState* _par_scan_state;
a61af66fc99e Initial load
duke
parents:
diff changeset
107 ParScanThreadState* par_scan_state() { return _par_scan_state; }
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // We want to preserve the specific types here (rather than "OopClosure")
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // for later de-virtualization of do_oop calls.
a61af66fc99e Initial load
duke
parents:
diff changeset
111 ParScanWithoutBarrierClosure* _to_space_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 ParScanWithoutBarrierClosure* to_space_closure() {
a61af66fc99e Initial load
duke
parents:
diff changeset
113 return _to_space_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
a61af66fc99e Initial load
duke
parents:
diff changeset
115 ParRootScanWithoutBarrierClosure* _to_space_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 ParRootScanWithoutBarrierClosure* to_space_root_closure() {
a61af66fc99e Initial load
duke
parents:
diff changeset
117 return _to_space_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 ParScanWithBarrierClosure* _old_gen_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 ParScanWithBarrierClosure* old_gen_closure () {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 return _old_gen_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 }
a61af66fc99e Initial load
duke
parents:
diff changeset
124 ParRootScanWithBarrierTwoGensClosure* _old_gen_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure () {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 return _old_gen_root_closure;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 ParNewGeneration* _par_gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 ParNewGeneration* par_gen() { return _par_gen; }
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 ObjToScanQueueSet* _task_queues;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 ObjToScanQueueSet* task_queues() { return _task_queues; }
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 ParallelTaskTerminator* _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
138 ParEvacuateFollowersClosure(
a61af66fc99e Initial load
duke
parents:
diff changeset
139 ParScanThreadState* par_scan_state_,
a61af66fc99e Initial load
duke
parents:
diff changeset
140 ParScanWithoutBarrierClosure* to_space_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
141 ParScanWithBarrierClosure* old_gen_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
142 ParRootScanWithoutBarrierClosure* to_space_root_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
143 ParNewGeneration* par_gen_,
a61af66fc99e Initial load
duke
parents:
diff changeset
144 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_,
a61af66fc99e Initial load
duke
parents:
diff changeset
145 ObjToScanQueueSet* task_queues_,
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
148 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
149
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1665
diff changeset
150 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP