Summary
Specify minimal JVMTI PopFrame support for virtual threads.
Problem
The JVMTI PopFrame is allowed to be supported by implementations in a general form but no minimal support is defined by the spec.
Solution
Specify that the PopFrame
can be used to pop current frame of
a virtual thread suspended at an event.
Specification
The PopFrame
thread
parameter is described with only one statement:
The thread whose current frame is to be popped.
Extend it with:
The `PopFrame` function may be used to pop the current frame of a virtual
thread when it is suspended at an event. An implementation may support
popping the current frame of a suspended virtual thread in other cases.
The description of the JVMTI_ERROR_OPAQUE_FRAME
error code is:
The thread is a virtual thread and the implementation is unable
to pop this frame.
Replace it with:
The thread is a suspended virtual thread and the implementation
was unable to pop the current frame.
The spec change is:
diff --git a/src/hotspot/share/prims/jvmti.xml b/src/hotspot/share/prims/jvmti.xml
index ae466071de2..d55db4f82ae 100644
--- a/src/hotspot/share/prims/jvmti.xml
+++ b/src/hotspot/share/prims/jvmti.xml
@@ -2958,6 +2958,10 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);
<jthread impl="noconvert"/>
<description>
The thread whose current frame is to be popped.
+ The <functionlink id="PopFrame"></functionlink> function may be used to
+ pop the current frame of a virtual thread when it is suspended at an event.
+ An implementation may support popping the current frame of a suspended
+ virtual thread in other cases.
</description>
</param>
</parameters>
@@ -2967,8 +2971,8 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);
The implementation is unable to pop this frame.
</error>
<error id="JVMTI_ERROR_OPAQUE_FRAME">
- The thread is a virtual thread and the implementation is unable
- to pop this frame.
+ The thread is a suspended virtual thread and the implementation
+ was unable to pop the current frame.
</error>
<error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
Thread was not suspended and was not the current thread.
- csr of
-
JDK-8308000 add PopFrame support for virtual threads
-
- Resolved
-
- relates to
-
JDK-8308238 add JDWP and JDI virtual thread support for ThreadReference.PopFrames
-
- Closed
-