JDK-8346868 : RISC-V: compiler/sharedstubs tests fail after JDK-8332689
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24,25
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: riscv
  • Submitted: 2024-12-28
  • Updated: 2025-01-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Following two tests fail with debug build on linux-riscv64 platform:
   TEST: compiler/sharedstubs/SharedStubToInterpTest.java
    TEST: compiler/sharedstubs/SharedTrampolineTest.java

A bit about the change history. https://bugs.openjdk.org/browse/JDK-8293011 shared stubs to interpreter for static calls.
And https://bugs.openjdk.org/browse/JDK-8293770 reused runtime call trampolines.
So we have `static constexpr bool supports_shared_stubs() { return true; }` in file src/hotspot/cpu/riscv/codeBuffer_riscv.hpp.
And both cases are handled in `CodeBuffer::pd_finalize_stubs` in file src/hotspot/cpu/riscv/codeBuffer_riscv.cpp.

```
bool CodeBuffer::pd_finalize_stubs() {
  return emit_shared_stubs_to_interp<MacroAssembler>(this, _shared_stub_to_interp_requests)
         && emit_shared_trampolines(this, _shared_trampoline_requests);
}
```

Then https://bugs.openjdk.org/browse/JDK-8332689 turned off uses of trampolines for far calls and changed this function into:
`static bool supports_shared_stubs() { return UseTrampolines; }`. This will cause the two test failures as option `UseTrampolines`
is off by default. Further, https://bugs.openjdk.org/browse/JDK-8343430 removed old trampoline call and option `UseTrampolines`.
So now we have `static bool supports_shared_stubs() { return false; }` and a simplified `CodeBuffer::pd_finalize_stubs`.

```
bool CodeBuffer::pd_finalize_stubs() {
  return emit_shared_stubs_to_interp<MacroAssembler>(this, _shared_stub_to_interp_requests);
}
```

But JDK-8332689 should only make the runtime call trampolines reuse feature depend on option `UseTrampolines`. It should not
affect the use of shared stubs to interpreter for static calls.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22888 Date: 2024-12-28 02:37:18 +0000
28-12-2024