< prev index next >

src/hotspot/share/prims/jvmtiImpl.hpp

Print this page

166 // only safely be done by the VM thread
167 //
168 // I'm told that in 1.5 oop maps are now protected by a lock and
169 // we could get rid of the VM op
170 // However if the VM op is removed then the target thread must
171 // be suspended AND a lock will be needed to prevent concurrent
172 // setting of locals to the same java thread. This lock is needed
173 // to prevent compiledVFrames from trying to add deferred updates
174 // to the thread simultaneously.
175 //
176 class VM_BaseGetOrSetLocal : public VM_Operation {
177  protected:
178   JavaThread* _calling_thread;
179   jint        _depth;
180   jint        _index;
181   BasicType   _type;
182   jvalue      _value;
183   javaVFrame* _jvf;
184   bool        _set;
185   bool        _self;

186 
187   static const jvalue _DEFAULT_VALUE;
188 
189   // It is possible to get the receiver out of a non-static native wrapper
190   // frame.  Use VM_GetReceiver to do this.
191   virtual bool getting_receiver() const { return false; }
192 
193   jvmtiError  _result;
194 
195   virtual javaVFrame* get_java_vframe() = 0;
196   bool check_slot_type_lvt(javaVFrame* vf);
197   bool check_slot_type_no_lvt(javaVFrame* vf);

198 
199 public:
200   VM_BaseGetOrSetLocal(JavaThread* calling_thread, jint depth, jint index,
201                        BasicType type, jvalue value, bool set, bool self);
202 
203   jvalue value()         { return _value; }
204   jvmtiError result()    { return _result; }
205 
206   void doit();

207   bool allow_nested_vm_operations() const;
208   virtual const char* name() const = 0;
209 
210   // Check that the klass is assignable to a type with the given signature.
211   static bool is_assignable(const char* ty_sign, Klass* klass, Thread* thread);
212 };
213 
214 
215 class VM_GetOrSetLocal : public VM_BaseGetOrSetLocal {
216  protected:
217   JavaThread* _thread;
218   EscapeBarrier _eb;
219 
220   vframe* get_vframe();
221   javaVFrame* get_java_vframe();
222 
223 public:
224   // Constructor for non-object getter
225   VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type, bool self);
226 

166 // only safely be done by the VM thread
167 //
168 // I'm told that in 1.5 oop maps are now protected by a lock and
169 // we could get rid of the VM op
170 // However if the VM op is removed then the target thread must
171 // be suspended AND a lock will be needed to prevent concurrent
172 // setting of locals to the same java thread. This lock is needed
173 // to prevent compiledVFrames from trying to add deferred updates
174 // to the thread simultaneously.
175 //
176 class VM_BaseGetOrSetLocal : public VM_Operation {
177  protected:
178   JavaThread* _calling_thread;
179   jint        _depth;
180   jint        _index;
181   BasicType   _type;
182   jvalue      _value;
183   javaVFrame* _jvf;
184   bool        _set;
185   bool        _self;
186   bool        _need_clone; // THIS object is in a value object constructor
187 
188   static const jvalue _DEFAULT_VALUE;
189 
190   // It is possible to get the receiver out of a non-static native wrapper
191   // frame.  Use VM_GetReceiver to do this.
192   virtual bool getting_receiver() const { return false; }
193 
194   jvmtiError  _result;
195 
196   virtual javaVFrame* get_java_vframe() = 0;
197   bool check_slot_type_lvt(javaVFrame* vf);
198   bool check_slot_type_no_lvt(javaVFrame* vf);
199   void check_and_clone_this_value_object();
200 
201 public:
202   VM_BaseGetOrSetLocal(JavaThread* calling_thread, jint depth, jint index,
203                        BasicType type, jvalue value, bool set, bool self);
204 
205   jvalue value()         { return _value; }
206   jvmtiError result()    { return _result; }
207 
208   void doit();
209   void doit_epilogue();
210   bool allow_nested_vm_operations() const;
211   virtual const char* name() const = 0;
212 
213   // Check that the klass is assignable to a type with the given signature.
214   static bool is_assignable(const char* ty_sign, Klass* klass, Thread* thread);
215 };
216 
217 
218 class VM_GetOrSetLocal : public VM_BaseGetOrSetLocal {
219  protected:
220   JavaThread* _thread;
221   EscapeBarrier _eb;
222 
223   vframe* get_vframe();
224   javaVFrame* get_java_vframe();
225 
226 public:
227   // Constructor for non-object getter
228   VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type, bool self);
229 
< prev index next >