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

Paul Sandoz psandoz at openjdk.java.net
Mon May 18 18:25:42 UTC 2020

On Mon, 18 May 2020 17:57:35 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> 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.

Marked as reviewed by psandoz (Committer).


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

More information about the panama-dev mailing list