8155790: aarch64: debug VM fails to start after 8155617
Summary: fix base register to point to end after zeroing
Reviewed-by: aph
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Fri Apr 29 12:56:27 2016 -0700
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Sat Apr 30 00:57:04 2016 -0700
@@ -4767,15 +4767,15 @@
br(rscratch2);
bind(loop);
+ add(base, base, unroll * 16);
for (int i = -unroll; i < 0; i++)
stp(value, value, Address(base, i * 16));
bind(entry);
subs(cnt, cnt, unroll * 2);
- add(base, base, unroll * 16);
br(Assembler::GE, loop);
tbz(cnt, 0, fini);
- str(value, Address(base, -unroll * 16));
+ str(value, Address(post(base, 8)));
bind(fini);
}
@@ -4828,15 +4828,15 @@
br(tmp2);
bind(small_loop);
+ add(base, base, unroll * 16);
for (int i = -unroll; i < 0; i++)
stp(zr, zr, Address(base, i * 16));
bind(small_table_end);
subs(cnt, cnt, unroll * 2);
- add(base, base, unroll * 16);
br(Assembler::GE, small_loop);
tbz(cnt, 0, done);
- str(zr, Address(base, -unroll * 16));
+ str(zr, Address(post(base, 8)));
bind(done);
}
--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp Fri Apr 29 12:56:27 2016 -0700
+++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp Sat Apr 30 00:57:04 2016 -0700
@@ -724,11 +724,15 @@
Register tmp2 = rscratch2;
int zva_length = VM_Version::zva_length();
Label initial_table_end, loop_zva;
+ Label fini;
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "zero_longs");
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.
__ neg(tmp, base);
__ andr(tmp, tmp, zva_length - 1);
@@ -751,6 +755,7 @@
__ add(base, base, zva_length);
__ br(Assembler::GE, loop_zva);
__ add(cnt, cnt, zva_length >> 3); // count not zeroed by DC ZVA
+ __ bind(fini);
__ ret(lr);
return start;