Skip to content

Commit

Permalink
Return early from isFSDNeeded under -XX:+DebugOnRestore
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dsouzai committed Aug 22, 2024
1 parent dcae1af commit 10291b2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions runtime/compiler/control/J9Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3020,6 +3020,17 @@ J9::Options::fePostProcessAOT(void * base)
bool
J9::Options::isFSDNeeded(J9JavaVM *javaVM, J9HookInterface **vmHooks)
{
#if defined(J9VM_OPT_CRIU_SUPPORT)
J9VMThread * vmThread = javaVM->internalVMFunctions->currentVMThread(javaVM);
if (javaVM->internalVMFunctions->isCheckpointAllowed(vmThread))
{
if (javaVM->internalVMFunctions->isDebugOnRestoreEnabled(vmThread))
{
return false;
}
}
#endif

return
#if defined(J9VM_JIT_FULL_SPEED_DEBUG)
(javaVM->requiredDebugAttributes & J9VM_DEBUG_ATTRIBUTE_CAN_ACCESS_LOCALS) ||
Expand Down

0 comments on commit 10291b2

Please sign in to comment.