Skip to content

Commit 6c75a20

Browse files
Andrew Haleypull[bot]
authored andcommitted
8344355: Register corruption in MacroAssembler::lookup_secondary_supers_table_var: x86-64 only
Reviewed-by: vlivanov, martin, dlong, asemenov
1 parent dda805d commit 6c75a20

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4912,6 +4912,10 @@ void MacroAssembler::population_count(Register dst, Register src,
49124912
}
49134913
bind(done);
49144914
}
4915+
#ifdef ASSERT
4916+
mov64(scratch1, 0xCafeBabeDeadBeef);
4917+
movq(scratch2, scratch1);
4918+
#endif
49154919
}
49164920

49174921
// Ensure that the inline code and the stub are using the same registers.
@@ -5113,6 +5117,7 @@ void MacroAssembler::lookup_secondary_supers_table_var(Register r_sub_klass,
51135117
const Register r_array_base = *available_regs++;
51145118

51155119
// Get the first array index that can contain super_klass into r_array_index.
5120+
// Note: Clobbers r_array_base and slot.
51165121
population_count(r_array_index, r_array_index, /*temp2*/r_array_base, /*temp3*/slot);
51175122

51185123
// NB! r_array_index is off by 1. It is compensated by keeping r_array_base off by 1 word.
@@ -5130,7 +5135,7 @@ void MacroAssembler::lookup_secondary_supers_table_var(Register r_sub_klass,
51305135
jccb(Assembler::equal, L_success);
51315136

51325137
// Restore slot to its true value
5133-
xorl(slot, (u1)(Klass::SECONDARY_SUPERS_TABLE_SIZE - 1)); // slot ^ 63 === 63 - slot (mod 64)
5138+
movb(slot, Address(r_super_klass, Klass::hash_slot_offset()));
51345139

51355140
// Linear probe. Rotate the bitmap so that the next bit to test is
51365141
// in Bit 1.

0 commit comments

Comments
 (0)