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;
818 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
819 vframeArray* vframe_array_last() const { return _vframe_array_last; }
820
821 // The special resourceMark used during deoptimization
822
823 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
824 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
825
826 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
827 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
828
829 Method* callee_target() const { return _callee_target; }
830 void set_callee_target (Method* x) { _callee_target = x; }
831
832 // Oop results of vm runtime calls
833 oop vm_result_oop() const { return _vm_result_oop; }
834 void set_vm_result_oop(oop x) { _vm_result_oop = x; }
835
836 void set_vm_result_metadata(Metadata* x) { _vm_result_metadata = x; }
837
838 // Is thread in scope of an InternalOOMEMark?
839 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
840 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
841
842 #if INCLUDE_JVMCI
843 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
844 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
845 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
846 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
847 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
848 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
849 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
850
851 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
852 void set_libjvmci_runtime(JVMCIRuntime* rt) {
853 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
854 _libjvmci_runtime = rt;
855 }
856 #endif // INCLUDE_JVMCI
857
880
881 // For assembly stub generation
882 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
883 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
884 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
885 static ByteSize pending_jni_exception_check_fn_offset() {
886 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
887 }
888 static ByteSize last_Java_sp_offset() {
889 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
890 }
891 static ByteSize last_Java_pc_offset() {
892 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
893 }
894 static ByteSize frame_anchor_offset() {
895 return byte_offset_of(JavaThread, _anchor);
896 }
897 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
898 static ByteSize vm_result_oop_offset() { return byte_offset_of(JavaThread, _vm_result_oop); }
899 static ByteSize vm_result_metadata_offset() { return byte_offset_of(JavaThread, _vm_result_metadata); }
900 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
901 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
902 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
903 #if INCLUDE_JVMCI
904 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
905 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
906 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
907 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
908 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
909 #endif // INCLUDE_JVMCI
910 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
911 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
912 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
913
914 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
915
916 // StackOverflow offsets
917 static ByteSize stack_overflow_limit_offset() {
918 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
919 }
|
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;
819 void set_vframe_array_last(vframeArray* value) { _vframe_array_last = value; }
820 vframeArray* vframe_array_last() const { return _vframe_array_last; }
821
822 // The special resourceMark used during deoptimization
823
824 void set_deopt_mark(DeoptResourceMark* value) { _deopt_mark = value; }
825 DeoptResourceMark* deopt_mark(void) { return _deopt_mark; }
826
827 void set_deopt_compiled_method(nmethod* nm) { _deopt_nmethod = nm; }
828 nmethod* deopt_compiled_method() { return _deopt_nmethod; }
829
830 Method* callee_target() const { return _callee_target; }
831 void set_callee_target (Method* x) { _callee_target = x; }
832
833 // Oop results of vm runtime calls
834 oop vm_result_oop() const { return _vm_result_oop; }
835 void set_vm_result_oop(oop x) { _vm_result_oop = x; }
836
837 void set_vm_result_metadata(Metadata* x) { _vm_result_metadata = x; }
838
839 oop return_buffered_value() const { return _return_buffered_value; }
840 void set_return_buffered_value(oop val) { _return_buffered_value = val; }
841
842 // Is thread in scope of an InternalOOMEMark?
843 bool is_in_internal_oome_mark() const { return _is_in_internal_oome_mark; }
844 void set_is_in_internal_oome_mark(bool b) { _is_in_internal_oome_mark = b; }
845
846 #if INCLUDE_JVMCI
847 jlong pending_failed_speculation() const { return _pending_failed_speculation; }
848 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; }
849 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
850 void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; }
851 void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
852 void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == nullptr, "must be"); _jvmci._alternate_call_target = a; }
853 void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == nullptr, "must be"); _jvmci._implicit_exception_pc = a; }
854
855 JVMCIRuntime* libjvmci_runtime() const { return _libjvmci_runtime; }
856 void set_libjvmci_runtime(JVMCIRuntime* rt) {
857 assert((_libjvmci_runtime == nullptr && rt != nullptr) || (_libjvmci_runtime != nullptr && rt == nullptr), "must be");
858 _libjvmci_runtime = rt;
859 }
860 #endif // INCLUDE_JVMCI
861
884
885 // For assembly stub generation
886 static ByteSize threadObj_offset() { return byte_offset_of(JavaThread, _threadObj); }
887 static ByteSize vthread_offset() { return byte_offset_of(JavaThread, _vthread); }
888 static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
889 static ByteSize pending_jni_exception_check_fn_offset() {
890 return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
891 }
892 static ByteSize last_Java_sp_offset() {
893 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
894 }
895 static ByteSize last_Java_pc_offset() {
896 return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_pc_offset();
897 }
898 static ByteSize frame_anchor_offset() {
899 return byte_offset_of(JavaThread, _anchor);
900 }
901 static ByteSize callee_target_offset() { return byte_offset_of(JavaThread, _callee_target); }
902 static ByteSize vm_result_oop_offset() { return byte_offset_of(JavaThread, _vm_result_oop); }
903 static ByteSize vm_result_metadata_offset() { return byte_offset_of(JavaThread, _vm_result_metadata); }
904 static ByteSize return_buffered_value_offset() { return byte_offset_of(JavaThread, _return_buffered_value); }
905 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state); }
906 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc); }
907 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread); }
908 #if INCLUDE_JVMCI
909 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); }
910 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); }
911 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); }
912 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); }
913 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); }
914 #endif // INCLUDE_JVMCI
915 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); }
916 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); }
917 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); }
918
919 static ByteSize active_handles_offset() { return byte_offset_of(JavaThread, _active_handles); }
920
921 // StackOverflow offsets
922 static ByteSize stack_overflow_limit_offset() {
923 return byte_offset_of(JavaThread, _stack_overflow_state._stack_overflow_limit);
924 }
|