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.
Progress
Change must not contain extraneous whitespace
Change must be properly reviewed
Issue
JDK-8245227: VarHandle adaptation fails when non-crackable direct method handles are used as adapters
👋 Welcome back mcimadamore! A progress list of the required criteria for merging this PR into foreign-memaccess will be added to the body of your pull request.
@mcimadamore This change now passes all automated pre-integration checks, type /integrate in a new comment to proceed. After integration, the commit message will be:
8245227: VarHandle adaptation fails when non-crackable direct method handles are used as adapters
Reviewed-by: psandoz
If you would like to add a summary, use the /summary command.
To credit additional contributors, use the /contributor command.
To add additional solved issues, use the /issue command.
There are currently no new commits on the foreign-memaccess branch since the last update of the source branch of this PR. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you would like to avoid potential automatic rebasing, specify the current head hash when integrating, like this: /integrate e2d2dba6f2c7c5ad1247be3cffc098b830242919.
➡️ To integrate this PR with the above commit message to the foreign-memaccess branch, type /integrate in a new comment.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
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.Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/panama-foreign pull/177/head:pull/177
$ git checkout pull/177