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

Skip methods with JvmtiMountTransition annotation in findDecompileInfo #17855

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.JvmtiMountTransition;

/**
* Continuation class performing the mount/unmount operation for VirtualThread
Expand Down Expand Up @@ -277,7 +278,9 @@ public PreemptStatus tryPreempt(Thread t) {
}

/* Continuation Native APIs */
@JvmtiMountTransition
gacholio marked this conversation as resolved.
Show resolved Hide resolved
private native boolean enterImpl();
private static native boolean yieldImpl(boolean isFinished);

@JvmtiMountTransition
private static native boolean yieldImpl(boolean isFinished);
}
24 changes: 23 additions & 1 deletion runtime/jvmti/jvmtiHelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,21 +1791,43 @@ static UDATA
findDecompileInfoFrameIterator(J9VMThread *currentThread, J9StackWalkState *walkState)
{
UDATA rc = J9_STACKWALK_KEEP_ITERATING;
J9Method *method = walkState->method;

#if JAVA_SPEC_VERSION >= 20
J9ROMMethod *romMethod = NULL;
U_32 extendedModifiers = 0;

/* walkState->method can never be NULL since the J9_STACKWALK_VISIBLE_ONLY flag is set. */
Assert_JVMTI_true(NULL != method);

romMethod = J9_ROM_METHOD_FROM_RAM_METHOD(method);
extendedModifiers = getExtendedModifiersDataFromROMMethod(romMethod);

if (J9_ARE_ANY_BITS_SET(extendedModifiers, CFR_METHOD_EXT_JVMTIMOUNTTRANSITION_ANNOTATION)) {
goto skip;
}
#endif /* JAVA_SPEC_VERSION >= 20 */

if (JVMTI_ERROR_NONE != (UDATA)walkState->userData1) {
/* The current frame is the requested frame. Record the inline depth for the decompiler
* and the method and bytecodePCOffset for the slot validator.
*/
walkState->userData1 = (void*)JVMTI_ERROR_NONE;
walkState->userData2 = (void*)walkState->inlineDepth;
walkState->userData3 = walkState->method;
walkState->userData3 = method;
walkState->userData4 = (void*)(UDATA)walkState->bytecodePCOffset;
}

/* Keep walking until the outer method is reached (the inline decompiler requires that
* the walkState be at this point).
*/
if (0 == walkState->inlineDepth) {
rc = J9_STACKWALK_STOP_ITERATING;
}

#if JAVA_SPEC_VERSION >= 20
skip:
#endif /* JAVA_SPEC_VERSION >= 20 */
return rc;
}

Expand Down