RFR: 8366747: RISC-V: Improve VerifyMethodHandles for method handle linkers

Fei Yang fyang at openjdk.org
Wed Sep 3 02:04:43 UTC 2025


On Tue, 26 Aug 2025 09:18:14 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:

> According to JDK-8353216,Add extra verification logic into MethodHandle::invokeBasic/linkTo* to ensure that holder classes are properly initialized on riscv platform.

Seems fine to me. Two minor comments.

src/hotspot/cpu/riscv/methodHandles_riscv.cpp line 100:

> 98:   __ verify_method_ptr(method);
> 99:   if (VerifyMethodHandles) {
> 100:     Label L_ok;

Can you add an assertion here about the registers? Like: `assert_different_registers(method, t0, t1);`

src/hotspot/cpu/riscv/methodHandles_riscv.cpp line 102:

> 100:     Label L_ok;
> 101:     const Register method_holder = t1;
> 102:     __ load_method_holder(method_holder, method);

Please leave a new line before the swith-case structure.

-------------

PR Review: https://git.openjdk.org/jdk/pull/26938#pullrequestreview-3178689768
PR Review Comment: https://git.openjdk.org/jdk/pull/26938#discussion_r2317554909
PR Review Comment: https://git.openjdk.org/jdk/pull/26938#discussion_r2317575345


More information about the hotspot-compiler-dev mailing list