< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page

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

 144 
 145   // See ReduceInitialCardMarks: this holds the precise space interval of
 146   // the most recent slow path allocation for which compiled code has
 147   // elided card-marks for performance along the fast-path.
 148   MemRegion     _deferred_card_mark;
 149 
 150   ObjectMonitor* volatile _current_pending_monitor;     // ObjectMonitor this thread is waiting to lock
 151   bool           _current_pending_monitor_is_from_java; // locking is from Java code
 152   ObjectMonitor* volatile _current_waiting_monitor;     // ObjectMonitor on which this thread called Object.wait()
 153 
 154   // Active_handles points to a block of handles
 155   JNIHandleBlock* _active_handles;
 156 
 157   // One-element thread local free list
 158   JNIHandleBlock* _free_handle_block;
 159 
 160  public:
 161   volatile intptr_t _Stalled;
 162 
 163   // For tracking the heavyweight monitor the thread is pending on.

 677   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 678   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 679 
 680   // The special resourceMark used during deoptimization
 681 
 682   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 683   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 684 
 685   void set_deopt_compiled_method(CompiledMethod* nm)  { _deopt_nmethod = nm; }
 686   CompiledMethod* deopt_compiled_method()        { return _deopt_nmethod; }
 687 
 688   Method*    callee_target() const               { return _callee_target; }
 689   void set_callee_target  (Method* x)            { _callee_target   = x; }
 690 
 691   // Oop results of vm runtime calls
 692   oop  vm_result() const                         { return _vm_result; }
 693   void set_vm_result  (oop x)                    { _vm_result   = x; }
 694 
 695   void set_vm_result_2  (Metadata* x)            { _vm_result_2   = x; }
 696 



 697   MemRegion deferred_card_mark() const           { return _deferred_card_mark; }
 698   void set_deferred_card_mark(MemRegion mr)      { _deferred_card_mark = mr;   }
 699 
 700 #if INCLUDE_JVMCI
 701   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 702   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 703   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 704   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 705   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 706   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 707   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 708 
 709   virtual bool in_retryable_allocation() const    { return _in_retryable_allocation; }
 710   void set_in_retryable_allocation(bool b)        { _in_retryable_allocation = b; }
 711 
 712   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 713   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 714     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 715     _libjvmci_runtime = rt;
 716   }

 742 
 743   // For assembly stub generation
 744   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 745   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 746   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 747   static ByteSize pending_jni_exception_check_fn_offset() {
 748     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 749   }
 750   static ByteSize last_Java_sp_offset() {
 751     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 752   }
 753   static ByteSize last_Java_pc_offset() {
 754     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 755   }
 756   static ByteSize frame_anchor_offset() {
 757     return byte_offset_of(JavaThread, _anchor);
 758   }
 759   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 760   static ByteSize vm_result_offset()             { return byte_offset_of(JavaThread, _vm_result); }
 761   static ByteSize vm_result_2_offset()           { return byte_offset_of(JavaThread, _vm_result_2); }

 762   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 763   static ByteSize polling_word_offset()          { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_word);}
 764   static ByteSize polling_page_offset()          { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_page);}
 765   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 766   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 767 #if INCLUDE_JVMCI
 768   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 769   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 770   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 771   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 772   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 773 #endif // INCLUDE_JVMCI
 774   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 775   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 776   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 777   static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
 778 
 779   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 780 
 781   // StackOverflow offsets

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

 678   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 679   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 680 
 681   // The special resourceMark used during deoptimization
 682 
 683   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 684   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 685 
 686   void set_deopt_compiled_method(CompiledMethod* nm)  { _deopt_nmethod = nm; }
 687   CompiledMethod* deopt_compiled_method()        { return _deopt_nmethod; }
 688 
 689   Method*    callee_target() const               { return _callee_target; }
 690   void set_callee_target  (Method* x)            { _callee_target   = x; }
 691 
 692   // Oop results of vm runtime calls
 693   oop  vm_result() const                         { return _vm_result; }
 694   void set_vm_result  (oop x)                    { _vm_result   = x; }
 695 
 696   void set_vm_result_2  (Metadata* x)            { _vm_result_2   = x; }
 697 
 698   oop return_buffered_value() const              { return _return_buffered_value; }
 699   void set_return_buffered_value(oop val)        { _return_buffered_value = val; }
 700 
 701   MemRegion deferred_card_mark() const           { return _deferred_card_mark; }
 702   void set_deferred_card_mark(MemRegion mr)      { _deferred_card_mark = mr;   }
 703 
 704 #if INCLUDE_JVMCI
 705   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 706   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 707   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 708   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 709   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 710   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 711   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 712 
 713   virtual bool in_retryable_allocation() const    { return _in_retryable_allocation; }
 714   void set_in_retryable_allocation(bool b)        { _in_retryable_allocation = b; }
 715 
 716   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 717   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 718     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 719     _libjvmci_runtime = rt;
 720   }

 746 
 747   // For assembly stub generation
 748   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 749   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 750   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 751   static ByteSize pending_jni_exception_check_fn_offset() {
 752     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 753   }
 754   static ByteSize last_Java_sp_offset() {
 755     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 756   }
 757   static ByteSize last_Java_pc_offset() {
 758     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 759   }
 760   static ByteSize frame_anchor_offset() {
 761     return byte_offset_of(JavaThread, _anchor);
 762   }
 763   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 764   static ByteSize vm_result_offset()             { return byte_offset_of(JavaThread, _vm_result); }
 765   static ByteSize vm_result_2_offset()           { return byte_offset_of(JavaThread, _vm_result_2); }
 766   static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
 767   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 768   static ByteSize polling_word_offset()          { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_word);}
 769   static ByteSize polling_page_offset()          { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_page);}
 770   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 771   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 772 #if INCLUDE_JVMCI
 773   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 774   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 775   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 776   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 777   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 778 #endif // INCLUDE_JVMCI
 779   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 780   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 781   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 782   static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
 783 
 784   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 785 
 786   // StackOverflow offsets
< prev index next >