author | stefank |
Thu, 13 Feb 2014 17:44:39 +0100 | |
changeset 22882 | 195c8f70d605 |
parent 22551 | 9bf46d16dcc6 |
child 22883 | 5378704451dc |
permissions | -rw-r--r-- |
1 | 1 |
/* |
22234
da823d78ad65
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
18687
diff
changeset
|
2 |
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4458
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4458
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4458
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_MEMORY_SHAREDHEAP_HPP |
26 |
#define SHARE_VM_MEMORY_SHAREDHEAP_HPP |
|
27 |
||
28 |
#include "gc_interface/collectedHeap.hpp" |
|
29 |
#include "memory/generation.hpp" |
|
30 |
||
1 | 31 |
// A "SharedHeap" is an implementation of a java heap for HotSpot. This |
32 |
// is an abstract class: there may be many different kinds of heaps. This |
|
33 |
// class defines the functions that a heap must implement, and contains |
|
34 |
// infrastructure common to all heaps. |
|
35 |
||
36 |
class Generation; |
|
37 |
class BarrierSet; |
|
38 |
class GenRemSet; |
|
39 |
class Space; |
|
40 |
class SpaceClosure; |
|
41 |
class OopClosure; |
|
42 |
class OopsInGenClosure; |
|
43 |
class ObjectClosure; |
|
44 |
class SubTasksDone; |
|
45 |
class WorkGang; |
|
6759
67b1a69ef5aa
6984287: Regularize how GC parallel workers are specified.
jmasa
parents:
5547
diff
changeset
|
46 |
class FlexibleWorkGang; |
1 | 47 |
class CollectorPolicy; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
48 |
class KlassClosure; |
1 | 49 |
|
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
50 |
// Note on use of FlexibleWorkGang's for GC. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
51 |
// There are three places where task completion is determined. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
52 |
// In |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
53 |
// 1) ParallelTaskTerminator::offer_termination() where _n_threads |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
54 |
// must be set to the correct value so that count of workers that |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
55 |
// have offered termination will exactly match the number |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
56 |
// working on the task. Tasks such as those derived from GCTask |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
57 |
// use ParallelTaskTerminator's. Tasks that want load balancing |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
58 |
// by work stealing use this method to gauge completion. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
59 |
// 2) SubTasksDone has a variable _n_threads that is used in |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
60 |
// all_tasks_completed() to determine completion. all_tasks_complete() |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
61 |
// counts the number of tasks that have been done and then reset |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
62 |
// the SubTasksDone so that it can be used again. When the number of |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
63 |
// tasks is set to the number of GC workers, then _n_threads must |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
64 |
// be set to the number of active GC workers. G1CollectedHeap, |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
65 |
// HRInto_G1RemSet, GenCollectedHeap and SharedHeap have SubTasksDone. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
66 |
// This seems too many. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
67 |
// 3) SequentialSubTasksDone has an _n_threads that is used in |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
68 |
// a way similar to SubTasksDone and has the same dependency on the |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
69 |
// number of active GC workers. CompactibleFreeListSpace and Space |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
70 |
// have SequentialSubTasksDone's. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
71 |
// Example of using SubTasksDone and SequentialSubTasksDone |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
72 |
// G1CollectedHeap::g1_process_strong_roots() calls |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
73 |
// process_strong_roots(false, // no scoping; this is parallel code |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
74 |
// is_scavenging, so, |
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
75 |
// &buf_scan_non_heap_roots, |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
76 |
// &eager_scan_code_roots); |
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
77 |
// which delegates to SharedHeap::process_strong_roots() and uses |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
78 |
// SubTasksDone* _process_strong_tasks to claim tasks. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
79 |
// process_strong_roots() calls |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
80 |
// rem_set()->younger_refs_iterate() |
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
81 |
// to scan the card table and which eventually calls down into |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
82 |
// CardTableModRefBS::par_non_clean_card_iterate_work(). This method |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
83 |
// uses SequentialSubTasksDone* _pst to claim tasks. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
84 |
// Both SubTasksDone and SequentialSubTasksDone call their method |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
85 |
// all_tasks_completed() to count the number of GC workers that have |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
86 |
// finished their work. That logic is "when all the workers are |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
87 |
// finished the tasks are finished". |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
88 |
// |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
89 |
// The pattern that appears in the code is to set _n_threads |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
90 |
// to a value > 1 before a task that you would like executed in parallel |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
91 |
// and then to set it to 0 after that task has completed. A value of |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
92 |
// 0 is a "special" value in set_n_threads() which translates to |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
93 |
// setting _n_threads to 1. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
94 |
// |
22551 | 95 |
// Some code uses _n_termination to decide if work should be done in |
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
96 |
// parallel. The notorious possibly_parallel_oops_do() in threads.cpp |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
97 |
// is an example of such code. Look for variable "is_par" for other |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
98 |
// examples. |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
99 |
// |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
100 |
// The active_workers is not reset to 0 after a parallel phase. It's |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
101 |
// value may be used in later phases and in one instance at least |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
102 |
// (the parallel remark) it has to be used (the parallel remark depends |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
103 |
// on the partitioning done in the previous parallel scavenge). |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
104 |
|
1 | 105 |
class SharedHeap : public CollectedHeap { |
106 |
friend class VMStructs; |
|
107 |
||
1374 | 108 |
friend class VM_GC_Operation; |
109 |
friend class VM_CGC_Operation; |
|
110 |
||
1 | 111 |
private: |
112 |
// For claiming strong_roots tasks. |
|
113 |
SubTasksDone* _process_strong_tasks; |
|
114 |
||
115 |
protected: |
|
116 |
// There should be only a single instance of "SharedHeap" in a program. |
|
117 |
// This is enforced with the protected constructor below, which will also |
|
118 |
// set the static pointer "_sh" to that instance. |
|
119 |
static SharedHeap* _sh; |
|
120 |
||
121 |
// and the Gen Remembered Set, at least one good enough to scan the perm |
|
122 |
// gen. |
|
123 |
GenRemSet* _rem_set; |
|
124 |
||
125 |
// A gc policy, controls global gc resource issues |
|
126 |
CollectorPolicy *_collector_policy; |
|
127 |
||
128 |
// See the discussion below, in the specification of the reader function |
|
129 |
// for this variable. |
|
130 |
int _strong_roots_parity; |
|
131 |
||
132 |
// If we're doing parallel GC, use this gang of threads. |
|
6759
67b1a69ef5aa
6984287: Regularize how GC parallel workers are specified.
jmasa
parents:
5547
diff
changeset
|
133 |
FlexibleWorkGang* _workers; |
1 | 134 |
|
135 |
// Full initialization is done in a concrete subtype's "initialize" |
|
136 |
// function. |
|
137 |
SharedHeap(CollectorPolicy* policy_); |
|
138 |
||
1374 | 139 |
// Returns true if the calling thread holds the heap lock, |
140 |
// or the calling thread is a par gc thread and the heap_lock is held |
|
141 |
// by the vm thread doing a gc operation. |
|
142 |
bool heap_lock_held_for_gc(); |
|
143 |
// True if the heap_lock is held by the a non-gc thread invoking a gc |
|
144 |
// operation. |
|
145 |
bool _thread_holds_heap_lock_for_gc; |
|
146 |
||
1 | 147 |
public: |
148 |
static SharedHeap* heap() { return _sh; } |
|
149 |
||
150 |
void set_barrier_set(BarrierSet* bs); |
|
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
151 |
SubTasksDone* process_strong_tasks() { return _process_strong_tasks; } |
1 | 152 |
|
153 |
// Does operations required after initialization has been done. |
|
154 |
virtual void post_initialize(); |
|
155 |
||
156 |
// Initialization of ("weak") reference processing support |
|
157 |
virtual void ref_processing_init(); |
|
158 |
||
159 |
// This function returns the "GenRemSet" object that allows us to scan |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
160 |
// generations in a fully generational heap. |
1 | 161 |
GenRemSet* rem_set() { return _rem_set; } |
162 |
||
163 |
// Iteration functions. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
164 |
void oop_iterate(ExtendedOopClosure* cl) = 0; |
1 | 165 |
|
166 |
// Same as above, restricted to a memory region. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
167 |
virtual void oop_iterate(MemRegion mr, ExtendedOopClosure* cl) = 0; |
1 | 168 |
|
169 |
// Iterate over all spaces in use in the heap, in an undefined order. |
|
170 |
virtual void space_iterate(SpaceClosure* cl) = 0; |
|
171 |
||
172 |
// A SharedHeap will contain some number of spaces. This finds the |
|
173 |
// space whose reserved area contains the given address, or else returns |
|
174 |
// NULL. |
|
175 |
virtual Space* space_containing(const void* addr) const = 0; |
|
176 |
||
177 |
bool no_gc_in_progress() { return !is_gc_active(); } |
|
178 |
||
179 |
// Some collectors will perform "process_strong_roots" in parallel. |
|
180 |
// Such a call will involve claiming some fine-grained tasks, such as |
|
181 |
// scanning of threads. To make this process simpler, we provide the |
|
182 |
// "strong_roots_parity()" method. Collectors that start parallel tasks |
|
183 |
// whose threads invoke "process_strong_roots" must |
|
184 |
// call "change_strong_roots_parity" in sequential code starting such a |
|
185 |
// task. (This also means that a parallel thread may only call |
|
186 |
// process_strong_roots once.) |
|
187 |
// |
|
188 |
// For calls to process_strong_roots by sequential code, the parity is |
|
189 |
// updated automatically. |
|
190 |
// |
|
191 |
// The idea is that objects representing fine-grained tasks, such as |
|
192 |
// threads, will contain a "parity" field. A task will is claimed in the |
|
193 |
// current "process_strong_roots" call only if its parity field is the |
|
194 |
// same as the "strong_roots_parity"; task claiming is accomplished by |
|
195 |
// updating the parity field to the strong_roots_parity with a CAS. |
|
196 |
// |
|
197 |
// If the client meats this spec, then strong_roots_parity() will have |
|
198 |
// the following properties: |
|
199 |
// a) to return a different value than was returned before the last |
|
200 |
// call to change_strong_roots_parity, and |
|
201 |
// c) to never return a distinguished value (zero) with which such |
|
202 |
// task-claiming variables may be initialized, to indicate "never |
|
203 |
// claimed". |
|
3908
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
204 |
private: |
1 | 205 |
void change_strong_roots_parity(); |
3908
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
206 |
public: |
1 | 207 |
int strong_roots_parity() { return _strong_roots_parity; } |
208 |
||
3908
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
209 |
// Call these in sequential code around process_strong_roots. |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
210 |
// strong_roots_prologue calls change_strong_roots_parity, if |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
211 |
// parallel tasks are enabled. |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
212 |
class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope { |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
213 |
public: |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
214 |
StrongRootsScope(SharedHeap* outer, bool activate = true); |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
215 |
~StrongRootsScope(); |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
216 |
}; |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
217 |
friend class StrongRootsScope; |
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
218 |
|
1 | 219 |
enum ScanningOption { |
220 |
SO_None = 0x0, |
|
221 |
SO_AllClasses = 0x1, |
|
222 |
SO_SystemClasses = 0x2, |
|
9342
456b8d0486b5
7039089: G1: changeset for 7037276 broke heap verification, and related cleanups
ysr
parents:
7397
diff
changeset
|
223 |
SO_Strings = 0x4, |
22550
820966182ab9
8032379: Remove the is_scavenging flag to process_strong_roots
mgerdin
parents:
22234
diff
changeset
|
224 |
SO_AllCodeCache = 0x8, |
820966182ab9
8032379: Remove the is_scavenging flag to process_strong_roots
mgerdin
parents:
22234
diff
changeset
|
225 |
SO_ScavengeCodeCache = 0x10 |
1 | 226 |
}; |
227 |
||
6759
67b1a69ef5aa
6984287: Regularize how GC parallel workers are specified.
jmasa
parents:
5547
diff
changeset
|
228 |
FlexibleWorkGang* workers() const { return _workers; } |
1 | 229 |
|
230 |
// Invoke the "do_oop" method the closure "roots" on all root locations. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
231 |
// The "so" argument determines which roots the closure is applied to: |
1 | 232 |
// "SO_None" does none; |
233 |
// "SO_AllClasses" applies the closure to all entries in the SystemDictionary; |
|
234 |
// "SO_SystemClasses" to all the "system" classes and loaders; |
|
235 |
// "SO_Strings" applies the closure to all entries in StringTable; |
|
22550
820966182ab9
8032379: Remove the is_scavenging flag to process_strong_roots
mgerdin
parents:
22234
diff
changeset
|
236 |
// "SO_AllCodeCache" applies the closure to all elements of the CodeCache. |
820966182ab9
8032379: Remove the is_scavenging flag to process_strong_roots
mgerdin
parents:
22234
diff
changeset
|
237 |
// "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache. |
3908
24b55ad4c228
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
2105
diff
changeset
|
238 |
void process_strong_roots(bool activate_scope, |
1 | 239 |
ScanningOption so, |
240 |
OopClosure* roots, |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11396
diff
changeset
|
241 |
KlassClosure* klass_closure); |
1 | 242 |
|
22882
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
243 |
// Apply "root_closure" to all the weak roots of the system. |
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
244 |
// These include JNI weak roots and string table. |
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
245 |
void process_weak_roots(OopClosure* root_closure); |
1 | 246 |
|
247 |
// The functions below are helper functions that a subclass of |
|
248 |
// "SharedHeap" can use in the implementation of its virtual |
|
249 |
// functions. |
|
250 |
||
1374 | 251 |
public: |
1 | 252 |
|
253 |
// Do anything common to GC's. |
|
254 |
virtual void gc_prologue(bool full) = 0; |
|
255 |
virtual void gc_epilogue(bool full) = 0; |
|
256 |
||
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
257 |
// Sets the number of parallel threads that will be doing tasks |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
258 |
// (such as process strong roots) subsequently. |
11396
917d8673b5ef
7121618: Change type of number of GC workers to unsigned int.
jmasa
parents:
11174
diff
changeset
|
259 |
virtual void set_par_threads(uint t); |
11174
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
260 |
|
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
261 |
int n_termination(); |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
262 |
void set_n_termination(int t); |
fccee5238e70
6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents:
9342
diff
changeset
|
263 |
|
1 | 264 |
// |
265 |
// New methods from CollectedHeap |
|
266 |
// |
|
267 |
||
268 |
// Some utilities. |
|
1374 | 269 |
void print_size_transition(outputStream* out, |
270 |
size_t bytes_before, |
|
1 | 271 |
size_t bytes_after, |
272 |
size_t capacity); |
|
273 |
}; |
|
7397 | 274 |
|
22882
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
275 |
inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) { |
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
276 |
return static_cast<SharedHeap::ScanningOption>(static_cast<int>(so0) | static_cast<int>(so1)); |
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
277 |
} |
195c8f70d605
8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents:
22551
diff
changeset
|
278 |
|
7397 | 279 |
#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP |