From ee656387eaae7c0e8a32e5b61728474d73dca73c Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 30 Nov 2011 12:52:06 -0800 Subject: [PATCH] cpu.*.bootstrap: return address for (set-context) 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 | 6 +++--- basis/cpu/x86/64/bootstrap.factor | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index 268597d41e..03a39715d4 100755 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -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 diff --git a/basis/cpu/x86/64/bootstrap.factor b/basis/cpu/x86/64/bootstrap.factor index 8367b54ae4..047d15654b 100755 --- a/basis/cpu/x86/64/bootstrap.factor +++ b/basis/cpu/x86/64/bootstrap.factor @@ -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