Integrated: 8353216: Improve VerifyMethodHandles for method handle linkers

Vladimir Ivanov vlivanov at openjdk.org
Thu Apr 24 01:11:56 UTC 2025


On Fri, 7 Mar 2025 20:58:15 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: 428334b6
Author:    Vladimir Ivanov <vlivanov at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/428334b616e1c436fbc2b8d71e41a0b154e9da12
Stats:     111 lines in 5 files changed: 97 ins; 2 del; 12 mod

8353216: Improve VerifyMethodHandles for method handle linkers

Reviewed-by: dlong

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

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


More information about the hotspot-dev mailing list