author | kvn |
Thu, 27 May 2010 18:01:56 -0700 | |
changeset 5694 | 1e0532a6abff |
parent 5080 | eff0cc882603 |
child 5547 | f4b087cbb361 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
3795 | 2 |
* Copyright 2005-2009 Sun Microsystems, Inc. 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 |
* |
|
19 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
20 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
21 |
* have any questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "incls/_precompiled.incl" |
|
26 |
#include "incls/_psCompactionManager.cpp.incl" |
|
27 |
||
28 |
PSOldGen* ParCompactionManager::_old_gen = NULL; |
|
29 |
ParCompactionManager** ParCompactionManager::_manager_array = NULL; |
|
30 |
OopTaskQueueSet* ParCompactionManager::_stack_array = NULL; |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
31 |
ParCompactionManager::ObjArrayTaskQueueSet* |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
32 |
ParCompactionManager::_objarray_queues = NULL; |
1 | 33 |
ObjectStartArray* ParCompactionManager::_start_array = NULL; |
34 |
ParMarkBitMap* ParCompactionManager::_mark_bitmap = NULL; |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
35 |
RegionTaskQueueSet* ParCompactionManager::_region_array = NULL; |
1 | 36 |
|
37 |
ParCompactionManager::ParCompactionManager() : |
|
38 |
_action(CopyAndUpdate) { |
|
39 |
||
40 |
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
|
41 |
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
|
42 |
||
43 |
_old_gen = heap->old_gen(); |
|
44 |
_start_array = old_gen()->start_array(); |
|
45 |
||
46 |
||
47 |
marking_stack()->initialize(); |
|
48 |
||
49 |
// We want the overflow stack to be permanent |
|
50 |
_overflow_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(10, true); |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
51 |
|
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
52 |
_objarray_queue.initialize(); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
53 |
_objarray_overflow_stack = |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
54 |
new (ResourceObj::C_HEAP) ObjArrayOverflowStack(10, true); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
55 |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
56 |
#ifdef USE_RegionTaskQueueWithOverflow |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
57 |
region_stack()->initialize(); |
1 | 58 |
#else |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
59 |
region_stack()->initialize(); |
1 | 60 |
|
61 |
// We want the overflow stack to be permanent |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
62 |
_region_overflow_stack = |
1 | 63 |
new (ResourceObj::C_HEAP) GrowableArray<size_t>(10, true); |
64 |
#endif |
|
65 |
||
66 |
// Note that _revisit_klass_stack is allocated out of the |
|
67 |
// C heap (as opposed to out of ResourceArena). |
|
68 |
int size = |
|
69 |
(SystemDictionary::number_of_classes() * 2) * 2 / ParallelGCThreads; |
|
70 |
_revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); |
|
3696 | 71 |
// From some experiments (#klass/k)^2 for k = 10 seems a better fit, but this will |
72 |
// have to do for now until we are able to investigate a more optimal setting. |
|
73 |
_revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(size*2, true); |
|
1 | 74 |
|
75 |
} |
|
76 |
||
77 |
ParCompactionManager::~ParCompactionManager() { |
|
78 |
delete _overflow_stack; |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
79 |
delete _objarray_overflow_stack; |
1 | 80 |
delete _revisit_klass_stack; |
3696 | 81 |
delete _revisit_mdo_stack; |
1 | 82 |
// _manager_array and _stack_array are statics |
83 |
// shared with all instances of ParCompactionManager |
|
84 |
// should not be deallocated. |
|
85 |
} |
|
86 |
||
87 |
void ParCompactionManager::initialize(ParMarkBitMap* mbm) { |
|
88 |
assert(PSParallelCompact::gc_task_manager() != NULL, |
|
89 |
"Needed for initialization"); |
|
90 |
||
91 |
_mark_bitmap = mbm; |
|
92 |
||
93 |
uint parallel_gc_threads = PSParallelCompact::gc_task_manager()->workers(); |
|
94 |
||
95 |
assert(_manager_array == NULL, "Attempt to initialize twice"); |
|
96 |
_manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1 ); |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
97 |
guarantee(_manager_array != NULL, "Could not allocate manager_array"); |
1 | 98 |
|
99 |
_stack_array = new OopTaskQueueSet(parallel_gc_threads); |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
100 |
guarantee(_stack_array != NULL, "Could not allocate stack_array"); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
101 |
_objarray_queues = new ObjArrayTaskQueueSet(parallel_gc_threads); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
102 |
guarantee(_objarray_queues != NULL, "Could not allocate objarray_queues"); |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
103 |
_region_array = new RegionTaskQueueSet(parallel_gc_threads); |
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
104 |
guarantee(_region_array != NULL, "Could not allocate region_array"); |
1 | 105 |
|
106 |
// Create and register the ParCompactionManager(s) for the worker threads. |
|
107 |
for(uint i=0; i<parallel_gc_threads; i++) { |
|
108 |
_manager_array[i] = new ParCompactionManager(); |
|
109 |
guarantee(_manager_array[i] != NULL, "Could not create ParCompactionManager"); |
|
110 |
stack_array()->register_queue(i, _manager_array[i]->marking_stack()); |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
111 |
_objarray_queues->register_queue(i, &_manager_array[i]->_objarray_queue); |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
112 |
#ifdef USE_RegionTaskQueueWithOverflow |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
113 |
region_array()->register_queue(i, _manager_array[i]->region_stack()->task_queue()); |
1 | 114 |
#else |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
115 |
region_array()->register_queue(i, _manager_array[i]->region_stack()); |
1 | 116 |
#endif |
117 |
} |
|
118 |
||
119 |
// The VMThread gets its own ParCompactionManager, which is not available |
|
120 |
// for work stealing. |
|
121 |
_manager_array[parallel_gc_threads] = new ParCompactionManager(); |
|
122 |
guarantee(_manager_array[parallel_gc_threads] != NULL, |
|
123 |
"Could not create ParCompactionManager"); |
|
124 |
assert(PSParallelCompact::gc_task_manager()->workers() != 0, |
|
125 |
"Not initialized?"); |
|
126 |
} |
|
127 |
||
128 |
bool ParCompactionManager::should_update() { |
|
129 |
assert(action() != NotValid, "Action is not set"); |
|
130 |
return (action() == ParCompactionManager::Update) || |
|
131 |
(action() == ParCompactionManager::CopyAndUpdate) || |
|
132 |
(action() == ParCompactionManager::UpdateAndCopy); |
|
133 |
} |
|
134 |
||
135 |
bool ParCompactionManager::should_copy() { |
|
136 |
assert(action() != NotValid, "Action is not set"); |
|
137 |
return (action() == ParCompactionManager::Copy) || |
|
138 |
(action() == ParCompactionManager::CopyAndUpdate) || |
|
139 |
(action() == ParCompactionManager::UpdateAndCopy); |
|
140 |
} |
|
141 |
||
142 |
bool ParCompactionManager::should_verify_only() { |
|
143 |
assert(action() != NotValid, "Action is not set"); |
|
144 |
return action() == ParCompactionManager::VerifyUpdate; |
|
145 |
} |
|
146 |
||
147 |
bool ParCompactionManager::should_reset_only() { |
|
148 |
assert(action() != NotValid, "Action is not set"); |
|
149 |
return action() == ParCompactionManager::ResetObjects; |
|
150 |
} |
|
151 |
||
152 |
// For now save on a stack |
|
153 |
void ParCompactionManager::save_for_scanning(oop m) { |
|
154 |
stack_push(m); |
|
155 |
} |
|
156 |
||
157 |
void ParCompactionManager::stack_push(oop obj) { |
|
158 |
||
159 |
if(!marking_stack()->push(obj)) { |
|
160 |
overflow_stack()->push(obj); |
|
161 |
} |
|
162 |
} |
|
163 |
||
164 |
oop ParCompactionManager::retrieve_for_scanning() { |
|
165 |
||
166 |
// Should not be used in the parallel case |
|
167 |
ShouldNotReachHere(); |
|
168 |
return NULL; |
|
169 |
} |
|
170 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
171 |
// Save region on a stack |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
172 |
void ParCompactionManager::save_for_processing(size_t region_index) { |
1 | 173 |
#ifdef ASSERT |
174 |
const ParallelCompactData& sd = PSParallelCompact::summary_data(); |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
175 |
ParallelCompactData::RegionData* const region_ptr = sd.region(region_index); |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
176 |
assert(region_ptr->claimed(), "must be claimed"); |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
177 |
assert(region_ptr->_pushed++ == 0, "should only be pushed once"); |
1 | 178 |
#endif |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
179 |
region_stack_push(region_index); |
1 | 180 |
} |
181 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
182 |
void ParCompactionManager::region_stack_push(size_t region_index) { |
1 | 183 |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
184 |
#ifdef USE_RegionTaskQueueWithOverflow |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
185 |
region_stack()->save(region_index); |
1 | 186 |
#else |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
187 |
if(!region_stack()->push(region_index)) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
188 |
region_overflow_stack()->push(region_index); |
1 | 189 |
} |
190 |
#endif |
|
191 |
} |
|
192 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
193 |
bool ParCompactionManager::retrieve_for_processing(size_t& region_index) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
194 |
#ifdef USE_RegionTaskQueueWithOverflow |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
195 |
return region_stack()->retrieve(region_index); |
1 | 196 |
#else |
197 |
// Should not be used in the parallel case |
|
198 |
ShouldNotReachHere(); |
|
199 |
return false; |
|
200 |
#endif |
|
201 |
} |
|
202 |
||
203 |
ParCompactionManager* |
|
204 |
ParCompactionManager::gc_thread_compaction_manager(int index) { |
|
205 |
assert(index >= 0 && index < (int)ParallelGCThreads, "index out of range"); |
|
206 |
assert(_manager_array != NULL, "Sanity"); |
|
207 |
return _manager_array[index]; |
|
208 |
} |
|
209 |
||
210 |
void ParCompactionManager::reset() { |
|
211 |
for(uint i=0; i<ParallelGCThreads+1; i++) { |
|
212 |
manager_array(i)->revisit_klass_stack()->clear(); |
|
3696 | 213 |
manager_array(i)->revisit_mdo_stack()->clear(); |
1 | 214 |
} |
215 |
} |
|
216 |
||
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
217 |
void ParCompactionManager::follow_marking_stacks() { |
1 | 218 |
do { |
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
219 |
// Drain the overflow stack first, to allow stealing from the marking stack. |
5080
eff0cc882603
6935839: excessive marking stack growth during full gcs
jcoomes
parents:
5076
diff
changeset
|
220 |
oop obj; |
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
221 |
while (!overflow_stack()->is_empty()) { |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
222 |
overflow_stack()->pop()->follow_contents(this); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
223 |
} |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
224 |
while (marking_stack()->pop_local(obj)) { |
1 | 225 |
obj->follow_contents(this); |
226 |
} |
|
227 |
||
5080
eff0cc882603
6935839: excessive marking stack growth during full gcs
jcoomes
parents:
5076
diff
changeset
|
228 |
// Process ObjArrays one at a time to avoid marking stack bloat. |
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
229 |
ObjArrayTask task; |
5080
eff0cc882603
6935839: excessive marking stack growth during full gcs
jcoomes
parents:
5076
diff
changeset
|
230 |
if (!_objarray_overflow_stack->is_empty()) { |
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
231 |
task = _objarray_overflow_stack->pop(); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
232 |
objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint(); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
233 |
k->oop_follow_contents(this, task.obj(), task.index()); |
5080
eff0cc882603
6935839: excessive marking stack growth during full gcs
jcoomes
parents:
5076
diff
changeset
|
234 |
} else if (_objarray_queue.pop_local(task)) { |
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
235 |
objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint(); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
236 |
k->oop_follow_contents(this, task.obj(), task.index()); |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
237 |
} |
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
238 |
} while (!marking_stacks_empty()); |
1 | 239 |
|
5076
8b74a4b60b31
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
3795
diff
changeset
|
240 |
assert(marking_stacks_empty(), "Sanity"); |
1 | 241 |
} |
242 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
243 |
void ParCompactionManager::drain_region_overflow_stack() { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
244 |
size_t region_index = (size_t) -1; |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
245 |
while(region_stack()->retrieve_from_overflow(region_index)) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
246 |
PSParallelCompact::fill_and_update_region(this, region_index); |
1 | 247 |
} |
248 |
} |
|
249 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
250 |
void ParCompactionManager::drain_region_stacks() { |
1 | 251 |
#ifdef ASSERT |
252 |
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
|
253 |
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
|
254 |
MutableSpace* to_space = heap->young_gen()->to_space(); |
|
255 |
MutableSpace* old_space = heap->old_gen()->object_space(); |
|
256 |
MutableSpace* perm_space = heap->perm_gen()->object_space(); |
|
257 |
#endif /* ASSERT */ |
|
258 |
||
259 |
#if 1 // def DO_PARALLEL - the serial code hasn't been updated |
|
260 |
do { |
|
261 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
262 |
#ifdef USE_RegionTaskQueueWithOverflow |
1 | 263 |
// Drain overflow stack first, so other threads can steal from |
264 |
// claimed stack while we work. |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
265 |
size_t region_index = (size_t) -1; |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
266 |
while(region_stack()->retrieve_from_overflow(region_index)) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
267 |
PSParallelCompact::fill_and_update_region(this, region_index); |
1 | 268 |
} |
269 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
270 |
while (region_stack()->retrieve_from_stealable_queue(region_index)) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
271 |
PSParallelCompact::fill_and_update_region(this, region_index); |
1 | 272 |
} |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
273 |
} while (!region_stack()->is_empty()); |
1 | 274 |
#else |
275 |
// Drain overflow stack first, so other threads can steal from |
|
276 |
// claimed stack while we work. |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
277 |
while(!region_overflow_stack()->is_empty()) { |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
278 |
size_t region_index = region_overflow_stack()->pop(); |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
279 |
PSParallelCompact::fill_and_update_region(this, region_index); |
1 | 280 |
} |
281 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
282 |
size_t region_index = -1; |
1 | 283 |
// obj is a reference!!! |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
284 |
while (region_stack()->pop_local(region_index)) { |
1 | 285 |
// It would be nice to assert about the type of objects we might |
286 |
// pop, but they can come from anywhere, unfortunately. |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
287 |
PSParallelCompact::fill_and_update_region(this, region_index); |
1 | 288 |
} |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
289 |
} while((region_stack()->size() != 0) || |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
290 |
(region_overflow_stack()->length() != 0)); |
1 | 291 |
#endif |
292 |
||
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
293 |
#ifdef USE_RegionTaskQueueWithOverflow |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
294 |
assert(region_stack()->is_empty(), "Sanity"); |
1 | 295 |
#else |
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
296 |
assert(region_stack()->size() == 0, "Sanity"); |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
297 |
assert(region_overflow_stack()->length() == 0, "Sanity"); |
1 | 298 |
#endif |
299 |
#else |
|
300 |
oop obj; |
|
301 |
while (obj = retrieve_for_scanning()) { |
|
302 |
obj->follow_contents(this); |
|
303 |
} |
|
304 |
#endif |
|
305 |
} |
|
306 |
||
307 |
#ifdef ASSERT |
|
308 |
bool ParCompactionManager::stacks_have_been_allocated() { |
|
3696 | 309 |
return (revisit_klass_stack()->data_addr() != NULL && |
310 |
revisit_mdo_stack()->data_addr() != NULL); |
|
1 | 311 |
} |
312 |
#endif |