< prev index next >
src/hotspot/share/gc/z/zHeap.cpp
Print this page
*** 245,279 ****
if (page->dec_refcount()) {
_page_allocator.free_page(page, reclaimed);
}
}
! void ZHeap::flip_views() {
! // For debugging only
! if (ZUnmapBadViews) {
! // Flip pages
ZPageTableIterator iter(&_pagetable);
for (ZPage* page; iter.next(&page);) {
if (!page->is_detached()) {
! _page_allocator.flip_page(page);
}
}
-
- // Flip pre-mapped memory
- _page_allocator.flip_pre_mapped();
}
}
void ZHeap::mark_start() {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
// Update statistics
ZStatSample(ZSamplerHeapUsedBeforeMark, used());
// Flip address view
! ZAddressMasks::flip_to_marked();
! flip_views();
// Retire allocating pages
_object_allocator.retire_pages();
// Reset allocated/reclaimed/used statistics
--- 245,293 ----
if (page->dec_refcount()) {
_page_allocator.free_page(page, reclaimed);
}
}
! void ZHeap::before_flip() {
! if (ZVerifyViews) {
! // Unmap all pages
! _page_allocator.unmap_all_pages();
! }
! }
!
! void ZHeap::after_flip() {
! if (ZVerifyViews) {
! // Map all pages
ZPageTableIterator iter(&_pagetable);
for (ZPage* page; iter.next(&page);) {
if (!page->is_detached()) {
! _page_allocator.map_page(page);
}
}
}
}
+ void ZHeap::flip_to_marked() {
+ before_flip();
+ ZAddressMasks::flip_to_marked();
+ after_flip();
+ }
+
+ void ZHeap::flip_to_remapped() {
+ before_flip();
+ ZAddressMasks::flip_to_remapped();
+ after_flip();
+ }
+
void ZHeap::mark_start() {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
// Update statistics
ZStatSample(ZSamplerHeapUsedBeforeMark, used());
// Flip address view
! flip_to_marked();
// Retire allocating pages
_object_allocator.retire_pages();
// Reset allocated/reclaimed/used statistics
*** 464,475 ****
// Finish unloading of classes and code
_unload.finish();
// Flip address view
! ZAddressMasks::flip_to_remapped();
! flip_views();
// Enter relocate phase
ZGlobalPhase = ZPhaseRelocate;
// Update statistics
--- 478,488 ----
// Finish unloading of classes and code
_unload.finish();
// Flip address view
! flip_to_remapped();
// Enter relocate phase
ZGlobalPhase = ZPhaseRelocate;
// Update statistics
< prev index next >