[aarch64-port-dev ] Fix stack overflow in recursive invocation

Andrew Haley aph at redhat.com
Fri Dec 19 11:35:59 UTC 2014


This one is a hangover from the very earliest days of this project.
In an entry frame we allocate a page of scratch memory when only a few
bytes are really needed.

Andrew.


# HG changeset patch
# User aph
# Date 1418988711 18000
#      Fri Dec 19 06:31:51 2014 -0500
# Node ID 39effdb6f83e69bfbd345a93eb083f38d780d079
# Parent  50f6ffa33a7c758ebd4a337b020bc8de2f4774ff
Remove insanely large stack allocation in entry frame.

diff -r 50f6ffa33a7c -r 39effdb6f83e src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
--- a/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp      Fri Dec 12 06:32:18 2014 -0500
+++ b/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp      Fri Dec 19 06:31:51 2014 -0500
@@ -305,7 +305,8 @@
 #endif
     // pass parameters if any
     __ mov(esp, sp);
-    __ sub(sp, sp, os::vm_page_size()); // Move SP out of the way
+    __ sub(rscratch1, sp, c_rarg6, ext::uxtw, LogBytesPerWord); // Move SP out of the way
+    __ andr(sp, rscratch1, -2 * wordSize);

     BLOCK_COMMENT("pass parameters if any");
     Label parameters_done;


More information about the aarch64-port-dev mailing list