Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8346868

RISC-V: compiler/sharedstubs tests fail after JDK-8332689

XMLWordPrintable

    • b05
    • riscv
    • linux

        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.

              fyang Fei Yang
              fyang Fei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: