Skip to content

Commit 3bcf218

Browse files
author
duke
committed
Backport 1d2ccaeaa316029772b5de3dc5579ee7b1363b60
1 parent f90566a commit 3bcf218

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hotspot/share/cds/filemap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ address FileMapInfo::heap_region_dumptime_address() {
22192219
assert(CDSConfig::is_using_archive(), "runtime only");
22202220
assert(is_aligned(r->mapping_offset(), sizeof(HeapWord)), "must be");
22212221
if (UseCompressedOops) {
2222-
return /*dumptime*/ narrow_oop_base() + r->mapping_offset();
2222+
return /*dumptime*/ (address)((uintptr_t)narrow_oop_base() + r->mapping_offset());
22232223
} else {
22242224
return heap_region_requested_address();
22252225
}
@@ -2245,7 +2245,7 @@ address FileMapInfo::heap_region_requested_address() {
22452245
// Runtime base = 0x4000 and shift is also 0. If we map this region at 0x5000, then
22462246
// the value P can remain 0x1200. The decoded address = (0x4000 + (0x1200 << 0)) = 0x5200,
22472247
// which is the runtime location of the referenced object.
2248-
return /*runtime*/ CompressedOops::base() + r->mapping_offset();
2248+
return /*runtime*/ (address)((uintptr_t)CompressedOops::base() + r->mapping_offset());
22492249
} else {
22502250
// This was the hard-coded requested base address used at dump time. With uncompressed oops,
22512251
// the heap range is assigned by the OS so we will most likely have to relocate anyway, no matter

src/hotspot/share/memory/virtualspace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ void ReservedHeapSpace::try_reserve_range(char *highest_start,
457457
while (attach_point >= lowest_start &&
458458
attach_point <= highest_start && // Avoid wrap around.
459459
((_base == nullptr) ||
460-
(_base < aligned_heap_base_min_address || _base + size > upper_bound))) {
460+
(_base < aligned_heap_base_min_address || size > (uintptr_t)(upper_bound - _base)))) {
461461
try_reserve_heap(size, alignment, page_size, attach_point);
462462
attach_point -= stepsize;
463463
}

0 commit comments

Comments
 (0)