Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @ 1705:2d160770d2e5
6814437: G1: remove the _new_refs array
Summary: The per-worker _new_refs array is used to hold references that point into the collection set. It is populated during RSet updating and subsequently processed. In the event of an evacuation failure it processed again to recreate the RSets of regions in the collection set. Remove the per-worker _new_refs array by processing the references directly. Use a DirtyCardQueue to hold the cards containing the references so that the RSets of regions in the collection set can be recreated when handling an evacuation failure.
Reviewed-by: iveresov, jmasa, tonyp
author | johnc |
---|---|
date | Mon, 02 Aug 2010 12:51:43 -0700 |
parents | 5cbac8938c4c |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1704:63f4675ac87d | 1705:2d160770d2e5 |
---|---|
337 // region. See above on how this can happen. | 337 // region. See above on how this can happen. |
338 | 338 |
339 return res; | 339 return res; |
340 } | 340 } |
341 | 341 |
342 void ConcurrentG1Refine::clean_up_cache(int worker_i, G1RemSet* g1rs) { | 342 void ConcurrentG1Refine::clean_up_cache(int worker_i, |
343 G1RemSet* g1rs, | |
344 DirtyCardQueue* into_cset_dcq) { | |
343 assert(!use_cache(), "cache should be disabled"); | 345 assert(!use_cache(), "cache should be disabled"); |
344 int start_idx; | 346 int start_idx; |
345 | 347 |
346 while ((start_idx = _hot_cache_par_claimed_idx) < _n_hot) { // read once | 348 while ((start_idx = _hot_cache_par_claimed_idx) < _n_hot) { // read once |
347 int end_idx = start_idx + _hot_cache_par_chunk_size; | 349 int end_idx = start_idx + _hot_cache_par_chunk_size; |
351 // The current worker has successfully claimed the chunk [start_idx..end_idx) | 353 // The current worker has successfully claimed the chunk [start_idx..end_idx) |
352 end_idx = MIN2(end_idx, _n_hot); | 354 end_idx = MIN2(end_idx, _n_hot); |
353 for (int i = start_idx; i < end_idx; i++) { | 355 for (int i = start_idx; i < end_idx; i++) { |
354 jbyte* entry = _hot_cache[i]; | 356 jbyte* entry = _hot_cache[i]; |
355 if (entry != NULL) { | 357 if (entry != NULL) { |
356 g1rs->concurrentRefineOneCard(entry, worker_i); | 358 if (g1rs->concurrentRefineOneCard(entry, worker_i, true)) { |
359 // 'entry' contains references that point into the current | |
360 // collection set. We need to record 'entry' in the DCQS | |
361 // that's used for that purpose. | |
362 // | |
363 // The only time we care about recording cards that contain | |
364 // references that point into the collection set is during | |
365 // RSet updating while within an evacuation pause. | |
366 // In this case worker_i should be the id of a GC worker thread | |
367 assert(SafepointSynchronize::is_at_safepoint(), "not during an evacuation pause"); | |
368 assert(worker_i < (int) DirtyCardQueueSet::num_par_ids(), "incorrect worker id"); | |
369 into_cset_dcq->enqueue(entry); | |
370 } | |
357 } | 371 } |
358 } | 372 } |
359 } | 373 } |
360 } | 374 } |
361 } | 375 } |