< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page

 131   vframeArray*  _vframe_array_head;              // Holds the heap of the active vframeArrays
 132   vframeArray*  _vframe_array_last;              // Holds last vFrameArray we popped
 133   // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
 134   // will be carried out as soon as possible which, in most cases, is just before deoptimization of
 135   // the frame, when control returns to it.
 136   JvmtiDeferredUpdates* _jvmti_deferred_updates;
 137 
 138   // Handshake value for fixing 6243940. We need a place for the i2c
 139   // adapter to store the callee Method*. This value is NEVER live
 140   // across a gc point so it does NOT have to be gc'd
 141   // The handshake is open ended since we can't be certain that it will
 142   // be nulled. This is because we rarely ever see the race and end up
 143   // in handle_wrong_method which is the backend of the handshake. See
 144   // code in i2c adapters and handle_wrong_method.
 145 
 146   Method*       _callee_target;
 147 
 148   // Used to pass back results to the interpreter or generated code running Java code.
 149   oop           _vm_result_oop;       // oop result is GC-preserved
 150   Metadata*     _vm_result_metadata;  // non-oop result

 151 
 152   ObjectMonitor* volatile _current_pending_monitor;     // ObjectMonitor this thread is waiting to lock
 153   bool           _current_pending_monitor_is_from_java; // locking is from Java code
 154   ObjectMonitor* volatile _current_waiting_monitor;     // ObjectMonitor on which this thread called Object.wait()
 155 
 156   // Active_handles points to a block of handles
 157   JNIHandleBlock* _active_handles;
 158 
 159   // One-element thread local free list
 160   JNIHandleBlock* _free_handle_block;
 161 
 162   // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the
 163   // current _vthread object, except during creation of the primordial and JNI
 164   // attached thread cases where this field can have a temporary value.
 165   int64_t _monitor_owner_id;
 166 
 167  public:
 168   void set_monitor_owner_id(int64_t id) {
 169     ThreadIdentifier::verify_id(id);
 170     _monitor_owner_id = id;

 796   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 797   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 798 
 799   // The special resourceMark used during deoptimization
 800 
 801   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 802   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 803 
 804   void set_deopt_compiled_method(nmethod* nm)    { _deopt_nmethod = nm; }
 805   nmethod* deopt_compiled_method()               { return _deopt_nmethod; }
 806 
 807   Method*    callee_target() const               { return _callee_target; }
 808   void set_callee_target  (Method* x)            { _callee_target   = x; }
 809 
 810   // Oop results of vm runtime calls
 811   oop  vm_result_oop() const                     { return _vm_result_oop; }
 812   void set_vm_result_oop(oop x)                  { _vm_result_oop   = x; }
 813 
 814   void set_vm_result_metadata(Metadata* x)       { _vm_result_metadata = x; }
 815 



 816   // Is thread in scope of an InternalOOMEMark?
 817   bool is_in_internal_oome_mark() const          { return _is_in_internal_oome_mark; }
 818   void set_is_in_internal_oome_mark(bool b)      { _is_in_internal_oome_mark = b;    }
 819 
 820 #if INCLUDE_JVMCI
 821   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 822   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 823   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 824   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 825   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 826   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 827   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 828 
 829   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 830   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 831     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 832     _libjvmci_runtime = rt;
 833   }
 834 #endif // INCLUDE_JVMCI
 835 

 858 
 859   // For assembly stub generation
 860   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 861   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 862   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 863   static ByteSize pending_jni_exception_check_fn_offset() {
 864     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 865   }
 866   static ByteSize last_Java_sp_offset() {
 867     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 868   }
 869   static ByteSize last_Java_pc_offset() {
 870     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 871   }
 872   static ByteSize frame_anchor_offset() {
 873     return byte_offset_of(JavaThread, _anchor);
 874   }
 875   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 876   static ByteSize vm_result_oop_offset()         { return byte_offset_of(JavaThread, _vm_result_oop); }
 877   static ByteSize vm_result_metadata_offset()    { return byte_offset_of(JavaThread, _vm_result_metadata); }

 878   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 879   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 880   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 881 #if INCLUDE_JVMCI
 882   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 883   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 884   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 885   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 886   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 887 #endif // INCLUDE_JVMCI
 888   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 889   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 890   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 891 
 892   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 893 
 894   // StackOverflow offsets
 895   static ByteSize stack_overflow_limit_offset()  {
 896     return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
 897   }

 131   vframeArray*  _vframe_array_head;              // Holds the heap of the active vframeArrays
 132   vframeArray*  _vframe_array_last;              // Holds last vFrameArray we popped
 133   // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
 134   // will be carried out as soon as possible which, in most cases, is just before deoptimization of
 135   // the frame, when control returns to it.
 136   JvmtiDeferredUpdates* _jvmti_deferred_updates;
 137 
 138   // Handshake value for fixing 6243940. We need a place for the i2c
 139   // adapter to store the callee Method*. This value is NEVER live
 140   // across a gc point so it does NOT have to be gc'd
 141   // The handshake is open ended since we can't be certain that it will
 142   // be nulled. This is because we rarely ever see the race and end up
 143   // in handle_wrong_method which is the backend of the handshake. See
 144   // code in i2c adapters and handle_wrong_method.
 145 
 146   Method*       _callee_target;
 147 
 148   // Used to pass back results to the interpreter or generated code running Java code.
 149   oop           _vm_result_oop;       // oop result is GC-preserved
 150   Metadata*     _vm_result_metadata;  // non-oop result
 151   oop           _return_buffered_value; // buffered value being returned
 152 
 153   ObjectMonitor* volatile _current_pending_monitor;     // ObjectMonitor this thread is waiting to lock
 154   bool           _current_pending_monitor_is_from_java; // locking is from Java code
 155   ObjectMonitor* volatile _current_waiting_monitor;     // ObjectMonitor on which this thread called Object.wait()
 156 
 157   // Active_handles points to a block of handles
 158   JNIHandleBlock* _active_handles;
 159 
 160   // One-element thread local free list
 161   JNIHandleBlock* _free_handle_block;
 162 
 163   // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the
 164   // current _vthread object, except during creation of the primordial and JNI
 165   // attached thread cases where this field can have a temporary value.
 166   int64_t _monitor_owner_id;
 167 
 168  public:
 169   void set_monitor_owner_id(int64_t id) {
 170     ThreadIdentifier::verify_id(id);
 171     _monitor_owner_id = id;

 797   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 798   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 799 
 800   // The special resourceMark used during deoptimization
 801 
 802   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 803   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 804 
 805   void set_deopt_compiled_method(nmethod* nm)    { _deopt_nmethod = nm; }
 806   nmethod* deopt_compiled_method()               { return _deopt_nmethod; }
 807 
 808   Method*    callee_target() const               { return _callee_target; }
 809   void set_callee_target  (Method* x)            { _callee_target   = x; }
 810 
 811   // Oop results of vm runtime calls
 812   oop  vm_result_oop() const                     { return _vm_result_oop; }
 813   void set_vm_result_oop(oop x)                  { _vm_result_oop   = x; }
 814 
 815   void set_vm_result_metadata(Metadata* x)       { _vm_result_metadata = x; }
 816 
 817   oop return_buffered_value() const              { return _return_buffered_value; }
 818   void set_return_buffered_value(oop val)        { _return_buffered_value = val; }
 819 
 820   // Is thread in scope of an InternalOOMEMark?
 821   bool is_in_internal_oome_mark() const          { return _is_in_internal_oome_mark; }
 822   void set_is_in_internal_oome_mark(bool b)      { _is_in_internal_oome_mark = b;    }
 823 
 824 #if INCLUDE_JVMCI
 825   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 826   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 827   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 828   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 829   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 830   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 831   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 832 
 833   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 834   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 835     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 836     _libjvmci_runtime = rt;
 837   }
 838 #endif // INCLUDE_JVMCI
 839 

 862 
 863   // For assembly stub generation
 864   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 865   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 866   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 867   static ByteSize pending_jni_exception_check_fn_offset() {
 868     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 869   }
 870   static ByteSize last_Java_sp_offset() {
 871     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 872   }
 873   static ByteSize last_Java_pc_offset() {
 874     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 875   }
 876   static ByteSize frame_anchor_offset() {
 877     return byte_offset_of(JavaThread, _anchor);
 878   }
 879   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 880   static ByteSize vm_result_oop_offset()         { return byte_offset_of(JavaThread, _vm_result_oop); }
 881   static ByteSize vm_result_metadata_offset()    { return byte_offset_of(JavaThread, _vm_result_metadata); }
 882   static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
 883   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 884   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 885   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 886 #if INCLUDE_JVMCI
 887   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 888   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 889   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 890   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 891   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 892 #endif // INCLUDE_JVMCI
 893   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 894   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 895   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 896 
 897   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 898 
 899   // StackOverflow offsets
 900   static ByteSize stack_overflow_limit_offset()  {
 901     return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
 902   }
< prev index next >