RFR: 8353216: Improve VerifyMethodHandles for method handle linkers [v3]

Vladimir Ivanov vlivanov at openjdk.org
Fri Apr 11 22:48:12 UTC 2025


> Add extra verification logic into `MethodHandle::invokeBasic/linkTo*` to ensure that holder classes are properly initialized.
> 
> The patch covers x86 and aarch64 platforms.
> 
> There are some differences in expectations between invocation modes.
> While `invokeStatic` assumes a clinit barrier (and `invokeBasic` just requires the holder class to be fully initialized), other invocation modes can only expect that class initialization has been initiated (due to class initialization failures and premature publication, instances of partially initialized classes can be observed).   
> 
> Testing: hs-tier1 - hs-tier4

Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:

  subs -> cmp

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23950/files
  - new: https://git.openjdk.org/jdk/pull/23950/files/ef7fa5cc..3b9374c5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23950&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23950&range=01-02

  Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/23950.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23950/head:pull/23950

PR: https://git.openjdk.org/jdk/pull/23950


More information about the hotspot-dev mailing list