23 */
24
25 #include "precompiled.hpp"
26 #include "code/codeBlob.hpp"
27 #include "compiler/abstractCompiler.hpp"
28 #include "compiler/compileBroker.hpp"
29 #include "jvmci/jvmciCodeInstaller.hpp"
30 #include "jvmci/jvmciCompilerToVM.hpp"
31 #include "jvmci/jvmciEnv.hpp"
32 #include "jvmci/jvmciRuntime.hpp"
33 #include "jvmci/vmStructs_compiler_runtime.hpp"
34 #include "jvmci/vmStructs_jvmci.hpp"
35 #include "oops/oop.hpp"
36 #include "oops/oopHandle.hpp"
37 #include "oops/objArrayKlass.hpp"
38 #include "runtime/flags/jvmFlag.hpp"
39 #include "runtime/globals.hpp"
40 #include "runtime/sharedRuntime.hpp"
41 #include "runtime/thread.hpp"
42 #include "runtime/vm_version.hpp"
43
44 #if INCLUDE_ALL_GCS
45 #include "gc/g1/g1BarrierSet.hpp"
46 #include "gc/g1/g1CardTable.hpp"
47 #include "gc/g1/heapRegion.hpp"
48 #include "gc/g1/g1ThreadLocalData.hpp"
49 #endif
50
51 #define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \
52 static_field(CompilerToVM::Data, Klass_vtable_start_offset, int) \
53 static_field(CompilerToVM::Data, Klass_vtable_length_offset, int) \
54 \
55 static_field(CompilerToVM::Data, Method_extra_stack_entries, int) \
56 \
57 static_field(CompilerToVM::Data, SharedRuntime_ic_miss_stub, address) \
58 static_field(CompilerToVM::Data, SharedRuntime_handle_wrong_method_stub, address) \
59 static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_unpack, address) \
60 static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_uncommon_trap, address) \
61 \
62 static_field(CompilerToVM::Data, ThreadLocalAllocBuffer_alignment_reserve, size_t) \
63 \
64 static_field(CompilerToVM::Data, Universe_collectedHeap, CollectedHeap*) \
619 declare_function(JVMCIRuntime::new_multi_array) \
620 declare_function(JVMCIRuntime::dynamic_new_array) \
621 declare_function(JVMCIRuntime::dynamic_new_instance) \
622 \
623 declare_function(JVMCIRuntime::thread_is_interrupted) \
624 declare_function(JVMCIRuntime::vm_message) \
625 declare_function(JVMCIRuntime::identity_hash_code) \
626 declare_function(JVMCIRuntime::exception_handler_for_pc) \
627 declare_function(JVMCIRuntime::monitorenter) \
628 declare_function(JVMCIRuntime::monitorexit) \
629 declare_function(JVMCIRuntime::object_notify) \
630 declare_function(JVMCIRuntime::object_notifyAll) \
631 declare_function(JVMCIRuntime::throw_and_post_jvmti_exception) \
632 declare_function(JVMCIRuntime::throw_klass_external_name_exception) \
633 declare_function(JVMCIRuntime::throw_class_cast_exception) \
634 declare_function(JVMCIRuntime::log_primitive) \
635 declare_function(JVMCIRuntime::log_object) \
636 declare_function(JVMCIRuntime::log_printf) \
637 declare_function(JVMCIRuntime::vm_error) \
638 declare_function(JVMCIRuntime::load_and_clear_exception) \
639 ALL_GCS_ONLY(declare_function(JVMCIRuntime::write_barrier_pre)) \
640 ALL_GCS_ONLY(declare_function(JVMCIRuntime::write_barrier_post)) \
641 declare_function(JVMCIRuntime::validate_object) \
642 \
643 declare_function(JVMCIRuntime::test_deoptimize_call_int)
644
645
646 #if INCLUDE_ALL_GCS
647
648 #define VM_STRUCTS_JVMCI_G1GC(nonstatic_field, static_field) \
649 static_field(HeapRegion, LogOfHRGrainBytes, int)
650
651 #define VM_INT_CONSTANTS_JVMCI_G1GC(declare_constant, declare_constant_with_value, declare_preprocessor_constant) \
652 declare_constant_with_value("G1CardTable::g1_young_gen", G1CardTable::g1_young_card_val()) \
653 declare_constant_with_value("G1ThreadLocalData::satb_mark_queue_active_offset", in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())) \
654 declare_constant_with_value("G1ThreadLocalData::satb_mark_queue_index_offset", in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset())) \
655 declare_constant_with_value("G1ThreadLocalData::satb_mark_queue_buffer_offset", in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset())) \
656 declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_index_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())) \
657 declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_buffer_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset()))
658
659 #endif // INCLUDE_ALL_GCS
660
661
662 #ifdef LINUX
663
664 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
665 declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
666
667 #endif
668
669
670 #ifdef BSD
671
672 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
673 declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
674
675 #endif
676
677 // AARCH64 is defined in closed port, too. TARGET_ARCH_aarch64 is not.
678 #ifdef TARGET_ARCH_aarch64
679
855 GENERATE_NONSTATIC_VM_STRUCT_ENTRY)
856
857 VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
858 GENERATE_STATIC_VM_STRUCT_ENTRY,
859 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
860 GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
861 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
862 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY,
863 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY,
864 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY)
865
866 VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
867 GENERATE_STATIC_VM_STRUCT_ENTRY,
868 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
869 GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
870 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
871 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY,
872 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY,
873 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY)
874
875 #if INCLUDE_ALL_GCS
876 VM_STRUCTS_JVMCI_G1GC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
877 GENERATE_STATIC_VM_STRUCT_ENTRY)
878 #endif
879
880 GENERATE_VM_STRUCT_LAST_ENTRY()
881 };
882
883 VMTypeEntry JVMCIVMStructs::localHotSpotVMTypes[] = {
884 VM_TYPES(GENERATE_VM_TYPE_ENTRY,
885 GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
886 GENERATE_INTEGER_VM_TYPE_ENTRY,
887 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY)
888
889 VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY,
890 GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
891 GENERATE_OOP_VM_TYPE_ENTRY,
892 GENERATE_INTEGER_VM_TYPE_ENTRY,
893 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY,
894 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY,
895 GENERATE_C2_VM_TYPE_ENTRY,
907 GENERATE_VM_TYPE_LAST_ENTRY()
908 };
909
910 VMIntConstantEntry JVMCIVMStructs::localHotSpotVMIntConstants[] = {
911 VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY,
912 GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY,
913 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
914
915 VM_INT_CONSTANTS_OS(GENERATE_VM_INT_CONSTANT_ENTRY,
916 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
917 GENERATE_C1_VM_INT_CONSTANT_ENTRY,
918 GENERATE_C2_VM_INT_CONSTANT_ENTRY,
919 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
920
921 VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY,
922 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
923 GENERATE_C1_VM_INT_CONSTANT_ENTRY,
924 GENERATE_C2_VM_INT_CONSTANT_ENTRY,
925 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
926
927 #if INCLUDE_ALL_GCS
928 VM_INT_CONSTANTS_JVMCI_G1GC(GENERATE_VM_INT_CONSTANT_ENTRY,
929 GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY,
930 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
931 #endif
932
933 GENERATE_VM_INT_CONSTANT_LAST_ENTRY()
934 };
935
936 VMLongConstantEntry JVMCIVMStructs::localHotSpotVMLongConstants[] = {
937 VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY,
938 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
939
940 VM_LONG_CONSTANTS_OS(GENERATE_VM_LONG_CONSTANT_ENTRY,
941 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
942 GENERATE_C1_VM_LONG_CONSTANT_ENTRY,
943 GENERATE_C2_VM_LONG_CONSTANT_ENTRY,
944 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
945
946 VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY,
947 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
|
23 */
24
25 #include "precompiled.hpp"
26 #include "code/codeBlob.hpp"
27 #include "compiler/abstractCompiler.hpp"
28 #include "compiler/compileBroker.hpp"
29 #include "jvmci/jvmciCodeInstaller.hpp"
30 #include "jvmci/jvmciCompilerToVM.hpp"
31 #include "jvmci/jvmciEnv.hpp"
32 #include "jvmci/jvmciRuntime.hpp"
33 #include "jvmci/vmStructs_compiler_runtime.hpp"
34 #include "jvmci/vmStructs_jvmci.hpp"
35 #include "oops/oop.hpp"
36 #include "oops/oopHandle.hpp"
37 #include "oops/objArrayKlass.hpp"
38 #include "runtime/flags/jvmFlag.hpp"
39 #include "runtime/globals.hpp"
40 #include "runtime/sharedRuntime.hpp"
41 #include "runtime/thread.hpp"
42 #include "runtime/vm_version.hpp"
43 #if INCLUDE_G1GC
44 #include "gc/g1/g1BarrierSet.hpp"
45 #include "gc/g1/g1CardTable.hpp"
46 #include "gc/g1/heapRegion.hpp"
47 #include "gc/g1/g1ThreadLocalData.hpp"
48 #endif
49
50 #define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \
51 static_field(CompilerToVM::Data, Klass_vtable_start_offset, int) \
52 static_field(CompilerToVM::Data, Klass_vtable_length_offset, int) \
53 \
54 static_field(CompilerToVM::Data, Method_extra_stack_entries, int) \
55 \
56 static_field(CompilerToVM::Data, SharedRuntime_ic_miss_stub, address) \
57 static_field(CompilerToVM::Data, SharedRuntime_handle_wrong_method_stub, address) \
58 static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_unpack, address) \
59 static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_uncommon_trap, address) \
60 \
61 static_field(CompilerToVM::Data, ThreadLocalAllocBuffer_alignment_reserve, size_t) \
62 \
63 static_field(CompilerToVM::Data, Universe_collectedHeap, CollectedHeap*) \
618 declare_function(JVMCIRuntime::new_multi_array) \
619 declare_function(JVMCIRuntime::dynamic_new_array) \
620 declare_function(JVMCIRuntime::dynamic_new_instance) \
621 \
622 declare_function(JVMCIRuntime::thread_is_interrupted) \
623 declare_function(JVMCIRuntime::vm_message) \
624 declare_function(JVMCIRuntime::identity_hash_code) \
625 declare_function(JVMCIRuntime::exception_handler_for_pc) \
626 declare_function(JVMCIRuntime::monitorenter) \
627 declare_function(JVMCIRuntime::monitorexit) \
628 declare_function(JVMCIRuntime::object_notify) \
629 declare_function(JVMCIRuntime::object_notifyAll) \
630 declare_function(JVMCIRuntime::throw_and_post_jvmti_exception) \
631 declare_function(JVMCIRuntime::throw_klass_external_name_exception) \
632 declare_function(JVMCIRuntime::throw_class_cast_exception) \
633 declare_function(JVMCIRuntime::log_primitive) \
634 declare_function(JVMCIRuntime::log_object) \
635 declare_function(JVMCIRuntime::log_printf) \
636 declare_function(JVMCIRuntime::vm_error) \
637 declare_function(JVMCIRuntime::load_and_clear_exception) \
638 G1GC_ONLY(declare_function(JVMCIRuntime::write_barrier_pre)) \
639 G1GC_ONLY(declare_function(JVMCIRuntime::write_barrier_post)) \
640 declare_function(JVMCIRuntime::validate_object) \
641 \
642 declare_function(JVMCIRuntime::test_deoptimize_call_int)
643
644
645 #if INCLUDE_G1GC
646
647 #define VM_STRUCTS_JVMCI_G1GC(nonstatic_field, static_field) \
648 static_field(HeapRegion, LogOfHRGrainBytes, int)
649
650 #define VM_INT_CONSTANTS_JVMCI_G1GC(declare_constant, declare_constant_with_value, declare_preprocessor_constant) \
651 declare_constant_with_value("G1CardTable::g1_young_gen", G1CardTable::g1_young_card_val()) \
652 declare_constant_with_value("G1ThreadLocalData::satb_mark_queue_active_offset", in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset())) \
653 declare_constant_with_value("G1ThreadLocalData::satb_mark_queue_index_offset", in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset())) \
654 declare_constant_with_value("G1ThreadLocalData::satb_mark_queue_buffer_offset", in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset())) \
655 declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_index_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())) \
656 declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_buffer_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset()))
657
658 #endif // INCLUDE_G1GC
659
660
661 #ifdef LINUX
662
663 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
664 declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
665
666 #endif
667
668
669 #ifdef BSD
670
671 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \
672 declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT)
673
674 #endif
675
676 // AARCH64 is defined in closed port, too. TARGET_ARCH_aarch64 is not.
677 #ifdef TARGET_ARCH_aarch64
678
854 GENERATE_NONSTATIC_VM_STRUCT_ENTRY)
855
856 VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
857 GENERATE_STATIC_VM_STRUCT_ENTRY,
858 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
859 GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
860 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
861 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY,
862 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY,
863 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY)
864
865 VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
866 GENERATE_STATIC_VM_STRUCT_ENTRY,
867 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
868 GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
869 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
870 GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY,
871 GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY,
872 GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY)
873
874 #if INCLUDE_G1GC
875 VM_STRUCTS_JVMCI_G1GC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
876 GENERATE_STATIC_VM_STRUCT_ENTRY)
877 #endif
878
879 GENERATE_VM_STRUCT_LAST_ENTRY()
880 };
881
882 VMTypeEntry JVMCIVMStructs::localHotSpotVMTypes[] = {
883 VM_TYPES(GENERATE_VM_TYPE_ENTRY,
884 GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
885 GENERATE_INTEGER_VM_TYPE_ENTRY,
886 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY)
887
888 VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY,
889 GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
890 GENERATE_OOP_VM_TYPE_ENTRY,
891 GENERATE_INTEGER_VM_TYPE_ENTRY,
892 GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY,
893 GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY,
894 GENERATE_C2_VM_TYPE_ENTRY,
906 GENERATE_VM_TYPE_LAST_ENTRY()
907 };
908
909 VMIntConstantEntry JVMCIVMStructs::localHotSpotVMIntConstants[] = {
910 VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY,
911 GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY,
912 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
913
914 VM_INT_CONSTANTS_OS(GENERATE_VM_INT_CONSTANT_ENTRY,
915 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
916 GENERATE_C1_VM_INT_CONSTANT_ENTRY,
917 GENERATE_C2_VM_INT_CONSTANT_ENTRY,
918 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
919
920 VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY,
921 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
922 GENERATE_C1_VM_INT_CONSTANT_ENTRY,
923 GENERATE_C2_VM_INT_CONSTANT_ENTRY,
924 GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
925
926 #if INCLUDE_G1GC
927 VM_INT_CONSTANTS_JVMCI_G1GC(GENERATE_VM_INT_CONSTANT_ENTRY,
928 GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY,
929 GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
930 #endif
931
932 GENERATE_VM_INT_CONSTANT_LAST_ENTRY()
933 };
934
935 VMLongConstantEntry JVMCIVMStructs::localHotSpotVMLongConstants[] = {
936 VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY,
937 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
938
939 VM_LONG_CONSTANTS_OS(GENERATE_VM_LONG_CONSTANT_ENTRY,
940 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
941 GENERATE_C1_VM_LONG_CONSTANT_ENTRY,
942 GENERATE_C2_VM_LONG_CONSTANT_ENTRY,
943 GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
944
945 VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY,
946 GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
|