135 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
136 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
137 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
138 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
139 // the frame, when control returns to it.
140 JvmtiDeferredUpdates* _jvmti_deferred_updates;
141
142 // Handshake value for fixing 6243940. We need a place for the i2c
143 // adapter to store the callee Method*. This value is NEVER live
144 // across a gc point so it does NOT have to be gc'd
145 // The handshake is open ended since we can't be certain that it will
146 // be nulled. This is because we rarely ever see the race and end up
147 // in handle_wrong_method which is the backend of the handshake. See
148 // code in i2c adapters and handle_wrong_method.
149
150 Method* _callee_target;
151
152 // Used to pass back results to the interpreter or generated code running Java code.
153 oop _vm_result_oop; // oop result is GC-preserved
154 Metadata* _vm_result_metadata; // non-oop result
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;
170
171 public:
172 void set_monitor_owner_id(int64_t id) {
173 ThreadIdentifier::verify_id(id);
174 _monitor_owner_id = id;
815 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
816 vframeArray* vframe_array_last() const { return _vframe_array_last; }
817
818 // The special resourceMark used during deoptimization
819
820 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
821 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
822
823 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
824 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
825
826 Method* callee_target() const { return _callee_target; }
827 void set_callee_target (Method* x) { _callee_target = x; }
828
829 // Oop results of vm runtime calls
830 oop vm_result_oop() const { return _vm_result_oop; }
831 void set_vm_result_oop(oop x) { _vm_result_oop = x; }
832
833 void set_vm_result_metadata(Metadata* x) { _vm_result_metadata = x; }
834
835 // Is thread in scope of an InternalOOMEMark?
836 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
837 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
838
839 #if INCLUDE_JVMCI
840 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
841 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
842 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
843 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
844 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
845 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
846 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
847
848 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
849 void set_libjvmci_runtime(JVMCIRuntime* rt) {
850 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
851 _libjvmci_runtime = rt;
852 }
853 #endif // INCLUDE_JVMCI
854
877
878 // For assembly stub generation
879 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
880 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
881 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
882 static ByteSize pending_jni_exception_check_fn_offset() {
883 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
884 }
885 static ByteSize last_Java_sp_offset() {
886 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
887 }
888 static ByteSize last_Java_pc_offset() {
889 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
890 }
891 static ByteSize frame_anchor_offset() {
892 return byte_offset_of(JavaThread, _anchor);
893 }
894 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
895 static ByteSize vm_result_oop_offset() { return byte_offset_of(JavaThread, _vm_result_oop); }
896 static ByteSize vm_result_metadata_offset() { return byte_offset_of(JavaThread, _vm_result_metadata); }
897 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
898 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
899 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
900 #if INCLUDE_JVMCI
901 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
902 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
903 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
904 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
905 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
906 #endif // INCLUDE_JVMCI
907 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
908 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
909 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
910
911 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
912
913 // StackOverflow offsets
914 static ByteSize stack_overflow_limit_offset() {
915 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
916 }
|
135 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays
136 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped
137 // Holds updates by JVMTI agents for compiled frames that cannot be performed immediately. They
138 // will be carried out as soon as possible which, in most cases, is just before deoptimization of
139 // the frame, when control returns to it.
140 JvmtiDeferredUpdates* _jvmti_deferred_updates;
141
142 // Handshake value for fixing 6243940. We need a place for the i2c
143 // adapter to store the callee Method*. This value is NEVER live
144 // across a gc point so it does NOT have to be gc'd
145 // The handshake is open ended since we can't be certain that it will
146 // be nulled. This is because we rarely ever see the race and end up
147 // in handle_wrong_method which is the backend of the handshake. See
148 // code in i2c adapters and handle_wrong_method.
149
150 Method* _callee_target;
151
152 // Used to pass back results to the interpreter or generated code running Java code.
153 oop _vm_result_oop; // oop result is GC-preserved
154 Metadata* _vm_result_metadata; // non-oop result
155 oop _return_buffered_value; // buffered value being returned
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;
171
172 public:
173 void set_monitor_owner_id(int64_t id) {
174 ThreadIdentifier::verify_id(id);
175 _monitor_owner_id = id;
816 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
817 vframeArray* vframe_array_last() const { return _vframe_array_last; }
818
819 // The special resourceMark used during deoptimization
820
821 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
822 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
823
824 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
825 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
826
827 Method* callee_target() const { return _callee_target; }
828 void set_callee_target (Method* x) { _callee_target = x; }
829
830 // Oop results of vm runtime calls
831 oop vm_result_oop() const { return _vm_result_oop; }
832 void set_vm_result_oop(oop x) { _vm_result_oop = x; }
833
834 void set_vm_result_metadata(Metadata* x) { _vm_result_metadata = x; }
835
836 oop return_buffered_value() const { return _return_buffered_value; }
837 void set_return_buffered_value(oop val) { _return_buffered_value = val; }
838
839 // Is thread in scope of an InternalOOMEMark?
840 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
841 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
842
843 #if INCLUDE_JVMCI
844 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
845 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
846 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
847 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
848 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
849 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
850 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
851
852 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
853 void set_libjvmci_runtime(JVMCIRuntime* rt) {
854 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
855 _libjvmci_runtime = rt;
856 }
857 #endif // INCLUDE_JVMCI
858
881
882 // For assembly stub generation
883 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
884 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
885 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
886 static ByteSize pending_jni_exception_check_fn_offset() {
887 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
888 }
889 static ByteSize last_Java_sp_offset() {
890 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
891 }
892 static ByteSize last_Java_pc_offset() {
893 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
894 }
895 static ByteSize frame_anchor_offset() {
896 return byte_offset_of(JavaThread, _anchor);
897 }
898 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
899 static ByteSize vm_result_oop_offset() { return byte_offset_of(JavaThread, _vm_result_oop); }
900 static ByteSize vm_result_metadata_offset() { return byte_offset_of(JavaThread, _vm_result_metadata); }
901 static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
902 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
903 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
904 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
905 #if INCLUDE_JVMCI
906 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
907 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
908 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
909 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
910 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
911 #endif // INCLUDE_JVMCI
912 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
913 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
914 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
915
916 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
917
918 // StackOverflow offsets
919 static ByteSize stack_overflow_limit_offset() {
920 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
921 }
|