323
324 bool G1MarkSweep::in_archive_range(oop object) {
325 // This is the out-of-line part of is_archive_object test, done separately
326 // to avoid additional performance impact when the check is not enabled.
327 return _archive_region_map.get_by_address((HeapWord*)object);
328 }
329
330 void G1MarkSweep::prepare_compaction_work(G1PrepareCompactClosure* blk) {
331 G1CollectedHeap* g1h = G1CollectedHeap::heap();
332 g1h->heap_region_iterate(blk);
333 blk->update_sets();
334 }
335
336 void G1PrepareCompactClosure::free_humongous_region(HeapRegion* hr) {
337 HeapWord* end = hr->end();
338 FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
339
340 hr->set_containing_set(NULL);
341 _humongous_regions_removed++;
342
343 _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */);
344 prepare_for_compaction(hr, end);
345 dummy_free_list.remove_all();
346 }
347
348 void G1PrepareCompactClosure::prepare_for_compaction(HeapRegion* hr, HeapWord* end) {
349 // If this is the first live region that we came across which we can compact,
350 // initialize the CompactPoint.
351 if (!is_cp_initialized()) {
352 _cp.space = hr;
353 _cp.threshold = hr->initialize_threshold();
354 }
355 prepare_for_compaction_work(&_cp, hr, end);
356 }
357
358 void G1PrepareCompactClosure::prepare_for_compaction_work(CompactPoint* cp,
359 HeapRegion* hr,
360 HeapWord* end) {
361 hr->prepare_for_compaction(cp);
362 // Also clear the part of the card table that will be unused after
363 // compaction.
|
323
324 bool G1MarkSweep::in_archive_range(oop object) {
325 // This is the out-of-line part of is_archive_object test, done separately
326 // to avoid additional performance impact when the check is not enabled.
327 return _archive_region_map.get_by_address((HeapWord*)object);
328 }
329
330 void G1MarkSweep::prepare_compaction_work(G1PrepareCompactClosure* blk) {
331 G1CollectedHeap* g1h = G1CollectedHeap::heap();
332 g1h->heap_region_iterate(blk);
333 blk->update_sets();
334 }
335
336 void G1PrepareCompactClosure::free_humongous_region(HeapRegion* hr) {
337 HeapWord* end = hr->end();
338 FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
339
340 hr->set_containing_set(NULL);
341 _humongous_regions_removed++;
342
343 _g1h->free_humongous_region(hr, &dummy_free_list, false /* skip_remset */);
344 prepare_for_compaction(hr, end);
345 dummy_free_list.remove_all();
346 }
347
348 void G1PrepareCompactClosure::prepare_for_compaction(HeapRegion* hr, HeapWord* end) {
349 // If this is the first live region that we came across which we can compact,
350 // initialize the CompactPoint.
351 if (!is_cp_initialized()) {
352 _cp.space = hr;
353 _cp.threshold = hr->initialize_threshold();
354 }
355 prepare_for_compaction_work(&_cp, hr, end);
356 }
357
358 void G1PrepareCompactClosure::prepare_for_compaction_work(CompactPoint* cp,
359 HeapRegion* hr,
360 HeapWord* end) {
361 hr->prepare_for_compaction(cp);
362 // Also clear the part of the card table that will be unused after
363 // compaction.
|