--- old/src/hotspot/share/gc/z/zPage.inline.hpp 2019-05-02 09:57:48.406012562 +0200 +++ new/src/hotspot/share/gc/z/zPage.inline.hpp 2019-05-02 09:57:48.164004570 +0200 @@ -34,10 +34,23 @@ #include "gc/z/zVirtualMemory.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" -#include "runtime/orderAccess.hpp" +#include "runtime/os.hpp" #include "utilities/align.hpp" #include "utilities/debug.hpp" +inline uint8_t ZPage::type_from_size(size_t size) const { + switch (size) { + case ZPageSizeSmall: + return ZPageTypeSmall; + + case ZPageSizeMedium: + return ZPageTypeMedium; + + default: + return ZPageTypeLarge; + } +} + inline const char* ZPage::type_to_string() const { switch (type()) { case ZPageTypeSmall: @@ -116,7 +129,7 @@ return end() - top(); } -inline ZPhysicalMemory& ZPage::physical_memory() { +inline const ZPhysicalMemory& ZPage::physical_memory() const { return _physical; } @@ -124,6 +137,14 @@ return _virtual; } +inline uint64_t ZPage::last_used() const { + return _last_used; +} + +inline void ZPage::set_last_used() { + _last_used = os::elapsedTime(); +} + inline uint8_t ZPage::numa_id() { if (_numa_id == (uint8_t)-1) { _numa_id = (uint8_t)ZNUMA::memory_id(ZAddress::good(start()));