Skip to content

Commit

Permalink
8346832: runtime/CompressedOops/CompressedCPUSpecificClassSpaceReserv…
Browse files Browse the repository at this point in the history
…ation.java fails on RISC-V

Reviewed-by: stuefe, fjiang
  • Loading branch information
RealFYang committed Jan 7, 2025
1 parent 27646e5 commit de02503
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
7 changes: 1 addition & 6 deletions src/hotspot/cpu/riscv/compressedKlass_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size

char* result = nullptr;

// RiscV loads a 64-bit immediate in up to four separate steps, splitting it into four different sections
// RISC-V loads a 64-bit immediate in up to four separate steps, splitting it into four different sections
// (two 32-bit sections, each split into two subsections of 20/12 bits).
//
// 63 ....... 44 43 ... 32 31 ....... 12 11 ... 0
Expand All @@ -51,11 +51,6 @@ char* CompressedKlassPointers::reserve_address_space_for_compressed_classes(size
// with one instruction (2)
result = reserve_address_space_for_unscaled_encoding(size, aslr);

// Failing that, attempt to reserve for base=zero shift>0
if (result == nullptr && optimize_for_zero_base) {
result = reserve_address_space_for_zerobased_encoding(size, aslr);
}

// Failing that, optimize for case (3) - a base with only bits set between [32-44)
if (result == nullptr) {
const uintptr_t from = nth_bit(32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,8 @@ private static void do_test(boolean CDS) throws IOException {
output.shouldContain(tryReserveFor16bitMoveIntoQ3);
} else if (Platform.isRISCV64()) {
output.shouldContain(tryReserveForUnscaled); // unconditionally
if (CDS) {
output.shouldNotContain(tryReserveForZeroBased);
// bits 32..44
output.shouldContain("reserve_between (range [0x0000000100000000-0x0000100000000000)");
} else {
output.shouldContain(tryReserveForZeroBased);
// bits 32..44, but not lower than zero-based limit
output.shouldContain("reserve_between (range [0x0000000800000000-0x0000100000000000)");
}
// bits 32..44
output.shouldContain("reserve_between (range [0x0000000100000000-0x0000100000000000)");
// bits 44..64
output.shouldContain("reserve_between (range [0x0000100000000000-0xffffffffffffffff)");
} else if (Platform.isS390x()) {
Expand Down

0 comments on commit de02503

Please sign in to comment.