src/hotspot/share/gc/z/zHeap.cpp
changeset 58815 a4cdca87152b
parent 58706 d8e211419aaf
child 59040 1251d78fafbf
--- a/src/hotspot/share/gc/z/zHeap.cpp	Mon Oct 28 11:26:53 2019 +0100
+++ b/src/hotspot/share/gc/z/zHeap.cpp	Mon Oct 28 11:27:27 2019 +0100
@@ -244,34 +244,14 @@
   return _page_allocator.uncommit(delay);
 }
 
-void ZHeap::before_flip() {
-  if (ZVerifyViews) {
-    // Unmap all pages
-    _page_allocator.debug_unmap_all_pages();
-  }
-}
-
-void ZHeap::after_flip() {
-  if (ZVerifyViews) {
-    // Map all pages
-    ZPageTableIterator iter(&_page_table);
-    for (ZPage* page; iter.next(&page);) {
-      _page_allocator.debug_map_page(page);
-    }
-    _page_allocator.debug_map_cached_pages();
-  }
-}
-
 void ZHeap::flip_to_marked() {
-  before_flip();
+  ZVerifyViewsFlip flip(&_page_allocator);
   ZAddress::flip_to_marked();
-  after_flip();
 }
 
 void ZHeap::flip_to_remapped() {
-  before_flip();
+  ZVerifyViewsFlip flip(&_page_allocator);
   ZAddress::flip_to_remapped();
-  after_flip();
 }
 
 void ZHeap::mark_start() {
@@ -460,6 +440,14 @@
   iter.objects_do(cl, visit_weaks);
 }
 
+void ZHeap::pages_do(ZPageClosure* cl) {
+  ZPageTableIterator iter(&_page_table);
+  for (ZPage* page; iter.next(&page);) {
+    cl->do_page(page);
+  }
+  _page_allocator.pages_do(cl);
+}
+
 void ZHeap::serviceability_initialize() {
   _serviceability.initialize();
 }