]> gitweb.factorcode.org Git - factor.git/commitdiff
cpu.*.bootstrap: return address for (set-context)
authorJoe Groff <arcata@gmail.com>
Wed, 30 Nov 2011 20:52:06 +0000 (12:52 -0800)
committerJoe Groff <arcata@gmail.com>
Wed, 14 Dec 2011 17:56:46 +0000 (09:56 -0800)
Instead of pushing zero as the fake return address for a set-context call, push an address that points back into the primitive so that callstack walking can match the frame back to the subprimitive.

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

index 268597d41e4b3216691da73cfe94799871995851..03a39715d44ab3aef3c22b25d08e71df99205746 100755 (executable)
@@ -294,9 +294,9 @@ IN: bootstrap.x86
 
 ! Contexts
 : jit-switch-context ( reg -- )
-    ! Reset return value since its bogus right now, to avoid
-    ! confusing the GC
-    ESP -4 [+] 0 MOV
+    ! Push a bogus return address so the GC can track this frame back
+    ! to the owner
+    0 CALL
 
     ! Make the new context the current one
     ctx-reg swap MOV
index 8367b54ae48bf30f21cda1a10d6f6034fc42e0f8..047d15654bd9d70e028af73ffe124574530a7db8 100755 (executable)
@@ -263,9 +263,9 @@ IN: bootstrap.x86
 
 ! Contexts
 : jit-switch-context ( reg -- )
-    ! Reset return value since its bogus right now, to avoid
-    ! confusing the GC
-    RSP -8 [+] 0 MOV
+    ! Push a bogus return address so the GC can track this frame back
+    ! to the owner
+    0 CALL
 
     ! Make the new context the current one
     ctx-reg swap MOV