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) Ensure JIT/AOT code is not invalidated post-restore under -XX:+DebugOnRestore #20219

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

dsouzai
Copy link
Contributor

@dsouzai dsouzai commented Sep 24, 2024

#19754 adds VM Support for Debug On Restore. As the code stands, this will result in the JIT invalidating all code post-restore because it is unable to distinguish between FSD mode caused by the VM or the user.

This PR fixes this by adding the following changes:

  • Cache the status of certain runtime events
  • Return early from isFSDNeeded under -XX:+DebugOnRestore

Depends on #20191

Cache the status of JVMTI events such as exception throw/catch as well
as whether method trace and FSD were enabled pre-checkpoint.

Signed-off-by: Irwin D'Souza <[email protected]>
Under -XX:+DebugOnRestore, the VM will enable some capabilities that
will be reset on restore (if the user does not want debug on restore).
However, if the JIT detects these capabilities via the J9HookDisable
call, there is no way for the JIT to know whether the capability was set
by the VM or a user pre-checkpoint.

With the recent change to the isDebugOnRestoreEnabled to check if a uesr
specified an JDWP agent pre-checkpoint, the JIT can simply return early
from isFSDNeeded. Under -XX:+DebugOnRestore, the JIT already generates
FSD code so there is on need to check the caps that were set by the VM
pre-checkpoint.

isFSDNeeded is called on restore, so at that point it is appropriate for
the JIT to execute the rest of the method at that point.

Signed-off-by: Irwin D'Souza <[email protected]>
@dsouzai
Copy link
Contributor Author

dsouzai commented Sep 24, 2024

Mostly a straightforward cherry-pick of #20047 (had to resolve a merge conflict).

FYI @pshipton @TobiAjila

@pshipton
Copy link
Member

I'll set this as draft until #20233 is resolved.

@pshipton pshipton marked this pull request as draft September 26, 2024 15:02
@dsouzai dsouzai changed the title Ensure JIT/AOT code is not invalidated post-restore under -XX:+DebugOnRestore (0.48) (0.48) Ensure JIT/AOT code is not invalidated post-restore under -XX:+DebugOnRestore Sep 26, 2024
@tajila tajila marked this pull request as ready for review October 2, 2024 13:33
@tajila tajila merged commit b3bcb8b into eclipse-openj9:v0.48.0-release Oct 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jit criu Used to track CRIU snapshot related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants