Skip to content

Prevent pushing null appendix object for invokedynamic and invokehandle - #14769

Merged
jdmpapin merged 1 commit into
eclipse-openj9:masterfrom
nbhuiyan:mh-osr-arg-adj
Apr 25, 2022
Merged

jdmpapin merged 1 commit into
eclipse-openj9:masterfrom
nbhuiyan:mh-osr-arg-adj

Conversation

@nbhuiyan

@nbhuiyan nbhuiyan commented Mar 23, 2022 •

Copy link
Copy Markdown
Member

This change impacts how the stack is set up for resolved invokedynamic
and invokehandle calls. An invokedynamic/invokehandle call is considered
resolved when the call site table entry (invokedynamic) or MethodType
table entry (invokehandle) corresponding to the bytecodes is resolved,
allowing us to check if the entries - which we refer to as invoke
cache array, contains a null appendix object. Normally, the appendix
object is implicitly pushed as the last argument for resolved
invokedynamic/invokehandle calls where we create a call for the
adapter method as we can determine that at compile time. However, in
some cases, the appendix object may be null, which happens when the
adapter method does not expect it. Therefore, we need to check if
that's the case and skip pushing the appendix object.

Furthermore, the number of args that needs to be stashed for OSR
would be determined by whether the appendix object was null.

This does not affect unresolved invokedynamic/invokehandle, as those
calls are handled via calling a VM INL method which checks if the
appendix object is null before constructing the call frame for
calling the target method.

Depends: eclipse-omr/omr#6429
Depends: eclipse-omr/omr#6443

Signed-off-by: Nazim Bhuiyan nubhuiyan@ibm.com

@nbhuiyan

Copy link
Copy Markdown
Member Author

@0xdaryl @jdmpapin Requesting review

@dsouzai dsouzai added comp:jit depends:omr Pull request is dependent on a corresponding change in OMR labels Mar 24, 2022
@0xdaryl 0xdaryl added depends:omr:breaking and removed depends:omr Pull request is dependent on a corresponding change in OMR labels Mar 25, 2022
@dsouzai

dsouzai commented Mar 25, 2022

Copy link
Copy Markdown
Contributor

@nbhuiyan we had to revert the OMR PR, could you open it again? It'll have to be merged at the same time as this OpenJ9 PR.

Comment thread runtime/compiler/ilgen/Walker.cpp Resolved
This change impacts how the stack is set up for resolved invokedynamic
and invokehandle calls. An invokedynamic/invokehandle call is considered
resolved when the call site table entry (invokedynamic) or MethodType
table entry (invokehandle) corresponding to the bytecodes is resolved,
allowing us to check if the entries - which we refer to as invoke
cache array, contains a null appendix object. Normally, the appendix
object is implicitly pushed as the last argument for resolved
invokedynamic/invokehandle calls where we create a call for the
target method as we can determine that at compile time. However, in
some cases, the appendix object may be null, which happens when the
target method does not expect it. Therefore, we need to check if
that's the case and skip pushing the appendix object.

Furthermore, the number of args that needs to be stashed for OSR
would be determined by whether the appendix object was null.

This does not affect unresolved invokedynamic/invokehandle, as those
calls are handled via calling a VM INL method which checks if the
appendix object is null before constructing the call frame for
calling the target method.

Signed-off-by: Nazim Bhuiyan <nubhuiyan@ibm.com>
@nbhuiyan

nbhuiyan commented Apr 6, 2022

Copy link
Copy Markdown
Member Author

@jdmpapin I have addressed the comments from your initial review

@jdmpapin jdmpapin self-assigned this Apr 6, 2022
@jdmpapin

jdmpapin commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

Jenkins test sanity all jdk17 depends eclipse-omr/omr#6443

@jdmpapin

jdmpapin commented Apr 7, 2022

Copy link
Copy Markdown
Contributor

jdk17 testing succeeded. Also testing 8 and 11 because not all of the changes are within #fidef J9VM_OPT_OPENJDK_METHODHANDLE

Jenkins test sanity all jdk8,jdk11 depends eclipse-omr/omr#6443

@jdmpapin

jdmpapin commented Apr 7, 2022

Copy link
Copy Markdown
Contributor

Jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit jdk8,jdk11,jdk17

@jdmpapin

jdmpapin commented Apr 7, 2022

Copy link
Copy Markdown
Contributor

Jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit jdk8,jdk11,jdk17 depends eclipse-omr/omr#6443

@jdmpapin

jdmpapin commented Apr 7, 2022

Copy link
Copy Markdown
Contributor

@nbhuiyan, please take a look at the JITServer build failures

@nbhuiyan

nbhuiyan commented Apr 8, 2022

Copy link
Copy Markdown
Member Author

@jdmpapin can you try re-launching the x86-64 JITServer jobs? From the surface it seems like the OMR changes were not picked up in the x86-64 builds.

@jdmpapin

jdmpapin commented Apr 8, 2022

Copy link
Copy Markdown
Contributor

Jenkins test sanity xlinuxjit jdk8,jdk11,jdk17 depends eclipse-omr/omr#6443

@nbhuiyan

nbhuiyan commented Apr 8, 2022 •

Copy link
Copy Markdown
Member Author

The build job that launched did not pick up the OMR changes once again. Here is the version of one of the files being used that should have been updated: https://github.com/eclipse-openj9/openj9-omr/blob/48d41b458955773afe9fc887d2f0c960d97ce966/compiler/compile/ResolvedMethod.hpp Looking at the console log, I realize that the "depends" changes are picked up a bit later and does not update the revision info in the Jenkins job status page.

@nbhuiyan

nbhuiyan commented Apr 9, 2022

Copy link
Copy Markdown
Member Author

The tests have now passed.

@jdmpapin

jdmpapin commented Apr 11, 2022 •

Copy link
Copy Markdown
Contributor

So they have! Maybe the failing builds were from my original Jenkins command where I forgot to specify the dependency, and they just hadn't been replaced by the second one yet

Re-running the OMR acceptance-equivalent build because the previous builds are now 4-5 days old.

Jenkins test sanity all jdk8,jdk11,jdk17 depends eclipse-omr/omr#6443

@pshipton

Copy link
Copy Markdown
Member

FYI there is a known build problem on Mac https://openj9.slack.com/archives/CDS7QE9HB/p1649429274506589

@jdmpapin

Copy link
Copy Markdown
Contributor

Jenkins test sanity xmac,amac jdk11,jdk17 depends eclipse-omr/omr#6443

@pshipton

pshipton commented Apr 11, 2022 •

Copy link
Copy Markdown
Member

there is a known build problem on Mac

Sorry, I didn't describe it very well. The code builds.
On xmac the JVM won't run if you happen to hit the 10.11 machine
On amac you will get failures like #14892

The fix is happening in eclipse-omr/omr#6467

@jdmpapin

Copy link
Copy Markdown
Contributor

Re-running the OMR acceptance-equivalent build again now that eclipse-omr/omr#6467 is merged. Third time's a charm

Jenkins test sanity all jdk8,jdk11,jdk17 depends eclipse-omr/omr#6443

@jdmpapin

Copy link
Copy Markdown
Contributor

The z Linux JDK 17 tests failed with an infrastructure problem:

ub18-390-2 was marked offline: Connection was broken: java.io.EOFException

Jenkins test sanity zlinux jdk17 depends eclipse-omr/omr#6443

@jdmpapin

Copy link
Copy Markdown
Contributor

The AArch64 Linux JDK17 build also failed with an infrastructure problem:

10:50:56  wrapper script does not seem to be touching the log file in /home/jenkins/workspace/Build_JDK17_aarch64_linux_Personal@tmp/durable-aee6b105
10:50:56  (JENKINS-48300: if on an extremely laggy filesystem, consider -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=86400)
[Pipeline] sh
10:56:12  process apparently never started in /home/jenkins/workspace/Build_JDK17_aarch64_linux_Personal@tmp/durable-5775b506
10:56:12  (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
10:56:12  Cannot contact ub20-aarch64-1: java.io.FileNotFoundException: /home/jenkins/workspace/Build_JDK17_aarch64_linux_Personal@tmp/durable-5775b506/output.txt (No such file or directory)

Jenkins test sanity alinux jdk17 depends eclipse-omr/omr#6443

@jdmpapin

Copy link
Copy Markdown
Contributor

Jenkins test sanity aarch64_linux jdk17 depends eclipse-omr/omr#6443

1 similar comment
@jdmpapin

Copy link
Copy Markdown
Contributor

Jenkins test sanity aarch64_linux jdk17 depends eclipse-omr/omr#6443

@jdmpapin

Copy link
Copy Markdown
Contributor

Re-running these again in the hope that I can catch openj9-omr's openj9 and master branches in sync after they pass but before the build gets stale again...

Jenkins test sanity all jdk8,jdk11,jdk17 depends eclipse-omr/omr#6443

@jdmpapin

Copy link
Copy Markdown
Contributor

Jenkins test sanity zlinux jdk17 depends eclipse-omr/omr#6443

@jdmpapin

Copy link
Copy Markdown
Contributor

Jenkins test sanity win jdk8 depends eclipse-omr/omr#6443

@jdmpapin
jdmpapin merged commit 9bce816 into eclipse-openj9:master Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants