Summary
Extend SetLocalXXX
minimal support for virtual threads.
Problem
SetLocalXXX
minimal support for virtual threads is defined for a virtual threads suspended at a breakpoint or single step event. Virtual threads suspended at other events are also important use cases which are supported by StopThread
, PopFrame
and ForceEarlyReturnXXX
functions.
Solution
Extend SetLocalXXX
minimal support for virtual threads to virtual threads suspended at any event.
Specification
The SetLocalXXX
intro has this statement:
The SetLocalXXX functions may be used to set the value of
a local variable in the topmost frame of a virtual thread
suspended at a breakpoint or single step event.
An implementation may support setting locals in other cases.
The third line is replaced with:
a virtual thread suspended at an event.
Replace the description of JVMTI_ERROR_OPAQUE_FRAME
for each SetLocalXXX
function:
The thread is a virtual thread and the implementation does not
support setting the value of locals in the frame of the given depth.
with:
The thread is a suspended virtual thread and the implementation does not
support setting the value of locals in the frame of the given depth.
The full spec update is:
diff --git a/src/hotspot/share/prims/jvmti.xml b/src/hotspot/share/prims/jvmti.xml
index 926f7cecb63..cd4b1a24e2c 100644
--- a/src/hotspot/share/prims/jvmti.xml
+++ b/src/hotspot/share/prims/jvmti.xml
@@ -5823,9 +5823,8 @@ class C2 extends C1 implements I2 {
The <code>GetLocalXXX</code> functions may be used to retrieve the value of
a local variable contained in the frame of a virtual thread.
The <code>SetLocalXXX</code> functions may be used to set the value of a
- local variable in the topmost frame of a virtual thread suspended at a
- breakpoint or single step event. An implementation may support setting locals
- in other cases.
+ local variable in the topmost frame of a virtual thread suspended at an event.
+ An implementation may support setting locals in other cases.
</intro>
<function id="GetLocalObject" num="21">
@@ -6202,7 +6201,7 @@ class C2 extends C1 implements I2 {
Not a visible frame
</error>
<error id="JVMTI_ERROR_OPAQUE_FRAME">
- The thread is a virtual thread and the implementation does not support
+ The thread is a suspended virtual thread and the implementation does not support
setting the value of locals in the frame of the given depth.
See <internallink id="local">Local Variables</internallink>.
</error>
@@ -6266,7 +6265,7 @@ class C2 extends C1 implements I2 {
Not a visible frame
</error>
<error id="JVMTI_ERROR_OPAQUE_FRAME">
- The thread is a virtual thread and the implementation does not support
+ The thread is a suspended virtual thread and the implementation does not support
setting the value of locals in the frame of the given depth.
See <internallink id="local">Local Variables</internallink>.
</error>
@@ -6325,7 +6324,7 @@ class C2 extends C1 implements I2 {
Not a visible frame
</error>
<error id="JVMTI_ERROR_OPAQUE_FRAME">
- The thread is a virtual thread and the implementation does not support
+ The thread is a suspended virtual thread and the implementation does not support
setting the value of locals in the frame of the given depth.
See <internallink id="local">Local Variables</internallink>.
</error>
@@ -6384,7 +6383,7 @@ class C2 extends C1 implements I2 {
Not a visible frame
</error>
<error id="JVMTI_ERROR_OPAQUE_FRAME">
- The thread is a virtual thread and the implementation does not support
+ The thread is a suspended virtual thread and the implementation does not support
setting the value of locals in the frame of the given depth.
See <internallink id="local">Local Variables</internallink>.
</error>
@@ -6443,7 +6442,7 @@ class C2 extends C1 implements I2 {
Not a visible frame
</error>
<error id="JVMTI_ERROR_OPAQUE_FRAME">
- The thread is a virtual thread and the implementation does not support
+ The thread is a suspended virtual thread and the implementation does not support
setting the value of locals in the frame of the given depth.
See <internallink id="local">Local Variables</internallink>.
</error>
- csr of
-
JDK-8308814 extend SetLocalXXX minimal support for virtual threads
-
- Resolved
-