picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit d57a1f04854ce1e4f7e555685c31088e18eede90
parent 6cc549a08e7809ae3d2a04210346598720e5d76e
Author: Alexander Burger <abu@software-lab.de>
Date:   Tue, 11 Jun 2013 17:06:54 +0200

cutLocalCX, joinLocalCX inline
Diffstat:
Mlib/map | 22+++++++++++-----------
Msrc64/flow.l | 62+++++++++++++++++++++++++++++++++++++-------------------------
Msrc64/tags | 38++++++++++++++++++--------------------
3 files changed, 66 insertions(+), 56 deletions(-)

diff --git a/lib/map b/lib/map @@ -1,5 +1,5 @@ -! (2880 . "@src64/flow.l") -$ (2982 . "@src64/flow.l") +! (2892 . "@src64/flow.l") +$ (2994 . "@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 (3430 . "@src64/flow.l") +bye (3442 . "@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 (3082 . "@src64/flow.l") +call (3094 . "@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 (2943 . "@src64/flow.l") +e (2955 . "@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 (3256 . "@src64/flow.l") +fork (3268 . "@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 (3201 . "@src64/flow.l") +ipid (3213 . "@src64/flow.l") isa (967 . "@src64/flow.l") job (1429 . "@src64/flow.l") journal (971 . "@src64/db.l") key (3401 . "@src64/io.l") -kill (3233 . "@src64/flow.l") +kill (3245 . "@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 (3217 . "@src64/flow.l") +opid (3229 . "@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 (3169 . "@src64/flow.l") +tick (3181 . "@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 (2729 . "@src64/flow.l") +yield (2744 . "@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 @@ -2582,7 +2582,12 @@ load (EnvCo) (EnvMid) (Y (pack -II "-(EnvMid-EnvCo)")) # Restore environment ld X Catch # Pointer to catch frames ld C (Z (pack III "+(Catch-EnvCo)")) # Local catch frames - call joinLocalCX # Join locals + do + null (X) # More locals? + while nz # Yes + ld X (X) # Next frame pointer + loop + ld (X) C # Join ld X (EnvBind) # Reversed bindings ld C (Z (pack III "+(EnvBind-EnvCo)")) # Main bindings do @@ -2606,10 +2611,20 @@ ld (EnvBind) C # Set local bindings ld X EnvInFrames # Pointer to input frames ld C (Z (pack III "+(EnvInFrames-EnvCo)")) # Local input frames - call joinLocalCX # Join locals + do + null (X) # More locals? + while nz # Yes + ld X (X) # Next frame pointer + loop + ld (X) C # Join ld X EnvOutFrames # Pointer to output frames ld C (Z (pack III "+(EnvOutFrames-EnvCo)")) # Local output frames - call joinLocalCX # Join locals + do + null (X) # More locals? + while nz # Yes + ld X (X) # Next frame pointer + loop + ld (X) C # Join ld X EnvApply # Local apply stack do null (X) # Any? @@ -2777,7 +2792,7 @@ jz 10 # No cmp A C # Reached main routine's link? while ne # No - ld X A # Follow link + ld X (A) # Follow link loop ld (X) 0 # Clear link end @@ -2794,10 +2809,20 @@ ld (X) 0 # Cut off ld X EnvOutFrames # Pointer to output frames ld C (Z (pack III "+(EnvOutFrames-EnvCo)")) # Local output frames - call cutLocalCX # Cut off locals + do + cmp C (X) # More locals? + while ne # Yes + ld X (X) # Next frame pointer + loop + ld (X) 0 # Cut off ld X EnvInFrames # Pointer to input frames ld C (Z (pack III "+(EnvInFrames-EnvCo)")) # Local input frames - call cutLocalCX # Cut off locals + do + cmp C (X) # More locals? + while ne # Yes + ld X (X) # Next frame pointer + loop + ld (X) 0 # Cut off ld C 0 # Back link ld X (EnvBind) # Reverse bindings null X # Any? @@ -2824,7 +2849,12 @@ ld (EnvBind) C # Store back link in coroutine's env ld X Catch # Pointer to catch frames ld C (Z (pack III "+(Catch-EnvCo)")) # Local catch frames - call cutLocalCX # Cut off locals + do + cmp C (X) # More locals? + while ne # Yes + ld X (X) # Next frame pointer + loop + ld (X) 0 # Cut off pop Y # Restore taget coroutine ld X (Z II) # Get 'seg' ld (X -II) S # Save stack pointer @@ -2845,24 +2875,6 @@ ld (Z II) Y # Set new 'seg' jmp resumeCoroutine # Resume -(code 'cutLocalCX 0) - do - cmp C (X) # More locals? - while ne # Yes - ld X (X) # Next frame pointer - loop - ld (X) 0 # Cut off - ret - -(code 'joinLocalCX 0) - do - null (X) # More locals? - while nz # Yes - ld X (X) # Next frame pointer - loop - ld (X) C # Join - ret - (code 'closeCoFilesC 0) do null C diff --git a/src64/tags b/src64/tags @@ -1040,7 +1040,7 @@ sys/x86-64.linux.defs.l,1959 consNumEA_E1037,24008 consNumEC_E1055,24384 -./flow.l,1658 +./flow.l,1611 redefMsgEC4,51 putSrcEC_E25,589 redefineCE109,3406 @@ -1108,25 +1108,23 @@ sys/x86-64.linux.defs.l,1959 doFinally2524,58583 doCo2548,59123 resumeCoroutine2576,60042 -doYield2729,65274 -cutLocalCX2848,68623 -joinLocalCX2857,68777 -closeCoFilesC2866,68928 -doBreak2880,69191 -brkLoadE_E2888,69343 -doE2943,70943 -doTrace2982,71709 -traceCY3054,73624 -doCall3082,74112 -doTick3169,76304 -doIpid3201,77301 -doOpid3217,77589 -doKill3233,77884 -doFork3256,78319 -forkLispX_FE3269,78540 -doBye3430,83100 -byeE3442,83272 -finishE3454,83583 +doYield2744,65712 +closeCoFilesC2878,69327 +doBreak2892,69590 +brkLoadE_E2900,69742 +doE2955,71342 +doTrace2994,72108 +traceCY3066,74023 +doCall3094,74511 +doTick3181,76703 +doIpid3213,77700 +doOpid3229,77988 +doKill3245,78283 +doFork3268,78718 +forkLispX_FE3281,78939 +doBye3442,83499 +byeE3454,83671 +finishE3466,83982 ./subr.l,2147 doCar5,71