8232601: ZGC: Parameterize the ZGranuleMap table size
Reviewed-by: pliden, eosterlund
This commit is contained in:
parent
0290476112
commit
acf447e49e
@ -25,11 +25,12 @@
|
||||
#include "gc/z/zAddress.inline.hpp"
|
||||
#include "gc/z/zForwarding.inline.hpp"
|
||||
#include "gc/z/zForwardingTable.inline.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zGranuleMap.inline.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
ZForwardingTable::ZForwardingTable() :
|
||||
_map() {}
|
||||
_map(ZAddressOffsetMax) {}
|
||||
|
||||
void ZForwardingTable::insert(ZForwarding* forwarding) {
|
||||
const uintptr_t addr = ZAddress::good(forwarding->start());
|
||||
|
@ -41,7 +41,7 @@ private:
|
||||
size_t index_for_addr(uintptr_t addr) const;
|
||||
|
||||
public:
|
||||
ZGranuleMap();
|
||||
ZGranuleMap(size_t max_offset);
|
||||
~ZGranuleMap();
|
||||
|
||||
T get(uintptr_t addr) const;
|
||||
|
@ -28,11 +28,15 @@
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zGranuleMap.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
template <typename T>
|
||||
inline ZGranuleMap<T>::ZGranuleMap() :
|
||||
_size(ZAddressOffsetMax >> ZGranuleSizeShift),
|
||||
_map(MmapArrayAllocator<T>::allocate(_size, mtGC)) {}
|
||||
inline ZGranuleMap<T>::ZGranuleMap(size_t max_offset) :
|
||||
_size(max_offset >> ZGranuleSizeShift),
|
||||
_map(MmapArrayAllocator<T>::allocate(_size, mtGC)) {
|
||||
assert(is_aligned(max_offset, ZGranuleSize), "Misaligned");
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline ZGranuleMap<T>::~ZGranuleMap() {
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
|
||||
ZHeapIterator::ZHeapIterator() :
|
||||
_visit_stack(),
|
||||
_visit_map() {}
|
||||
_visit_map(ZAddressOffsetMax) {}
|
||||
|
||||
ZHeapIterator::~ZHeapIterator() {
|
||||
ZVisitMapIterator iter(&_visit_map);
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/z/zAddress.inline.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zGranuleMap.inline.hpp"
|
||||
#include "gc/z/zPage.inline.hpp"
|
||||
#include "gc/z/zPageTable.inline.hpp"
|
||||
@ -30,7 +31,7 @@
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
ZPageTable::ZPageTable() :
|
||||
_map() {}
|
||||
_map(ZAddressOffsetMax) {}
|
||||
|
||||
void ZPageTable::insert(ZPage* page) {
|
||||
const uintptr_t addr = ZAddress::good(page->start());
|
||||
|
Loading…
x
Reference in New Issue
Block a user