126 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
127 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
128 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
129 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
130 // the frame, when control returns to it.
131 JvmtiDeferredUpdates* _jvmti_deferred_updates;
132
133 // Handshake value for fixing 6243940. We need a place for the i2c
134 // adapter to store the callee Method*. This value is NEVER live
135 // across a gc point so it does NOT have to be gc'd
136 // The handshake is open ended since we can't be certain that it will
137 // be nulled. This is because we rarely ever see the race and end up
138 // in handle_wrong_method which is the backend of the handshake. See
139 // code in i2c adapters and handle_wrong_method.
140
141 Method* _callee_target;
142
143 // Used to pass back results to the interpreter or generated code running Java code.
144 oop _vm_result; // oop result is GC-preserved
145 Metadata* _vm_result_2; // non-oop result
146
147 // See ReduceInitialCardMarks: this holds the precise space interval of
148 // the most recent slow path allocation for which compiled code has
149 // elided card-marks for performance along the fast-path.
150 MemRegion _deferred_card_mark;
151
152 ObjectMonitor* volatile _current_pending_monitor; // ObjectMonitor this thread is waiting to lock
153 bool _current_pending_monitor_is_from_java; // locking is from Java code
154 ObjectMonitor* volatile _current_waiting_monitor; // ObjectMonitor on which this thread called Object.wait()
155
156 // Active_handles points to a block of handles
157 JNIHandleBlock* _active_handles;
158
159 // One-element thread local free list
160 JNIHandleBlock* _free_handle_block;
161
162 public:
163 // For tracking the heavyweight monitor the thread is pending on.
164 ObjectMonitor* current_pending_monitor() {
165 // Use Atomic::load() to prevent data race between concurrent modification and
712 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
713 vframeArray* vframe_array_last() const { return _vframe_array_last; }
714
715 // The special resourceMark used during deoptimization
716
717 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
718 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
719
720 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
721 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
722
723 Method* callee_target() const { return _callee_target; }
724 void set_callee_target (Method* x) { _callee_target = x; }
725
726 // Oop results of vm runtime calls
727 oop vm_result() const { return _vm_result; }
728 void set_vm_result (oop x) { _vm_result = x; }
729
730 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
731
732 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
733 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
734
735 // Is thread in scope of an InternalOOMEMark?
736 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
737 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
738
739 #if INCLUDE_JVMCI
740 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
741 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
742 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
743 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
744 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
745 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
746 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
747
748 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
749 void set_libjvmci_runtime(JVMCIRuntime* rt) {
750 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
751 _libjvmci_runtime = rt;
778
779 // For assembly stub generation
780 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
781 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
782 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
783 static ByteSize pending_jni_exception_check_fn_offset() {
784 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
785 }
786 static ByteSize last_Java_sp_offset() {
787 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
788 }
789 static ByteSize last_Java_pc_offset() {
790 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
791 }
792 static ByteSize frame_anchor_offset() {
793 return byte_offset_of(JavaThread, _anchor);
794 }
795 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
796 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
797 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
798 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
799 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
800 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
801 #if INCLUDE_JVMCI
802 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
803 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
804 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
805 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
806 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
807 #endif // INCLUDE_JVMCI
808 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
809 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
810 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
811 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
812
813 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
814
815 // StackOverflow offsets
816 static ByteSize stack_overflow_limit_offset() {
817 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
|
126 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
127 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
128 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
129 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
130 // the frame, when control returns to it.
131 JvmtiDeferredUpdates* _jvmti_deferred_updates;
132
133 // Handshake value for fixing 6243940. We need a place for the i2c
134 // adapter to store the callee Method*. This value is NEVER live
135 // across a gc point so it does NOT have to be gc'd
136 // The handshake is open ended since we can't be certain that it will
137 // be nulled. This is because we rarely ever see the race and end up
138 // in handle_wrong_method which is the backend of the handshake. See
139 // code in i2c adapters and handle_wrong_method.
140
141 Method* _callee_target;
142
143 // Used to pass back results to the interpreter or generated code running Java code.
144 oop _vm_result; // oop result is GC-preserved
145 Metadata* _vm_result_2; // non-oop result
146 oop _return_buffered_value; // buffered value being returned
147
148 // See ReduceInitialCardMarks: this holds the precise space interval of
149 // the most recent slow path allocation for which compiled code has
150 // elided card-marks for performance along the fast-path.
151 MemRegion _deferred_card_mark;
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 public:
164 // For tracking the heavyweight monitor the thread is pending on.
165 ObjectMonitor* current_pending_monitor() {
166 // Use Atomic::load() to prevent data race between concurrent modification and
713 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
714 vframeArray* vframe_array_last() const { return _vframe_array_last; }
715
716 // The special resourceMark used during deoptimization
717
718 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
719 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
720
721 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
722 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
723
724 Method* callee_target() const { return _callee_target; }
725 void set_callee_target (Method* x) { _callee_target = x; }
726
727 // Oop results of vm runtime calls
728 oop vm_result() const { return _vm_result; }
729 void set_vm_result (oop x) { _vm_result = x; }
730
731 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
732
733 oop return_buffered_value() const { return _return_buffered_value; }
734 void set_return_buffered_value(oop val) { _return_buffered_value = val; }
735
736 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
737 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
738
739 // Is thread in scope of an InternalOOMEMark?
740 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
741 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
742
743 #if INCLUDE_JVMCI
744 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
745 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
746 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
747 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
748 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
749 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
750 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
751
752 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
753 void set_libjvmci_runtime(JVMCIRuntime* rt) {
754 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
755 _libjvmci_runtime = rt;
782
783 // For assembly stub generation
784 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
785 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
786 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
787 static ByteSize pending_jni_exception_check_fn_offset() {
788 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
789 }
790 static ByteSize last_Java_sp_offset() {
791 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
792 }
793 static ByteSize last_Java_pc_offset() {
794 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
795 }
796 static ByteSize frame_anchor_offset() {
797 return byte_offset_of(JavaThread, _anchor);
798 }
799 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
800 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
801 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
802 static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
803 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
804 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
805 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
806 #if INCLUDE_JVMCI
807 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
808 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
809 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
810 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
811 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
812 #endif // INCLUDE_JVMCI
813 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
814 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
815 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
816 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
817
818 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
819
820 // StackOverflow offsets
821 static ByteSize stack_overflow_limit_offset() {
822 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
|