Stash all invokedynamic and invokehandle arguments for OSR - #20232
Merged
Conversation
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.
Contributor
Author
|
@0xdaryl, could you please review? This one is targeted for 0.48 |
Contributor
|
Jenkins test sanity all jdk21 |
1 similar comment
Contributor
|
Jenkins test sanity all jdk21 |
Contributor
Author
|
AArch64 Linux sanity.functional failures... We hit #20233 in cmdLineTester_criu_jitPostRestore_[34] "Test SSL Failure Case with mismatched certificate" failed in cmdLineTester_criu_jitserverPostRestore_2 with "address already in use" (#14706) "Check SSL Verbose Log for connection failure with mismatched certificate" failed in cmdLineTester_criu_jitserverPostRestore_2. I couldn't find an open issue for this one, but the output only says that some files were missing and none of the expected output messages were found. I would be very surprised if this were related to my changes. |
0xdaryl
approved these changes
Sep 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to 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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When stashing arguments for OSR at an
invokedynamicorinvokehandlebytecode 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 aMemberName). 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 casesstashArgumentsForOSR()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
numArgsToNotStashin theJ9VM_OPT_OPENJDK_METHODHANDLE#if.Fixes #19369