< 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;

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



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

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

 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   }

 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;

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

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