Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/parNew/parOopClosures.hpp @ 1951:899bbbdcb6ea
6997298: fatal error: must own lock CMS_markBitMap_lock during heap dump
Summary: Since we are at a stop-world pause, the existing CMS-phase checks are sufficient for safety, and the locking check can be safely elided. Elaborated documentation comment to the case where class unloading and verification are disabled, and the query happens when we aren't in the sweeping phase, where the answer "false" would be (almost everywhere) too pessimistic.
Reviewed-by: jmasa, johnc, tonyp
author | ysr |
---|---|
date | Fri, 05 Nov 2010 13:20:37 -0700 |
parents | a93a9eda13f7 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 1 /* |
1665 | 2 * Copyright (c) 2007, 2010, 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 | |
25 // Closures for ParNewGeneration | |
26 | |
27 class ParScanThreadState; | |
28 class ParNewGeneration; | |
1665 | 29 typedef Padded<OopTaskQueue> ObjToScanQueue; |
30 typedef GenericTaskQueueSet<ObjToScanQueue> ObjToScanQueueSet; | |
0 | 31 class ParallelTaskTerminator; |
32 | |
33 class ParScanClosure: public OopsInGenClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
34 protected: |
0 | 35 ParScanThreadState* _par_scan_state; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
36 ParNewGeneration* _g; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
37 HeapWord* _boundary; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
38 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
|
39 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
|
40 bool gc_barrier, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
41 bool root_scan); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
42 public: |
0 | 43 ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state); |
44 }; | |
45 | |
46 class ParScanWithBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
47 public: |
0 | 48 ParScanWithBarrierClosure(ParNewGeneration* g, |
49 ParScanThreadState* par_scan_state) : | |
50 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
|
51 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
|
52 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
|
53 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
|
54 inline void do_oop_nv(narrowOop* p); |
0 | 55 }; |
56 | |
57 class ParScanWithoutBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
58 public: |
0 | 59 ParScanWithoutBarrierClosure(ParNewGeneration* g, |
60 ParScanThreadState* par_scan_state) : | |
61 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
|
62 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
|
63 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
|
64 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
|
65 inline void do_oop_nv(narrowOop* p); |
0 | 66 }; |
67 | |
68 class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
69 public: |
0 | 70 ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g, |
71 ParScanThreadState* par_scan_state) : | |
72 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
|
73 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
|
74 virtual void do_oop(narrowOop* p); |
0 | 75 }; |
76 | |
77 class ParRootScanWithoutBarrierClosure: public ParScanClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
78 public: |
0 | 79 ParRootScanWithoutBarrierClosure(ParNewGeneration* g, |
80 ParScanThreadState* par_scan_state) : | |
81 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
|
82 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
|
83 virtual void do_oop(narrowOop* p); |
0 | 84 }; |
85 | |
86 class ParScanWeakRefClosure: public ScanWeakRefClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
87 protected: |
0 | 88 ParScanThreadState* _par_scan_state; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
89 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
|
90 public: |
0 | 91 ParScanWeakRefClosure(ParNewGeneration* g, |
92 ParScanThreadState* par_scan_state); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
93 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
|
94 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
|
95 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
|
96 inline void do_oop_nv(narrowOop* p); |
0 | 97 }; |
98 | |
99 class ParEvacuateFollowersClosure: public VoidClosure { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
100 private: |
0 | 101 ParScanThreadState* _par_scan_state; |
102 ParScanThreadState* par_scan_state() { return _par_scan_state; } | |
103 | |
104 // We want to preserve the specific types here (rather than "OopClosure") | |
105 // for later de-virtualization of do_oop calls. | |
106 ParScanWithoutBarrierClosure* _to_space_closure; | |
107 ParScanWithoutBarrierClosure* to_space_closure() { | |
108 return _to_space_closure; | |
109 } | |
110 ParRootScanWithoutBarrierClosure* _to_space_root_closure; | |
111 ParRootScanWithoutBarrierClosure* to_space_root_closure() { | |
112 return _to_space_root_closure; | |
113 } | |
114 | |
115 ParScanWithBarrierClosure* _old_gen_closure; | |
116 ParScanWithBarrierClosure* old_gen_closure () { | |
117 return _old_gen_closure; | |
118 } | |
119 ParRootScanWithBarrierTwoGensClosure* _old_gen_root_closure; | |
120 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure () { | |
121 return _old_gen_root_closure; | |
122 } | |
123 | |
124 ParNewGeneration* _par_gen; | |
125 ParNewGeneration* par_gen() { return _par_gen; } | |
126 | |
127 ObjToScanQueueSet* _task_queues; | |
128 ObjToScanQueueSet* task_queues() { return _task_queues; } | |
129 | |
130 ParallelTaskTerminator* _terminator; | |
131 ParallelTaskTerminator* terminator() { return _terminator; } | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
132 public: |
0 | 133 ParEvacuateFollowersClosure( |
134 ParScanThreadState* par_scan_state_, | |
135 ParScanWithoutBarrierClosure* to_space_closure_, | |
136 ParScanWithBarrierClosure* old_gen_closure_, | |
137 ParRootScanWithoutBarrierClosure* to_space_root_closure_, | |
138 ParNewGeneration* par_gen_, | |
139 ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_, | |
140 ObjToScanQueueSet* task_queues_, | |
141 ParallelTaskTerminator* terminator_); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
142 virtual void do_void(); |
0 | 143 }; |