8167200: AArch64: Broken stack pointer adjustment in interpreter
Summary: Always adjust SP unconditionally
Reviewed-by: dlong, kbarrett
--- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp Tue May 24 08:47:37 2016 -0700
+++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp Thu Oct 06 09:25:21 2016 +0000
@@ -3717,19 +3717,15 @@
// allocate one if there's no free slot
{
- Label entry, loop, no_adjust;
+ Label entry, loop;
// 1. compute new pointers // rsp: old expression stack top
__ ldr(c_rarg1, monitor_block_bot); // c_rarg1: old expression stack bottom
- __ sub(esp, esp, entry_size); // move expression stack top
+ __ sub(esp, esp, entry_size); // move expression stack top
__ sub(c_rarg1, c_rarg1, entry_size); // move expression stack bottom
__ mov(c_rarg3, esp); // set start value for copy loop
__ str(c_rarg1, monitor_block_bot); // set new monitor block bottom
- __ cmp(sp, c_rarg3); // Check if we need to move sp
- __ br(Assembler::LO, no_adjust); // to allow more stack space
- // for our new esp
- __ sub(sp, sp, 2 * wordSize);
- __ bind(no_adjust);
+ __ sub(sp, sp, entry_size); // make room for the monitor
__ b(entry);
// 2. move expression stack contents