commit 536e3bcfc9b217230bb8b08b2c72ec3fc47532d6
parent ad31ee94e49c3e91e5d2275918fa802707b5d63b
Author: Alexander Burger <abu@software-lab.de>
Date: Thu, 13 Jun 2013 20:43:47 +0200
Bug in coroutine file contexts (wasn't 'cutLocalCX' / 'joinLocalCX')
Diffstat:
M | lib/map | | | 22 | +++++++++++----------- |
M | src64/flow.l | | | 48 | +++++++++++++++++++++++++++++++++++------------- |
M | src64/tags | | | 34 | +++++++++++++++++----------------- |
3 files changed, 63 insertions(+), 41 deletions(-)
diff --git a/lib/map b/lib/map
@@ -1,5 +1,5 @@
-! (2886 . "@src64/flow.l")
-$ (2988 . "@src64/flow.l")
+! (2908 . "@src64/flow.l")
+$ (3010 . "@src64/flow.l")
% (2572 . "@src64/big.l")
& (2807 . "@src64/big.l")
* (2389 . "@src64/big.l")
@@ -46,7 +46,7 @@ bool (1724 . "@src64/flow.l")
box (828 . "@src64/flow.l")
box? (1131 . "@src64/sym.l")
by (1669 . "@src64/apply.l")
-bye (3436 . "@src64/flow.l")
+bye (3458 . "@src64/flow.l")
bytes (2973 . "@src64/subr.l")
caaaar (271 . "@src64/subr.l")
caaadr (288 . "@src64/subr.l")
@@ -62,7 +62,7 @@ caddar (409 . "@src64/subr.l")
cadddr (435 . "@src64/subr.l")
caddr (156 . "@src64/subr.l")
cadr (45 . "@src64/subr.l")
-call (3088 . "@src64/flow.l")
+call (3110 . "@src64/flow.l")
car (5 . "@src64/subr.l")
case (1965 . "@src64/flow.l")
catch (2467 . "@src64/flow.l")
@@ -115,7 +115,7 @@ diff (2590 . "@src64/subr.l")
dir (3154 . "@src64/main.l")
dm (545 . "@src64/flow.l")
do (2141 . "@src64/flow.l")
-e (2949 . "@src64/flow.l")
+e (2971 . "@src64/flow.l")
echo (4434 . "@src64/io.l")
env (609 . "@src64/main.l")
eof (3549 . "@src64/io.l")
@@ -141,7 +141,7 @@ flip (1700 . "@src64/subr.l")
flush (5143 . "@src64/io.l")
fold (3521 . "@src64/sym.l")
for (2230 . "@src64/flow.l")
-fork (3262 . "@src64/flow.l")
+fork (3284 . "@src64/flow.l")
format (2089 . "@src64/big.l")
free (1960 . "@src64/db.l")
from (3568 . "@src64/io.l")
@@ -169,12 +169,12 @@ inc (2256 . "@src64/big.l")
index (2638 . "@src64/subr.l")
info (3056 . "@src64/main.l")
intern (1007 . "@src64/sym.l")
-ipid (3207 . "@src64/flow.l")
+ipid (3229 . "@src64/flow.l")
isa (967 . "@src64/flow.l")
job (1429 . "@src64/flow.l")
journal (971 . "@src64/db.l")
key (3401 . "@src64/io.l")
-kill (3239 . "@src64/flow.l")
+kill (3261 . "@src64/flow.l")
last (2045 . "@src64/subr.l")
le0 (2693 . "@src64/big.l")
length (2742 . "@src64/subr.l")
@@ -239,7 +239,7 @@ on (1717 . "@src64/sym.l")
onOff (1747 . "@src64/sym.l")
one (1780 . "@src64/sym.l")
open (4360 . "@src64/io.l")
-opid (3223 . "@src64/flow.l")
+opid (3245 . "@src64/flow.l")
opt (3345 . "@src64/main.l")
or (1640 . "@src64/flow.l")
out (4236 . "@src64/io.l")
@@ -324,7 +324,7 @@ tail (1912 . "@src64/subr.l")
tell (3285 . "@src64/io.l")
text (1407 . "@src64/sym.l")
throw (2493 . "@src64/flow.l")
-tick (3175 . "@src64/flow.l")
+tick (3197 . "@src64/flow.l")
till (3635 . "@src64/io.l")
time (2861 . "@src64/main.l")
touch (1181 . "@src64/sym.l")
@@ -352,7 +352,7 @@ wr (5268 . "@src64/io.l")
xchg (1672 . "@src64/sym.l")
xor (1701 . "@src64/flow.l")
x| (2887 . "@src64/big.l")
-yield (2741 . "@src64/flow.l")
+yield (2752 . "@src64/flow.l")
yoke (1197 . "@src64/subr.l")
zap (1195 . "@src64/sym.l")
zero (1765 . "@src64/sym.l")
diff --git a/src64/flow.l b/src64/flow.l
@@ -1,4 +1,4 @@
-# 11jun13abu
+# 13jun13abu
# (c) Software Lab. Alexander Burger
(code 'redefMsgEC)
@@ -2609,18 +2609,29 @@
loop
ld (EnvBind) C # Set local bindings
ld X EnvInFrames # Pointer to input frames
- do
- null (X) # More locals?
- while nz # Yes
- ld X (X) # Next frame pointer
- loop
+ null (X) # Any locals?
+ if z # No
+ ld (Chr) (Z (pack III "+(Chr-EnvCo)")) # Adapt In
+ ld (Get_A) (Z (pack III "+(Get_A-EnvCo)"))
+ ld (InFile) (Z (pack III "+(InFile-EnvCo)"))
+ else
+ do
+ ld X (X) # Next frame pointer
+ null (X) # More locals?
+ until z # No
+ end
ld (X) (Z (pack III "+(EnvInFrames-EnvCo)")) # Join
ld X EnvOutFrames # Pointer to output frames
- do
- null (X) # More locals?
- while nz # Yes
- ld X (X) # Next frame pointer
- loop
+ null (X) # Any locals?
+ if z # No
+ ld (PutB) (Z (pack III "+(PutB-EnvCo)")) # Adapt Out
+ ld (OutFile) (Z (pack III "+(OutFile-EnvCo)"))
+ else
+ do
+ ld X (X) # Next frame pointer
+ null (X) # More locals?
+ until z # No
+ end
ld (X) (Z (pack III "+(EnvOutFrames-EnvCo)")) # Join
ld X EnvApply # Local apply stack
do
@@ -2688,7 +2699,7 @@
link
prog X # Run 'prg'
ld S (EnvCo7) # Not yielded: Restore stack pointer
- load (EnvCo) (EnvMid) (S III) # Restore environment
+ load (Env) (EnvMid) (S (pack III "+(Env-EnvCo)")) # Restore environment
pop (EnvCo7) # Restore coroutine link
pop (StkLimit) # 'lim'
ld (Y -I) 0 # Mark segment as unused
@@ -2855,8 +2866,19 @@
save (EnvCo) (EnvMid) (X (pack -II "-(EnvMid-EnvCo)")) # Save environment
null Y # Target coroutine?
if z # No
+ null (EnvInFrames) # Adapt In?
+ if nz # Yes
+ ld (Chr) (Z (pack III "+(Chr-EnvCo)"))
+ ld (Get_A) (Z (pack III "+(Get_A-EnvCo)"))
+ ld (InFile) (Z (pack III "+(InFile-EnvCo)"))
+ end
+ null (EnvOutFrames) # Adapt Out?
+ if nz # Yes
+ ld (PutB) (Z (pack III "+(PutB-EnvCo)"))
+ ld (OutFile) (Z (pack III "+(OutFile-EnvCo)"))
+ end
ld S Z # Set stack pointer
- load (EnvCo) (EnvMid) (Z III) # Restore environment
+ load (Env) (EnvMid) (Z (pack III "+(Env-EnvCo)")) # Restore environment
pop (EnvCo7) # Restore coroutine link
pop (StkLimit) # 'lim'
add S (pack I "+(EnvMid-EnvCo)") # Clean up
diff --git a/src64/tags b/src64/tags
@@ -1108,23 +1108,23 @@ sys/x86-64.linux.defs.l,1959
doFinally2524,58583
doCo2548,59123
resumeCoroutine2576,60042
-doYield2741,65579
-closeCoFilesC2872,69097
-doBreak2886,69360
-brkLoadE_E2894,69512
-doE2949,71112
-doTrace2988,71878
-traceCY3060,73793
-doCall3088,74281
-doTick3175,76473
-doIpid3207,77470
-doOpid3223,77758
-doKill3239,78053
-doFork3262,78488
-forkLispX_FE3275,78709
-doBye3436,83269
-byeE3448,83441
-finishE3460,83752
+doYield2752,66117
+closeCoFilesC2894,70051
+doBreak2908,70314
+brkLoadE_E2916,70466
+doE2971,72066
+doTrace3010,72832
+traceCY3082,74747
+doCall3110,75235
+doTick3197,77427
+doIpid3229,78424
+doOpid3245,78712
+doKill3261,79007
+doFork3284,79442
+forkLispX_FE3297,79663
+doBye3458,84223
+byeE3470,84395
+finishE3482,84706
./subr.l,2147
doCar5,71