Skip to content
Permalink
Browse files

8235748: ZGC: Remove ZAddress::address()

Reviewed-by: eosterlund, stefank
  • Loading branch information
pliden committed Dec 12, 2019
1 parent 056b70c commit b7bca76f51d9c8885a8d7e2675c18f7f6b765028
@@ -135,10 +135,6 @@
// * 63-48 Fixed (16-bits, always zero)
//

uintptr_t ZPlatformAddressBase() {
return 0;
}

size_t ZPlatformAddressOffsetBits() {
const size_t min_address_offset_bits = 42; // 4TB
const size_t max_address_offset_bits = 44; // 16TB
@@ -29,7 +29,6 @@ const size_t ZPlatformHeapViews = 3;
const size_t ZPlatformNMethodDisarmedOffset = 4;
const size_t ZPlatformCacheLineSize = 64;

uintptr_t ZPlatformAddressBase();
size_t ZPlatformAddressOffsetBits();
size_t ZPlatformAddressMetadataShift();

@@ -135,10 +135,6 @@
// * 63-48 Fixed (16-bits, always zero)
//

uintptr_t ZPlatformAddressBase() {
return 0;
}

size_t ZPlatformAddressOffsetBits() {
const size_t min_address_offset_bits = 42; // 4TB
const size_t max_address_offset_bits = 44; // 16TB
@@ -29,7 +29,6 @@ const size_t ZPlatformHeapViews = 3;
const size_t ZPlatformNMethodDisarmedOffset = 4;
const size_t ZPlatformCacheLineSize = 64;

uintptr_t ZPlatformAddressBase();
size_t ZPlatformAddressOffsetBits();
size_t ZPlatformAddressMetadataShift();

@@ -32,8 +32,6 @@ void ZAddress::set_good_mask(uintptr_t mask) {
}

void ZAddress::initialize() {
ZAddressBase = ZPlatformAddressBase();

ZAddressOffsetBits = ZPlatformAddressOffsetBits();
ZAddressOffsetMask = (((uintptr_t)1 << ZAddressOffsetBits) - 1) << ZAddressOffsetShift;
ZAddressOffsetMax = (uintptr_t)1 << ZAddressOffsetBits;
@@ -96,40 +96,36 @@ inline bool ZAddress::is_in(uintptr_t value) {
return value & (ZAddressMetadataMask & ~ZAddressMetadataFinalizable);
}

inline uintptr_t ZAddress::address(uintptr_t value) {
return value | ZAddressBase;
}

inline uintptr_t ZAddress::offset(uintptr_t value) {
return value & ZAddressOffsetMask;
}

inline uintptr_t ZAddress::good(uintptr_t value) {
return address(offset(value) | ZAddressGoodMask);
return offset(value) | ZAddressGoodMask;
}

inline uintptr_t ZAddress::good_or_null(uintptr_t value) {
return is_null(value) ? 0 : good(value);
}

inline uintptr_t ZAddress::finalizable_good(uintptr_t value) {
return address(offset(value) | ZAddressMetadataFinalizable | ZAddressGoodMask);
return offset(value) | ZAddressMetadataFinalizable | ZAddressGoodMask;
}

inline uintptr_t ZAddress::marked(uintptr_t value) {
return address(offset(value) | ZAddressMetadataMarked);
return offset(value) | ZAddressMetadataMarked;
}

inline uintptr_t ZAddress::marked0(uintptr_t value) {
return address(offset(value) | ZAddressMetadataMarked0);
return offset(value) | ZAddressMetadataMarked0;
}

inline uintptr_t ZAddress::marked1(uintptr_t value) {
return address(offset(value) | ZAddressMetadataMarked1);
return offset(value) | ZAddressMetadataMarked1;
}

inline uintptr_t ZAddress::remapped(uintptr_t value) {
return address(offset(value) | ZAddressMetadataRemapped);
return offset(value) | ZAddressMetadataRemapped;
}

inline uintptr_t ZAddress::remapped_or_null(uintptr_t value) {
@@ -42,8 +42,6 @@ uintptr_t ZAddressGoodMask;
uintptr_t ZAddressBadMask;
uintptr_t ZAddressWeakBadMask;

uintptr_t ZAddressBase;

size_t ZAddressOffsetBits;
uintptr_t ZAddressOffsetMask;
size_t ZAddressOffsetMax;
@@ -93,9 +93,6 @@ extern uintptr_t ZAddressGoodMask;
extern uintptr_t ZAddressBadMask;
extern uintptr_t ZAddressWeakBadMask;

// Pointer base address
extern uintptr_t ZAddressBase;

// Pointer part of address
extern size_t ZAddressOffsetBits;
const size_t ZAddressOffsetShift = 0;

0 comments on commit b7bca76

Please sign in to comment.
You can’t perform that action at this time.