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
717 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
718 vframeArray* vframe_array_last() const { return _vframe_array_last; }
719
720 // The special resourceMark used during deoptimization
721
722 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
723 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
724
725 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
726 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
727
728 Method* callee_target() const { return _callee_target; }
729 void set_callee_target (Method* x) { _callee_target = x; }
730
731 // Oop results of vm runtime calls
732 oop vm_result() const { return _vm_result; }
733 void set_vm_result (oop x) { _vm_result = x; }
734
735 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
736
737 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
738 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
739
740 // Is thread in scope of an InternalOOMEMark?
741 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
742 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
743
744 #if INCLUDE_JVMCI
745 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
746 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
747 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
748 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
749 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
750 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
751 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
752
753 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
754 void set_libjvmci_runtime(JVMCIRuntime* rt) {
755 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
756 _libjvmci_runtime = rt;
783
784 // For assembly stub generation
785 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
786 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
787 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
788 static ByteSize pending_jni_exception_check_fn_offset() {
789 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
790 }
791 static ByteSize last_Java_sp_offset() {
792 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
793 }
794 static ByteSize last_Java_pc_offset() {
795 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
796 }
797 static ByteSize frame_anchor_offset() {
798 return byte_offset_of(JavaThread, _anchor);
799 }
800 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
801 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
802 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
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);
|
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
718 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
719 vframeArray* vframe_array_last() const { return _vframe_array_last; }
720
721 // The special resourceMark used during deoptimization
722
723 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
724 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
725
726 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
727 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
728
729 Method* callee_target() const { return _callee_target; }
730 void set_callee_target (Method* x) { _callee_target = x; }
731
732 // Oop results of vm runtime calls
733 oop vm_result() const { return _vm_result; }
734 void set_vm_result (oop x) { _vm_result = x; }
735
736 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
737
738 oop return_buffered_value() const { return _return_buffered_value; }
739 void set_return_buffered_value(oop val) { _return_buffered_value = val; }
740
741 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
742 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
743
744 // Is thread in scope of an InternalOOMEMark?
745 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
746 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
747
748 #if INCLUDE_JVMCI
749 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
750 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
751 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
752 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
753 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
754 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
755 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
756
757 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
758 void set_libjvmci_runtime(JVMCIRuntime* rt) {
759 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
760 _libjvmci_runtime = rt;
787
788 // For assembly stub generation
789 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
790 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
791 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
792 static ByteSize pending_jni_exception_check_fn_offset() {
793 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
794 }
795 static ByteSize last_Java_sp_offset() {
796 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
797 }
798 static ByteSize last_Java_pc_offset() {
799 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
800 }
801 static ByteSize frame_anchor_offset() {
802 return byte_offset_of(JavaThread, _anchor);
803 }
804 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
805 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
806 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
807 static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
808 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
809 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
810 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
811 #if INCLUDE_JVMCI
812 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
813 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
814 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
815 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
816 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
817 #endif // INCLUDE_JVMCI
818 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
819 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
820 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
821 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
822
823 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
824
825 // StackOverflow offsets
826 static ByteSize stack_overflow_limit_offset() {
827 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
|