< prev index next >

src/hotspot/share/prims/jvmtiImpl.hpp

Print this page
rev 56101 : 8227745: Enable Escape Analysis for better performance when debugging
Reviewed-by: ???


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_PRIMS_JVMTIIMPL_HPP
  26 #define SHARE_PRIMS_JVMTIIMPL_HPP
  27 
  28 #include "classfile/systemDictionary.hpp"
  29 #include "jvmtifiles/jvmti.h"
  30 #include "oops/objArrayOop.hpp"
  31 #include "prims/jvmtiEnvThreadState.hpp"
  32 #include "prims/jvmtiEventController.hpp"
  33 #include "prims/jvmtiTrace.hpp"
  34 #include "prims/jvmtiUtil.hpp"

  35 #include "runtime/stackValueCollection.hpp"
  36 #include "runtime/vmOperations.hpp"
  37 #include "utilities/ostream.hpp"
  38 
  39 //
  40 // Forward Declarations
  41 //
  42 
  43 class JvmtiBreakpoint;
  44 class JvmtiBreakpoints;
  45 
  46 
  47 ///////////////////////////////////////////////////////////////
  48 //
  49 // class GrowableCache, GrowableElement
  50 // Used by              : JvmtiBreakpointCache
  51 // Used by JVMTI methods: none directly.
  52 //
  53 // GrowableCache is a permanent CHeap growable array of <GrowableElement *>
  54 //


 338 //
 339 // I'm told that in 1.5 oop maps are now protected by a lock and
 340 // we could get rid of the VM op
 341 // However if the VM op is removed then the target thread must
 342 // be suspended AND a lock will be needed to prevent concurrent
 343 // setting of locals to the same java thread. This lock is needed
 344 // to prevent compiledVFrames from trying to add deferred updates
 345 // to the thread simultaneously.
 346 //
 347 class VM_GetOrSetLocal : public VM_Operation {
 348  protected:
 349   JavaThread* _thread;
 350   JavaThread* _calling_thread;
 351   jint        _depth;
 352   jint        _index;
 353   BasicType   _type;
 354   jvalue      _value;
 355   javaVFrame* _jvf;
 356   bool        _set;
 357 


 358   // It is possible to get the receiver out of a non-static native wrapper
 359   // frame.  Use VM_GetReceiver to do this.
 360   virtual bool getting_receiver() const { return false; }
 361 
 362   jvmtiError  _result;
 363 
 364   vframe* get_vframe();
 365   javaVFrame* get_java_vframe();
 366   bool check_slot_type_lvt(javaVFrame* vf);
 367   bool check_slot_type_no_lvt(javaVFrame* vf);

 368 
 369 public:
 370   // Constructor for non-object getter
 371   VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type);
 372 
 373   // Constructor for object or non-object setter
 374   VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type, jvalue value);
 375 
 376   // Constructor for object getter
 377   VM_GetOrSetLocal(JavaThread* thread, JavaThread* calling_thread, jint depth,
 378                    int index);
 379 
 380   VMOp_Type type() const { return VMOp_GetOrSetLocal; }
 381   jvalue value()         { return _value; }
 382   jvmtiError result()    { return _result; }
 383 
 384   bool doit_prologue();
 385   void doit();
 386   bool allow_nested_vm_operations() const;
 387   const char* name() const                       { return "get/set locals"; }




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_PRIMS_JVMTIIMPL_HPP
  26 #define SHARE_PRIMS_JVMTIIMPL_HPP
  27 
  28 #include "classfile/systemDictionary.hpp"
  29 #include "jvmtifiles/jvmti.h"
  30 #include "oops/objArrayOop.hpp"
  31 #include "prims/jvmtiEnvThreadState.hpp"
  32 #include "prims/jvmtiEventController.hpp"
  33 #include "prims/jvmtiTrace.hpp"
  34 #include "prims/jvmtiUtil.hpp"
  35 #include "runtime/deoptimization.hpp"
  36 #include "runtime/stackValueCollection.hpp"
  37 #include "runtime/vmOperations.hpp"
  38 #include "utilities/ostream.hpp"
  39 
  40 //
  41 // Forward Declarations
  42 //
  43 
  44 class JvmtiBreakpoint;
  45 class JvmtiBreakpoints;
  46 
  47 
  48 ///////////////////////////////////////////////////////////////
  49 //
  50 // class GrowableCache, GrowableElement
  51 // Used by              : JvmtiBreakpointCache
  52 // Used by JVMTI methods: none directly.
  53 //
  54 // GrowableCache is a permanent CHeap growable array of <GrowableElement *>
  55 //


 339 //
 340 // I'm told that in 1.5 oop maps are now protected by a lock and
 341 // we could get rid of the VM op
 342 // However if the VM op is removed then the target thread must
 343 // be suspended AND a lock will be needed to prevent concurrent
 344 // setting of locals to the same java thread. This lock is needed
 345 // to prevent compiledVFrames from trying to add deferred updates
 346 // to the thread simultaneously.
 347 //
 348 class VM_GetOrSetLocal : public VM_Operation {
 349  protected:
 350   JavaThread* _thread;
 351   JavaThread* _calling_thread;
 352   jint        _depth;
 353   jint        _index;
 354   BasicType   _type;
 355   jvalue      _value;
 356   javaVFrame* _jvf;
 357   bool        _set;
 358 
 359   JVMTIEscapeBarrier _eb;
 360 
 361   // It is possible to get the receiver out of a non-static native wrapper
 362   // frame.  Use VM_GetReceiver to do this.
 363   virtual bool getting_receiver() const { return false; }
 364 
 365   jvmtiError  _result;
 366 
 367   vframe* get_vframe();
 368   javaVFrame* get_java_vframe();
 369   bool check_slot_type_lvt(javaVFrame* vf);
 370   bool check_slot_type_no_lvt(javaVFrame* vf);
 371   bool deoptimize_objects(javaVFrame* vf);
 372 
 373 public:
 374   // Constructor for non-object getter
 375   VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type);
 376 
 377   // Constructor for object or non-object setter
 378   VM_GetOrSetLocal(JavaThread* thread, jint depth, jint index, BasicType type, jvalue value);
 379 
 380   // Constructor for object getter
 381   VM_GetOrSetLocal(JavaThread* thread, JavaThread* calling_thread, jint depth,
 382                    int index);
 383 
 384   VMOp_Type type() const { return VMOp_GetOrSetLocal; }
 385   jvalue value()         { return _value; }
 386   jvmtiError result()    { return _result; }
 387 
 388   bool doit_prologue();
 389   void doit();
 390   bool allow_nested_vm_operations() const;
 391   const char* name() const                       { return "get/set locals"; }


< prev index next >