8293942: [JVMCI] data section entries must be 4-byte aligned on AArch64
Reviewed-by: never
This commit is contained in:
parent
6e23b43220
commit
8ff2c2639e
src/hotspot/share/jvmci
@ -1212,6 +1212,9 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, HotSpotCo
|
||||
case PATCH_DATA_SECTION_REFERENCE: {
|
||||
int data_offset = stream->read_u4("data:offset");
|
||||
if (0 <= data_offset && data_offset < _constants_size) {
|
||||
if (!is_aligned(data_offset, CompilerToVM::Data::get_data_section_item_alignment())) {
|
||||
JVMCI_ERROR("data offset 0x%x is not %d-byte aligned%s", data_offset, relocInfo::addr_unit(), stream->context());
|
||||
}
|
||||
pd_patch_DataSectionReference(pc_offset, data_offset, JVMCI_CHECK);
|
||||
} else {
|
||||
JVMCI_ERROR("data offset 0x%x points outside data section (size 0x%x)%s", data_offset, _constants_size, stream->context());
|
||||
|
@ -91,6 +91,9 @@ class CompilerToVM {
|
||||
static address symbol_init;
|
||||
static address symbol_clinit;
|
||||
|
||||
// Minimum alignment of an offset into CodeBuffer::SECT_CONSTS
|
||||
static int data_section_item_alignment;
|
||||
|
||||
public:
|
||||
static void initialize(JVMCI_TRAPS);
|
||||
|
||||
@ -98,6 +101,10 @@ class CompilerToVM {
|
||||
assert(_max_oop_map_stack_offset > 0, "must be initialized");
|
||||
return Data::_max_oop_map_stack_offset;
|
||||
}
|
||||
|
||||
static int get_data_section_item_alignment() {
|
||||
return data_section_item_alignment;
|
||||
}
|
||||
};
|
||||
|
||||
static bool cstring_equals(const char* const& s0, const char* const& s1) {
|
||||
|
@ -95,6 +95,8 @@ address CompilerToVM::Data::dpow;
|
||||
address CompilerToVM::Data::symbol_init;
|
||||
address CompilerToVM::Data::symbol_clinit;
|
||||
|
||||
int CompilerToVM::Data::data_section_item_alignment;
|
||||
|
||||
void CompilerToVM::Data::initialize(JVMCI_TRAPS) {
|
||||
Klass_vtable_start_offset = in_bytes(Klass::vtable_start_offset());
|
||||
Klass_vtable_length_offset = in_bytes(Klass::vtable_length_offset());
|
||||
@ -133,6 +135,8 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) {
|
||||
|
||||
_fields_annotations_base_offset = Array<AnnotationArray*>::base_offset_in_bytes();
|
||||
|
||||
data_section_item_alignment = relocInfo::addr_unit();
|
||||
|
||||
BarrierSet* bs = BarrierSet::barrier_set();
|
||||
if (bs->is_a(BarrierSet::CardTableBarrierSet)) {
|
||||
CardTable::CardValue* base = ci_card_table_address();
|
||||
|
@ -100,6 +100,8 @@
|
||||
static_field(CompilerToVM::Data, symbol_init, address) \
|
||||
static_field(CompilerToVM::Data, symbol_clinit, address) \
|
||||
\
|
||||
static_field(CompilerToVM::Data, data_section_item_alignment, int) \
|
||||
\
|
||||
static_field(Abstract_VM_Version, _features, uint64_t) \
|
||||
\
|
||||
nonstatic_field(Annotations, _fields_annotations, Array<AnnotationArray*>*) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user