[jdk21u-dev] RFR: 8343377: Performance regression in reflective invocation of native methods
Chen Liang
liach at openjdk.org
Tue Jul 8 14:11:41 UTC 2025
On Fri, 6 Dec 2024 16:45:39 GMT, Chen Liang <liach at openjdk.org> wrote:
> The reimplementation of core reflection with Method Handles blanket-forced all native methods to use the native accessor due to bootstrapping issues. However, these are already covered by a `VM.isJavaLangInvokeInited()` check, and this blanket enforcement causes performance regression in reflective invocation of native methods like `Object::hashCode` or `Thread::currentThread`.
>
> The patch is not clean due to the comment update to `useNativeAccessor` - it edits a previously added comment not in JDK 21. The code changes are all clean.
@Voyinno I think we were looking at stabilizing that patch for longer back then. Anyone can open a new PR to backport this patch again if this is found necessary.
-------------
PR Comment: https://git.openjdk.org/jdk21u-dev/pull/1207#issuecomment-3049128192
More information about the jdk-updates-dev
mailing list