124 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
125 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
126 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
127 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
128 // the frame, when control returns to it.
129 JvmtiDeferredUpdates* _jvmti_deferred_updates;
130
131 // Handshake value for fixing 6243940. We need a place for the i2c
132 // adapter to store the callee Method*. This value is NEVER live
133 // across a gc point so it does NOT have to be gc'd
134 // The handshake is open ended since we can't be certain that it will
135 // be nulled. This is because we rarely ever see the race and end up
136 // in handle_wrong_method which is the backend of the handshake. See
137 // code in i2c adapters and handle_wrong_method.
138
139 Method* _callee_target;
140
141 // Used to pass back results to the interpreter or generated code running Java code.
142 oop _vm_result; // oop result is GC-preserved
143 Metadata* _vm_result_2; // non-oop result
144
145 // See ReduceInitialCardMarks: this holds the precise space interval of
146 // the most recent slow path allocation for which compiled code has
147 // elided card-marks for performance along the fast-path.
148 MemRegion _deferred_card_mark;
149
150 ObjectMonitor* volatile _current_pending_monitor; // ObjectMonitor this thread is waiting to lock
151 bool _current_pending_monitor_is_from_java; // locking is from Java code
152 ObjectMonitor* volatile _current_waiting_monitor; // ObjectMonitor on which this thread called Object.wait()
153
154 // Active_handles points to a block of handles
155 JNIHandleBlock* _active_handles;
156
157 // One-element thread local free list
158 JNIHandleBlock* _free_handle_block;
159
160 public:
161 volatile intptr_t _Stalled;
162
163 // For tracking the heavyweight monitor the thread is pending on.
681 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
682 vframeArray* vframe_array_last() const { return _vframe_array_last; }
683
684 // The special resourceMark used during deoptimization
685
686 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
687 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
688
689 void set_deopt_compiled_method(CompiledMethod* nm) { _deopt_nmethod = nm; }
690 CompiledMethod* deopt_compiled_method() { return _deopt_nmethod; }
691
692 Method* callee_target() const { return _callee_target; }
693 void set_callee_target (Method* x) { _callee_target = x; }
694
695 // Oop results of vm runtime calls
696 oop vm_result() const { return _vm_result; }
697 void set_vm_result (oop x) { _vm_result = x; }
698
699 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
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 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
706 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
707 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
708 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
709 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
710 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
711 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
712
713 virtual bool in_retryable_allocation() const { return _in_retryable_allocation; }
714 void set_in_retryable_allocation(bool b) { _in_retryable_allocation = b; }
715
716 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
717 void set_libjvmci_runtime(JVMCIRuntime* rt) {
718 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
719 _libjvmci_runtime = rt;
720 }
746
747 // For assembly stub generation
748 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
749 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
750 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
751 static ByteSize pending_jni_exception_check_fn_offset() {
752 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
753 }
754 static ByteSize last_Java_sp_offset() {
755 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
756 }
757 static ByteSize last_Java_pc_offset() {
758 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
759 }
760 static ByteSize frame_anchor_offset() {
761 return byte_offset_of(JavaThread, _anchor);
762 }
763 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
764 static ByteSize vm_result_offset() { return byte_offset_of(JavaThread, _vm_result); }
765 static ByteSize vm_result_2_offset() { return byte_offset_of(JavaThread, _vm_result_2); }
766 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
767 static ByteSize polling_word_offset() { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_word);}
768 static ByteSize polling_page_offset() { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_page);}
769 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
770 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
771 #if INCLUDE_JVMCI
772 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
773 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
774 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
775 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
776 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
777 #endif // INCLUDE_JVMCI
778 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
779 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
780 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
781 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
782
783 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
784
785 // StackOverflow offsets
|
124 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
125 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
126 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
127 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
128 // the frame, when control returns to it.
129 JvmtiDeferredUpdates* _jvmti_deferred_updates;
130
131 // Handshake value for fixing 6243940. We need a place for the i2c
132 // adapter to store the callee Method*. This value is NEVER live
133 // across a gc point so it does NOT have to be gc'd
134 // The handshake is open ended since we can't be certain that it will
135 // be nulled. This is because we rarely ever see the race and end up
136 // in handle_wrong_method which is the backend of the handshake. See
137 // code in i2c adapters and handle_wrong_method.
138
139 Method* _callee_target;
140
141 // Used to pass back results to the interpreter or generated code running Java code.
142 oop _vm_result; // oop result is GC-preserved
143 Metadata* _vm_result_2; // non-oop result
144 oop _return_buffered_value; // buffered value being returned
145
146 // See ReduceInitialCardMarks: this holds the precise space interval of
147 // the most recent slow path allocation for which compiled code has
148 // elided card-marks for performance along the fast-path.
149 MemRegion _deferred_card_mark;
150
151 ObjectMonitor* volatile _current_pending_monitor; // ObjectMonitor this thread is waiting to lock
152 bool _current_pending_monitor_is_from_java; // locking is from Java code
153 ObjectMonitor* volatile _current_waiting_monitor; // ObjectMonitor on which this thread called Object.wait()
154
155 // Active_handles points to a block of handles
156 JNIHandleBlock* _active_handles;
157
158 // One-element thread local free list
159 JNIHandleBlock* _free_handle_block;
160
161 public:
162 volatile intptr_t _Stalled;
163
164 // For tracking the heavyweight monitor the thread is pending on.
682 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
683 vframeArray* vframe_array_last() const { return _vframe_array_last; }
684
685 // The special resourceMark used during deoptimization
686
687 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
688 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
689
690 void set_deopt_compiled_method(CompiledMethod* nm) { _deopt_nmethod = nm; }
691 CompiledMethod* deopt_compiled_method() { return _deopt_nmethod; }
692
693 Method* callee_target() const { return _callee_target; }
694 void set_callee_target (Method* x) { _callee_target = x; }
695
696 // Oop results of vm runtime calls
697 oop vm_result() const { return _vm_result; }
698 void set_vm_result (oop x) { _vm_result = x; }
699
700 void set_vm_result_2 (Metadata* x) { _vm_result_2 = x; }
701
702 oop return_buffered_value() const { return _return_buffered_value; }
703 void set_return_buffered_value(oop val) { _return_buffered_value = val; }
704
705 MemRegion deferred_card_mark() const { return _deferred_card_mark; }
706 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; }
707
708 #if INCLUDE_JVMCI
709 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
710 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
711 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
712 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
713 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
714 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
715 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
716
717 virtual bool in_retryable_allocation() const { return _in_retryable_allocation; }
718 void set_in_retryable_allocation(bool b) { _in_retryable_allocation = b; }
719
720 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
721 void set_libjvmci_runtime(JVMCIRuntime* rt) {
722 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
723 _libjvmci_runtime = rt;
724 }
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 return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
771 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
772 static ByteSize polling_word_offset() { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_word);}
773 static ByteSize polling_page_offset() { return byte_offset_of(JavaThread, _poll_data) + byte_offset_of(SafepointMechanism::ThreadData, _polling_page);}
774 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
775 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
776 #if INCLUDE_JVMCI
777 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
778 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
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
790 // StackOverflow offsets
|