Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8308815

extend SetLocalXXX minimal support for virtual threads

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 21
    • hotspot
    • None
    • behavioral
    • minimal
    • The compatibility risk is minimal. The spec update only extends the SetLocalXXX minimal support for virtual threads suspended at any event rather than just at a breakpoint or single step event.
    • Other
    • SE

    Description

      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>

      Attachments

        Issue Links

          Activity

            People

              sspitsyn Serguei Spitsyn
              sspitsyn Serguei Spitsyn
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: