8170100: AArch64: Crash in C1-compiled code accessing References
Reviewed-by: roland
--- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp Mon Nov 21 17:29:17 2016 +0000
+++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp Mon Nov 21 17:38:13 2016 +0000
@@ -886,7 +886,7 @@
// and so we don't need to call the G1 pre-barrier. Thus we can use the
// regular method entry code to generate the NPE.
//
- // This code is based on generate_accessor_enty.
+ // This code is based on generate_accessor_entry.
//
// rmethod: Method*
// r13: senderSP must preserve for slow path, set SP to it on fast path
@@ -904,11 +904,11 @@
__ ldr(local_0, Address(esp, 0));
__ cbz(local_0, slow_path);
-
// Load the value of the referent field.
const Address field_address(local_0, referent_offset);
__ load_heap_oop(local_0, field_address);
+ __ mov(r19, r13); // Move senderSP to a callee-saved register
// Generate the G1 pre-barrier code to log the value of
// the referent field in an SATB buffer.
__ enter(); // g1_write may call runtime
@@ -920,7 +920,7 @@
true /* expand_call */);
__ leave();
// areturn
- __ andr(sp, r13, -16); // done with stack
+ __ andr(sp, r19, -16); // done with stack
__ ret(lr);
// generate a vanilla interpreter entry as the slow path