--- a/src/hotspot/share/gc/z/zHeap.cpp Tue May 14 09:12:06 2019 +0200
+++ b/src/hotspot/share/gc/z/zHeap.cpp Tue May 14 09:55:02 2019 +0200
@@ -22,6 +22,7 @@
*/
#include "precompiled.hpp"
+#include "gc/shared/gcArguments.hpp"
#include "gc/shared/oopStorage.hpp"
#include "gc/z/zAddress.hpp"
#include "gc/z/zGlobals.hpp"
@@ -45,6 +46,7 @@
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
+#include "runtime/arguments.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"
#include "utilities/align.hpp"
@@ -62,7 +64,7 @@
ZHeap::ZHeap() :
_workers(),
_object_allocator(_workers.nworkers()),
- _page_allocator(heap_min_size(), heap_max_size(), heap_max_reserve_size()),
+ _page_allocator(heap_min_size(), heap_initial_size(), heap_max_size(), heap_max_reserve_size()),
_page_table(),
_forwarding_table(),
_mark(&_workers, &_page_table),
@@ -81,13 +83,15 @@
}
size_t ZHeap::heap_min_size() const {
- const size_t aligned_min_size = align_up(InitialHeapSize, ZGranuleSize);
- return MIN2(aligned_min_size, heap_max_size());
+ return MinHeapSize;
+}
+
+size_t ZHeap::heap_initial_size() const {
+ return InitialHeapSize;
}
size_t ZHeap::heap_max_size() const {
- const size_t aligned_max_size = align_up(MaxHeapSize, ZGranuleSize);
- return MIN2(aligned_max_size, ZAddressOffsetMax);
+ return MaxHeapSize;
}
size_t ZHeap::heap_max_reserve_size() const {
@@ -102,7 +106,7 @@
}
size_t ZHeap::min_capacity() const {
- return heap_min_size();
+ return _page_allocator.min_capacity();
}
size_t ZHeap::max_capacity() const {
@@ -250,10 +254,14 @@
_page_allocator.free_page(page, reclaimed);
}
+uint64_t ZHeap::uncommit(uint64_t delay) {
+ return _page_allocator.uncommit(delay);
+}
+
void ZHeap::before_flip() {
if (ZVerifyViews) {
// Unmap all pages
- _page_allocator.unmap_all_pages();
+ _page_allocator.debug_unmap_all_pages();
}
}
@@ -262,8 +270,9 @@
// Map all pages
ZPageTableIterator iter(&_page_table);
for (ZPage* page; iter.next(&page);) {
- _page_allocator.map_page(page);
+ _page_allocator.debug_map_page(page);
}
+ _page_allocator.debug_map_cached_pages();
}
}