130 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
131 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
132 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
133 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
134 // the frame, when control returns to it.
135 JvmtiDeferredUpdates* _jvmti_deferred_updates;
136
137 // Handshake value for fixing 6243940. We need a place for the i2c
138 // adapter to store the callee Method*. This value is NEVER live
139 // across a gc point so it does NOT have to be gc'd
140 // The handshake is open ended since we can't be certain that it will
141 // be nulled. This is because we rarely ever see the race and end up
142 // in handle_wrong_method which is the backend of the handshake. See
143 // code in i2c adapters and handle_wrong_method.
144
145 Method* _callee_target;
146
147 // Used to pass back results to the interpreter or generated code running Java code.
148 oop _vm_result; // oop result is GC-preserved
149 Metadata* _vm_result_2; // non-oop result
150
151 // See ReduceInitialCardMarks: this holds the precise space interval of
152 // the most recent slow path allocation for which compiled code has
153 // elided card-marks for performance along the fast-path.
154 MemRegion _deferred_card_mark;
155
156 ObjectMonitor* volatile _current_pending_monitor; // ObjectMonitor this thread is waiting to lock
157 bool _current_pending_monitor_is_from_java; // locking is from Java code
158 ObjectMonitor* volatile _current_waiting_monitor; // ObjectMonitor on which this thread called Object.wait()
159
160 // Active_handles points to a block of handles
161 JNIHandleBlock* _active_handles;
162
163 // One-element thread local free list
164 JNIHandleBlock* _free_handle_block;
165
166 // ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the
167 // current _vthread object, except during creation of the primordial and JNI
168 // attached thread cases where this field can have a temporary value.
169 int64_t _monitor_owner_id;
767 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
768 vframeArray* vframe_array_last() const { return _vframe_array_last; }
769
770 // The special resourceMark used during deoptimization
771
772 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
773 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
774
775 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
776 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
777
778 Method* callee_target() const { return _callee_target; }
779 void set_callee_target (Method* x) { _callee_target = x; }
780
781 // Oop results of vm runtime calls
782 oop vm_result() const { return _vm_result; }
783 void set_vm_result (oop x) { _vm_result = x; }
784
785 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
786
787 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
788 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
789
790 // Is thread in scope of an InternalOOMEMark?
791 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
792 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
793
794 #if INCLUDE_JVMCI
795 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
796 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
797 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
798 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
799 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
800 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
801 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
802
803 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
804 void set_libjvmci_runtime(JVMCIRuntime* rt) {
805 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
806 _libjvmci_runtime = rt;
833
834 // For assembly stub generation
835 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
836 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
837 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
838 static ByteSize pending_jni_exception_check_fn_offset() {
839 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
840 }
841 static ByteSize last_Java_sp_offset() {
842 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
843 }
844 static ByteSize last_Java_pc_offset() {
845 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
846 }
847 static ByteSize frame_anchor_offset() {
848 return byte_offset_of(JavaThread, _anchor);
849 }
850 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
851 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
852 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
853 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
854 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
855 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
856 #if INCLUDE_JVMCI
857 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
858 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
859 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
860 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
861 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
862 #endif // INCLUDE_JVMCI
863 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
864 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
865 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
866 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
867
868 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
869
870 // StackOverflow offsets
871 static ByteSize stack_overflow_limit_offset() {
872 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
|
130 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
131 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
132 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
133 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
134 // the frame, when control returns to it.
135 JvmtiDeferredUpdates* _jvmti_deferred_updates;
136
137 // Handshake value for fixing 6243940. We need a place for the i2c
138 // adapter to store the callee Method*. This value is NEVER live
139 // across a gc point so it does NOT have to be gc'd
140 // The handshake is open ended since we can't be certain that it will
141 // be nulled. This is because we rarely ever see the race and end up
142 // in handle_wrong_method which is the backend of the handshake. See
143 // code in i2c adapters and handle_wrong_method.
144
145 Method* _callee_target;
146
147 // Used to pass back results to the interpreter or generated code running Java code.
148 oop _vm_result; // oop result is GC-preserved
149 Metadata* _vm_result_2; // non-oop result
150 oop _return_buffered_value; // buffered value being returned
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;
768 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
769 vframeArray* vframe_array_last() const { return _vframe_array_last; }
770
771 // The special resourceMark used during deoptimization
772
773 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
774 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
775
776 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
777 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
778
779 Method* callee_target() const { return _callee_target; }
780 void set_callee_target (Method* x) { _callee_target = x; }
781
782 // Oop results of vm runtime calls
783 oop vm_result() const { return _vm_result; }
784 void set_vm_result (oop x) { _vm_result = x; }
785
786 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
787
788 oop return_buffered_value() const { return _return_buffered_value; }
789 void set_return_buffered_value(oop val) { _return_buffered_value = val; }
790
791 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
792 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
793
794 // Is thread in scope of an InternalOOMEMark?
795 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
796 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
797
798 #if INCLUDE_JVMCI
799 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
800 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
801 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
802 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
803 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
804 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
805 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
806
807 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
808 void set_libjvmci_runtime(JVMCIRuntime* rt) {
809 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
810 _libjvmci_runtime = rt;
837
838 // For assembly stub generation
839 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
840 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
841 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
842 static ByteSize pending_jni_exception_check_fn_offset() {
843 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
844 }
845 static ByteSize last_Java_sp_offset() {
846 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
847 }
848 static ByteSize last_Java_pc_offset() {
849 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
850 }
851 static ByteSize frame_anchor_offset() {
852 return byte_offset_of(JavaThread, _anchor);
853 }
854 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
855 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
856 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
857 static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
858 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
859 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
860 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
861 #if INCLUDE_JVMCI
862 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
863 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
864 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
865 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
866 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
867 #endif // INCLUDE_JVMCI
868 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
869 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
870 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
871 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
872
873 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
874
875 // StackOverflow offsets
876 static ByteSize stack_overflow_limit_offset() {
877 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
|