49 #include "logging/log.hpp"
50 #include "logging/logStream.hpp"
51 #include "memory/oopFactory.hpp"
52 #include "memory/resourceArea.hpp"
53 #include "memory/universe.hpp"
54 #include "oops/fieldInfo.hpp"
55 #include "oops/fieldStreams.inline.hpp"
56 #include "oops/instanceKlass.inline.hpp"
57 #include "oops/instanceMirrorKlass.hpp"
58 #include "oops/klass.hpp"
59 #include "oops/klass.inline.hpp"
60 #include "oops/method.inline.hpp"
61 #include "oops/objArrayKlass.hpp"
62 #include "oops/objArrayOop.inline.hpp"
63 #include "oops/oopCast.inline.hpp"
64 #include "oops/oop.inline.hpp"
65 #include "oops/symbol.hpp"
66 #include "oops/recordComponent.hpp"
67 #include "oops/typeArrayOop.inline.hpp"
68 #include "prims/jvmtiExport.hpp"
69 #include "prims/methodHandles.hpp"
70 #include "prims/resolvedMethodTable.hpp"
71 #include "runtime/continuationEntry.inline.hpp"
72 #include "runtime/continuationJavaClasses.inline.hpp"
73 #include "runtime/fieldDescriptor.inline.hpp"
74 #include "runtime/frame.inline.hpp"
75 #include "runtime/handles.inline.hpp"
76 #include "runtime/handshake.hpp"
77 #include "runtime/init.hpp"
78 #include "runtime/interfaceSupport.inline.hpp"
79 #include "runtime/java.hpp"
80 #include "runtime/javaCalls.hpp"
81 #include "runtime/javaThread.hpp"
82 #include "runtime/jniHandles.inline.hpp"
83 #include "runtime/reflectionUtils.hpp"
84 #include "runtime/safepoint.hpp"
85 #include "runtime/safepointVerifiers.hpp"
86 #include "runtime/threadSMR.hpp"
87 #include "runtime/vframe.inline.hpp"
88 #include "runtime/vm_version.hpp"
89 #include "utilities/align.hpp"
90 #include "utilities/globalDefinitions.hpp"
91 #include "utilities/growableArray.hpp"
92 #include "utilities/preserveException.hpp"
93 #include "utilities/utf8.hpp"
94 #if INCLUDE_JVMCI
95 #include "jvmci/jvmciJavaClasses.hpp"
96 #endif
97
98 #define DECLARE_INJECTED_FIELD(klass, name, signature, may_be_java) \
99 { VM_CLASS_ID(klass), VM_SYMBOL_ENUM_NAME(name##_name), VM_SYMBOL_ENUM_NAME(signature), may_be_java },
100
101 InjectedField JavaClasses::_injected_fields[] = {
102 ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD)
103 };
104
105 // Register native methods of Object
1855 // Write the thread status value to threadStatus field in java.lang.Thread java class.
1856 void java_lang_Thread::set_thread_status(oop java_thread, JavaThreadStatus status) {
1857 SET_FIELDHOLDER_FIELD(java_thread, thread_status, status);
1858 }
1859
1860 // Read thread status value from threadStatus field in java.lang.Thread java class.
1861 JavaThreadStatus java_lang_Thread::get_thread_status(oop java_thread) {
1862 // Make sure the caller is operating on behalf of the VM or is
1863 // running VM code (state == _thread_in_vm).
1864 assert(Threads_lock->owned_by_self() || Thread::current()->is_VM_thread() ||
1865 JavaThread::current()->thread_state() == _thread_in_vm,
1866 "Java Thread is not running in vm");
1867 GET_FIELDHOLDER_FIELD(java_thread, get_thread_status, JavaThreadStatus::NEW /* not initialized */);
1868 }
1869
1870 ByteSize java_lang_Thread::thread_id_offset() {
1871 return in_ByteSize(_tid_offset);
1872 }
1873
1874 oop java_lang_Thread::park_blocker(oop java_thread) {
1875 return java_thread->obj_field(_park_blocker_offset);
1876 }
1877
1878 oop java_lang_Thread::async_get_stack_trace(oop java_thread, TRAPS) {
1879 ThreadsListHandle tlh(JavaThread::current());
1880 JavaThread* thread;
1881 bool is_virtual = java_lang_VirtualThread::is_instance(java_thread);
1882 if (is_virtual) {
1883 oop carrier_thread = java_lang_VirtualThread::carrier_thread(java_thread);
1884 if (carrier_thread == nullptr) {
1885 return nullptr;
1886 }
1887 thread = java_lang_Thread::thread(carrier_thread);
1888 } else {
1889 thread = java_lang_Thread::thread(java_thread);
1890 }
1891 if (thread == nullptr) {
1892 return nullptr;
1893 }
1894
1895 class GetStackTraceClosure : public HandshakeClosure {
1896 public:
1982
1983 // Convert to StackTraceElement array
1984 InstanceKlass* k = vmClasses::StackTraceElement_klass();
1985 assert(k != nullptr, "must be loaded in 1.4+");
1986 if (k->should_be_initialized()) {
1987 k->initialize(CHECK_NULL);
1988 }
1989 objArrayHandle trace = oopFactory::new_objArray_handle(k, gstc._depth, CHECK_NULL);
1990
1991 for (int i = 0; i < gstc._depth; i++) {
1992 methodHandle method(THREAD, gstc._methods->at(i));
1993 oop element = java_lang_StackTraceElement::create(method,
1994 gstc._bcis->at(i),
1995 CHECK_NULL);
1996 trace->obj_at_put(i, element);
1997 }
1998
1999 return trace();
2000 }
2001
2002 const char* java_lang_Thread::thread_status_name(oop java_thread) {
2003 JavaThreadStatus status = get_thread_status(java_thread);
2004 switch (status) {
2005 case JavaThreadStatus::NEW : return "NEW";
2006 case JavaThreadStatus::RUNNABLE : return "RUNNABLE";
2007 case JavaThreadStatus::SLEEPING : return "TIMED_WAITING (sleeping)";
2008 case JavaThreadStatus::IN_OBJECT_WAIT : return "WAITING (on object monitor)";
2009 case JavaThreadStatus::IN_OBJECT_WAIT_TIMED : return "TIMED_WAITING (on object monitor)";
2010 case JavaThreadStatus::PARKED : return "WAITING (parking)";
2011 case JavaThreadStatus::PARKED_TIMED : return "TIMED_WAITING (parking)";
2012 case JavaThreadStatus::BLOCKED_ON_MONITOR_ENTER : return "BLOCKED (on object monitor)";
2013 case JavaThreadStatus::TERMINATED : return "TERMINATED";
2014 default : return "UNKNOWN";
2015 };
2016 }
2017 int java_lang_ThreadGroup::_parent_offset;
2018 int java_lang_ThreadGroup::_name_offset;
2019 int java_lang_ThreadGroup::_maxPriority_offset;
2020 int java_lang_ThreadGroup::_daemon_offset;
2021
2057 InstanceKlass* k = vmClasses::ThreadGroup_klass();
2058 THREADGROUP_FIELDS_DO(FIELD_COMPUTE_OFFSET);
2059 }
2060
2061 #if INCLUDE_CDS
2062 void java_lang_ThreadGroup::serialize_offsets(SerializeClosure* f) {
2063 THREADGROUP_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
2064 }
2065 #endif
2066
2067
2068 // java_lang_VirtualThread
2069
2070 int java_lang_VirtualThread::static_vthread_scope_offset;
2071 int java_lang_VirtualThread::_carrierThread_offset;
2072 int java_lang_VirtualThread::_continuation_offset;
2073 int java_lang_VirtualThread::_state_offset;
2074 int java_lang_VirtualThread::_next_offset;
2075 int java_lang_VirtualThread::_onWaitingList_offset;
2076 int java_lang_VirtualThread::_notified_offset;
2077 int java_lang_VirtualThread::_timeout_offset;
2078 int java_lang_VirtualThread::_objectWaiter_offset;
2079
2080 #define VTHREAD_FIELDS_DO(macro) \
2081 macro(static_vthread_scope_offset, k, "VTHREAD_SCOPE", continuationscope_signature, true); \
2082 macro(_carrierThread_offset, k, "carrierThread", thread_signature, false); \
2083 macro(_continuation_offset, k, "cont", continuation_signature, false); \
2084 macro(_state_offset, k, "state", int_signature, false); \
2085 macro(_next_offset, k, "next", vthread_signature, false); \
2086 macro(_onWaitingList_offset, k, "onWaitingList", bool_signature, false); \
2087 macro(_notified_offset, k, "notified", bool_signature, false); \
2088 macro(_timeout_offset, k, "timeout", long_signature, false);
2089
2090
2091 void java_lang_VirtualThread::compute_offsets() {
2092 InstanceKlass* k = vmClasses::VirtualThread_klass();
2093 VTHREAD_FIELDS_DO(FIELD_COMPUTE_OFFSET);
2094 VTHREAD_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
2095 }
2096
2097 bool java_lang_VirtualThread::is_instance(oop obj) {
2098 return obj != nullptr && is_subclass(obj->klass());
2099 }
2100
2101 oop java_lang_VirtualThread::carrier_thread(oop vthread) {
2102 oop thread = vthread->obj_field(_carrierThread_offset);
2103 return thread;
2104 }
2105
2106 oop java_lang_VirtualThread::continuation(oop vthread) {
2107 oop cont = vthread->obj_field(_continuation_offset);
2137 bool java_lang_VirtualThread::set_onWaitingList(oop vthread, OopHandle& list_head) {
2138 jboolean* addr = vthread->field_addr<jboolean>(_onWaitingList_offset);
2139 jboolean vthread_on_list = Atomic::load(addr);
2140 if (!vthread_on_list) {
2141 vthread_on_list = Atomic::cmpxchg(addr, (jboolean)JNI_FALSE, (jboolean)JNI_TRUE);
2142 if (!vthread_on_list) {
2143 for (;;) {
2144 oop head = list_head.resolve();
2145 java_lang_VirtualThread::set_next(vthread, head);
2146 if (list_head.cmpxchg(head, vthread) == head) return true;
2147 }
2148 }
2149 }
2150 return false; // already on waiting list
2151 }
2152
2153 void java_lang_VirtualThread::set_notified(oop vthread, jboolean value) {
2154 vthread->bool_field_put_volatile(_notified_offset, value);
2155 }
2156
2157 jlong java_lang_VirtualThread::timeout(oop vthread) {
2158 return vthread->long_field(_timeout_offset);
2159 }
2160
2161 void java_lang_VirtualThread::set_timeout(oop vthread, jlong value) {
2162 vthread->long_field_put(_timeout_offset, value);
2163 }
2164
2165 JavaThreadStatus java_lang_VirtualThread::map_state_to_thread_status(int state) {
2166 JavaThreadStatus status = JavaThreadStatus::NEW;
2167 switch (state & ~SUSPENDED) {
2168 case NEW:
2169 status = JavaThreadStatus::NEW;
2170 break;
2171 case STARTED:
2172 case RUNNING:
2173 case PARKING:
2174 case TIMED_PARKING:
2175 case UNPARKED:
2176 case YIELDING:
3351 LIVESTACKFRAMEINFO_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
3352 }
3353 #endif
3354
3355 void java_lang_LiveStackFrameInfo::set_monitors(oop obj, oop value) {
3356 obj->obj_field_put(_monitors_offset, value);
3357 }
3358
3359 void java_lang_LiveStackFrameInfo::set_locals(oop obj, oop value) {
3360 obj->obj_field_put(_locals_offset, value);
3361 }
3362
3363 void java_lang_LiveStackFrameInfo::set_operands(oop obj, oop value) {
3364 obj->obj_field_put(_operands_offset, value);
3365 }
3366
3367 void java_lang_LiveStackFrameInfo::set_mode(oop obj, int value) {
3368 obj->int_field_put(_mode_offset, value);
3369 }
3370
3371
3372 // java_lang_AccessibleObject
3373
3374 int java_lang_reflect_AccessibleObject::_override_offset;
3375
3376 #define ACCESSIBLEOBJECT_FIELDS_DO(macro) \
3377 macro(_override_offset, k, "override", bool_signature, false)
3378
3379 void java_lang_reflect_AccessibleObject::compute_offsets() {
3380 InstanceKlass* k = vmClasses::reflect_AccessibleObject_klass();
3381 ACCESSIBLEOBJECT_FIELDS_DO(FIELD_COMPUTE_OFFSET);
3382 }
3383
3384 #if INCLUDE_CDS
3385 void java_lang_reflect_AccessibleObject::serialize_offsets(SerializeClosure* f) {
3386 ACCESSIBLEOBJECT_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
3387 }
3388 #endif
3389
3390 jboolean java_lang_reflect_AccessibleObject::override(oop reflect) {
3391 return (jboolean) reflect->bool_field(_override_offset);
5039 void java_lang_AssertionStatusDirectives::set_packageEnabled(oop o, oop val) {
5040 o->obj_field_put(_packageEnabled_offset, val);
5041 }
5042
5043 void java_lang_AssertionStatusDirectives::set_deflt(oop o, bool val) {
5044 o->bool_field_put(_deflt_offset, val);
5045 }
5046
5047 int java_util_concurrent_locks_AbstractOwnableSynchronizer::_owner_offset;
5048
5049 #define AOS_FIELDS_DO(macro) \
5050 macro(_owner_offset, k, "exclusiveOwnerThread", thread_signature, false)
5051
5052 void java_util_concurrent_locks_AbstractOwnableSynchronizer::compute_offsets() {
5053 InstanceKlass* k = vmClasses::java_util_concurrent_locks_AbstractOwnableSynchronizer_klass();
5054 AOS_FIELDS_DO(FIELD_COMPUTE_OFFSET);
5055 }
5056
5057 oop java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(oop obj) {
5058 assert(_owner_offset != 0, "Must be initialized");
5059 return obj->obj_field(_owner_offset);
5060 }
5061
5062 #if INCLUDE_CDS
5063 void java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize_offsets(SerializeClosure* f) {
5064 AOS_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
5065 }
5066 #endif
5067
5068 int vector_VectorPayload::_payload_offset;
5069
5070 #define VECTORPAYLOAD_FIELDS_DO(macro) \
5071 macro(_payload_offset, k, "payload", object_signature, false)
5072
5073 void vector_VectorPayload::compute_offsets() {
5074 InstanceKlass* k = vmClasses::vector_VectorPayload_klass();
5075 VECTORPAYLOAD_FIELDS_DO(FIELD_COMPUTE_OFFSET);
5076 }
5077
5078 #if INCLUDE_CDS
5079 void vector_VectorPayload::serialize_offsets(SerializeClosure* f) {
|
49 #include "logging/log.hpp"
50 #include "logging/logStream.hpp"
51 #include "memory/oopFactory.hpp"
52 #include "memory/resourceArea.hpp"
53 #include "memory/universe.hpp"
54 #include "oops/fieldInfo.hpp"
55 #include "oops/fieldStreams.inline.hpp"
56 #include "oops/instanceKlass.inline.hpp"
57 #include "oops/instanceMirrorKlass.hpp"
58 #include "oops/klass.hpp"
59 #include "oops/klass.inline.hpp"
60 #include "oops/method.inline.hpp"
61 #include "oops/objArrayKlass.hpp"
62 #include "oops/objArrayOop.inline.hpp"
63 #include "oops/oopCast.inline.hpp"
64 #include "oops/oop.inline.hpp"
65 #include "oops/symbol.hpp"
66 #include "oops/recordComponent.hpp"
67 #include "oops/typeArrayOop.inline.hpp"
68 #include "prims/jvmtiExport.hpp"
69 #include "prims/jvmtiThreadState.hpp" // for JvmtiVTMSTransitionDisabler
70 #include "prims/methodHandles.hpp"
71 #include "prims/resolvedMethodTable.hpp"
72 #include "runtime/continuationEntry.inline.hpp"
73 #include "runtime/continuationJavaClasses.inline.hpp"
74 #include "runtime/fieldDescriptor.inline.hpp"
75 #include "runtime/frame.inline.hpp"
76 #include "runtime/handles.inline.hpp"
77 #include "runtime/handshake.hpp"
78 #include "runtime/init.hpp"
79 #include "runtime/interfaceSupport.inline.hpp"
80 #include "runtime/java.hpp"
81 #include "runtime/javaCalls.hpp"
82 #include "runtime/javaThread.hpp"
83 #include "runtime/jniHandles.inline.hpp"
84 #include "runtime/reflectionUtils.hpp"
85 #include "runtime/safepoint.hpp"
86 #include "runtime/safepointVerifiers.hpp"
87 #include "runtime/synchronizer.inline.hpp"
88 #include "runtime/threadSMR.hpp"
89 #include "runtime/vframe.inline.hpp"
90 #include "runtime/vm_version.hpp"
91 #include "utilities/align.hpp"
92 #include "utilities/globalDefinitions.hpp"
93 #include "utilities/growableArray.hpp"
94 #include "utilities/preserveException.hpp"
95 #include "utilities/utf8.hpp"
96 #if INCLUDE_JVMCI
97 #include "jvmci/jvmciJavaClasses.hpp"
98 #endif
99
100 #define DECLARE_INJECTED_FIELD(klass, name, signature, may_be_java) \
101 { VM_CLASS_ID(klass), VM_SYMBOL_ENUM_NAME(name##_name), VM_SYMBOL_ENUM_NAME(signature), may_be_java },
102
103 InjectedField JavaClasses::_injected_fields[] = {
104 ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD)
105 };
106
107 // Register native methods of Object
1857 // Write the thread status value to threadStatus field in java.lang.Thread java class.
1858 void java_lang_Thread::set_thread_status(oop java_thread, JavaThreadStatus status) {
1859 SET_FIELDHOLDER_FIELD(java_thread, thread_status, status);
1860 }
1861
1862 // Read thread status value from threadStatus field in java.lang.Thread java class.
1863 JavaThreadStatus java_lang_Thread::get_thread_status(oop java_thread) {
1864 // Make sure the caller is operating on behalf of the VM or is
1865 // running VM code (state == _thread_in_vm).
1866 assert(Threads_lock->owned_by_self() || Thread::current()->is_VM_thread() ||
1867 JavaThread::current()->thread_state() == _thread_in_vm,
1868 "Java Thread is not running in vm");
1869 GET_FIELDHOLDER_FIELD(java_thread, get_thread_status, JavaThreadStatus::NEW /* not initialized */);
1870 }
1871
1872 ByteSize java_lang_Thread::thread_id_offset() {
1873 return in_ByteSize(_tid_offset);
1874 }
1875
1876 oop java_lang_Thread::park_blocker(oop java_thread) {
1877 return java_thread->obj_field_acquire(_park_blocker_offset);
1878 }
1879
1880 struct LockInfo {
1881 enum { // should be synced with jdk.internal.vm.ThreadSnapshot.ThreadLock constants
1882 PARKING_TO_WAIT = 0,
1883 ELIMINATED_SCALAR_REPLACED = 1,
1884 ELIMINATED_MONITOR = 2,
1885 LOCKED = 3,
1886 WAITING_TO_LOCK = 4,
1887 WAITING_ON = 5,
1888 WAITING_TO_RELOCK = 6,
1889 OWNABLE_SYNCHRONIZER = 7,
1890 };
1891
1892 int _depth;
1893 int _type;
1894 oop _obj;
1895
1896 LockInfo(int depth, int type, oop obj) : _depth(depth), _type(type), _obj(obj) {}
1897 LockInfo() : _depth(0), _type(0), _obj(nullptr) {}
1898 };
1899
1900 class GetThreadSnapshotClosure : public HandshakeClosure {
1901 public:
1902 Handle _java_thread;
1903 JavaThread* _thread;
1904 int _depth;
1905 bool _retry_handshake;
1906 GrowableArray<Method*>* _methods;
1907 GrowableArray<int>* _bcis;
1908 JavaThreadStatus _thread_status;
1909 oop _name;
1910 bool _with_locks;
1911 bool _found_first_lock;
1912 GrowableArray<LockInfo>* _locks;
1913
1914 GetThreadSnapshotClosure(Handle java_thread, JavaThread* thread, bool with_locks) :
1915 HandshakeClosure("GetThreadSnapshotClosure"), _java_thread(java_thread), _thread(thread),
1916 _depth(0), _retry_handshake(false),
1917 _methods(nullptr), _bcis(nullptr),
1918 _thread_status(), _name(nullptr),
1919 _with_locks(with_locks), _found_first_lock(false), _locks(nullptr) { }
1920 virtual ~GetThreadSnapshotClosure() {
1921 delete _methods;
1922 delete _bcis;
1923 if (_locks != nullptr) {
1924 delete _locks;
1925 }
1926 }
1927
1928 bool read_reset_retry() {
1929 bool ret = _retry_handshake;
1930 // If we re-execute the handshake this method need to return false
1931 // when the handshake cannot be performed. (E.g. thread terminating)
1932 _retry_handshake = false;
1933 return ret;
1934 }
1935
1936 void detect_locks(javaVFrame* jvf, int depth) {
1937 Thread* current = Thread::current();
1938
1939 if (depth == 0 && !_found_first_lock) {
1940 // See javaVFrame::print_lock_info_on() for some other cases:
1941 // "waiting to re-lock in wait", "waiting on the Class initialization monitor".
1942
1943 // If this is the first frame and it is java.lang.Object.wait(...)
1944 // then print out the receiver.
1945 if (jvf->method()->name() == vmSymbols::wait_name() &&
1946 jvf->method()->method_holder()->name() == vmSymbols::java_lang_Object()) {
1947 StackValueCollection* locs = jvf->locals();
1948 if (locs->is_empty()) {
1949 _locks->push(LockInfo(depth, LockInfo::WAITING_ON, nullptr));
1950 } else {
1951 int type = LockInfo::WAITING_ON;
1952 StackValue* sv = locs->at(0);
1953 if (sv->type() == T_OBJECT) {
1954 Handle o = locs->at(0)->get_obj();
1955 if (_thread_status == JavaThreadStatus::BLOCKED_ON_MONITOR_ENTER) {
1956 type = LockInfo::WAITING_TO_RELOCK;;
1957 }
1958 _locks->push(LockInfo(depth, type, o()));
1959 }
1960 }
1961 _found_first_lock = true;
1962 } else {
1963 oop park_blocker = java_lang_Thread::park_blocker(_java_thread());
1964 if (park_blocker != nullptr) {
1965 _locks->push(LockInfo(depth, LockInfo::PARKING_TO_WAIT, park_blocker));
1966 if (park_blocker->is_a(vmClasses::java_util_concurrent_locks_AbstractOwnableSynchronizer_klass())) {
1967 oop owner = java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(park_blocker);
1968 if (owner != nullptr) {
1969 _locks->push(LockInfo(depth, LockInfo::OWNABLE_SYNCHRONIZER, owner));
1970 }
1971 }
1972 _found_first_lock = true;
1973 }
1974 }
1975 }
1976
1977 GrowableArray<MonitorInfo*>* mons = jvf->monitors();
1978 if (!mons->is_empty()) {
1979 for (int index = (mons->length() - 1); index >= 0; index--) {
1980 MonitorInfo* monitor = mons->at(index);
1981 if (monitor->eliminated() && jvf->is_compiled_frame()) { // Eliminated in compiled code
1982 if (monitor->owner_is_scalar_replaced()) {
1983 Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
1984 _locks->push(LockInfo(depth, LockInfo::ELIMINATED_SCALAR_REPLACED, k->klass_holder()));
1985 } else {
1986 Handle obj(current, monitor->owner());
1987 if (obj() != nullptr) {
1988 _locks->push(LockInfo(depth, LockInfo::ELIMINATED_MONITOR, obj()));
1989 }
1990 }
1991 continue;
1992 }
1993 if (monitor->owner() != nullptr) {
1994 // the monitor is associated with an object, i.e., it is locked
1995 int type = LockInfo::LOCKED;
1996
1997 if (depth == 0 && !_found_first_lock) {
1998 ObjectMonitor* pending_moninor = java_lang_VirtualThread::is_instance(_java_thread())
1999 ? java_lang_VirtualThread::current_pending_monitor(_java_thread())
2000 : jvf->thread()->current_pending_monitor();
2001
2002 markWord mark = monitor->owner()->mark();
2003 // The first stage of async deflation does not affect any field
2004 // used by this comparison so the ObjectMonitor* is usable here.
2005 if (mark.has_monitor()) {
2006 ObjectMonitor* mon = ObjectSynchronizer::read_monitor(current, monitor->owner(), mark);
2007 if (// if the monitor is null we must be in the process of locking
2008 mon == nullptr ||
2009 // we have marked ourself as pending on this monitor
2010 mon == pending_moninor ||
2011 // we are not the owner of this monitor
2012 (_thread != nullptr && !mon->is_entered(_thread))) {
2013 type = LockInfo::WAITING_TO_LOCK;
2014 }
2015 }
2016 }
2017 _locks->push(LockInfo(depth, type, monitor->owner()));
2018
2019 _found_first_lock = true;
2020 }
2021 }
2022 }
2023 }
2024
2025 void do_thread(Thread* th) override {
2026 if (!Thread::current()->is_Java_thread()) {
2027 _retry_handshake = true;
2028 return;
2029 }
2030
2031 bool is_virtual = java_lang_VirtualThread::is_instance(_java_thread());
2032 if (_thread != nullptr) {
2033 if (is_virtual) {
2034 // mounted vthread, use carrier thread state
2035 oop carrier_thread = java_lang_VirtualThread::carrier_thread(_java_thread());
2036 _thread_status = java_lang_Thread::get_thread_status(carrier_thread);
2037 } else {
2038 _thread_status = java_lang_Thread::get_thread_status(_java_thread());
2039 }
2040 } else {
2041 // unmounted vthread
2042 int vt_state = java_lang_VirtualThread::state(_java_thread());
2043 _thread_status = java_lang_VirtualThread::map_state_to_thread_status(vt_state);
2044 }
2045 _name = java_lang_Thread::name(_java_thread());
2046
2047 if (_thread != nullptr && !_thread->has_last_Java_frame()) {
2048 // stack trace is empty
2049 return;
2050 }
2051
2052 bool walk_cont = false;
2053
2054 if (is_virtual) {
2055 if (_thread != nullptr) {
2056 // if (thread->vthread() != _java_thread()) // We might be inside a System.executeOnCarrierThread
2057 const ContinuationEntry* ce = _thread->vthread_continuation();
2058 if (ce == nullptr || ce->cont_oop(_thread) != java_lang_VirtualThread::continuation(_java_thread())) {
2059 // TODO: handle
2060 }
2061 }
2062 } else {
2063 walk_cont = (_thread->vthread_continuation() != nullptr);
2064 }
2065
2066 ResourceMark rm(Thread::current());
2067
2068 const int max_depth = MaxJavaStackTraceDepth;
2069 const bool skip_hidden = !ShowHiddenFrames;
2070
2071 // Pick minimum length that will cover most cases
2072 int init_length = 64;
2073 _methods = new (mtInternal) GrowableArray<Method*>(init_length, mtInternal);
2074 _bcis = new (mtInternal) GrowableArray<int>(init_length, mtInternal);
2075
2076 if (_with_locks) {
2077 _locks = new (mtInternal) GrowableArray<LockInfo>(init_length, mtInternal);
2078 }
2079 int total_count = 0;
2080
2081 vframeStream vfst(_thread != nullptr
2082 ? vframeStream(_thread, false, false, walk_cont)
2083 : vframeStream(java_lang_VirtualThread::continuation(_java_thread())));
2084
2085 for (;
2086 !vfst.at_end() && (max_depth == 0 || max_depth != total_count);
2087 vfst.next()) {
2088 if (_with_locks) {
2089 detect_locks(vfst.asJavaVFrame(), total_count);
2090 }
2091 if (skip_hidden && (vfst.method()->is_hidden() ||
2092 vfst.method()->is_continuation_enter_intrinsic())) {
2093 continue;
2094 }
2095 _methods->push(vfst.method());
2096 _bcis->push(vfst.bci());
2097 total_count++;
2098 }
2099
2100 _depth = total_count;
2101 }
2102 };
2103
2104 oop java_lang_Thread::async_get_stack_trace(oop java_thread, TRAPS) {
2105 ThreadsListHandle tlh(JavaThread::current());
2106 JavaThread* thread;
2107 bool is_virtual = java_lang_VirtualThread::is_instance(java_thread);
2108 if (is_virtual) {
2109 oop carrier_thread = java_lang_VirtualThread::carrier_thread(java_thread);
2110 if (carrier_thread == nullptr) {
2111 return nullptr;
2112 }
2113 thread = java_lang_Thread::thread(carrier_thread);
2114 } else {
2115 thread = java_lang_Thread::thread(java_thread);
2116 }
2117 if (thread == nullptr) {
2118 return nullptr;
2119 }
2120
2121 class GetStackTraceClosure : public HandshakeClosure {
2122 public:
2208
2209 // Convert to StackTraceElement array
2210 InstanceKlass* k = vmClasses::StackTraceElement_klass();
2211 assert(k != nullptr, "must be loaded in 1.4+");
2212 if (k->should_be_initialized()) {
2213 k->initialize(CHECK_NULL);
2214 }
2215 objArrayHandle trace = oopFactory::new_objArray_handle(k, gstc._depth, CHECK_NULL);
2216
2217 for (int i = 0; i < gstc._depth; i++) {
2218 methodHandle method(THREAD, gstc._methods->at(i));
2219 oop element = java_lang_StackTraceElement::create(method,
2220 gstc._bcis->at(i),
2221 CHECK_NULL);
2222 trace->obj_at_put(i, element);
2223 }
2224
2225 return trace();
2226 }
2227
2228 class jdk_internal_vm_ThreadLock: AllStatic {
2229 static bool _inited;
2230 static int _depth_offset;
2231 static int _typeOrdinal_offset;
2232 static int _obj_offset;
2233
2234 static void compute_offsets(InstanceKlass * klass, TRAPS) {
2235 JavaClasses::compute_offset(_depth_offset, klass, "depth", vmSymbols::int_signature(), false);
2236 JavaClasses::compute_offset(_typeOrdinal_offset, klass, "typeOrdinal", vmSymbols::int_signature(), false);
2237 JavaClasses::compute_offset(_obj_offset, klass, "obj", vmSymbols::object_signature(), false);
2238 }
2239 public:
2240 static void init(InstanceKlass* klass, TRAPS) {
2241 if (!_inited) {
2242 compute_offsets(klass, CHECK);
2243 _inited = true;
2244 }
2245 }
2246
2247 static Handle allocate(InstanceKlass* klass, TRAPS) {
2248 init(klass, CHECK_NH);
2249 return klass->allocate_instance_handle(CHECK_NH);
2250 }
2251
2252 static void set_depth(oop thread_lock, int depth) {
2253 thread_lock->int_field_put(_depth_offset, depth);
2254 }
2255 static void set_type(oop thread_lock, int type_ordinal) {
2256 thread_lock->int_field_put(_typeOrdinal_offset, type_ordinal);
2257 }
2258 static void set_lock_object(oop thread_lock, oop obj) {
2259 thread_lock->obj_field_put(_obj_offset, obj);
2260 }
2261 };
2262
2263 bool jdk_internal_vm_ThreadLock::_inited = false;
2264 int jdk_internal_vm_ThreadLock::_depth_offset;
2265 int jdk_internal_vm_ThreadLock::_typeOrdinal_offset;
2266 int jdk_internal_vm_ThreadLock::_obj_offset;
2267
2268 class jdk_internal_vm_ThreadSnapshot: AllStatic {
2269 static bool _inited;
2270 static int _name_offset;
2271 static int _threadStatus_offset;
2272 static int _stackTrace_offset;
2273 static int _locks_offset;
2274
2275 static void compute_offsets(InstanceKlass* klass, TRAPS) {
2276 JavaClasses::compute_offset(_name_offset, klass, "name", vmSymbols::string_signature(), false);
2277 JavaClasses::compute_offset(_threadStatus_offset, klass, "threadStatus", vmSymbols::int_signature(), false);
2278 JavaClasses::compute_offset(_stackTrace_offset, klass, "stackTrace", vmSymbols::java_lang_StackTraceElement_array(), false);
2279 JavaClasses::compute_offset(_locks_offset, klass, "locks", vmSymbols::jdk_internal_vm_ThreadLock_array(), false);
2280 }
2281 public:
2282 static void init(InstanceKlass* klass, TRAPS) {
2283 if (!_inited) {
2284 compute_offsets(klass, CHECK);
2285 _inited = true;
2286 }
2287 }
2288
2289 static Handle allocate(InstanceKlass* klass, TRAPS) {
2290 init(klass, CHECK_NH);
2291 return klass->allocate_instance_handle(CHECK_NH);
2292 }
2293
2294 static void set_name(oop snapshot, oop name) {
2295 snapshot->obj_field_put(_name_offset, name);
2296 }
2297 static void set_thread_status(oop snapshot, int status) {
2298 snapshot->int_field_put(_threadStatus_offset, status);
2299 }
2300 static void set_stack_trace(oop snapshot, oop trace) {
2301 snapshot->obj_field_put(_stackTrace_offset, trace);
2302 }
2303 static void set_locks(oop snapshot, oop locks) {
2304 snapshot->obj_field_put(_locks_offset, locks);
2305 }
2306 };
2307
2308 bool jdk_internal_vm_ThreadSnapshot::_inited = false;
2309 int jdk_internal_vm_ThreadSnapshot::_name_offset;
2310 int jdk_internal_vm_ThreadSnapshot::_threadStatus_offset;
2311 int jdk_internal_vm_ThreadSnapshot::_stackTrace_offset;
2312 int jdk_internal_vm_ThreadSnapshot::_locks_offset;
2313
2314 oop java_lang_Thread::get_thread_snapshot(jobject jthread, bool with_locks, TRAPS) {
2315 ThreadsListHandle tlh(JavaThread::current());
2316
2317 ResourceMark rm(THREAD);
2318 HandleMark hm(THREAD);
2319 Handle java_thread(THREAD, JNIHandles::resolve(jthread));
2320
2321 // wrapper to auto delete JvmtiVTMSTransitionDisabler
2322 class TransitionDisabler {
2323 JvmtiVTMSTransitionDisabler* _transition_disabler;
2324 public:
2325 TransitionDisabler() : _transition_disabler(nullptr) {}
2326 ~TransitionDisabler() {
2327 reset();
2328 }
2329 void init(jobject jthread) {
2330 _transition_disabler = new (mtInternal) JvmtiVTMSTransitionDisabler(jthread);
2331 }
2332 void reset() {
2333 if (_transition_disabler != nullptr) {
2334 delete _transition_disabler;
2335 _transition_disabler = nullptr;
2336 }
2337 }
2338 } transition_disabler;
2339
2340 JavaThread* thread = nullptr;
2341 bool is_virtual = java_lang_VirtualThread::is_instance(java_thread());
2342
2343 if (is_virtual) {
2344 // 1st need to disable mount/unmount transitions
2345 transition_disabler.init(jthread);
2346
2347 oop carrier_thread = java_lang_VirtualThread::carrier_thread(java_thread());
2348 if (carrier_thread != nullptr) {
2349 thread = java_lang_Thread::thread(carrier_thread);
2350 }
2351 } else {
2352 thread = java_lang_Thread::thread(java_thread());
2353 }
2354
2355 // Handshake with target
2356 GetThreadSnapshotClosure cl(java_thread, thread, with_locks);
2357 if (thread == nullptr) {
2358 // unmounted vthread, execute on the current thread
2359 cl.do_thread(nullptr);
2360 } else {
2361 do {
2362 Handshake::execute(&cl, &tlh, thread);
2363 } while (cl.read_reset_retry());
2364 }
2365
2366 // Handle thread name
2367 Handle thread_name(THREAD, cl._name);
2368
2369 // Convert to StackTraceElement array
2370 InstanceKlass* ste_klass = vmClasses::StackTraceElement_klass();
2371 assert(ste_klass != nullptr, "must be loaded in 1.4+");
2372 if (ste_klass->should_be_initialized()) {
2373 ste_klass->initialize(CHECK_NULL);
2374 }
2375
2376 int max_locks = cl._locks != nullptr ? cl._locks->length() : 0;
2377
2378 InstanceKlass* lock_klass = nullptr;
2379 if (with_locks) {
2380 Symbol* sym = vmSymbols::jdk_internal_vm_ThreadLock();
2381 Klass* k = SystemDictionary::resolve_or_fail(sym, true, CHECK_NULL);
2382 lock_klass = InstanceKlass::cast(k);
2383 }
2384
2385 objArrayHandle trace = oopFactory::new_objArray_handle(ste_klass, cl._depth, CHECK_NULL);
2386
2387 for (int i = 0; i < cl._depth; i++) {
2388 methodHandle method(THREAD, cl._methods->at(i));
2389 oop element = java_lang_StackTraceElement::create(method, cl._bcis->at(i), CHECK_NULL);
2390 trace->obj_at_put(i, element);
2391 }
2392
2393 objArrayHandle locks;
2394 int lock_index = 0;
2395 if (with_locks && max_locks > 0) {
2396 locks = oopFactory::new_objArray_handle(lock_klass, max_locks, CHECK_NULL);
2397 for (int n = 0; n < max_locks; n++) {
2398 LockInfo* lock_info = cl._locks->adr_at(lock_index++);
2399 Handle lock_object = Handle(THREAD, lock_info->_obj);
2400
2401 Handle lock = jdk_internal_vm_ThreadLock::allocate(lock_klass, CHECK_NULL);
2402 jdk_internal_vm_ThreadLock::set_depth(lock(), lock_info->_depth);
2403 jdk_internal_vm_ThreadLock::set_type(lock(), lock_info->_type);
2404 jdk_internal_vm_ThreadLock::set_lock_object(lock(), lock_object());
2405 locks->obj_at_put(n, lock());
2406 }
2407 }
2408
2409 // call static StackTraceElement[] StackTraceElement.of(StackTraceElement[] stackTrace)
2410 // to properly initialize STE.
2411 {
2412 JavaValue result(T_OBJECT);
2413 JavaCalls::call_static(&result,
2414 ste_klass,
2415 vmSymbols::java_lang_StackTraceElement_of_name(),
2416 vmSymbols::java_lang_StackTraceElement_of_signature(),
2417 trace,
2418 CHECK_NULL);
2419 // the method return the same trace object
2420 }
2421
2422 // all oops are handled, can enable transitions.
2423 transition_disabler.reset();
2424
2425 Symbol* snapshot_name = vmSymbols::jdk_internal_vm_ThreadSnapshot();
2426 Klass* snapshot_klass = SystemDictionary::resolve_or_fail(snapshot_name, true, CHECK_NULL);
2427 if (snapshot_klass->should_be_initialized()) {
2428 snapshot_klass->initialize(CHECK_NULL);
2429 }
2430
2431 Handle snapshot = jdk_internal_vm_ThreadSnapshot::allocate(InstanceKlass::cast(snapshot_klass), CHECK_NULL);
2432 jdk_internal_vm_ThreadSnapshot::set_name(snapshot(), thread_name());
2433 jdk_internal_vm_ThreadSnapshot::set_thread_status(snapshot(), (int)cl._thread_status);
2434 jdk_internal_vm_ThreadSnapshot::set_stack_trace(snapshot(), trace());
2435 jdk_internal_vm_ThreadSnapshot::set_locks(snapshot(), locks());
2436 return snapshot();
2437 }
2438
2439 const char* java_lang_Thread::thread_status_name(oop java_thread) {
2440 JavaThreadStatus status = get_thread_status(java_thread);
2441 switch (status) {
2442 case JavaThreadStatus::NEW : return "NEW";
2443 case JavaThreadStatus::RUNNABLE : return "RUNNABLE";
2444 case JavaThreadStatus::SLEEPING : return "TIMED_WAITING (sleeping)";
2445 case JavaThreadStatus::IN_OBJECT_WAIT : return "WAITING (on object monitor)";
2446 case JavaThreadStatus::IN_OBJECT_WAIT_TIMED : return "TIMED_WAITING (on object monitor)";
2447 case JavaThreadStatus::PARKED : return "WAITING (parking)";
2448 case JavaThreadStatus::PARKED_TIMED : return "TIMED_WAITING (parking)";
2449 case JavaThreadStatus::BLOCKED_ON_MONITOR_ENTER : return "BLOCKED (on object monitor)";
2450 case JavaThreadStatus::TERMINATED : return "TERMINATED";
2451 default : return "UNKNOWN";
2452 };
2453 }
2454 int java_lang_ThreadGroup::_parent_offset;
2455 int java_lang_ThreadGroup::_name_offset;
2456 int java_lang_ThreadGroup::_maxPriority_offset;
2457 int java_lang_ThreadGroup::_daemon_offset;
2458
2494 InstanceKlass* k = vmClasses::ThreadGroup_klass();
2495 THREADGROUP_FIELDS_DO(FIELD_COMPUTE_OFFSET);
2496 }
2497
2498 #if INCLUDE_CDS
2499 void java_lang_ThreadGroup::serialize_offsets(SerializeClosure* f) {
2500 THREADGROUP_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
2501 }
2502 #endif
2503
2504
2505 // java_lang_VirtualThread
2506
2507 int java_lang_VirtualThread::static_vthread_scope_offset;
2508 int java_lang_VirtualThread::_carrierThread_offset;
2509 int java_lang_VirtualThread::_continuation_offset;
2510 int java_lang_VirtualThread::_state_offset;
2511 int java_lang_VirtualThread::_next_offset;
2512 int java_lang_VirtualThread::_onWaitingList_offset;
2513 int java_lang_VirtualThread::_notified_offset;
2514 int java_lang_VirtualThread::_interruptible_wait_offset;
2515 int java_lang_VirtualThread::_timeout_offset;
2516 int java_lang_VirtualThread::_objectWaiter_offset;
2517
2518 #define VTHREAD_FIELDS_DO(macro) \
2519 macro(static_vthread_scope_offset, k, "VTHREAD_SCOPE", continuationscope_signature, true); \
2520 macro(_carrierThread_offset, k, "carrierThread", thread_signature, false); \
2521 macro(_continuation_offset, k, "cont", continuation_signature, false); \
2522 macro(_state_offset, k, "state", int_signature, false); \
2523 macro(_next_offset, k, "next", vthread_signature, false); \
2524 macro(_onWaitingList_offset, k, "onWaitingList", bool_signature, false); \
2525 macro(_notified_offset, k, "notified", bool_signature, false); \
2526 macro(_interruptible_wait_offset, k, "interruptableWait", bool_signature, false); \
2527 macro(_timeout_offset, k, "timeout", long_signature, false);
2528
2529
2530 void java_lang_VirtualThread::compute_offsets() {
2531 InstanceKlass* k = vmClasses::VirtualThread_klass();
2532 VTHREAD_FIELDS_DO(FIELD_COMPUTE_OFFSET);
2533 VTHREAD_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
2534 }
2535
2536 bool java_lang_VirtualThread::is_instance(oop obj) {
2537 return obj != nullptr && is_subclass(obj->klass());
2538 }
2539
2540 oop java_lang_VirtualThread::carrier_thread(oop vthread) {
2541 oop thread = vthread->obj_field(_carrierThread_offset);
2542 return thread;
2543 }
2544
2545 oop java_lang_VirtualThread::continuation(oop vthread) {
2546 oop cont = vthread->obj_field(_continuation_offset);
2576 bool java_lang_VirtualThread::set_onWaitingList(oop vthread, OopHandle& list_head) {
2577 jboolean* addr = vthread->field_addr<jboolean>(_onWaitingList_offset);
2578 jboolean vthread_on_list = Atomic::load(addr);
2579 if (!vthread_on_list) {
2580 vthread_on_list = Atomic::cmpxchg(addr, (jboolean)JNI_FALSE, (jboolean)JNI_TRUE);
2581 if (!vthread_on_list) {
2582 for (;;) {
2583 oop head = list_head.resolve();
2584 java_lang_VirtualThread::set_next(vthread, head);
2585 if (list_head.cmpxchg(head, vthread) == head) return true;
2586 }
2587 }
2588 }
2589 return false; // already on waiting list
2590 }
2591
2592 void java_lang_VirtualThread::set_notified(oop vthread, jboolean value) {
2593 vthread->bool_field_put_volatile(_notified_offset, value);
2594 }
2595
2596 void java_lang_VirtualThread::set_interruptible_wait(oop vthread, jboolean value) {
2597 vthread->bool_field_put_volatile(_interruptible_wait_offset, value);
2598 }
2599
2600 jlong java_lang_VirtualThread::timeout(oop vthread) {
2601 return vthread->long_field(_timeout_offset);
2602 }
2603
2604 void java_lang_VirtualThread::set_timeout(oop vthread, jlong value) {
2605 vthread->long_field_put(_timeout_offset, value);
2606 }
2607
2608 JavaThreadStatus java_lang_VirtualThread::map_state_to_thread_status(int state) {
2609 JavaThreadStatus status = JavaThreadStatus::NEW;
2610 switch (state & ~SUSPENDED) {
2611 case NEW:
2612 status = JavaThreadStatus::NEW;
2613 break;
2614 case STARTED:
2615 case RUNNING:
2616 case PARKING:
2617 case TIMED_PARKING:
2618 case UNPARKED:
2619 case YIELDING:
3794 LIVESTACKFRAMEINFO_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
3795 }
3796 #endif
3797
3798 void java_lang_LiveStackFrameInfo::set_monitors(oop obj, oop value) {
3799 obj->obj_field_put(_monitors_offset, value);
3800 }
3801
3802 void java_lang_LiveStackFrameInfo::set_locals(oop obj, oop value) {
3803 obj->obj_field_put(_locals_offset, value);
3804 }
3805
3806 void java_lang_LiveStackFrameInfo::set_operands(oop obj, oop value) {
3807 obj->obj_field_put(_operands_offset, value);
3808 }
3809
3810 void java_lang_LiveStackFrameInfo::set_mode(oop obj, int value) {
3811 obj->int_field_put(_mode_offset, value);
3812 }
3813
3814 // java_lang_AccessibleObject
3815
3816 int java_lang_reflect_AccessibleObject::_override_offset;
3817
3818 #define ACCESSIBLEOBJECT_FIELDS_DO(macro) \
3819 macro(_override_offset, k, "override", bool_signature, false)
3820
3821 void java_lang_reflect_AccessibleObject::compute_offsets() {
3822 InstanceKlass* k = vmClasses::reflect_AccessibleObject_klass();
3823 ACCESSIBLEOBJECT_FIELDS_DO(FIELD_COMPUTE_OFFSET);
3824 }
3825
3826 #if INCLUDE_CDS
3827 void java_lang_reflect_AccessibleObject::serialize_offsets(SerializeClosure* f) {
3828 ACCESSIBLEOBJECT_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
3829 }
3830 #endif
3831
3832 jboolean java_lang_reflect_AccessibleObject::override(oop reflect) {
3833 return (jboolean) reflect->bool_field(_override_offset);
5481 void java_lang_AssertionStatusDirectives::set_packageEnabled(oop o, oop val) {
5482 o->obj_field_put(_packageEnabled_offset, val);
5483 }
5484
5485 void java_lang_AssertionStatusDirectives::set_deflt(oop o, bool val) {
5486 o->bool_field_put(_deflt_offset, val);
5487 }
5488
5489 int java_util_concurrent_locks_AbstractOwnableSynchronizer::_owner_offset;
5490
5491 #define AOS_FIELDS_DO(macro) \
5492 macro(_owner_offset, k, "exclusiveOwnerThread", thread_signature, false)
5493
5494 void java_util_concurrent_locks_AbstractOwnableSynchronizer::compute_offsets() {
5495 InstanceKlass* k = vmClasses::java_util_concurrent_locks_AbstractOwnableSynchronizer_klass();
5496 AOS_FIELDS_DO(FIELD_COMPUTE_OFFSET);
5497 }
5498
5499 oop java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(oop obj) {
5500 assert(_owner_offset != 0, "Must be initialized");
5501 return obj->obj_field_acquire(_owner_offset);
5502 }
5503
5504 #if INCLUDE_CDS
5505 void java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize_offsets(SerializeClosure* f) {
5506 AOS_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
5507 }
5508 #endif
5509
5510 int vector_VectorPayload::_payload_offset;
5511
5512 #define VECTORPAYLOAD_FIELDS_DO(macro) \
5513 macro(_payload_offset, k, "payload", object_signature, false)
5514
5515 void vector_VectorPayload::compute_offsets() {
5516 InstanceKlass* k = vmClasses::vector_VectorPayload_klass();
5517 VECTORPAYLOAD_FIELDS_DO(FIELD_COMPUTE_OFFSET);
5518 }
5519
5520 #if INCLUDE_CDS
5521 void vector_VectorPayload::serialize_offsets(SerializeClosure* f) {
|