@@ -51,7 +51,7 @@ PSPromotionManager::PSScannerTasksQueueSet* PSPromotionManager::_stack_array_dep
51
51
PreservedMarksSet* PSPromotionManager::_preserved_marks_set = nullptr ;
52
52
PSOldGen* PSPromotionManager::_old_gen = nullptr ;
53
53
MutableSpace* PSPromotionManager::_young_space = nullptr ;
54
- PartialArrayStateAllocator * PSPromotionManager::_partial_array_state_allocator = nullptr ;
54
+ PartialArrayStateManager * PSPromotionManager::_partial_array_state_manager = nullptr ;
55
55
56
56
void PSPromotionManager::initialize () {
57
57
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap ();
@@ -61,21 +61,20 @@ void PSPromotionManager::initialize() {
61
61
62
62
const uint promotion_manager_num = ParallelGCThreads;
63
63
64
+ assert (_partial_array_state_manager == nullptr , " Attempt to initialize twice" );
65
+ _partial_array_state_manager
66
+ = new PartialArrayStateManager (promotion_manager_num);
67
+
64
68
// To prevent false sharing, we pad the PSPromotionManagers
65
69
// and make sure that the first instance starts at a cache line.
66
70
assert (_manager_array == nullptr , " Attempt to initialize twice" );
67
71
_manager_array = PaddedArray<PSPromotionManager, mtGC>::create_unfreeable (promotion_manager_num);
68
72
69
- assert (_partial_array_state_allocator == nullptr , " Attempt to initialize twice" );
70
- _partial_array_state_allocator
71
- = new PartialArrayStateAllocator (ParallelGCThreads);
72
-
73
- _stack_array_depth = new PSScannerTasksQueueSet (ParallelGCThreads);
73
+ _stack_array_depth = new PSScannerTasksQueueSet (promotion_manager_num);
74
74
75
75
// Create and register the PSPromotionManager(s) for the worker threads.
76
76
for (uint i=0 ; i<ParallelGCThreads; i++) {
77
77
stack_array_depth ()->register_queue (i, _manager_array[i].claimed_stack_depth ());
78
- _manager_array[i]._partial_array_state_allocator_index = i;
79
78
}
80
79
// The VMThread gets its own PSPromotionManager, which is not available
81
80
// for work stealing.
@@ -187,7 +186,8 @@ void PSPromotionManager::reset_stats() {
187
186
188
187
// Most members are initialized either by initialize() or reset().
189
188
PSPromotionManager::PSPromotionManager ()
190
- : _partial_array_stepper(ParallelGCThreads, ParGCArrayScanChunk)
189
+ : _partial_array_state_allocator(_partial_array_state_manager),
190
+ _partial_array_stepper(ParallelGCThreads, ParGCArrayScanChunk)
191
191
{
192
192
// We set the old lab's start array.
193
193
_old_lab.set_start_array (old_gen ()->start_array ());
@@ -198,9 +198,6 @@ PSPromotionManager::PSPromotionManager()
198
198
_target_stack_size = GCDrainStackTargetSize;
199
199
}
200
200
201
- // Initialize to a bad value; fixed by initialize().
202
- _partial_array_state_allocator_index = UINT_MAX;
203
-
204
201
// let's choose 1.5x the chunk size
205
202
_min_array_size_for_chunking = (3 * ParGCArrayScanChunk / 2 );
206
203
@@ -317,7 +314,7 @@ void PSPromotionManager::process_array_chunk(PartialArrayState* state) {
317
314
process_array_chunk_work<oop>(state->destination (), start, end);
318
315
}
319
316
// Release reference to state, now that we're done with it.
320
- _partial_array_state_allocator-> release (_partial_array_state_allocator_index, state);
317
+ _partial_array_state_allocator. release (state);
321
318
}
322
319
323
320
void PSPromotionManager::push_objArray (oop old_obj, oop new_obj) {
@@ -331,11 +328,10 @@ void PSPromotionManager::push_objArray(oop old_obj, oop new_obj) {
331
328
if (step._ncreate > 0 ) {
332
329
TASKQUEUE_STATS_ONLY (++_arrays_chunked);
333
330
PartialArrayState* state =
334
- _partial_array_state_allocator->allocate (_partial_array_state_allocator_index,
335
- old_obj, new_obj,
336
- step._index ,
337
- array_length,
338
- step._ncreate );
331
+ _partial_array_state_allocator.allocate (old_obj, new_obj,
332
+ step._index ,
333
+ array_length,
334
+ step._ncreate );
339
335
for (uint i = 0 ; i < step._ncreate ; ++i) {
340
336
push_depth (ScannerTask (state));
341
337
}
0 commit comments