Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 4072:8aae2050e83e
7092309: G1: introduce old region set
Summary: Keep track of all the old regions in the heap with a heap region set.
Reviewed-by: brutisso, johnc
author | tonyp |
---|---|
date | Mon, 07 Nov 2011 22:11:12 -0500 |
parents | 074f0252cc13 |
children | 6071e0581859 |
comparison
equal
deleted
inserted
replaced
4071:ed80554efa25 | 4072:8aae2050e83e |
---|---|
1516 int _worker_num; | 1516 int _worker_num; |
1517 size_t _max_live_bytes; | 1517 size_t _max_live_bytes; |
1518 size_t _regions_claimed; | 1518 size_t _regions_claimed; |
1519 size_t _freed_bytes; | 1519 size_t _freed_bytes; |
1520 FreeRegionList* _local_cleanup_list; | 1520 FreeRegionList* _local_cleanup_list; |
1521 OldRegionSet* _old_proxy_set; | |
1521 HumongousRegionSet* _humongous_proxy_set; | 1522 HumongousRegionSet* _humongous_proxy_set; |
1522 HRRSCleanupTask* _hrrs_cleanup_task; | 1523 HRRSCleanupTask* _hrrs_cleanup_task; |
1523 double _claimed_region_time; | 1524 double _claimed_region_time; |
1524 double _max_region_time; | 1525 double _max_region_time; |
1525 | 1526 |
1526 public: | 1527 public: |
1527 G1NoteEndOfConcMarkClosure(G1CollectedHeap* g1, | 1528 G1NoteEndOfConcMarkClosure(G1CollectedHeap* g1, |
1528 int worker_num, | 1529 int worker_num, |
1529 FreeRegionList* local_cleanup_list, | 1530 FreeRegionList* local_cleanup_list, |
1531 OldRegionSet* old_proxy_set, | |
1530 HumongousRegionSet* humongous_proxy_set, | 1532 HumongousRegionSet* humongous_proxy_set, |
1531 HRRSCleanupTask* hrrs_cleanup_task); | 1533 HRRSCleanupTask* hrrs_cleanup_task); |
1532 size_t freed_bytes() { return _freed_bytes; } | 1534 size_t freed_bytes() { return _freed_bytes; } |
1533 | 1535 |
1534 bool doHeapRegion(HeapRegion *r); | 1536 bool doHeapRegion(HeapRegion *r); |
1555 _max_live_bytes(0), _freed_bytes(0), _cleanup_list(cleanup_list) { } | 1557 _max_live_bytes(0), _freed_bytes(0), _cleanup_list(cleanup_list) { } |
1556 | 1558 |
1557 void work(int i) { | 1559 void work(int i) { |
1558 double start = os::elapsedTime(); | 1560 double start = os::elapsedTime(); |
1559 FreeRegionList local_cleanup_list("Local Cleanup List"); | 1561 FreeRegionList local_cleanup_list("Local Cleanup List"); |
1562 OldRegionSet old_proxy_set("Local Cleanup Old Proxy Set"); | |
1560 HumongousRegionSet humongous_proxy_set("Local Cleanup Humongous Proxy Set"); | 1563 HumongousRegionSet humongous_proxy_set("Local Cleanup Humongous Proxy Set"); |
1561 HRRSCleanupTask hrrs_cleanup_task; | 1564 HRRSCleanupTask hrrs_cleanup_task; |
1562 G1NoteEndOfConcMarkClosure g1_note_end(_g1h, i, &local_cleanup_list, | 1565 G1NoteEndOfConcMarkClosure g1_note_end(_g1h, i, &local_cleanup_list, |
1566 &old_proxy_set, | |
1563 &humongous_proxy_set, | 1567 &humongous_proxy_set, |
1564 &hrrs_cleanup_task); | 1568 &hrrs_cleanup_task); |
1565 if (G1CollectedHeap::use_parallel_gc_threads()) { | 1569 if (G1CollectedHeap::use_parallel_gc_threads()) { |
1566 _g1h->heap_region_par_iterate_chunked(&g1_note_end, i, | 1570 _g1h->heap_region_par_iterate_chunked(&g1_note_end, i, |
1567 HeapRegion::NoteEndClaimValue); | 1571 HeapRegion::NoteEndClaimValue); |
1571 assert(g1_note_end.complete(), "Shouldn't have yielded!"); | 1575 assert(g1_note_end.complete(), "Shouldn't have yielded!"); |
1572 | 1576 |
1573 // Now update the lists | 1577 // Now update the lists |
1574 _g1h->update_sets_after_freeing_regions(g1_note_end.freed_bytes(), | 1578 _g1h->update_sets_after_freeing_regions(g1_note_end.freed_bytes(), |
1575 NULL /* free_list */, | 1579 NULL /* free_list */, |
1580 &old_proxy_set, | |
1576 &humongous_proxy_set, | 1581 &humongous_proxy_set, |
1577 true /* par */); | 1582 true /* par */); |
1578 { | 1583 { |
1579 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); | 1584 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); |
1580 _max_live_bytes += g1_note_end.max_live_bytes(); | 1585 _max_live_bytes += g1_note_end.max_live_bytes(); |
1641 | 1646 |
1642 G1NoteEndOfConcMarkClosure:: | 1647 G1NoteEndOfConcMarkClosure:: |
1643 G1NoteEndOfConcMarkClosure(G1CollectedHeap* g1, | 1648 G1NoteEndOfConcMarkClosure(G1CollectedHeap* g1, |
1644 int worker_num, | 1649 int worker_num, |
1645 FreeRegionList* local_cleanup_list, | 1650 FreeRegionList* local_cleanup_list, |
1651 OldRegionSet* old_proxy_set, | |
1646 HumongousRegionSet* humongous_proxy_set, | 1652 HumongousRegionSet* humongous_proxy_set, |
1647 HRRSCleanupTask* hrrs_cleanup_task) | 1653 HRRSCleanupTask* hrrs_cleanup_task) |
1648 : _g1(g1), _worker_num(worker_num), | 1654 : _g1(g1), _worker_num(worker_num), |
1649 _max_live_bytes(0), _regions_claimed(0), | 1655 _max_live_bytes(0), _regions_claimed(0), |
1650 _freed_bytes(0), | 1656 _freed_bytes(0), |
1651 _claimed_region_time(0.0), _max_region_time(0.0), | 1657 _claimed_region_time(0.0), _max_region_time(0.0), |
1652 _local_cleanup_list(local_cleanup_list), | 1658 _local_cleanup_list(local_cleanup_list), |
1659 _old_proxy_set(old_proxy_set), | |
1653 _humongous_proxy_set(humongous_proxy_set), | 1660 _humongous_proxy_set(humongous_proxy_set), |
1654 _hrrs_cleanup_task(hrrs_cleanup_task) { } | 1661 _hrrs_cleanup_task(hrrs_cleanup_task) { } |
1655 | 1662 |
1656 bool G1NoteEndOfConcMarkClosure::doHeapRegion(HeapRegion *hr) { | 1663 bool G1NoteEndOfConcMarkClosure::doHeapRegion(HeapRegion *hr) { |
1657 // We use a claim value of zero here because all regions | 1664 // We use a claim value of zero here because all regions |
1663 hr->note_end_of_marking(); | 1670 hr->note_end_of_marking(); |
1664 _max_live_bytes += hr->max_live_bytes(); | 1671 _max_live_bytes += hr->max_live_bytes(); |
1665 _g1->free_region_if_empty(hr, | 1672 _g1->free_region_if_empty(hr, |
1666 &_freed_bytes, | 1673 &_freed_bytes, |
1667 _local_cleanup_list, | 1674 _local_cleanup_list, |
1675 _old_proxy_set, | |
1668 _humongous_proxy_set, | 1676 _humongous_proxy_set, |
1669 _hrrs_cleanup_task, | 1677 _hrrs_cleanup_task, |
1670 true /* par */); | 1678 true /* par */); |
1671 double region_time = (os::elapsedTime() - start); | 1679 double region_time = (os::elapsedTime() - start); |
1672 _claimed_region_time += region_time; | 1680 _claimed_region_time += region_time; |
1687 if (has_aborted()) { | 1695 if (has_aborted()) { |
1688 g1h->set_marking_complete(); // So bitmap clearing isn't confused | 1696 g1h->set_marking_complete(); // So bitmap clearing isn't confused |
1689 return; | 1697 return; |
1690 } | 1698 } |
1691 | 1699 |
1700 HRSPhaseSetter x(HRSPhaseCleanup); | |
1692 g1h->verify_region_sets_optional(); | 1701 g1h->verify_region_sets_optional(); |
1693 | 1702 |
1694 if (VerifyDuringGC) { | 1703 if (VerifyDuringGC) { |
1695 HandleMark hm; // handle scope | 1704 HandleMark hm; // handle scope |
1696 gclog_or_tty->print(" VerifyDuringGC:(before)"); | 1705 gclog_or_tty->print(" VerifyDuringGC:(before)"); |