< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page

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

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

 677   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 678 
 679   // The special resourceMark used during deoptimization
 680 
 681   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 682   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 683 
 684   void set_deopt_compiled_method(CompiledMethod* nm)  { _deopt_nmethod = nm; }
 685   CompiledMethod* deopt_compiled_method()        { return _deopt_nmethod; }
 686 
 687   Method*    callee_target() const               { return _callee_target; }
 688   void set_callee_target  (Method* x)          { _callee_target   = x; }
 689 
 690   // Oop results of vm runtime calls
 691   oop  vm_result() const                         { return _vm_result; }
 692   void set_vm_result  (oop x)                    { _vm_result   = x; }
 693 
 694   Metadata*    vm_result_2() const               { return _vm_result_2; }
 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   int  pending_deoptimization() const             { return _pending_deoptimization; }
 702   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 703   bool has_pending_monitorenter() const           { return _pending_monitorenter; }
 704   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 705   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 706   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 707   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 708   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; }
 709   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; }
 710 
 711   virtual bool in_retryable_allocation() const    { return _in_retryable_allocation; }
 712   void set_in_retryable_allocation(bool b)        { _in_retryable_allocation = b; }
 713 
 714   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 715   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 716     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");

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

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

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

 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   Metadata*    vm_result_2() const               { return _vm_result_2; }
 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   int  pending_deoptimization() const             { return _pending_deoptimization; }
 706   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 707   bool has_pending_monitorenter() const           { return _pending_monitorenter; }
 708   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 709   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 710   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 711   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 712   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; }
 713   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; }
 714 
 715   virtual bool in_retryable_allocation() const    { return _in_retryable_allocation; }
 716   void set_in_retryable_allocation(bool b)        { _in_retryable_allocation = b; }
 717 
 718   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 719   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 720     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");

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