[foreign-memaccess] RFR: 8245227: VarHandle adaptation fails when non-crackable direct method handles are used as adapters

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon May 18 18:06:07 UTC 2020


Not all direct method handles are crackable with revealDirect. When such adapters are enountered by the logic which
checks for absence of exception, an exception is thrown - since the code tries to test as to whether the adapter is a
direct handle and if so, an invocation to `revealDirect` occurs.

The solution is to obtain the member name from the direct handle and then take it from there (note that in such cases,
the member name is still set to the one of the crackable handle), and to avoid the more public `revealDirect` API.

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

Commit messages:
 - Fix bug with adaptation support and non-crackable direct handles

Changes: https://git.openjdk.java.net/panama-foreign/pull/177/files
 Webrev: https://webrevs.openjdk.java.net/panama-foreign/177/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8245227
  Stats: 40 lines in 2 files changed: 29 ins; 0 del; 11 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/177.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/177/head:pull/177

PR: https://git.openjdk.java.net/panama-foreign/pull/177


More information about the panama-dev mailing list