Skip to content

Commit

Permalink
Revert initializeMethodRunAddressNoHook
Browse files Browse the repository at this point in the history
initializeMethodRunAddressNoHook is called by JIT'd code when it needs
to revert to the interpeter. Openj9:20387 modified this function to set
the extra to 0x1. However, resetting the extra can result in hang
(see OpenJ9:20750 for details).

This commit reverts the change specific to
initializeMethodRunAddressNoHook.

Signed-off-by: Irwin D'Souza <[email protected]>
  • Loading branch information
dsouzai committed Dec 9, 2024
1 parent 752c652 commit 5f27449
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions runtime/vm/initsendtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@ initializeMethodRunAddress(J9VMThread *vmThread, J9Method *method)

method->extra = (void *) J9_STARTPC_NOT_TRANSLATED;

#if defined(J9VM_OPT_OPENJDK_METHODHANDLE)
if (initializeMethodRunAddressMethodHandle(method)) {
return;
}
#endif /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */

#if defined(J9VM_OPT_METHOD_HANDLE)
if (initializeMethodRunAddressVarHandle(method)) {
return;
}
#endif /* defined(J9VM_OPT_METHOD_HANDLE) */

if (J9_EVENT_IS_HOOKED(vm->hookInterface, J9HOOK_VM_INITIALIZE_SEND_TARGET)) {
method->methodRunAddress = NULL;
ALWAYS_TRIGGER_J9HOOK_VM_INITIALIZE_SEND_TARGET(vm->hookInterface, vmThread, method);
Expand All @@ -234,20 +246,6 @@ initializeMethodRunAddressNoHook(J9JavaVM* vm, J9Method *method)
J9ROMMethod* romMethod = J9_ROM_METHOD_FROM_RAM_METHOD(method);
U_32 const modifiers = romMethod->modifiers;

method->extra = (void *) J9_STARTPC_NOT_TRANSLATED;

#if defined(J9VM_OPT_OPENJDK_METHODHANDLE)
if (initializeMethodRunAddressMethodHandle(method)) {
return;
}
#endif /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */

#if defined(J9VM_OPT_METHOD_HANDLE)
if (initializeMethodRunAddressVarHandle(method)) {
return;
}
#endif /* defined(J9VM_OPT_METHOD_HANDLE) */

if (modifiers & J9AccAbstract) {
method->methodRunAddress = J9_BCLOOP_ENCODE_SEND_TARGET(J9_BCLOOP_SEND_TARGET_UNSATISFIED_OR_ABSTRACT);
return;
Expand Down

0 comments on commit 5f27449

Please sign in to comment.