Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0.48) Stash all invokedynamic and invokehandle arguments for OSR #20242

Merged

Conversation

jdmpapin
Copy link
Contributor

@jdmpapin jdmpapin commented Sep 26, 2024

This is a cherry-pick of #20232 for 0.48.

Fixes #19369

When stashing arguments for OSR at an invokedynamic or invokehandle
bytecode instruction, the callee usually has an extra parameter (the
appendix, if it's non-null). If the call is unresolved, it expects two
extra parameters instead (the appendix and a MemberName). For the
purpose of stashing, these are all ignored because they're not on the
stack just prior to running the invoke bytecode instruction. However,
in these cases stashArgumentsForOSR() has been ignoring the top one or
two elements of the stack as well, as though the extra arguments were
already pushed. However, they haven't actually been pushed at this
point, so we would simply fail to stash the last one or two regular
arguments. Failure to stash could cause stack slots to appear falsely to
be dead, and they could therefore be left uninitialized after an OSR
transition at runtime.

This commit changes stashArgumentsForOSR() to use the stack size as-is
because the regular arguments are still at the top of the stack.

Also keep numArgsToNotStash in the J9VM_OPT_OPENJDK_METHODHANDLE #if.

(cherry picked from commit 7dd6408)
@vij-singh
Copy link

@pshipton FYI

@pshipton pshipton merged commit ccc7390 into eclipse-openj9:v0.48.0-release Sep 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants