8155790: aarch64: debug VM fails to start after 8155617

Fix base register to point to end after zeroing

Reviewed-by: aph
This commit is contained in:
Ed Nevill 2016-04-30 00:57:04 -07:00
parent f1eeebc17e
commit 17ee5a98f3
2 changed files with 9 additions and 4 deletions

View file

@ -4767,15 +4767,15 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value)
br(rscratch2); br(rscratch2);
bind(loop); bind(loop);
add(base, base, unroll * 16);
for (int i = -unroll; i < 0; i++) for (int i = -unroll; i < 0; i++)
stp(value, value, Address(base, i * 16)); stp(value, value, Address(base, i * 16));
bind(entry); bind(entry);
subs(cnt, cnt, unroll * 2); subs(cnt, cnt, unroll * 2);
add(base, base, unroll * 16);
br(Assembler::GE, loop); br(Assembler::GE, loop);
tbz(cnt, 0, fini); tbz(cnt, 0, fini);
str(value, Address(base, -unroll * 16)); str(value, Address(post(base, 8)));
bind(fini); bind(fini);
} }
@ -4828,15 +4828,15 @@ void MacroAssembler::block_zero(Register base, Register cnt, bool is_large)
br(tmp2); br(tmp2);
bind(small_loop); bind(small_loop);
add(base, base, unroll * 16);
for (int i = -unroll; i < 0; i++) for (int i = -unroll; i < 0; i++)
stp(zr, zr, Address(base, i * 16)); stp(zr, zr, Address(base, i * 16));
bind(small_table_end); bind(small_table_end);
subs(cnt, cnt, unroll * 2); subs(cnt, cnt, unroll * 2);
add(base, base, unroll * 16);
br(Assembler::GE, small_loop); br(Assembler::GE, small_loop);
tbz(cnt, 0, done); tbz(cnt, 0, done);
str(zr, Address(base, -unroll * 16)); str(zr, Address(post(base, 8)));
bind(done); bind(done);
} }

View file

@ -724,11 +724,15 @@ class StubGenerator: public StubCodeGenerator {
Register tmp2 = rscratch2; Register tmp2 = rscratch2;
int zva_length = VM_Version::zva_length(); int zva_length = VM_Version::zva_length();
Label initial_table_end, loop_zva; Label initial_table_end, loop_zva;
Label fini;
__ align(CodeEntryAlignment); __ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "zero_longs"); StubCodeMark mark(this, "StubRoutines", "zero_longs");
address start = __ pc(); address start = __ pc();
// Base must be 16 byte aligned. If not just return and let caller handle it
__ tst(base, 0x0f);
__ br(Assembler::NE, fini);
// Align base with ZVA length. // Align base with ZVA length.
__ neg(tmp, base); __ neg(tmp, base);
__ andr(tmp, tmp, zva_length - 1); __ andr(tmp, tmp, zva_length - 1);
@ -751,6 +755,7 @@ class StubGenerator: public StubCodeGenerator {
__ add(base, base, zva_length); __ add(base, base, zva_length);
__ br(Assembler::GE, loop_zva); __ br(Assembler::GE, loop_zva);
__ add(cnt, cnt, zva_length >> 3); // count not zeroed by DC ZVA __ add(cnt, cnt, zva_length >> 3); // count not zeroed by DC ZVA
__ bind(fini);
__ ret(lr); __ ret(lr);
return start; return start;