< prev index next >

src/hotspot/share/jvmci/jvmciEnv.hpp

Print this page




  77 
  78   bool    operator == (Klass* o) const          { return klass() == o; }
  79   bool    operator == (const JVMCIKlassHandle& h) const  { return klass() == h.klass(); }
  80 
  81   /* Null checks */
  82   bool    is_null() const                      { return _klass == NULL; }
  83   bool    not_null() const                     { return _klass != NULL; }
  84 };
  85 
  86 // A class that maintains the state needed for compilations requested
  87 // by the CompileBroker.  It is created in the broker and passed through
  88 // into the code installation step.
  89 class JVMCICompileState : public ResourceObj {
  90   friend class JVMCIVMStructs;
  91  private:
  92   CompileTask*     _task;
  93 
  94   // Cache JVMTI state. Defined as bytes so that reading them from Java
  95   // via Unsafe is well defined (the C++ type for bool is implementation
  96   // defined and may not be the same as a Java boolean).

  97   jbyte  _jvmti_can_hotswap_or_post_breakpoint;
  98   jbyte  _jvmti_can_access_local_variables;
  99   jbyte  _jvmti_can_post_on_exceptions;
 100   jbyte  _jvmti_can_pop_frame;
 101 
 102   // Compilation result values.
 103   bool             _retryable;
 104   const char*      _failure_reason;
 105 
 106   // Specifies if _failure_reason is on the C heap. If so, it is allocated
 107   // with the mtJVMCI NMT flag.
 108   bool             _failure_reason_on_C_heap;
 109 
 110  public:
 111   JVMCICompileState(CompileTask* task);
 112 
 113   CompileTask* task() { return _task; }
 114 
 115   bool  jvmti_state_changed() const;

 116   bool  jvmti_can_hotswap_or_post_breakpoint() const { return  _jvmti_can_hotswap_or_post_breakpoint != 0; }
 117   bool  jvmti_can_access_local_variables() const     { return  _jvmti_can_access_local_variables != 0; }
 118   bool  jvmti_can_post_on_exceptions() const         { return  _jvmti_can_post_on_exceptions != 0; }
 119   bool  jvmti_can_pop_frame() const                  { return  _jvmti_can_pop_frame != 0; }
 120 
 121   const char* failure_reason() { return _failure_reason; }
 122   bool failure_reason_on_C_heap() { return _failure_reason_on_C_heap; }
 123   bool retryable() { return _retryable; }
 124 
 125   void set_failure(bool retryable, const char* reason, bool reason_on_C_heap = false) {
 126     _failure_reason = reason;
 127     _failure_reason_on_C_heap = reason_on_C_heap;
 128     _retryable = retryable;
 129   }
 130 };
 131 
 132 
 133 // This class is a top level wrapper around interactions between HotSpot
 134 // and the JVMCI Java code.  It supports both a HotSpot heap based
 135 // runtime with HotSpot oop based accessors as well as a shared library




  77 
  78   bool    operator == (Klass* o) const          { return klass() == o; }
  79   bool    operator == (const JVMCIKlassHandle& h) const  { return klass() == h.klass(); }
  80 
  81   /* Null checks */
  82   bool    is_null() const                      { return _klass == NULL; }
  83   bool    not_null() const                     { return _klass != NULL; }
  84 };
  85 
  86 // A class that maintains the state needed for compilations requested
  87 // by the CompileBroker.  It is created in the broker and passed through
  88 // into the code installation step.
  89 class JVMCICompileState : public ResourceObj {
  90   friend class JVMCIVMStructs;
  91  private:
  92   CompileTask*     _task;
  93 
  94   // Cache JVMTI state. Defined as bytes so that reading them from Java
  95   // via Unsafe is well defined (the C++ type for bool is implementation
  96   // defined and may not be the same as a Java boolean).
  97   int    _jvmti_redefinition_count;
  98   jbyte  _jvmti_can_hotswap_or_post_breakpoint;
  99   jbyte  _jvmti_can_access_local_variables;
 100   jbyte  _jvmti_can_post_on_exceptions;
 101   jbyte  _jvmti_can_pop_frame;
 102 
 103   // Compilation result values.
 104   bool             _retryable;
 105   const char*      _failure_reason;
 106 
 107   // Specifies if _failure_reason is on the C heap. If so, it is allocated
 108   // with the mtJVMCI NMT flag.
 109   bool             _failure_reason_on_C_heap;
 110 
 111  public:
 112   JVMCICompileState(CompileTask* task);
 113 
 114   CompileTask* task() { return _task; }
 115 
 116   bool  jvmti_state_changed() const;
 117   bool  jvmti_redefinition_count() const             { return  _jvmti_redefinition_count; }
 118   bool  jvmti_can_hotswap_or_post_breakpoint() const { return  _jvmti_can_hotswap_or_post_breakpoint != 0; }
 119   bool  jvmti_can_access_local_variables() const     { return  _jvmti_can_access_local_variables != 0; }
 120   bool  jvmti_can_post_on_exceptions() const         { return  _jvmti_can_post_on_exceptions != 0; }
 121   bool  jvmti_can_pop_frame() const                  { return  _jvmti_can_pop_frame != 0; }
 122 
 123   const char* failure_reason() { return _failure_reason; }
 124   bool failure_reason_on_C_heap() { return _failure_reason_on_C_heap; }
 125   bool retryable() { return _retryable; }
 126 
 127   void set_failure(bool retryable, const char* reason, bool reason_on_C_heap = false) {
 128     _failure_reason = reason;
 129     _failure_reason_on_C_heap = reason_on_C_heap;
 130     _retryable = retryable;
 131   }
 132 };
 133 
 134 
 135 // This class is a top level wrapper around interactions between HotSpot
 136 // and the JVMCI Java code.  It supports both a HotSpot heap based
 137 // runtime with HotSpot oop based accessors as well as a shared library


< prev index next >