]> gitweb.factorcode.org Git - factor.git/commitdiff
cpu.x86.(32,64).bootstrap: get rid of PUSH malarky
authorJoe Groff <arcata@gmail.com>
Fri, 21 Oct 2011 17:53:44 +0000 (10:53 -0700)
committerJoe Groff <arcata@gmail.com>
Fri, 28 Oct 2011 04:14:50 +0000 (21:14 -0700)
In the function prologue, move the stack pointer once after the stack frame is set up instead of PUSHing the stack frame piece by piece.

basis/cpu/x86/32/bootstrap.factor
basis/cpu/x86/64/bootstrap.factor

index 184c0e6b3346798bd89343521929a5bebbb7e9f7..5e0561bfca475115cda55c8cbbf37775d3367ea5 100755 (executable)
@@ -34,12 +34,12 @@ IN: bootstrap.x86
     0 CALL f rc-relative rel-dlsym ;
 
 [
-    ! save stack frame size
-    stack-frame-size PUSH
-    ! push entry point
-    0 PUSH rc-absolute-cell rel-this
+    ! store entry point
+    ESP bootstrap-cell 2 * neg [+] 0 MOV rc-absolute-cell rel-this
+    ! store stack frame size
+    ESP bootstrap-cell neg [+] stack-frame-size MOV
     ! alignment
-    ESP stack-frame-size 3 bootstrap-cells - SUB
+    ESP stack-frame-size bootstrap-cell - SUB
 ] jit-prolog jit-define
 
 [
index 5191f3993c8084e014da830c77ded5da3ab9285b..cc209746ea328483f382cd155d7903f83e8789ce 100755 (executable)
@@ -36,12 +36,12 @@ IN: bootstrap.x86
 [
     ! load entry point
     RAX 0 MOV rc-absolute-cell rel-this
-    ! save stack frame size
-    stack-frame-size PUSH
-    ! push entry point
-    RAX PUSH
+    ! store entry point
+    RSP bootstrap-cell 2 * neg [+] RAX MOV
+    ! store stack frame size
+    RSP bootstrap-cell neg [+] stack-frame-size MOV
     ! alignment
-    RSP stack-frame-size 3 bootstrap-cells - SUB
+    RSP stack-frame-size bootstrap-cell - SUB
 ] jit-prolog jit-define
 
 [