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

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

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

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

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

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