< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page

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

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

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



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

 749 
 750   // For assembly stub generation
 751   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 752   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 753   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 754   static ByteSize pending_jni_exception_check_fn_offset() {
 755     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 756   }
 757   static ByteSize last_Java_sp_offset() {
 758     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 759   }
 760   static ByteSize last_Java_pc_offset() {
 761     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 762   }
 763   static ByteSize frame_anchor_offset() {
 764     return byte_offset_of(JavaThread, _anchor);
 765   }
 766   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 767   static ByteSize vm_result_offset()             { return byte_offset_of(JavaThread, _vm_result); }
 768   static ByteSize vm_result_2_offset()           { return byte_offset_of(JavaThread, _vm_result_2); }

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

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

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

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