< prev index next >

src/hotspot/share/prims/jvmtiImpl.hpp

Print this page
*** 308,34 ***
  // be suspended AND a lock will be needed to prevent concurrent
  // setting of locals to the same java thread. This lock is needed
  // to prevent compiledVFrames from trying to add deferred updates
  // to the thread simultaneously.
  //
! class VM_GetOrSetLocal : public VM_Operation {
   protected:
-   JavaThread* _thread;
    JavaThread* _calling_thread;
    jint        _depth;
    jint        _index;
    BasicType   _type;
    jvalue      _value;
    javaVFrame* _jvf;
    bool        _set;
  
!   EscapeBarrier _eb;
  
    // It is possible to get the receiver out of a non-static native wrapper
    // frame.  Use VM_GetReceiver to do this.
    virtual bool getting_receiver() const { return false; }
  
    jvmtiError  _result;
  
!   vframe* get_vframe();
-   javaVFrame* get_java_vframe();
    bool check_slot_type_lvt(javaVFrame* vf);
    bool check_slot_type_no_lvt(javaVFrame* vf);
  
  public:
    // Constructor for non-object getter
    VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type);
  
    // Constructor for object or non-object setter
--- 308,56 ---
  // be suspended AND a lock will be needed to prevent concurrent
  // setting of locals to the same java thread. This lock is needed
  // to prevent compiledVFrames from trying to add deferred updates
  // to the thread simultaneously.
  //
! class VM_BaseGetOrSetLocal : public VM_Operation {
   protected:
    JavaThread* _calling_thread;
    jint        _depth;
    jint        _index;
    BasicType   _type;
    jvalue      _value;
    javaVFrame* _jvf;
    bool        _set;
  
!   static const jvalue _DEFAULT_VALUE;
  
    // It is possible to get the receiver out of a non-static native wrapper
    // frame.  Use VM_GetReceiver to do this.
    virtual bool getting_receiver() const { return false; }
  
    jvmtiError  _result;
  
!   virtual javaVFrame* get_java_vframe() = 0;
    bool check_slot_type_lvt(javaVFrame* vf);
    bool check_slot_type_no_lvt(javaVFrame* vf);
  
+ public:
+   VM_BaseGetOrSetLocal(JavaThread* calling_thread, jint depth, jint index,
+                        BasicType type, jvalue value, bool set);
+ 
+   jvalue value()         { return _value; }
+   jvmtiError result()    { return _result; }
+ 
+   void doit();
+   bool allow_nested_vm_operations() const;
+   virtual const char* name() const = 0;
+ 
+   // Check that the klass is assignable to a type with the given signature.
+   static bool is_assignable(const char* ty_sign, Klass* klass, Thread* thread);
+ };
+ 
+ 
+ class VM_GetOrSetLocal : public VM_BaseGetOrSetLocal {
+  protected:
+   JavaThread* _thread;
+   EscapeBarrier _eb;
+ 
+   vframe* get_vframe();
+   javaVFrame* get_java_vframe();
+ 
  public:
    // Constructor for non-object getter
    VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type);
  
    // Constructor for object or non-object setter

*** 344,20 ***
    // Constructor for object getter
    VM_GetOrSetLocal(JavaThread* thread, JavaThread* calling_thread, jint depth,
                     int index);
  
    VMOp_Type type() const { return VMOp_GetOrSetLocal; }
-   jvalue value()         { return _value; }
-   jvmtiError result()    { return _result; }
  
    bool doit_prologue();
-   void doit();
-   bool allow_nested_vm_operations() const;
-   const char* name() const                       { return "get/set locals"; }
  
!   // Check that the klass is assignable to a type with the given signature.
-   static bool is_assignable(const char* ty_sign, Klass* klass, Thread* thread);
  };
  
  class VM_GetReceiver : public VM_GetOrSetLocal {
   protected:
    virtual bool getting_receiver() const { return true; }
--- 366,14 ---
    // Constructor for object getter
    VM_GetOrSetLocal(JavaThread* thread, JavaThread* calling_thread, jint depth,
                     int index);
  
    VMOp_Type type() const { return VMOp_GetOrSetLocal; }
  
    bool doit_prologue();
  
!   const char* name() const                       { return "get/set locals"; }
  };
  
  class VM_GetReceiver : public VM_GetOrSetLocal {
   protected:
    virtual bool getting_receiver() const { return true; }

*** 365,10 ***
--- 381,44 ---
   public:
    VM_GetReceiver(JavaThread* thread, JavaThread* calling_thread, jint depth);
    const char* name() const                       { return "get receiver"; }
  };
  
+ // VM operation to get or set virtual thread local
+ class VM_VirtualThreadGetOrSetLocal : public VM_BaseGetOrSetLocal {
+  protected:
+   JvmtiEnv *_env;
+   Handle _vthread_h;
+ 
+   javaVFrame* get_java_vframe();
+ 
+ public:
+   // Constructor for non-object getter
+   VM_VirtualThreadGetOrSetLocal(JvmtiEnv* env, Handle vthread_h, jint depth, jint index, BasicType type);
+ 
+   // Constructor for object or non-object setter
+   VM_VirtualThreadGetOrSetLocal(JvmtiEnv* env, Handle vthread_h, jint depth,
+                         jint index, BasicType type, jvalue value);
+ 
+   // Constructor for object getter
+   VM_VirtualThreadGetOrSetLocal(JvmtiEnv* env, Handle vthread_h, JavaThread* calling_thread,
+                         jint depth, int index);
+ 
+   VMOp_Type type() const { return VMOp_VirtualThreadGetOrSetLocal; }
+ 
+   const char* name() const                       { return "virtual thread get/set locals"; }
+ };
+ 
+ class VM_VirtualThreadGetReceiver : public VM_VirtualThreadGetOrSetLocal {
+  protected:
+   virtual bool getting_receiver() const { return true; }
+ 
+  public:
+   VM_VirtualThreadGetReceiver(JvmtiEnv* env, Handle vthread_h, JavaThread* calling_thread, jint depth);
+   const char* name() const                       { return "virtual thread get receiver"; }
+ };
+ 
  
  ///////////////////////////////////////////////////////////////
  //
  // class JvmtiSuspendControl
  //
< prev index next >