21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "code/codeCache.hpp"
27 #include "code/compiledIC.hpp"
28 #include "compiler/compileBroker.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "jvmci/jvmciCodeInstaller.hpp"
31 #include "jvmci/jvmciCompilerToVM.hpp"
32 #include "jvmci/jvmciRuntime.hpp"
33 #include "jvmci/vmStructs_jvmci.hpp"
34 #include "oops/klassVtable.hpp"
35 #include "oops/methodCounters.hpp"
36 #include "oops/objArrayKlass.hpp"
37 #include "prims/jvmtiThreadState.hpp"
38 #include "runtime/continuationEntry.hpp"
39 #include "runtime/deoptimization.hpp"
40 #include "runtime/flags/jvmFlag.hpp"
41 #include "runtime/osThread.hpp"
42 #include "runtime/sharedRuntime.hpp"
43 #include "runtime/stubRoutines.hpp"
44 #include "runtime/vm_version.hpp"
45 #if INCLUDE_G1GC
46 #include "gc/g1/g1BarrierSetRuntime.hpp"
47 #include "gc/g1/g1CardTable.hpp"
48 #include "gc/g1/g1HeapRegion.hpp"
49 #include "gc/g1/g1ThreadLocalData.hpp"
50 #endif
51 #if INCLUDE_ZGC
52 #include "gc/x/xBarrierSetRuntime.hpp"
53 #include "gc/z/zBarrierSetAssembler.hpp"
54 #include "gc/z/zBarrierSetRuntime.hpp"
55 #include "gc/z/zThreadLocalData.hpp"
56 #endif
57
58 #define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \
59 static_field(CompilerToVM::Data, Klass_vtable_start_offset, int) \
60 static_field(CompilerToVM::Data, Klass_vtable_length_offset, int) \
206 nonstatic_field(InstanceKlass, _fieldinfo_stream, Array<u1>*) \
207 nonstatic_field(InstanceKlass, _constants, ConstantPool*) \
208 volatile_nonstatic_field(InstanceKlass, _init_state, InstanceKlass::ClassState) \
209 volatile_nonstatic_field(InstanceKlass, _init_thread, JavaThread*) \
210 nonstatic_field(InstanceKlass, _misc_flags._flags, u2) \
211 nonstatic_field(InstanceKlass, _annotations, Annotations*) \
212 \
213 volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \
214 volatile_nonstatic_field(JavaFrameAnchor, _last_Java_pc, address) \
215 \
216 nonstatic_field(JVMCICompileState, _jvmti_can_hotswap_or_post_breakpoint, jbyte) \
217 nonstatic_field(JVMCICompileState, _jvmti_can_access_local_variables, jbyte) \
218 nonstatic_field(JVMCICompileState, _jvmti_can_post_on_exceptions, jbyte) \
219 nonstatic_field(JVMCICompileState, _jvmti_can_pop_frame, jbyte) \
220 nonstatic_field(JVMCICompileState, _compilation_ticks, jint) \
221 \
222 nonstatic_field(JavaThread, _threadObj, OopHandle) \
223 nonstatic_field(JavaThread, _vthread, OopHandle) \
224 nonstatic_field(JavaThread, _scopedValueCache, OopHandle) \
225 nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \
226 nonstatic_field(JavaThread, _vm_result, oop) \
227 nonstatic_field(JavaThread, _stack_overflow_state._stack_overflow_limit, address) \
228 volatile_nonstatic_field(JavaThread, _exception_oop, oop) \
229 volatile_nonstatic_field(JavaThread, _exception_pc, address) \
230 volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \
231 volatile_nonstatic_field(JavaThread, _doing_unsafe_access, bool) \
232 nonstatic_field(JavaThread, _osthread, OSThread*) \
233 nonstatic_field(JavaThread, _saved_exception_pc, address) \
234 nonstatic_field(JavaThread, _pending_deoptimization, int) \
235 nonstatic_field(JavaThread, _pending_failed_speculation, jlong) \
236 nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \
237 nonstatic_field(JavaThread, _jvmci_counters, jlong*) \
238 nonstatic_field(JavaThread, _jvmci_reserved0, jlong) \
239 nonstatic_field(JavaThread, _jvmci_reserved1, jlong) \
240 nonstatic_field(JavaThread, _jvmci_reserved_oop0, oop) \
241 nonstatic_field(JavaThread, _should_post_on_exceptions_flag, int) \
242 nonstatic_field(JavaThread, _jni_environment, JNIEnv) \
243 nonstatic_field(JavaThread, _poll_data, SafepointMechanism::ThreadData) \
244 nonstatic_field(JavaThread, _stack_overflow_state._reserved_stack_activation, address) \
245 nonstatic_field(JavaThread, _held_monitor_count, intx) \
312 nonstatic_field(MethodData, _compiler_counters._trap_hist._array[0], u1) \
313 nonstatic_field(MethodData, _eflags, intx) \
314 nonstatic_field(MethodData, _arg_local, intx) \
315 nonstatic_field(MethodData, _arg_stack, intx) \
316 nonstatic_field(MethodData, _arg_returned, intx) \
317 nonstatic_field(MethodData, _tenure_traps, uint) \
318 nonstatic_field(MethodData, _invoke_mask, int) \
319 nonstatic_field(MethodData, _backedge_mask, int) \
320 nonstatic_field(MethodData, _jvmci_ir_size, int) \
321 \
322 nonstatic_field(nmethod, _verified_entry_offset, u2) \
323 nonstatic_field(nmethod, _comp_level, CompLevel) \
324 \
325 nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
326 \
327 unchecked_nonstatic_field(ObjectMonitor, _owner, sizeof(void *)) /* NOTE: no type */ \
328 volatile_nonstatic_field(ObjectMonitor, _recursions, intptr_t) \
329 volatile_nonstatic_field(ObjectMonitor, _cxq, ObjectWaiter*) \
330 volatile_nonstatic_field(ObjectMonitor, _EntryList, ObjectWaiter*) \
331 volatile_nonstatic_field(ObjectMonitor, _succ, JavaThread*) \
332 \
333 volatile_nonstatic_field(oopDesc, _mark, markWord) \
334 volatile_nonstatic_field(oopDesc, _metadata._klass, Klass*) \
335 \
336 static_field(StubRoutines, _verify_oop_count, jint) \
337 \
338 static_field(StubRoutines, _jbyte_arraycopy, address) \
339 static_field(StubRoutines, _jshort_arraycopy, address) \
340 static_field(StubRoutines, _jint_arraycopy, address) \
341 static_field(StubRoutines, _jlong_arraycopy, address) \
342 static_field(StubRoutines, _oop_arraycopy, address) \
343 static_field(StubRoutines, _oop_arraycopy_uninit, address) \
344 static_field(StubRoutines, _jbyte_disjoint_arraycopy, address) \
345 static_field(StubRoutines, _jshort_disjoint_arraycopy, address) \
346 static_field(StubRoutines, _jint_disjoint_arraycopy, address) \
347 static_field(StubRoutines, _jlong_disjoint_arraycopy, address) \
348 static_field(StubRoutines, _oop_disjoint_arraycopy, address) \
349 static_field(StubRoutines, _oop_disjoint_arraycopy_uninit, address) \
350 static_field(StubRoutines, _arrayof_jbyte_arraycopy, address) \
351 static_field(StubRoutines, _arrayof_jshort_arraycopy, address) \
788 declare_constant(vmIntrinsics::_linkToSpecial) \
789 declare_constant(vmIntrinsics::_linkToInterface) \
790 declare_constant(vmIntrinsics::_linkToNative) \
791 \
792 declare_constant(vmSymbols::FIRST_SID) \
793 declare_constant(vmSymbols::SID_LIMIT) \
794
795 #define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant) \
796 declare_constant(InvocationCounter::count_increment) \
797 declare_constant(InvocationCounter::count_shift) \
798 \
799 declare_constant(markWord::hash_shift) \
800 declare_constant(markWord::monitor_value) \
801 \
802 declare_constant(markWord::lock_mask_in_place) \
803 declare_constant(markWord::age_mask_in_place) \
804 declare_constant(markWord::hash_mask) \
805 declare_constant(markWord::hash_mask_in_place) \
806 \
807 declare_constant(markWord::unlocked_value) \
808 \
809 declare_constant(markWord::no_hash_in_place) \
810 declare_constant(markWord::no_lock_in_place) \
811
812 // Helper macro to support ZGC pattern where the function itself isn't exported
813 #define DECLARE_FUNCTION_FROM_ADDR(declare_function_with_value, name) \
814 declare_function_with_value(name, name##_addr())
815
816
817 #define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function, declare_function_with_value) \
818 declare_function(SharedRuntime::register_finalizer) \
819 declare_function(SharedRuntime::exception_handler_for_return_address) \
820 declare_function(SharedRuntime::OSR_migration_end) \
821 declare_function(SharedRuntime::enable_stack_reserved_zone) \
822 declare_function(SharedRuntime::frem) \
823 declare_function(SharedRuntime::drem) \
824 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_start)) \
825 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_end)) \
826 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_mount)) \
827 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_unmount)) \
|
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "code/codeCache.hpp"
27 #include "code/compiledIC.hpp"
28 #include "compiler/compileBroker.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "jvmci/jvmciCodeInstaller.hpp"
31 #include "jvmci/jvmciCompilerToVM.hpp"
32 #include "jvmci/jvmciRuntime.hpp"
33 #include "jvmci/vmStructs_jvmci.hpp"
34 #include "oops/klassVtable.hpp"
35 #include "oops/methodCounters.hpp"
36 #include "oops/objArrayKlass.hpp"
37 #include "prims/jvmtiThreadState.hpp"
38 #include "runtime/continuationEntry.hpp"
39 #include "runtime/deoptimization.hpp"
40 #include "runtime/flags/jvmFlag.hpp"
41 #include "runtime/objectMonitor.hpp"
42 #include "runtime/osThread.hpp"
43 #include "runtime/sharedRuntime.hpp"
44 #include "runtime/stubRoutines.hpp"
45 #include "runtime/vm_version.hpp"
46 #if INCLUDE_G1GC
47 #include "gc/g1/g1BarrierSetRuntime.hpp"
48 #include "gc/g1/g1CardTable.hpp"
49 #include "gc/g1/g1HeapRegion.hpp"
50 #include "gc/g1/g1ThreadLocalData.hpp"
51 #endif
52 #if INCLUDE_ZGC
53 #include "gc/x/xBarrierSetRuntime.hpp"
54 #include "gc/z/zBarrierSetAssembler.hpp"
55 #include "gc/z/zBarrierSetRuntime.hpp"
56 #include "gc/z/zThreadLocalData.hpp"
57 #endif
58
59 #define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \
60 static_field(CompilerToVM::Data, Klass_vtable_start_offset, int) \
61 static_field(CompilerToVM::Data, Klass_vtable_length_offset, int) \
207 nonstatic_field(InstanceKlass, _fieldinfo_stream, Array<u1>*) \
208 nonstatic_field(InstanceKlass, _constants, ConstantPool*) \
209 volatile_nonstatic_field(InstanceKlass, _init_state, InstanceKlass::ClassState) \
210 volatile_nonstatic_field(InstanceKlass, _init_thread, JavaThread*) \
211 nonstatic_field(InstanceKlass, _misc_flags._flags, u2) \
212 nonstatic_field(InstanceKlass, _annotations, Annotations*) \
213 \
214 volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \
215 volatile_nonstatic_field(JavaFrameAnchor, _last_Java_pc, address) \
216 \
217 nonstatic_field(JVMCICompileState, _jvmti_can_hotswap_or_post_breakpoint, jbyte) \
218 nonstatic_field(JVMCICompileState, _jvmti_can_access_local_variables, jbyte) \
219 nonstatic_field(JVMCICompileState, _jvmti_can_post_on_exceptions, jbyte) \
220 nonstatic_field(JVMCICompileState, _jvmti_can_pop_frame, jbyte) \
221 nonstatic_field(JVMCICompileState, _compilation_ticks, jint) \
222 \
223 nonstatic_field(JavaThread, _threadObj, OopHandle) \
224 nonstatic_field(JavaThread, _vthread, OopHandle) \
225 nonstatic_field(JavaThread, _scopedValueCache, OopHandle) \
226 nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \
227 nonstatic_field(JavaThread, _lock_id, int64_t) \
228 nonstatic_field(JavaThread, _vm_result, oop) \
229 nonstatic_field(JavaThread, _stack_overflow_state._stack_overflow_limit, address) \
230 volatile_nonstatic_field(JavaThread, _exception_oop, oop) \
231 volatile_nonstatic_field(JavaThread, _exception_pc, address) \
232 volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \
233 volatile_nonstatic_field(JavaThread, _doing_unsafe_access, bool) \
234 nonstatic_field(JavaThread, _osthread, OSThread*) \
235 nonstatic_field(JavaThread, _saved_exception_pc, address) \
236 nonstatic_field(JavaThread, _pending_deoptimization, int) \
237 nonstatic_field(JavaThread, _pending_failed_speculation, jlong) \
238 nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \
239 nonstatic_field(JavaThread, _jvmci_counters, jlong*) \
240 nonstatic_field(JavaThread, _jvmci_reserved0, jlong) \
241 nonstatic_field(JavaThread, _jvmci_reserved1, jlong) \
242 nonstatic_field(JavaThread, _jvmci_reserved_oop0, oop) \
243 nonstatic_field(JavaThread, _should_post_on_exceptions_flag, int) \
244 nonstatic_field(JavaThread, _jni_environment, JNIEnv) \
245 nonstatic_field(JavaThread, _poll_data, SafepointMechanism::ThreadData) \
246 nonstatic_field(JavaThread, _stack_overflow_state._reserved_stack_activation, address) \
247 nonstatic_field(JavaThread, _held_monitor_count, intx) \
314 nonstatic_field(MethodData, _compiler_counters._trap_hist._array[0], u1) \
315 nonstatic_field(MethodData, _eflags, intx) \
316 nonstatic_field(MethodData, _arg_local, intx) \
317 nonstatic_field(MethodData, _arg_stack, intx) \
318 nonstatic_field(MethodData, _arg_returned, intx) \
319 nonstatic_field(MethodData, _tenure_traps, uint) \
320 nonstatic_field(MethodData, _invoke_mask, int) \
321 nonstatic_field(MethodData, _backedge_mask, int) \
322 nonstatic_field(MethodData, _jvmci_ir_size, int) \
323 \
324 nonstatic_field(nmethod, _verified_entry_offset, u2) \
325 nonstatic_field(nmethod, _comp_level, CompLevel) \
326 \
327 nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
328 \
329 unchecked_nonstatic_field(ObjectMonitor, _owner, sizeof(void *)) /* NOTE: no type */ \
330 volatile_nonstatic_field(ObjectMonitor, _recursions, intptr_t) \
331 volatile_nonstatic_field(ObjectMonitor, _cxq, ObjectWaiter*) \
332 volatile_nonstatic_field(ObjectMonitor, _EntryList, ObjectWaiter*) \
333 volatile_nonstatic_field(ObjectMonitor, _succ, JavaThread*) \
334 volatile_nonstatic_field(ObjectMonitor, _stack_locker, BasicLock*) \
335 \
336 volatile_nonstatic_field(oopDesc, _mark, markWord) \
337 volatile_nonstatic_field(oopDesc, _metadata._klass, Klass*) \
338 \
339 static_field(StubRoutines, _verify_oop_count, jint) \
340 \
341 static_field(StubRoutines, _jbyte_arraycopy, address) \
342 static_field(StubRoutines, _jshort_arraycopy, address) \
343 static_field(StubRoutines, _jint_arraycopy, address) \
344 static_field(StubRoutines, _jlong_arraycopy, address) \
345 static_field(StubRoutines, _oop_arraycopy, address) \
346 static_field(StubRoutines, _oop_arraycopy_uninit, address) \
347 static_field(StubRoutines, _jbyte_disjoint_arraycopy, address) \
348 static_field(StubRoutines, _jshort_disjoint_arraycopy, address) \
349 static_field(StubRoutines, _jint_disjoint_arraycopy, address) \
350 static_field(StubRoutines, _jlong_disjoint_arraycopy, address) \
351 static_field(StubRoutines, _oop_disjoint_arraycopy, address) \
352 static_field(StubRoutines, _oop_disjoint_arraycopy_uninit, address) \
353 static_field(StubRoutines, _arrayof_jbyte_arraycopy, address) \
354 static_field(StubRoutines, _arrayof_jshort_arraycopy, address) \
791 declare_constant(vmIntrinsics::_linkToSpecial) \
792 declare_constant(vmIntrinsics::_linkToInterface) \
793 declare_constant(vmIntrinsics::_linkToNative) \
794 \
795 declare_constant(vmSymbols::FIRST_SID) \
796 declare_constant(vmSymbols::SID_LIMIT) \
797
798 #define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant) \
799 declare_constant(InvocationCounter::count_increment) \
800 declare_constant(InvocationCounter::count_shift) \
801 \
802 declare_constant(markWord::hash_shift) \
803 declare_constant(markWord::monitor_value) \
804 \
805 declare_constant(markWord::lock_mask_in_place) \
806 declare_constant(markWord::age_mask_in_place) \
807 declare_constant(markWord::hash_mask) \
808 declare_constant(markWord::hash_mask_in_place) \
809 \
810 declare_constant(markWord::unlocked_value) \
811 declare_constant(markWord::marked_value) \
812 \
813 declare_constant(markWord::no_hash_in_place) \
814 declare_constant(markWord::no_lock_in_place) \
815
816 // Helper macro to support ZGC pattern where the function itself isn't exported
817 #define DECLARE_FUNCTION_FROM_ADDR(declare_function_with_value, name) \
818 declare_function_with_value(name, name##_addr())
819
820
821 #define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function, declare_function_with_value) \
822 declare_function(SharedRuntime::register_finalizer) \
823 declare_function(SharedRuntime::exception_handler_for_return_address) \
824 declare_function(SharedRuntime::OSR_migration_end) \
825 declare_function(SharedRuntime::enable_stack_reserved_zone) \
826 declare_function(SharedRuntime::frem) \
827 declare_function(SharedRuntime::drem) \
828 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_start)) \
829 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_end)) \
830 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_mount)) \
831 JVMTI_ONLY(declare_function(SharedRuntime::notify_jvmti_vthread_unmount)) \
|