equal
deleted
inserted
replaced
62 #include "runtime/jniHandles.inline.hpp" |
62 #include "runtime/jniHandles.inline.hpp" |
63 #include "runtime/safepoint.hpp" |
63 #include "runtime/safepoint.hpp" |
64 #include "runtime/safepointVerifiers.hpp" |
64 #include "runtime/safepointVerifiers.hpp" |
65 #include "runtime/thread.inline.hpp" |
65 #include "runtime/thread.inline.hpp" |
66 #include "runtime/vframe.inline.hpp" |
66 #include "runtime/vframe.inline.hpp" |
|
67 #include "runtime/vm_version.hpp" |
67 #include "utilities/align.hpp" |
68 #include "utilities/align.hpp" |
68 #include "utilities/preserveException.hpp" |
69 #include "utilities/preserveException.hpp" |
69 #include "utilities/utf8.hpp" |
70 #include "utilities/utf8.hpp" |
70 #if INCLUDE_JVMCI |
71 #if INCLUDE_JVMCI |
71 #include "jvmci/jvmciJavaClasses.hpp" |
72 #include "jvmci/jvmciJavaClasses.hpp" |
4032 private: |
4033 private: |
4033 int _address_size; |
4034 int _address_size; |
4034 int _page_size; |
4035 int _page_size; |
4035 bool _big_endian; |
4036 bool _big_endian; |
4036 bool _use_unaligned_access; |
4037 bool _use_unaligned_access; |
|
4038 int _data_cache_line_flush_size; |
4037 public: |
4039 public: |
4038 UnsafeConstantsFixup() { |
4040 UnsafeConstantsFixup() { |
4039 // round up values for all static final fields |
4041 // round up values for all static final fields |
4040 _address_size = sizeof(void*); |
4042 _address_size = sizeof(void*); |
4041 _page_size = os::vm_page_size(); |
4043 _page_size = os::vm_page_size(); |
4042 _big_endian = LITTLE_ENDIAN_ONLY(false) BIG_ENDIAN_ONLY(true); |
4044 _big_endian = LITTLE_ENDIAN_ONLY(false) BIG_ENDIAN_ONLY(true); |
4043 _use_unaligned_access = UseUnalignedAccesses; |
4045 _use_unaligned_access = UseUnalignedAccesses; |
|
4046 _data_cache_line_flush_size = (int)VM_Version::data_cache_line_flush_size(); |
4044 } |
4047 } |
4045 |
4048 |
4046 void do_field(fieldDescriptor* fd) { |
4049 void do_field(fieldDescriptor* fd) { |
4047 oop mirror = fd->field_holder()->java_mirror(); |
4050 oop mirror = fd->field_holder()->java_mirror(); |
4048 assert(mirror != NULL, "UnsafeConstants must have mirror already"); |
4051 assert(mirror != NULL, "UnsafeConstants must have mirror already"); |
4055 mirror->int_field_put(fd->offset(), _page_size); |
4058 mirror->int_field_put(fd->offset(), _page_size); |
4056 } else if (fd->name() == vmSymbols::big_endian_name()) { |
4059 } else if (fd->name() == vmSymbols::big_endian_name()) { |
4057 mirror->bool_field_put(fd->offset(), _big_endian); |
4060 mirror->bool_field_put(fd->offset(), _big_endian); |
4058 } else if (fd->name() == vmSymbols::use_unaligned_access_name()) { |
4061 } else if (fd->name() == vmSymbols::use_unaligned_access_name()) { |
4059 mirror->bool_field_put(fd->offset(), _use_unaligned_access); |
4062 mirror->bool_field_put(fd->offset(), _use_unaligned_access); |
|
4063 } else if (fd->name() == vmSymbols::data_cache_line_flush_size_name()) { |
|
4064 mirror->int_field_put(fd->offset(), _data_cache_line_flush_size); |
4060 } else { |
4065 } else { |
4061 assert(false, "unexpected UnsafeConstants field"); |
4066 assert(false, "unexpected UnsafeConstants field"); |
4062 } |
4067 } |
4063 } |
4068 } |
4064 }; |
4069 }; |