[aarch64-port-dev ] C1: Restore LR for use by C2 runtime

Andrew Haley aph at redhat.com
Thu Oct 17 11:02:28 PDT 2013


C1 doesn't bother to restore the link register when throwing an exception
because its runtime doesn't care.  The C2 runtime does care, however, so
we need to restore it because we might be throwing back to C2-compiled
code.

Andrew.


# HG changeset patch
# User aph
# Date 1382032180 -3600
# Node ID 0fdfde0445496891b057f34c3fce74f9ca3dd3ce
# Parent  7ad16844c57ec14065f6354b1d8e75f965489ab4
Restore LR for use by C2 runtime

diff -r 7ad16844c57e -r 0fdfde044549 src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp
--- a/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp	Thu Oct 17 16:46:49 2013 +0100
+++ b/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp	Thu Oct 17 18:49:40 2013 +0100
@@ -509,7 +509,8 @@

   // get throwing pc (= return address).
   // lr has been destroyed by the call
-  __ ldp(r3, exception_oop, Address(__ post(sp, 2 * wordSize)));
+  __ ldp(lr, exception_oop, Address(__ post(sp, 2 * wordSize)));
+  __ mov(r3, lr);

   __ verify_not_null_oop(exception_oop);




More information about the aarch64-port-dev mailing list