537 #define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function) \ |
537 #define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function) \ |
538 declare_function(SharedRuntime::register_finalizer) \ |
538 declare_function(SharedRuntime::register_finalizer) \ |
539 declare_function(SharedRuntime::exception_handler_for_return_address) \ |
539 declare_function(SharedRuntime::exception_handler_for_return_address) \ |
540 declare_function(SharedRuntime::OSR_migration_end) \ |
540 declare_function(SharedRuntime::OSR_migration_end) \ |
541 declare_function(SharedRuntime::enable_stack_reserved_zone) \ |
541 declare_function(SharedRuntime::enable_stack_reserved_zone) \ |
|
542 declare_function(SharedRuntime::frem) \ |
|
543 declare_function(SharedRuntime::drem) \ |
542 \ |
544 \ |
543 declare_function(os::dll_load) \ |
545 declare_function(os::dll_load) \ |
544 declare_function(os::dll_lookup) \ |
546 declare_function(os::dll_lookup) \ |
545 declare_function(os::javaTimeMillis) \ |
547 declare_function(os::javaTimeMillis) \ |
546 declare_function(os::javaTimeNanos) \ |
548 declare_function(os::javaTimeNanos) \ |
731 #ifndef VM_ADDRESSES_OS |
733 #ifndef VM_ADDRESSES_OS |
732 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) |
734 #define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) |
733 #endif |
735 #endif |
734 |
736 |
735 |
737 |
736 // whole purpose of this function is to work around bug c++/27724 in gcc 4.1.1 |
|
737 // with optimization turned on it doesn't affect produced code |
|
738 static inline uint64_t cast_uint64_t(size_t x) |
|
739 { |
|
740 return x; |
|
741 } |
|
742 |
|
743 #define ASSIGN_CONST_TO_64BIT_VAR(var, expr) \ |
|
744 JNIEXPORT uint64_t var = cast_uint64_t(expr); |
|
745 |
|
746 #define ASSIGN_OFFSET_TO_64BIT_VAR(var, type, field) \ |
|
747 ASSIGN_CONST_TO_64BIT_VAR(var, offset_of(type, field)) |
|
748 |
|
749 #define ASSIGN_STRIDE_TO_64BIT_VAR(var, array) \ |
|
750 ASSIGN_CONST_TO_64BIT_VAR(var, (char*)&array[1] - (char*)&array[0]) |
|
751 |
|
752 // |
738 // |
753 // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries |
739 // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries |
754 // |
740 // |
755 |
741 |
756 // These initializers are allowed to access private fields in classes |
742 // These initializers are allowed to access private fields in classes |
869 GENERATE_VM_FUNCTION_ENTRY) |
855 GENERATE_VM_FUNCTION_ENTRY) |
870 |
856 |
871 GENERATE_VM_ADDRESS_LAST_ENTRY() |
857 GENERATE_VM_ADDRESS_LAST_ENTRY() |
872 }; |
858 }; |
873 |
859 |
|
860 int JVMCIVMStructs::localHotSpotVMStructs_count() { |
|
861 // Ignore sentinel entry at the end |
|
862 return (sizeof(localHotSpotVMStructs) / sizeof(VMStructEntry)) - 1; |
|
863 } |
|
864 int JVMCIVMStructs::localHotSpotVMTypes_count() { |
|
865 // Ignore sentinel entry at the end |
|
866 return (sizeof(localHotSpotVMTypes) / sizeof(VMTypeEntry)) - 1; |
|
867 } |
|
868 int JVMCIVMStructs::localHotSpotVMIntConstants_count() { |
|
869 // Ignore sentinel entry at the end |
|
870 return (sizeof(localHotSpotVMIntConstants) / sizeof(VMIntConstantEntry)) - 1; |
|
871 } |
|
872 int JVMCIVMStructs::localHotSpotVMLongConstants_count() { |
|
873 // Ignore sentinel entry at the end |
|
874 return (sizeof(localHotSpotVMLongConstants) / sizeof(VMLongConstantEntry)) - 1; |
|
875 } |
|
876 int JVMCIVMStructs::localHotSpotVMAddresses_count() { |
|
877 // Ignore sentinel entry at the end |
|
878 return (sizeof(localHotSpotVMAddresses) / sizeof(VMAddressEntry)) - 1; |
|
879 } |
|
880 |
874 extern "C" { |
881 extern "C" { |
875 JNIEXPORT VMStructEntry* jvmciHotSpotVMStructs = JVMCIVMStructs::localHotSpotVMStructs; |
882 JNIEXPORT VMStructEntry* jvmciHotSpotVMStructs = JVMCIVMStructs::localHotSpotVMStructs; |
876 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryTypeNameOffset, VMStructEntry, typeName); |
|
877 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryFieldNameOffset, VMStructEntry, fieldName); |
|
878 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryTypeStringOffset, VMStructEntry, typeString); |
|
879 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryIsStaticOffset, VMStructEntry, isStatic); |
|
880 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryOffsetOffset, VMStructEntry, offset); |
|
881 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryAddressOffset, VMStructEntry, address); |
|
882 ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMStructEntryArrayStride, jvmciHotSpotVMStructs); |
|
883 |
|
884 JNIEXPORT VMTypeEntry* jvmciHotSpotVMTypes = JVMCIVMStructs::localHotSpotVMTypes; |
883 JNIEXPORT VMTypeEntry* jvmciHotSpotVMTypes = JVMCIVMStructs::localHotSpotVMTypes; |
885 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryTypeNameOffset, VMTypeEntry, typeName); |
|
886 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntrySuperclassNameOffset, VMTypeEntry, superclassName); |
|
887 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsOopTypeOffset, VMTypeEntry, isOopType); |
|
888 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsIntegerTypeOffset, VMTypeEntry, isIntegerType); |
|
889 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsUnsignedOffset, VMTypeEntry, isUnsigned); |
|
890 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntrySizeOffset, VMTypeEntry, size); |
|
891 ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryArrayStride, jvmciHotSpotVMTypes); |
|
892 |
|
893 JNIEXPORT VMIntConstantEntry* jvmciHotSpotVMIntConstants = JVMCIVMStructs::localHotSpotVMIntConstants; |
884 JNIEXPORT VMIntConstantEntry* jvmciHotSpotVMIntConstants = JVMCIVMStructs::localHotSpotVMIntConstants; |
894 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryNameOffset, VMIntConstantEntry, name); |
|
895 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryValueOffset, VMIntConstantEntry, value); |
|
896 ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryArrayStride, jvmciHotSpotVMIntConstants); |
|
897 |
|
898 JNIEXPORT VMLongConstantEntry* jvmciHotSpotVMLongConstants = JVMCIVMStructs::localHotSpotVMLongConstants; |
885 JNIEXPORT VMLongConstantEntry* jvmciHotSpotVMLongConstants = JVMCIVMStructs::localHotSpotVMLongConstants; |
899 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryNameOffset, VMLongConstantEntry, name); |
|
900 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryValueOffset, VMLongConstantEntry, value); |
|
901 ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryArrayStride, jvmciHotSpotVMLongConstants); |
|
902 |
|
903 JNIEXPORT VMAddressEntry* jvmciHotSpotVMAddresses = JVMCIVMStructs::localHotSpotVMAddresses; |
886 JNIEXPORT VMAddressEntry* jvmciHotSpotVMAddresses = JVMCIVMStructs::localHotSpotVMAddresses; |
904 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryNameOffset, VMAddressEntry, name); |
|
905 ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryValueOffset, VMAddressEntry, value); |
|
906 ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryArrayStride, jvmciHotSpotVMAddresses); |
|
907 } |
887 } |