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
Add Continuation direct transition support #15678
Conversation
93f4395
to
650f1c2
Compare
@fengxue-IS do the ppc jit failures still occur with these changes? |
This PR should also provide the |
397d100
to
a86060f
Compare
Still need to add the stack walk wrapper. |
Per discussion with @LinHu2016, I included part of Lin's code to prepare a stack allocated J9VMThread for stackwalk with data from Continuation object, this helper will be shared by VM and GC. |
093beb4
to
e0c304b
Compare
The VMHelpers change is not how I would like this done. Please create a wrapper for walkStackFrames as I've described above. It should be a C function, not an inline header function. Also note that |
The current VMHelper function is what GC would need as they have code that specifically depends on a walkable J9VMThread passed to top level function which eventually would call I can add a separate wrapper that would accept a continuation object and walkState, then stack allocate the J9VMThread/ELS and uses this api to copy the data and calls |
do |
Yes. |
Yes, this is what we'll need (think javacore). Will the wrapper be able to share the helper code? I dislike having multiple copies of this logic, particularly split between VM and GC. |
Feel free to remove the ifdefs from the VMHelpers code - we always have a JIT and always have FSD. Certainly don't propagate the ifdefs into the structure definition. |
7d6f9f4
to
f9d59bc
Compare
Actually, the wrapper function should take the J9JavaVM rather than the current J9VMThread (which is NULL is some of the RAS code). |
Thanks @fengxue-IS for new walkContinuationStackFrames function, currently in GC there is no precompile option (#if JAVA_SPEC_VERSION >= 19), so could you please add a wrapper for the walkContinuationStackFrames() (the function is for java 19 only)? |
I was under the impression the GC could not use |
Discussed the logic with @LinHu2016 offline, GC have optimized their design to combine the different hierarchy into a single location on scanning Continuation object which allow them to directly consume the I will move code from |
OK, please add the J9JavaVM parameter to it as we need it to initialize the J9VMThread for use in the stack walk, and we can't depend on being able to fetch it from the current thread. |
Also, please zero initialize the ELS and J9VMThread to 0 at the start (using |
We would need currentVMThread regardless to fetch the Edit: I guess I can use the |
There should me a matching |
@gacholio what about the currentThread that |
The stack walker can handle the NULL current thread already so you can just pass it through. |
The case we're interested in handling is when javacore generation is signalled on a non-java thread, so in that case asking the VM for the current thread would not work. All of this is assuming we will eventually want to display continuation stacks in the javacore. |
I'm not sure the macro will actually work in this case unless the GC can also handle a NULL vmThread. Maybe for now leave the function signature the way it is and add an assert that the current thread is not NULL. We can consider this again when javacore support is added. |
Please squash the commits. |
- Cache jitGPR data in J9VMContinuation - Wrap `Continuation.execute` call to force yield after completion - Build Callin frame during first enterContinuation call - Update j9vmcontinuation to include j2iframe and decompstack Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
- prepare a stub J9VMThread with necessary field for stack walk using data from Continuation object and calls walkStackFrames with stub thread and walkState - Add wrapper for walkContinuationStackFrames used by GC in VMHelpers Co-authored-by: Lin Hu <linhu@ca.ibm.com> Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
df45bbc
to
1fdb001
Compare
jenkins test sanity.functional xlinux jdknext |
jenkins compile win jdk8,jdknext |
|
@gacholio can you please run the sanity suite against jdk19, I think jdknext is running with jdk20 which might not work as virtualthread is preview for Java 19 |
jenkins test sanity.functional xlinux jdk19 |
Continuation.execute
call to force yield after completionCloses: #15464
Signed-off-by: Jack Lu Jack.S.Lu@ibm.com