Skip to content

Commit 695117f

Browse files
author
Patric Hedlin
committedNov 24, 2020
8255479: [aarch64] assert(src->section_index_of(target) == CodeBuffer::SECT_NONE) failed: sanity
Reviewed-by: aph, neliasso
1 parent dbfeb90 commit 695117f

File tree

3 files changed

+13
-23
lines changed

3 files changed

+13
-23
lines changed
 

‎src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
220220

221221
// storing region crossing non-NULL, is card already dirty?
222222

223-
ExternalAddress cardtable((address) ct->byte_map_base());
224223
const Register card_addr = tmp;
225224

226225
__ lsr(card_addr, store_addr, CardTable::card_shift);

‎src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -4429,18 +4429,9 @@ void MacroAssembler::load_byte_map_base(Register reg) {
44294429
CardTable::CardValue* byte_map_base =
44304430
((CardTableBarrierSet*)(BarrierSet::barrier_set()))->card_table()->byte_map_base();
44314431

4432-
if (is_valid_AArch64_address((address)byte_map_base)) {
4433-
// Strictly speaking the byte_map_base isn't an address at all,
4434-
// and it might even be negative.
4435-
uint64_t offset;
4436-
adrp(reg, ExternalAddress((address)byte_map_base), offset);
4437-
// We expect offset to be zero with most collectors.
4438-
if (offset != 0) {
4439-
add(reg, reg, offset);
4440-
}
4441-
} else {
4442-
mov(reg, (uint64_t)byte_map_base);
4443-
}
4432+
// Strictly speaking the byte_map_base isn't an address at all, and it might
4433+
// even be negative. It is thus materialised as a constant.
4434+
mov(reg, (uint64_t)byte_map_base);
44444435
}
44454436

44464437
void MacroAssembler::build_frame(int framesize) {

‎src/hotspot/share/code/relocInfo.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -732,16 +732,16 @@ bool static_stub_Relocation::clear_inline_cache() {
732732

733733

734734
void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
735-
address target = _target;
736-
if (target == NULL) {
737-
// An absolute embedded reference to an external location,
738-
// which means there is nothing to fix here.
739-
return;
740-
}
741-
// Probably this reference is absolute, not relative, so the
742-
// following is probably a no-op.
743-
assert(src->section_index_of(target) == CodeBuffer::SECT_NONE, "sanity");
744-
set_value(target);
735+
if (_target != NULL) {
736+
// Probably this reference is absolute, not relative, so the following is
737+
// probably a no-op.
738+
set_value(_target);
739+
}
740+
// If target is NULL, this is an absolute embedded reference to an external
741+
// location, which means there is nothing to fix here. In either case, the
742+
// resulting target should be an "external" address.
743+
postcond(src->section_index_of(target()) == CodeBuffer::SECT_NONE);
744+
postcond(dest->section_index_of(target()) == CodeBuffer::SECT_NONE);
745745
}
746746

747747

0 commit comments

Comments
 (0)
Please sign in to comment.