[jdk21u-dev] RFR: 8343377: Performance regression in reflective invocation of native methods

Chen Liang liach at openjdk.org
Fri Dec 6 17:04:13 UTC 2024


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.

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

Commit messages:
 - 8343377: Performance regression in reflective invocation of native methods

Changes: https://git.openjdk.org/jdk21u-dev/pull/1207/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=1207&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8343377
  Stats: 137 lines in 3 files changed: 122 ins; 2 del; 13 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/1207.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/1207/head:pull/1207

PR: https://git.openjdk.org/jdk21u-dev/pull/1207


More information about the jdk-updates-dev mailing list