< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page

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

 152 
 153   ObjectMonitor* volatile _current_pending_monitor;     // ObjectMonitor this thread is waiting to lock
 154   bool           _current_pending_monitor_is_from_java; // locking is from Java code
 155   ObjectMonitor* volatile _current_waiting_monitor;     // ObjectMonitor on which this thread called Object.wait()
 156 
 157   // Active_handles points to a block of handles
 158   JNIHandleBlock* _active_handles;
 159 
 160   // One-element thread local free list
 161   JNIHandleBlock* _free_handle_block;
 162 
 163   // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the
 164   // current _vthread object, except during creation of the primordial and JNI
 165   // attached thread cases where this field can have a temporary value.
 166   int64_t _monitor_owner_id;
 167 
 168  public:
 169   void set_monitor_owner_id(int64_t id) {
 170     ThreadIdentifier::verify_id(id);
 171     _monitor_owner_id = id;

 802   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 803   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 804 
 805   // The special resourceMark used during deoptimization
 806 
 807   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 808   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 809 
 810   void set_deopt_compiled_method(nmethod* nm)    { _deopt_nmethod = nm; }
 811   nmethod* deopt_compiled_method()               { return _deopt_nmethod; }
 812 
 813   Method*    callee_target() const               { return _callee_target; }
 814   void set_callee_target  (Method* x)            { _callee_target   = x; }
 815 
 816   // Oop results of vm runtime calls
 817   oop  vm_result_oop() const                     { return _vm_result_oop; }
 818   void set_vm_result_oop(oop x)                  { _vm_result_oop   = x; }
 819 
 820   void set_vm_result_metadata(Metadata* x)       { _vm_result_metadata = x; }
 821 



 822   // Is thread in scope of an InternalOOMEMark?
 823   bool is_in_internal_oome_mark() const          { return _is_in_internal_oome_mark; }
 824   void set_is_in_internal_oome_mark(bool b)      { _is_in_internal_oome_mark = b;    }
 825 
 826 #if INCLUDE_JVMCI
 827   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 828   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 829   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 830   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 831   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 832   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 833   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 834 
 835   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 836   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 837     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 838     _libjvmci_runtime = rt;
 839   }
 840 #endif // INCLUDE_JVMCI
 841 

 864 
 865   // For assembly stub generation
 866   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 867   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 868   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 869   static ByteSize pending_jni_exception_check_fn_offset() {
 870     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 871   }
 872   static ByteSize last_Java_sp_offset() {
 873     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 874   }
 875   static ByteSize last_Java_pc_offset() {
 876     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 877   }
 878   static ByteSize frame_anchor_offset() {
 879     return byte_offset_of(JavaThread, _anchor);
 880   }
 881   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 882   static ByteSize vm_result_oop_offset()         { return byte_offset_of(JavaThread, _vm_result_oop); }
 883   static ByteSize vm_result_metadata_offset()    { return byte_offset_of(JavaThread, _vm_result_metadata); }

 884   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 885   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 886   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 887 #if INCLUDE_JVMCI
 888   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 889   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 890   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 891   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 892   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 893 #endif // INCLUDE_JVMCI
 894   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 895   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 896   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 897 
 898   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 899 
 900   // StackOverflow offsets
 901   static ByteSize stack_overflow_limit_offset()  {
 902     return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
 903   }

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

 803   void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
 804   vframeArray* vframe_array_last() const         { return _vframe_array_last;  }
 805 
 806   // The special resourceMark used during deoptimization
 807 
 808   void set_deopt_mark(DeoptResourceMark* value)  { _deopt_mark = value; }
 809   DeoptResourceMark* deopt_mark(void)            { return _deopt_mark; }
 810 
 811   void set_deopt_compiled_method(nmethod* nm)    { _deopt_nmethod = nm; }
 812   nmethod* deopt_compiled_method()               { return _deopt_nmethod; }
 813 
 814   Method*    callee_target() const               { return _callee_target; }
 815   void set_callee_target  (Method* x)            { _callee_target   = x; }
 816 
 817   // Oop results of vm runtime calls
 818   oop  vm_result_oop() const                     { return _vm_result_oop; }
 819   void set_vm_result_oop(oop x)                  { _vm_result_oop   = x; }
 820 
 821   void set_vm_result_metadata(Metadata* x)       { _vm_result_metadata = x; }
 822 
 823   oop return_buffered_value() const              { return _return_buffered_value; }
 824   void set_return_buffered_value(oop val)        { _return_buffered_value = val; }
 825 
 826   // Is thread in scope of an InternalOOMEMark?
 827   bool is_in_internal_oome_mark() const          { return _is_in_internal_oome_mark; }
 828   void set_is_in_internal_oome_mark(bool b)      { _is_in_internal_oome_mark = b;    }
 829 
 830 #if INCLUDE_JVMCI
 831   jlong pending_failed_speculation() const        { return _pending_failed_speculation; }
 832   void set_pending_monitorenter(bool b)           { _pending_monitorenter = b; }
 833   void set_pending_deoptimization(int reason)     { _pending_deoptimization = reason; }
 834   void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
 835   void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
 836   void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
 837   void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
 838 
 839   JVMCIRuntime* libjvmci_runtime() const          { return _libjvmci_runtime; }
 840   void set_libjvmci_runtime(JVMCIRuntime* rt) {
 841     assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
 842     _libjvmci_runtime = rt;
 843   }
 844 #endif // INCLUDE_JVMCI
 845 

 868 
 869   // For assembly stub generation
 870   static ByteSize threadObj_offset()             { return byte_offset_of(JavaThread, _threadObj); }
 871   static ByteSize vthread_offset()               { return byte_offset_of(JavaThread, _vthread); }
 872   static ByteSize jni_environment_offset()       { return byte_offset_of(JavaThread, _jni_environment); }
 873   static ByteSize pending_jni_exception_check_fn_offset() {
 874     return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
 875   }
 876   static ByteSize last_Java_sp_offset() {
 877     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
 878   }
 879   static ByteSize last_Java_pc_offset() {
 880     return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
 881   }
 882   static ByteSize frame_anchor_offset() {
 883     return byte_offset_of(JavaThread, _anchor);
 884   }
 885   static ByteSize callee_target_offset()         { return byte_offset_of(JavaThread, _callee_target); }
 886   static ByteSize vm_result_oop_offset()         { return byte_offset_of(JavaThread, _vm_result_oop); }
 887   static ByteSize vm_result_metadata_offset()    { return byte_offset_of(JavaThread, _vm_result_metadata); }
 888   static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
 889   static ByteSize thread_state_offset()          { return byte_offset_of(JavaThread, _thread_state); }
 890   static ByteSize saved_exception_pc_offset()    { return byte_offset_of(JavaThread, _saved_exception_pc); }
 891   static ByteSize osthread_offset()              { return byte_offset_of(JavaThread, _osthread); }
 892 #if INCLUDE_JVMCI
 893   static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
 894   static ByteSize pending_monitorenter_offset()  { return byte_offset_of(JavaThread, _pending_monitorenter); }
 895   static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
 896   static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
 897   static ByteSize jvmci_counters_offset()        { return byte_offset_of(JavaThread, _jvmci_counters); }
 898 #endif // INCLUDE_JVMCI
 899   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop); }
 900   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc); }
 901   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
 902 
 903   static ByteSize active_handles_offset()        { return byte_offset_of(JavaThread, _active_handles); }
 904 
 905   // StackOverflow offsets
 906   static ByteSize stack_overflow_limit_offset()  {
 907     return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
 908   }
< prev index next >