< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page

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

 150 
 151   // See ReduceInitialCardMarks: this holds the precise space interval of
 152   // the most recent slow path allocation for which compiled code has
 153   // elided card-marks for performance along the fast-path.
 154   MemRegion     _deferred_card_mark;
 155 
 156   ObjectMonitor* volatile _current_pending_monitor;     // ObjectMonitor this thread is waiting to lock
 157   bool           _current_pending_monitor_is_from_java; // locking is from Java code
 158   ObjectMonitor* volatile _current_waiting_monitor;     // ObjectMonitor on which this thread called Object.wait()
 159 
 160   // Active_handles points to a block of handles
 161   JNIHandleBlock* _active_handles;
 162 
 163   // One-element thread local free list
 164   JNIHandleBlock* _free_handle_block;
 165 
 166   // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the
 167   // current _vthread object, except during creation of the primordial and JNI
 168   // attached thread cases where this field can have a temporary value.
 169   int64_t _monitor_owner_id;

 772   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 773   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 774 
 775   // The special resourceMark used during deoptimization
 776 
 777   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 778   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 779 
 780   void set_deopt_compiled_method(nmethod* nm)    { _deopt_nmethod = nm; }
 781   nmethod* deopt_compiled_method()               { return _deopt_nmethod; }
 782 
 783   Method*    callee_target() const               { return _callee_target; }
 784   void set_callee_target  (Method* x)            { _callee_target   = x; }
 785 
 786   // Oop results of vm runtime calls
 787   oop  vm_result_oop() const                     { return _vm_result_oop; }
 788   void set_vm_result_oop(oop x)                  { _vm_result_oop   = x; }
 789 
 790   void set_vm_result_metadata(Metadata* x)       { _vm_result_metadata = x; }
 791 



 792   MemRegion deferred_card_mark() const           { return _deferred_card_mark; }
 793   void set_deferred_card_mark(MemRegion mr)      { _deferred_card_mark = mr;   }
 794 
 795   // Is thread in scope of an InternalOOMEMark?
 796   bool is_in_internal_oome_mark() const          { return _is_in_internal_oome_mark; }
 797   void set_is_in_internal_oome_mark(bool b)      { _is_in_internal_oome_mark = b;    }
 798 
 799 #if INCLUDE_JVMCI
 800   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 801   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 802   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 803   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 804   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 805   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 806   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 807 
 808   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 809   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 810     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 811     _libjvmci_runtime = rt;

 838 
 839   // For assembly stub generation
 840   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 841   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 842   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 843   static ByteSize pending_jni_exception_check_fn_offset() {
 844     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 845   }
 846   static ByteSize last_Java_sp_offset() {
 847     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 848   }
 849   static ByteSize last_Java_pc_offset() {
 850     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 851   }
 852   static ByteSize frame_anchor_offset() {
 853     return byte_offset_of(JavaThread, _anchor);
 854   }
 855   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 856   static ByteSize vm_result_oop_offset()         { return byte_offset_of(JavaThread, _vm_result_oop); }
 857   static ByteSize vm_result_metadata_offset()    { return byte_offset_of(JavaThread, _vm_result_metadata); }

 858   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 859   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 860   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 861 #if INCLUDE_JVMCI
 862   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 863   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 864   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 865   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 866   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 867 #endif // INCLUDE_JVMCI
 868   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 869   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 870   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 871   static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
 872 
 873   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 874 
 875   // StackOverflow offsets
 876   static ByteSize stack_overflow_limit_offset()  {
 877     return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);

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

 773   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 774   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 775 
 776   // The special resourceMark used during deoptimization
 777 
 778   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 779   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 780 
 781   void set_deopt_compiled_method(nmethod* nm)    { _deopt_nmethod = nm; }
 782   nmethod* deopt_compiled_method()               { return _deopt_nmethod; }
 783 
 784   Method*    callee_target() const               { return _callee_target; }
 785   void set_callee_target  (Method* x)            { _callee_target   = x; }
 786 
 787   // Oop results of vm runtime calls
 788   oop  vm_result_oop() const                     { return _vm_result_oop; }
 789   void set_vm_result_oop(oop x)                  { _vm_result_oop   = x; }
 790 
 791   void set_vm_result_metadata(Metadata* x)       { _vm_result_metadata = x; }
 792 
 793   oop return_buffered_value() const              { return _return_buffered_value; }
 794   void set_return_buffered_value(oop val)        { _return_buffered_value = val; }
 795 
 796   MemRegion deferred_card_mark() const           { return _deferred_card_mark; }
 797   void set_deferred_card_mark(MemRegion mr)      { _deferred_card_mark = mr;   }
 798 
 799   // Is thread in scope of an InternalOOMEMark?
 800   bool is_in_internal_oome_mark() const          { return _is_in_internal_oome_mark; }
 801   void set_is_in_internal_oome_mark(bool b)      { _is_in_internal_oome_mark = b;    }
 802 
 803 #if INCLUDE_JVMCI
 804   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 805   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 806   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 807   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 808   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 809   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 810   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 811 
 812   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 813   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 814     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 815     _libjvmci_runtime = rt;

 842 
 843   // For assembly stub generation
 844   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 845   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 846   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 847   static ByteSize pending_jni_exception_check_fn_offset() {
 848     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 849   }
 850   static ByteSize last_Java_sp_offset() {
 851     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 852   }
 853   static ByteSize last_Java_pc_offset() {
 854     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 855   }
 856   static ByteSize frame_anchor_offset() {
 857     return byte_offset_of(JavaThread, _anchor);
 858   }
 859   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 860   static ByteSize vm_result_oop_offset()         { return byte_offset_of(JavaThread, _vm_result_oop); }
 861   static ByteSize vm_result_metadata_offset()    { return byte_offset_of(JavaThread, _vm_result_metadata); }
 862   static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
 863   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 864   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 865   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 866 #if INCLUDE_JVMCI
 867   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 868   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 869   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 870   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 871   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 872 #endif // INCLUDE_JVMCI
 873   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 874   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 875   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 876   static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
 877 
 878   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 879 
 880   // StackOverflow offsets
 881   static ByteSize stack_overflow_limit_offset()  {
 882     return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
< prev index next >