(FILECREATED "11-AUG-83 22:23:03" <BLISP>BYTECOMPILER.;31 156171 changes to: (FNS SCANOPT) previous date: "22-JUL-83 12:55:12" <BLISP>BYTECOMPILER.;30) (* Copyright (c) 1981, 1982, 1983 by Xerox Corporation) (PRETTYCOMPRINT BYTECOMPILERCOMS) (RPAQQ BYTECOMPILERCOMS [(* THE BYTE LISP COMPILER) (COMS (FNS BYTEBLOCKCOMPILE2 BYTECOMPILE2 MC1 MC2 COMPERROR COMPPRINT COMPERRM) (FNS MC2A BINDLIS CKVAR BINDVARS UNBINDVARS) (FNS CVALN CPROGN DELPOPP CEXP1 CEXPR TRYCUSERFN CUSERFN CCONST CCALL CVAR CVAL1 CPROG1 CEFFECT CVAL CMAC) (FNS VARTYPE LOOKUPVAR LOOKUPCONST) (FNS COMP.ST COMP.STFN COMP.STCONST COMP.STVAR COMP.STPOP COMP.DELFN COMP.STRETURN COMP.STTAG COMP.STJUMP COMP.STSETQ COMP.STCOPY COMP.DELPUSH COMP.DELPOP COMP.STBIND COMP.STUNBIND) (FNS ATYP CLEANEXPP CLEANFNP CLEANFNOP GLOBALVARP LINKCALLP ANONP) (FNS CPI CPI1 PICOUNT) (PROP BYTEMACRO EVQ) (FNS CEVQ) (PROP BYTEMACRO AND OR) (FNS CBOOL) (FNS APFNP) (PROP BYTEMACRO AC ASSEMBLE ASSEM FLOC) (FNS CAC PUNT) (PROP BYTEMACRO FUNCTION) (FNS CFUNCTION CLAM1 GENFN) (PROP BYTEMACRO COND SELECTQ) (FNS CCOND CSELECTQ) (PROP BYTEMACRO PROGN PROG1) (PROP BYTEMACRO QUOTE *) (FNS CQUOTE CCOMMENT) (PROP BYTEMACRO DECLARE) (FNS CDECLARE CDECLARE1) (PROP (BYTEMACRO CROPS) * MCROPS) (FNS CCROP COMP.STCROP) (PROP BYTEMACRO NOT NULL) (FNS CNOT) (PROP BYTEMACRO SETQ SETN) (FNS CSETQ CSETN) (FNS CLAM) (PROP BYTEMACRO PROG GO RETURN) (FNS CPROG CGO CRETURN) (VARS NUMBERFNS (GLOBALVARFLG T) (NEWOPTFLG) (COMPVERSION (DATE))) (PROP BYTEMACRO IPLUS ITIMES LOGOR LOGXOR LOGAND IDIFFERENCE IQUOTIENT IREMAINDER IMINUS LSH LLSH RSH LRSH FIX PLUS DIFFERENCE TIMES QUOTIENT FPLUS FDIFFERENCE FTIMES FQUOTIENT) (FNS CNUMBER CNCALL CFIX STFIX DELFIX) (PROP BYTEMACRO EQ EQUAL EQP) (FNS CEQ) (PROP BYTEMACRO .TEST.) (FNS CNTEST) (PROP BYTEMACRO * MAPFNS) (PROP BYTEMACRO .DOCOLLECT. .DOJOIN.) (FNS CMAPC) (PROP BYTEMACRO LISPXWATCH) (PROP BYTEMACRO FETCHFIELD REPLACEFIELD FFETCHFIELD FREPLACEFIELD REPLACEFIELDVAL FREPLACEFIELDVAL) (PROP BYTEMACRO GETPROP) (PROP BYTEMACRO BLKAPPLY BLKAPPLY*) (PROP BYTEMACRO ADD1VAR SUB1VAR KWOTE FRPLNODE RPLNODE LISTGET1 FRPLNODE2) (PROP BYTEMACRO JSYS) (PROP BYTEMACRO EQMEMB MKLIST) [COMS (* Pass 1 listing) (FNS MLLIST MLL MLLVAR LCASE MLLFN) (VARS COPS) (IFPROP MLSYM * (PROGN COPS)) (BLOCKS (MLL MLL MLLFN (NOLINKFNS . T] [COMS (* ARJ - JUMP LENGTH RESOLVER) (FNS RESOLVEJUMPS JLENPASS JFIXPASS JSIZE) (BLOCKS (RESOLVEJUMPS RESOLVEJUMPS JLENPASS JFIXPASS (NOLINKFNS . T] (COMS (* utilities used by all files) (FNS CALLP JUMPCHECK DREV CHLEV CHECKTAG NOTJUMP INITHASH COMPINIT)) (P (MOVD? (QUOTE NILL) (QUOTE REFRAME)) (AND (GETD (QUOTE COMPINIT)) (COMPINIT))) (PROP BYTEMACRO LOADTIMECONSTANT) (PROP BYTEMACRO FRPTQ) (FNS CFRPTQ) (BLOCKS (BYTECOMPBLOCK ANONP APFNP ATYP BINDLIS BINDVARS BYTEBLOCKCOMPILE2 BYTECOMPILE2 CAC CBOOL CCALL CCOMMENT CCOND CCONST CCROP CDECLARE CDECLARE1 CEFFECT CEQ CEXP1 CEXPR CFRPTQ CFUNCTION CGO CKVAR CLAM CLAM1 CMAC CMAPC CNCALL CNOT CNTEST CNUMBER CPI CPI1 CPROG CPROG1 CPROGN CQUOTE CRETURN CSELECTQ CSETN CSETQ CVAL CVAL1 CVALN CVAR DELPOPP GENFN LOOKUPVAR MC1 MC2 MC2A PICOUNT TRYCUSERFN UNBINDVARS VARTYPE (ENTRIES BYTEBLOCKCOMPILE2 BYTECOMPILE2 CVAL1 CVAL CEFFECT CEXPR CEXP1 CLAM1 CCALL LOOKUPVAR CCONST CPROGN) (BLKAPPLYFNS CAC CBOOL CCOMMENT CCOND CCROP CDECLARE CEQ CEXP1 CEXPR CFUNCTION CGO CLAM1 CMAPC CNCALL CNOT CNTEST CNUMBER CPROG CPROG1 CPROGN CQUOTE CRETURN CSELECTQ CSETN CSETQ CFRPTQ) (SPECVARS AC ALAMS1 ALLVARS ARGS ARGVARS BLKDEFS BLKFLG CODE COMFN COMFNS COMTYPE CONSTS EFF EMFLAG EXP FRAME FREELST FREEVARS LAPFLG LBCNT LEVEL LOCALVARS LOCALVARS LSTFIL MACEXP NLAMS1 PIFN PREDF PROGEFF PROGRETF RETF RETURNLABEL SPECVARS SPECVARS SUBFNFREEVARS TAGS TOPFN TOPFRAME TOPLAB VARS INTERNALBLKFNS) (RETFNS CVAR MC2) (NOLINKFNS COMPPRINT COMPERRM)) (NIL CUSERFN COMPERRM (SPECVARS PLVLFILEFLG))) (PROP BYTEMACRO IMAX2 IMIN2)) (ADDVARS (COMPILETYPELST)) (COMS * POSTOPTCOMS) (COMS (* CONSISTENCY CHECKS) (DECLARE: EVAL@COMPILE DONTCOPY (MACROS CCHECK) (VARS (COMPILECOMPILERCHECKS NIL))) (FNS COMPILERERROR OPTCHECK CCHECK)) (DECLARE: EVAL@COMPILE DONTCOPY (ALISTS (PRETTYPRINTMACROS CW CWN)) (TEMPLATES CW CWN) (MACROS CW CWN) (ADDVARS (NLAML CW))) (GLOBALVARS ALAMS BLKLIBRARY BYTE.EXT BYTEASSEMFN BYTECOMPFLG COMPILERMACROPROPS CIA CLEANFNLIST COMP.SCRATCH COMPILETYPELST COMPILEUSERFN COMPSTATLST COMPSTATS CONDITIONALS CONST.FNS CONSTOPS DONOTHING FILERDTBL FNA FORSHALLOW FRA GLOBALVARS HEADERBYTES HOKEYDEFPROP LAMBDANOBIND LAMS LBA LEVELARRAY LINKEDFNS LINKFNS LOADTIMECONSTANT MAXBNILS MAXBVALS MCONSTOPS MERGEFRAMEFLG MERGEFRAMEMAX MERGEFRAMETYPES MOPARRAY MOPCODES NLAMA NLAML NODARR NOLINKFNS NOSTATSFLG NUMBERFNS OPCOPY OPNIL OPPOP OPRETURN PRA SELECTQFMEMB SELECTVARTYPES STATAR STATMAX STATN SYSSPECVARS UNIQUE#ARRAY VCA VCONDITIONALS VREFFRA COUTFILE XVARFLG MERGEFRAMEFLG OPTIMIZATIONSOFF NOFREEVARSFNS EQCONSTFN MERGEUNBINDFLG NEWOPTFLG) (DECLARE: DONTCOPY (* for compiling compiler) EVAL@COMPILE (RECORDS CODELST) (PROP MACRO OASSOC) (RECORDS OP JUMP TAG VAR) (RECORDS FRAME COMINFO COMP JD)) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML INITHASH) (LAMA]) (* THE BYTE LISP COMPILER) (DEFINEQ (BYTEBLOCKCOMPILE2 [LAMBDA (BLKNAME BLKDEFS ENTRIES) (* lmm "13-MAR-81 09:29") (COND [(EQ BYTECOMPFLG (QUOTE NOBLOCK)) (* use PDP-10 compiler for blocks) (RESETVARS (BYTECOMPFLG) (RETURN (BLOCKCOMPILE2 BLKNAME BLKDEFS ENTRIES] (T (PROG [(BLKFLG T) (INTERNALBLKFNS (AND (NEQ BYTECOMPFLG (QUOTE RETRY)) (for X in BLKDEFS when (NOT (OR (FMEMB (CAR X) ENTRIES) (EQ (CAR X) BLKNAME) (FMEMB (CAR X) RETFNS) (AND (LISTP NOLINKFNS) (FMEMB (CAR X) NOLINKFNS)) (FMEMB (CAR X) BLKAPPLYFNS))) collect (CONS (CAR X) (PACK* (QUOTE \) BLKNAME (QUOTE /) (CAR X] (* this is a dummy block compiler) (RETURN (MAPCONC BLKDEFS (FUNCTION (LAMBDA (X) (PROG1 (MC1 (OR (CDR (FASSOC (CAR X) INTERNALBLKFNS)) (CAR X)) (CADDR X) (CAR X)) (* The FRPLACA allows the function definitions to be reclaimed. This is written to parallel BLOCKCOMPILE2 which needs the list of BLKDEFS for something. - rrb) (FRPLACA (CDDR X) (LIST (CAR (CADDR X)) (CADR (CADDR X]) (BYTECOMPILE2 [LAMBDA (FN DEF) (* lmm: " 5-AUG-76 15:52:02") (PROG ((BLKFLG NIL)) (MC1 FN DEF) (RETURN FN]) (MC1 [LAMBDA (TOPFN DEF RECNAME) (* lmm "13-MAR-81 09:29") (PROG ((EMFLAG TOPFN) COMFNS FLG SUBFNFREEVARS) (CW compile attempt) (SETQ FLG (MC2 TOPFN DEF RECNAME)) [COND ((NULL EMFLAG) (LISPXPRIN1 (QUOTE "----- ") T) (COND ((NEQ COUTFILE T) (LISPXPRIN1 (QUOTE "----- ") COUTFILE] (COND (FLG (CW compile succeed) (RETURN COMFNS)) ((AND (GETD (QUOTE COMPILE2)) (NEQ BYTECOMPFLG T)) (CW retry with COMPILE2) (LISPXPRINT (CONS TOPFN (QUOTE (-- retrying with PDP-10 compiler))) T T) [COND (BLKFLG (OR (EQ SPECVARS T) (EVAL (CONS (QUOTE SPECVARS) LOCALFREEVARS] (RETURN (COMPILE2 TOPFN DEF))) (T (LISPXPRINT [LIST (CONS TOPFN (QUOTE (not compiled] T T) (RETURN]) (MC2 [LAMBDA (COMFN DEF RECNAME) (* lmm "13-MAR-81 09:29") (PROG ((LBCNT 0)) (* This is the RETFROM point in case of an error while compiling COMFN or any of its generated subfunctions.) (fetch (COMP CLEAR) of T) (* CLEAR is an accessfn which clears all of the hash tables used by any HASHLINK field in the compiler; done this way so that the program need not know which hash tables are used) (RETURN (PROG1 (MC2A COMFN DEF RECNAME) (fetch (COMP CLEAR) of T]) (COMPERROR [LAMBDA (X) (* lmm: "20-JUL-76 16:35:59") (AND X (COMPERRM X)) (RETFROM (QUOTE MC2) NIL]) (COMPPRINT [LAMBDA (X) (* wt: " 9-JUL-79 21:09") (* A separate function so it can be broken or advised) (PRINT X COUTFILE T]) (COMPERRM [LAMBDA (X FL) (* rrb "22-JUL-83 12:54") (AND (NULL FL) (SETQ FL COUTFILE)) (COND (EMFLAG (LISPXTAB 0 0 FL) (LISPXPRIN1 (QUOTE "-----In ") FL) (LISPXPRIN2 EMFLAG FL T) (LISPXPRINT (QUOTE :) FL))) [COND (X (LISPXPRIN1 (QUOTE *****) FL T) (PROG ((PLVLFILEFLG T)) (RESETFORM (PRINTLEVEL 2 20) (LISPXPRINT X FL T] (COND ((NEQ FL T) (* so message gets printed in both places) (COMPERRM X T))) (SETQ EMFLAG NIL]) ) (DEFINEQ (MC2A [LAMBDA (COMFN DEF RECNAME) (* lmm "16-APR-82 00:29") (PROG (ALAMS1 NLAMS1 CONSTS ALLVARS ARGVARS ARGS COMTYPE CODE FREEVARS CI (LEVEL 0) FRAME PIFN TOPLAB (LOCALVARS LOCALVARS) (SPECVARS SPECVARS) TOPFRAME MACEXP AC FRELST) [COND ((SETQ PIFN (GETP COMFN HOKEYDEFPROP)) (CW use hokey definition) (SETQ DEF (COND [(EQ PIFN T) (LIST (CAR DEF) (CADR DEF) (QUOTE (DECLARE (LOCALVARS . T))) (CONS COMFN (CADR DEF] (T PIFN] (* * Set COMTYPE {= ARGTYPE of DEF} and ARGS) RETRY [OR [AND (LISTP DEF) (LISTP (CDR DEF)) (SETQ COMTYPE (COND [(OR (LISTP (SETQ ARGS (CADR DEF))) (NULL ARGS)) (SELECTQ (CAR DEF) [NLAMBDA 1] [LAMBDA 0] (COND ((AND COMPILEUSERFN (SETQ DEF (APPLY* COMPILEUSERFN NIL DEF))) (GO RETRY] (T (COND ((AND LAMBDANOBIND (EQ ARGS (QUOTE NOBIND))) (SETQ ARGS NIL) 2) (T (SETQ ARGS (LIST ARGS)) (SELECTQ (CAR DEF) [LAMBDA 2] [NLAMBDA 3] (COND ((AND COMPILEUSERFN (SETQ DEF (APPLY* COMPILEUSERFN NIL DEF) )) (GO RETRY] (COMPERROR (CONS COMFN (QUOTE (not compilable] (SETQ PIFN (COND ((EQ PIFN T) (* compile as call to self) 0) ((GETPROP COMFN OPCODEPROP) 0) ((EQ 0 COMTYPE) (OR RECNAME COMFN)) (T 0))) (SETQ FRAME (SETQ TOPFRAME (create FRAME VARS ←(SETQ ARGVARS (SETQ ALLVARS (BINDLIS ARGS))) NNILS ← 0))) (COMP.STTAG (SETQ TOPLAB (create TAG))) (CVALN (CDDR DEF) NIL T) (UNBINDVARS TOPFRAME T) (SETQ CI (create COMINFO COMTYPE ← COMTYPE CODE ←(POSTOPT CODE) TOPFRAME ← TOPFRAME ARGS ← ARGVARS)) [COMPPRINT (CONS COMFN (CONS (CADR DEF) (NCONC (AND (SETQ FREELST (for X in FREEVARS when (EQ (fetch OPNAME of X) (QUOTE FVAR)) collect (fetch OPARG of X))) (LIST (CONS (QUOTE uses:) FREELST))) [COND ([SETQ ALAMS1 (SUBSET ALAMS1 (FUNCTION (LAMBDA (X) (NOT (GETPROP X OPCODEPROP] (LIST (CONS (QUOTE calls:) ALAMS1] (COND (NLAMS1 (LIST (CONS (QUOTE nlams:) NLAMS1] (SELECTQ LAPFLG ((1 T) (RESETFORM (OUTPUT LSTFIL) (MLLIST COMFN CI))) NIL) (* ASSERT: (CALLS: MASSEM)) (APPLY* BYTEASSEMFN COMFN CI) [COND ((NEQ COMFN TOPFN) (CW generated subfunction) (SETQ SUBFNFREEVARS (APPEND SUBFNFREEVARS FREELST] (SETQ COMFNS (CONS COMFN COMFNS)) (RETURN COMFN]) (BINDLIS [LAMBDA (VARS) (* lmm: "25-OCT-76 17:37:57") (MAPCAR VARS (FUNCTION (LAMBDA (VAR) (create VAR VARNAME ←(CKVAR VAR T) VARTYPE ←(VARTYPE VAR]) (CKVAR [LAMBDA (X BIND) (* lmm: "25-OCT-76 17:35:20") [AND BIND (GLOBALVARP X) (COND [(NOT FORSHALLOW) (COMPERRM (CONS X (QUOTE (- is global] (T (SETQ SPECVARS (CONS X SPECVARS] (OR (AND (LITATOM X) (NEQ X T) X) (COMPERROR (CONS X (QUOTE (is not a legal variable name]) (BINDVARS [LAMBDA (ARGS VALS TYPE) (* lmm "16-APR-82 00:28") (PROG (VLV VLN NVALS NNILS) ALP [COND [(NULL ARGS) (COND (VALS (CW extra values to open lambda) (CEFFECT (CAR VALS))) (T (SETQ NNILS (LENGTH VLN)) [COND ((IGREATERP (SETQ NVALS (LENGTH VLV)) MAXBVALS) (COMPERROR (CONS EXP (QUOTE (-- too many variables with values] (RETURN (create FRAME PARENT ← FRAME NVALS ←(LENGTH VLV) VARS ←(BINDLIS (DREV VLV (DREV VLN))) FRAMETYPE ← TYPE NNILS ← NNILS] ([OR (NULL (CAR VALS)) (PROGN (CVAL (CAR VALS)) (COND ((EQ (CAR CODE) OPNIL) (CW prog var value is NIL) (COMP.DELPUSH) T] (SETQ VLN (CONS (CAR ARGS) VLN))) (T (SETQ VLV (CONS (CAR ARGS) VLV] (SETQ ARGS (CDR ARGS)) (SETQ VALS (CDR VALS)) (GO ALP]) (UNBINDVARS [LAMBDA (F FLG) (* lmm "16-APR-82 00:28") (COND ((NOT (OR FLG (AND MERGEUNBINDFLG RETF) (JUMPCHECK CODE))) (CCHECK (EQ F FRAME)) (COMP.STUNBIND EFF) (replace (FRAME PRIMARYRETURN) of (CAR CODE) with T))) (QUOTE NOVALUE]) ) (DEFINEQ (CVALN [LAMBDA (L EFF RETF PREDF) (* lmm: " 9-AUG-76 18:38:04") (CPROGN L]) (CPROGN [LAMBDA (A) (* lmm "16-APR-82 00:28") (COND ((NULL (CDR A)) (CEXP1 (CAR A))) (T (PROG [(FLG (COND ((AND RETF (NOT OPTIMIZATIONSOFF) MERGEUNBINDFLG) (OR (DELPOPP) (CW pop even though higher PROG labels)) T] LP (CEFFECT (CAR A)) (AND FLG (while (EQ (CAR CODE) OPPOP) do (CW delete POP in PROGN) (COMP.DELPOP))) (COND ((JUMPCHECK CODE)) ((CDR (SETQ A (CDR A))) (GO LP)) (T (RETURN (CEXP1 (CAR A]) (DELPOPP [LAMBDA NIL (* DD: "27-Jan-81 02:59") (AND RETF MERGEUNBINDFLG (PROG ((F FRAME)) LP (COND ((EQ F TOPFRAME) (RETURN T)) ((fetch PROGLABELS of F) (RETURN NIL)) (T (SETQ F (fetch PARENT of F)) (GO LP]) (CEXP1 [LAMBDA (E) (CEXPR E EFF RETF PREDF]) (CEXPR [LAMBDA (EXP EFF RETF PREDF) (* bvm: " 6-JAN-83 12:05") (PROG (M V) [COND ((NULL FRAME) (COND [(JUMPCHECK CODE) (RETURN (COND (PREDF (QUOTE PREDVALUE)) (T (QUOTE NOVALUE] (T (COMPILERERROR] TOP [SETQ V (COND [(NLISTP EXP) (COND ((LITATOM EXP) (SELECTQ EXP ((T NIL) (CCONST EXP)) (CVAR EXP))) ([OR (NUMBERP EXP) (PROGN (CW non-quoted string) (OR [NULL (SETQ M (CDR (FASSOC (TYPENAME EXP) COMPILETYPELST] (EQ EXP (SETQ EXP (APPLY* M EXP] (CCONST EXP)) (T (GO TOP] [[NOT (LITATOM (SETQ M (CAR EXP] (SELECTQ (CAR (LISTP M)) ([LAMBDA NLAMBDA OPENLAMBDA] (CLAM M (CDR EXP))) (OPCODES (COMP.STFN (CAR EXP) (for X in (CDR EXP) sum (CVAL X) 1))) (COND ((SETQ M (TRYCUSERFN EXP)) (SETQ EXP M) (GO TOP)) (T (COMPERROR (CONS M (QUOTE (- non-atomic CAR of form] ((AND (SETQ V (GETMACROPROP M COMPILERMACROPROPS)) (NEQ V T)) (CMAC EXP V)) ((AND RETF (EQ M PIFN)) (CPI M (CDR EXP))) ((SETQ V (ATYP M)) (CCALL M (CDR EXP) V)) ((SETQ V (TRYCUSERFN EXP)) (SETQ EXP V) (GO TOP)) (T (CCALL M (CDR EXP] (RETURN (COND (EFF (OR (EQ V (QUOTE NOVALUE)) (COMP.STPOP)) (QUOTE NOVALUE)) (RETF (OR (JUMPCHECK CODE) (COMP.STRETURN)) (QUOTE NOVALUE)) (PREDF (COND ((NEQ V (QUOTE PREDVALUE)) (COMP.STJUMP PREDF))) (QUOTE PREDVALUE]) (TRYCUSERFN [LAMBDA (EXP M) (AND COMPILEUSERFN (COND ((EQ (SETQ M (CUSERFN EXP)) (QUOTE INSTRUCTIONS)) [COMPERRM (CONS EXP (QUOTE (COMPILEUSERFN returned INSTRUCTIONS] NIL) (T M]) (CUSERFN [LAMBDA (X) (* lmm "26-MAY-82 10:10") (COND ((LITATOM X) (OR (AND COMPVARMACROHASH (GETHASH X COMPVARMACROHASH)) X)) (T (PROG [(FN TOPFN) (OTHERVARS (MAPCAR ALLVARS (FUNCTION (LAMBDA (X) (fetch OPARG of X] (DECLARE (SPECVARS FN OTHERVARS)) (* uses FN DEF ARGS OTHERVARS) (RETURN (APPLY* COMPILEUSERFN (CDR X) X]) (CCONST [LAMBDA (X) (* bvm: " 6-JAN-83 12:12") (COND ((AND (NOT OPTIMIZATIONSOFF) EFF) (CW CONST in EFF) (QUOTE NOVALUE)) ((AND (NOT OPTIMIZATIONSOFF) PREDF) (CW CONST in EFF) [AND (SELECTQ (fetch OPNAME of PREDF) (TJUMP X) (NTJUMP (COND (X (COMP.STCONST X) T))) (FJUMP (NOT X)) (NFJUMP (COND ((NOT X) (COMP.STCONST X) T))) (SHOULDNT)) (COMP.STJUMP (QUOTE JUMP) (CAR (fetch OPARG of PREDF)) (CDR (fetch OPARG of PREDF] (QUOTE PREDVALUE)) (T (COMP.STCONST X]) (CCALL [LAMBDA (F A TYP) (* lmm "16-APR-82 00:28") (PROG ((N 0)) (OR (fetch EXTCALL of FRAME) (CLEANFNOP F (QUOTE FREEVARS)) (replace EXTCALL of FRAME with F)) (SELECTQ TYP (3 (* call nlambda by applying with entire arglist as first arg) (pushnew NLAMS1 F) (COMP.STCONST A) (RETURN (COMP.STFN F 1))) (1 (* call NLAMBDA spread merely by not compiling arguments) (pushnew NLAMS1 F)) (NIL (* unknown argtype, assume lambda, but warn user) (pushnew ALAMS1 F)) NIL) LP (COND ((LISTP A) (SELECTQ TYP (1 (COMP.STCONST (CAR A))) (CVAL (CAR A))) (SETQ N (ADD1 N)) (SETQ A (CDR A)) (GO LP)) [A (COMPERROR (CONS A (QUOTE (- unusual CDR arg list] ((OR (NULL TYP) (EQ TYP 2)) (* for LAMBDA* or unknown types, don't remove extra NIL's) (GO ST))) NON (COND ((AND (IGREATERP N 1) (EQ (CAR CODE) OPNIL)) (CW delete NIL before fn call) (COMP.DELPUSH) (SUB1VAR N) (GO NON))) ST (RETURN (COMP.STFN F N]) (CVAR [LAMBDA (VAR) (* lmm "16-APR-82 00:19") (COND (EFF (CW VAR in EFF) (QUOTE NOVALUE)) (T (COMP.STVAR (LOOKUPVAR VAR T]) (CVAL1 [LAMBDA (L EFF RETF PREDF) (* lmm: " 2-AUG-76 03:14:39") (CPROG1 L]) (CPROG1 [LAMBDA (A) (* lmm: " 1-OCT-76 12:46:23") (COND ((NULL (CDR A)) (CEXP1 (CAR A))) (T (PROG1 (CEXPR (CAR A) EFF) (MAPC (CDR A) (FUNCTION CEFFECT]) (CEFFECT [LAMBDA (E) (* lmm "13-MAR-81 09:35") (PROG ((LV LEVEL)) (COND ((JUMPCHECK CODE) (CW code for effect eliminated after JUMP or RETURN) (RETURN)) (T (CCHECK LV))) (RETURN (PROG1 (CEXPR E T) (CCHECK (OR AC (EQ LEVEL LV) (JUMPCHECK CODE]) (CVAL [LAMBDA (X) (* lmm "13-MAR-81 09:36") (PROG ((LV LEVEL)) (COND ((JUMPCHECK CODE) (CW code for value eliminated after JUMP or RETURN) (RETURN))) (RETURN (PROG1 (CEXPR X) (CCHECK (OR (EQ (ADD1 LV) LEVEL) AC (JUMPCHECK CODE]) (CMAC [LAMBDA (EXP MAC) (* lmm "29-OCT-81 09:02") (* ASSERT: (CALLS: CSHIFT CNUMBER CSPREAD CPUSHNILS) (CALLS: CRPLAC CREPLACE CFETCH STCROP CLOC CVAG CFNOPENR CFNCLOSER CBOOL CAPPLY* CAC PUNT CFUNCTION CCOND CSELECTQ CPROGN CPROG1 CQUOTE CCOMMENT CDECLARE CCROP CSETQ CSETN CPROG CGO CRETURN CEQ CNTEST CMAPC MBERSET CMBARG CNUMBER CNCALL)) (COND [(NLISTP MAC) (SELECTQ MAC [T (CW MACRO is T) (CCALL (CAR EXP) (CDR EXP) (ATYP (CAR EXP] (PUNT (PUNT)) (BLKAPPLY* MAC (CDR EXP] (T (SELECTQ (CAR MAC) (APPLY (BLKAPPLY (CADR MAC) (CDR EXP))) [APPLY* (BLKAPPLY (CADR MAC) (CONS (CDR EXP) (CDDR MAC] [= (CW MACRO is =) (CEXP1 (CONS (CDR MAC) (CDR EXP] ([LAMBDA NLAMBDA OPENLAMBDA] (CW LAMBDA macro) (CLAM MAC (CDR EXP))) (PROG ((MACEXP EXP)) (RETURN (COND [(OR (NULL (CAR MAC)) (LISTP (CAR MAC))) (CW expand substitution macro) [COND ([AND (IGREATERP (LENGTH (CDR EXP)) (LENGTH (CAR MAC))) (NOT (CDR (LAST (CAR MAC] (COMPERRM (CONS (CAR EXP) (QUOTE (- warning: too many args for macro] (CPROGN (SUBPAIR (CAR MAC) (CDR EXP) (CDR MAC] [(NEQ (SETQ MAC (APPLY (CONS (QUOTE NLAMBDA) MAC) (CDR EXP))) (QUOTE IGNOREMACRO)) (CW expand computed macro) (COND [(EQ MAC (QUOTE INSTRUCTIONS)) (COMPERROR (CONS EXP (QUOTE (returned INSTRUCTIONS] (T (CEXP1 MAC] (T (CW computed macro returns IGNOREMACRO) (CCALL (CAR EXP) (CDR EXP) (ATYP (CAR EXP]) ) (DEFINEQ (VARTYPE [LAMBDA (VAR) (* lmm "13-MAR-81 09:36") (CCHECK (AND VAR (LITATOM VAR))) (COND ((ANONP VAR) (QUOTE HVAR)) (T (QUOTE AVAR]) (LOOKUPVAR [LAMBDA (V FLG) (* lmm "13-MAR-81 11:29") (PROG NIL (RETURN (CAR (OR [SOME ALLVARS (FUNCTION (LAMBDA (VAR) (EQ (fetch VARNAME of VAR) V] [SOME FREEVARS (FUNCTION (LAMBDA (VAR) (EQ (fetch VARNAME of VAR) V] (AND FLG (NEQ V (SETQ FLG (CUSERFN V))) (RETAPPLY (QUOTE CVAR) (FUNCTION CVAL) (LIST FLG) T)) (SETQ FREEVARS (CONS (create VAR VARTYPE ←(COND ((AND GLOBALVARFLG (GLOBALVARP V)) (QUOTE GVAR)) (T (QUOTE FVAR))) VARNAME ←(CKVAR V)) FREEVARS]) (LOOKUPCONST [LAMBDA (X) (* lmm "24-JUN-78 22:56") (COND ((NULL X) OPNIL) (T (OR [CAR (SOME CONSTS (FUNCTION (LAMBDA (Y) (EQ X (fetch OPARG of Y] (PROG1 (SETQ X (create OP OPNAME ←(QUOTE CONST) OPARG ← X)) (SETQ CONSTS (NCONC1 CONSTS X]) ) (DEFINEQ (COMP.ST [LAMBDA (X DL) (* lmm "15-JAN-82 14:42") (CCHECK DL) (COND [(OR LEVEL (EQ DL T)) (SETQ CODE (CONS X CODE)) (SETQ LEVEL (COND ((FIXP DL) (IPLUS LEVEL DL] (T (CCHECK (JUMPCHECK CODE)) (CW didn't store code after JUMP or RETURN) NIL]) (COMP.STFN [LAMBDA (FN N) (* lmm "16-APR-82 00:14") (COMP.ST (create OP OPNAME ←(QUOTE FN) OPARG ←(CONS N (OR (AND BLKFLG (LITATOM FN) (CDR (FASSOC FN INTERNALBLKFNS))) FN))) (IDIFFERENCE 1 N]) (COMP.STCONST [LAMBDA (X) (* lmm "16-APR-82 00:14") (COMP.ST (LOOKUPCONST X) 1]) (COMP.STVAR [LAMBDA (VREF) (* lmm "16-APR-82 00:14") (COMP.ST VREF 1]) (COMP.STPOP [LAMBDA (N) (* lmm "16-APR-82 00:14") (RPTQ (OR N 1) (COMP.ST OPPOP -1]) (COMP.DELFN [LAMBDA NIL (* lmm: "22-JUL-77 02:40") [SETQ LEVEL (IPLUS (SUB1 LEVEL) (CAR (fetch OPARG of (CAR CODE] (SETQ CODE (CDR CODE]) (COMP.STRETURN [LAMBDA NIL (* lmm "16-APR-82 00:13") (COMP.ST OPRETURN T) (SETQ LEVEL (SETQ FRAME]) (COMP.STTAG [LAMBDA (TAG) (* lmm "16-APR-82 00:13") (PROG ((NLV (fetch (TAG LEVEL) of TAG)) (NF (fetch (TAG FRAME) of TAG))) (OR (COND [(OR NLV NF) (AND (EQ NLV (OR LEVEL (SETQ LEVEL NLV))) (EQ NF (OR FRAME (SETQ FRAME NF] ((OR LEVEL FRAME) (AND (replace (TAG LEVEL) of TAG with LEVEL) (replace (TAG FRAME) of TAG with FRAME))) (T T)) (COMPILERERROR)) [COND ((AND (EQ (fetch OPNAME of (CAR CODE)) (QUOTE JUMP)) (EQ (fetch (JUMP TAG) of (CAR CODE)) TAG)) (CW delete JUMP to next in COMP.STTAG) (SETQ CODE (CDR CODE] (COMP.ST TAG 0]) (COMP.STJUMP [LAMBDA (OP TAG JT) (* lmm "16-APR-82 00:13") (COND ((JUMPCHECK CODE) (CW JUMP not stored after JUMP or RETURN) NIL) (T [COND ((NULL TAG) (* even if OP is given and in correct format, re-cons it up since POSTOPT might smash it) (SETQ TAG (CAR (fetch OPARG of OP))) (SETQ JT (CDR (fetch OPARG of OP))) (SETQ OP (fetch OPNAME of OP] (COMP.ST (create JUMP OPNAME ← OP TAG ← TAG JT ← JT) 0) (PROG ((F (fetch FRAME of TAG)) (V (fetch (TAG LEVEL) of TAG)) NV) (COND (F (CCHECK (EQ F FRAME))) (T (replace (TAG FRAME) of TAG with FRAME))) (SETQ NV (SELECTQ OP [JUMP (PROG1 LEVEL (SETQ FRAME (SETQ LEVEL] ((FJUMP TJUMP) (SETQ LEVEL (SUB1 LEVEL))) [(NFJUMP NTJUMP) (PROG1 LEVEL (SETQ LEVEL (SUB1 LEVEL] (ERRORSET (PROG1 (SUB1 LEVEL) (SETQ FRAME JT) (SETQ LEVEL 0))) (COMPILERERROR))) (CCHECK (OR (NULL NV) (IGEQ NV 0))) (CCHECK (OR (NULL LEVEL) (IGEQ LEVEL 0))) (COND (V (CCHECK (EQ V NV))) (T (replace (TAG LEVEL) of TAG with NV]) (COMP.STSETQ [LAMBDA (VREF) (* lmm "16-APR-82 00:14") (CCHECK (IGREATERP LEVEL 0)) (COMP.ST (create OP OPNAME ←(QUOTE SETQ) OPARG ← VREF) 0]) (COMP.STCOPY [LAMBDA NIL (* lmm "16-APR-82 00:14") (CCHECK (IGREATERP LEVEL 0)) (COMP.ST OPCOPY 1]) (COMP.DELPUSH [LAMBDA NIL (* lmm: " 9-AUG-76 21:50:49") (SUB1VAR LEVEL) (SETQ CODE (CDR CODE]) (COMP.DELPOP [LAMBDA NIL (* lmm "28-OCT-77 15:23") (SETQ LEVEL (ADD1 LEVEL)) (SETQ CODE (CDR CODE]) (COMP.STBIND [LAMBDA (F) (* lmm "16-APR-82 00:14") [COND ((NULL (fetch PARENT of F)) (replace PARENT of F with FRAME)) (T (CCHECK (EQ (fetch PARENT of F) FRAME] [COND [(NULL (fetch (FRAME LEVEL) of F)) (replace (FRAME LEVEL) of F with (IDIFFERENCE LEVEL (fetch NVALS of F] (T (CCHECK (EQ (fetch (FRAME LEVEL) of F) (IDIFFERENCE LEVEL (fetch NVALS of F] (COND ([EVERY CODE (FUNCTION (LAMBDA (X) (SELECTQ (fetch OPNAME of X) ((TAG HVAR AVAR GVAR CONST) T) [FN (OR (NULL (fetch (FRAME VARS) of F)) (CLEANFNOP (CDR (fetch OPARG of X)) (QUOTE FREEVARS] NIL] (CW PROG is first thing in function) (replace CPIOK of F with T))) (COMP.ST (create OP OPNAME ←(QUOTE BIND) OPARG ←(CONS NIL F)) 0) (SETQ FRAME F) (SETQ LEVEL 0]) (COMP.STUNBIND [LAMBDA (D) (* lmm "16-APR-82 00:14") (COMP.ST (create OP OPNAME ←(COND (D (QUOTE DUNBIND)) (T (QUOTE UNBIND))) OPARG ←(CONS LEVEL FRAME)) 0) [SETQ LEVEL (IPLUS (fetch (FRAME LEVEL) of FRAME) (COND (D 0) (T 1] (SETQ FRAME (fetch PARENT of FRAME]) ) (DEFINEQ (ATYP [LAMBDA (FN) (* lmm "25-FEB-82 16:29") (PROG NIL (RETURN (COND ((NOT (LITATOM FN)) (ARGTYPE FN)) ((FMEMB FN LAMA) 2) ((FMEMB FN LAMS) 0) ((FMEMB FN NLAML) 1) ((FMEMB FN NLAMA) 3) (T (ARGTYPE (OR [AND BLKFLG (OR (CADDR (FASSOC FN BLKDEFS)) (AND (FMEMB FN BLKLIBRARY) (GETP FN (QUOTE BLKLIBRARYDEF] (GETPROP FN (QUOTE BROKEN)) (AND (GETD FN) FN) (GETPROP FN (QUOTE EXPR)) (RETURN (COND ((FMEMB FN NOFIXFNSLST) 2) (T NIL]) (CLEANEXPP [LAMBDA (X TYPE) (* lmm "15-APR-82 23:01") (COND ((NLISTP X)) ((CLEANFNP (CAR X) TYPE) (EVERY (CDR X) (FUNCTION (LAMBDA (X) (CLEANEXPP X TYPE]) (CLEANFNP [LAMBDA (X TYPE) (* lmm "15-APR-82 23:02") (COND ((LITATOM X) (APPLY* CLEANFNTEST X)) ((LISTP X) (SELECTQ (CAR X) [[LAMBDA OPENLAMBDA] (EVERY (CDDR X) (FUNCTION (LAMBDA (X) (CLEANEXPP X TYPE] NIL]) (CLEANFNOP [LAMBDA (FN TYPE) (* lmm "15-APR-82 23:07") (APPLY* CLEANFNTEST FN TYPE]) (GLOBALVARP [LAMBDA (X) (* lmm: " 9-AUG-76 20:34:14") (OR (GETP X (QUOTE GLOBALVAR)) (FMEMB X GLOBALVARS]) (LINKCALLP [LAMBDA (FN) (* edited (18-NOV-75 . 2341)) (COND ((AND (LISTP NOLINKFNS) (FMEMB FN NOLINKFNS)) NIL) ((AND BLKFLG (OR (FASSOC FN BLKDEFS) (FMEMB FN BLKLIBRARY))) T) ((AND (LISTP LINKFNS) (FMEMB FN LINKFNS)) T) ((EQ NOLINKFNS T) NIL) ((OR BLKFLG (EQ LINKFNS T)) T]) (ANONP [LAMBDA (E) (* lmm "31-MAR-78 01:34") (COND ((NEQ LOCALVARS T) (FMEMB E LOCALVARS)) (T (NOT (OR (EQ SPECVARS T) (FMEMB E SPECVARS) (AND BLKFLG (FMEMB E LOCALFREEVARS]) ) (DEFINEQ (CPI [LAMBDA (FN ARGS) (* lmm "16-APR-82 00:28") (PROG ((F FRAME)) LP (COND ((EQ F TOPFRAME) (CPI1 ARGS ARGVARS (PICOUNT ARGS)) (while (NEQ FRAME TOPFRAME) do (CW unbind localvar FRAME before recursion) (COMP.STUNBIND T)) (COND ((NEQ LEVEL 0) (CW pop stack before recursion) (COMP.STPOP LEVEL))) (COMP.STJUMP (QUOTE JUMP) TOPLAB) (CW CPI succeeds) (RETURN (QUOTE NOVALUE))) ((SELECTQ (fetch FRAMETYPE of F) [(PROG LAMBDA) (COND ((OASSOC (QUOTE AVAR) (fetch VARS of F)) (COND ((NOT (fetch CPIOK of F)) (CW can't remove recursion inside frame with SPECVARS) T) (T (CW CPI can succeed because SPECVARS bound first thing in function) NIL] (PROGN (CW can't remove recursion inside ERRORSET) T)) (CCALL FN ARGS 0)) ((SETQ F (fetch PARENT of F)) (GO LP)) (T (COMPILERERROR]) (CPI1 [LAMBDA (ARGS VARS N) (* lmm "16-APR-82 00:28") (COND [(NULL VARS) (COND ((LISTP ARGS) (CEFFECT (CAR ARGS)) (CPI1 (CDR ARGS) VARS (SUB1 N] ([OR (IGREATERP N 0) (NOT (LITATOM (CAR ARGS))) (NEQ (CAR ARGS) (fetch OPARG of (CAR VARS] (CVAL (CAR ARGS)) (CPI1 (CDR ARGS) (CDR VARS) (SUB1 N)) (COMP.STSETQ (CAR VARS)) (COMP.STPOP)) (T (CPI1 (CDR ARGS) (CDR VARS) (SUB1 N]) (PICOUNT [LAMBDA (ARGS) (* lmm "27-OCT-81 20:57") (PROG ((N 0) (ND 0) (VARS ARGVARS)) LP (COND (VARS (SETQ N (ADD1 N)) (COND [(AND (LITATOM (CAR ARGS)) (EQ (CAR ARGS) (fetch OPARG of (CAR VARS] ((NOT (CLEANEXPP (CAR ARGS) (QUOTE PICOUNT))) (SETQ ND N))) (SETQ VARS (CDR VARS)) (SETQ ARGS (CDR ARGS)) (GO LP))) (RETURN ND]) ) (PUTPROPS EVQ BYTEMACRO CEVQ) (DEFINEQ (CEVQ [LAMBDA (X) (* lmm "26-MAY-82 10:12") (RESETVARS (COMPVARMACROHASH) (RETURN (CEXP1 (CAR X]) ) (PUTPROPS AND BYTEMACRO (APPLY* CBOOL T)) (PUTPROPS OR BYTEMACRO (APPLY* CBOOL NIL)) (DEFINEQ (CBOOL [LAMBDA (A FLAG) (* lmm "16-APR-82 00:29") (COND ((NULL A) (CW (AND/OR)) (CCONST FLAG)) ((NULL (CDR A)) (CW (AND/OR expr)) (CEXP1 (CAR A))) (T (PROG ((END (create TAG)) P) (SETQ P (create JUMP OPNAME ←[COND ((SETQ P PREDF) (CW AND/OR in PREDF) (SELECTQ (fetch OPNAME of PREDF) [(TJUMP NTJUMP) (COND (FLAG (QUOTE FJUMP)) (T (GO LP] [(FJUMP NFJUMP) (COND (FLAG (GO LP)) (T (QUOTE TJUMP] (COMPILERERROR))) [EFF (CW AND/OR in EFF) (COND (FLAG (QUOTE FJUMP)) (T (QUOTE TJUMP] (T (CW other AND/OR) (COND (FLAG (QUOTE NFJUMP)) (T (QUOTE NTJUMP] TAG ← END)) LP (COND ((CDR A) (CEXPR (CAR A) NIL NIL P) (SETQ A (CDR A)) (GO LP))) (RETURN (PROG1 (CEXPR (CAR A) EFF RETF PREDF) (COMP.STTAG END]) ) (DEFINEQ (APFNP [LAMBDA (X) (* edited: "21-MAY-80 09:38") (AND (LISTP X) (SELECTQ (CAR X) ((FUNCTION QUOTE) (AND (NULL (CDDR X)) (SELECTQ (ATYP (CADR X)) (NIL (pushnew ALAMS1 (CADR X)) T) ((0 1 2) T) NIL))) NIL]) ) (PUTPROPS AC BYTEMACRO CAC) (PUTPROPS ASSEMBLE BYTEMACRO PUNT) (PUTPROPS ASSEM BYTEMACRO PUNT) (PUTPROPS FLOC BYTEMACRO PUNT) (DEFINEQ (CAC [LAMBDA NIL (* lmm: " 1-OCT-76 12:41:01") (OR (EQ (SETQ AC EXP) DONOTHING) (PUNT)) NIL]) (PUNT [LAMBDA NIL (* lmm "22-OCT-79 12:44") (PROG [(EM (CONS (CAR EXP) (QUOTE (-- can't compile] (COMPERROR (COND [MACEXP (CONS (QUOTE Under) (CONS (CAR MACEXP) (CONS (QUOTE -) EM] (T EM]) ) (PUTPROPS FUNCTION BYTEMACRO CFUNCTION) (DEFINEQ (CFUNCTION [LAMBDA (A) (* lmm "16-APR-82 00:18") (PROG ((FN (CAR A))) [COND ((LISTP FN) (SETQ FN (CLAM1 FN] (RETURN (COND ((CDR A) (CCALL (QUOTE FUNCTION) (CONS FN (CDR A)) 1)) (T (COMP.STCONST FN]) (CLAM1 [LAMBDA (DEF) (* lmm "22-OCT-79 12:45") (PROG ((FN (GENFN))) (MC2A FN DEF) [MAPC ALLVARS (FUNCTION (LAMBDA (X) (COND ((AND (NEQ (fetch OPNAME of X) (QUOTE AVAR)) (FMEMB (fetch OPARG of X) SUBFNFREEVARS)) (CW change LOCALVAR to SPECVAR because subfn uses it free) (replace OPNAME of X with (QUOTE AVAR] (RETURN FN]) (GENFN [LAMBDA NIL (PACK (LIST COMFN (GENSYM]) ) (PUTPROPS COND BYTEMACRO CCOND) (PUTPROPS SELECTQ BYTEMACRO CSELECTQ) (DEFINEQ (CCOND [LAMBDA (A) (* lmm "16-APR-82 00:29") (PROG (NEXT PRED CLAUSE (END (create TAG)) ENDF) LP [SETQ PRED (CAR (SETQ CLAUSE (CAR A] (COND [(CDR CLAUSE) [CEXPR PRED NIL NIL (create JUMP OPNAME ←(QUOTE FJUMP) TAG ←(SETQ NEXT (create TAG] [COND ((JUMPCHECK CODE) NIL) (T (CVALN (CDR CLAUSE) EFF RETF) (OR RETF (JUMPCHECK CODE) (COMP.STJUMP (QUOTE JUMP) (SETQ ENDF END] (COND ((OR OPTIMIZATIONSOFF (find X in CODE suchthat (EQ (CAR (LISTP (fetch OPARG of X))) NEXT))) (COMP.STTAG NEXT)) (T (GO OUT] [(CDR A) (CEXPR PRED NIL NIL (create JUMP OPNAME ←(COND (EFF (QUOTE TJUMP)) (T (QUOTE NTJUMP))) TAG ←(SETQ ENDF END] (T (CEXPR PRED EFF RETF) (GO OUT))) (COND ((SETQ A (CDR A)) (GO LP))) (CEXPR NIL EFF) OUT (AND ENDF (COMP.STTAG END)) (RETURN (AND EFF (QUOTE NOVALUE]) (CSELECTQ [LAMBDA (A) (* lmm "16-APR-82 00:29") (PROG ((END (create TAG)) VAR THISLABEL NEXT TEST CLAUSE) (CW compile SELECTQ) (CVAL (CAR A)) (SETQ A (CDR A)) (COND ((FMEMB (fetch OPNAME of (CAR CODE)) SELECTVARTYPES) (* SELECTQVARTYPES is (AVAR HVAR) for Alto and NIL for maxc) (CW SELECTQ var) (SETQ VAR (CAR CODE)) (COMP.DELPUSH)) ((AND (EQ (fetch OPNAME of (CAR CODE)) (QUOTE SETQ)) (FMEMB (fetch OPNAME of (fetch OPARG of (CAR CODE))) SELECTVARTYPES)) (CW SELECTQ SETQ) (SETQ VAR (fetch OPARG of (CAR CODE))) (COMP.STPOP)) [(EQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST)) (CW SELECTQ of constant) (RETURN (CPROGN (PROG [(C (fetch OPARG of (CAR CODE] (COMP.DELPUSH) ALP (COND ((NULL (CDR A)) (RETURN A))) [COND ((COND ((LISTP (CAAR A)) (FMEMB C (CAAR A))) (T (EQ (CAAR A) C))) (RETURN (CDAR A] (SETQ A (CDR A)) (GO ALP] (T (SETQ THISLABEL T))) LP [COND ((NULL (CDR A)) (AND THISLABEL (NULL VAR) (COMP.STPOP)) (RETURN (PROG1 (CEXPR (CAR A) EFF RETF) (OR RETF (COMP.STTAG END] (SETQ THISLABEL) [COND ([LISTP (SETQ TEST (CAR (SETQ CLAUSE (PROG1 (CAR A) (SETQ A (CDR A] (COND ((NLISTP (CDR TEST)) (SETQ TEST (CAR TEST))) (SELECTQFMEMB (CW FMEMB in SELECTQ) (COND (VAR (COMP.STVAR VAR)) ((CDR A) (COMP.STCOPY))) (COMP.STCONST (APPEND TEST)) (COMP.STFN (QUOTE FMEMB) 2) (GO DUN)) (T (SETQ THISLABEL (create TAG)) (MAP TEST (FUNCTION (LAMBDA (Y) (COND ((CDR Y) (COND (VAR (COMP.STVAR VAR)) (T (COMP.STCOPY))) (COMP.STCONST (CAR Y)) (COMP.STFN (QUOTE EQ) 2) (COMP.STJUMP (QUOTE TJUMP) THISLABEL)) (T (SETQ TEST (CAR Y] (COND (VAR (COMP.STVAR VAR)) ((OR THISLABEL (CDR A)) (COMP.STCOPY))) (COMP.STCONST TEST) (COMP.STFN (QUOTE EQ) 2) DUN [COND ((AND (NULL THISLABEL) (NULL (CDR A)) (NULL (CAR A))) (CW SELECTQ ends in NIL) (COMP.STJUMP (COND (EFF (QUOTE FJUMP)) (T (QUOTE NFJUMP))) END) (RETURN (PROG1 (CVALN (CDR CLAUSE) EFF NIL) (COMP.STTAG END] (COMP.STJUMP (QUOTE FJUMP) (SETQ NEXT (create TAG))) (COND (THISLABEL (COMP.STTAG THISLABEL))) (COND ((AND (OR THISLABEL (CDR A)) (NULL VAR)) (COMP.STPOP))) (CVALN (CDR CLAUSE) EFF RETF) (OR RETF (COMP.STJUMP (QUOTE JUMP) END)) (COMP.STTAG NEXT) (GO LP]) ) (PUTPROPS PROGN BYTEMACRO CPROGN) (PUTPROPS PROG1 BYTEMACRO CPROG1) (PUTPROPS QUOTE BYTEMACRO CQUOTE) (PUTPROPS * BYTEMACRO CCOMMENT) (DEFINEQ (CQUOTE [LAMBDA (A) (* lmm: " 9-AUG-76 22:04:49") [COND ((CDR A) (COMPERRM (CONS EXP (QUOTE (- probable parenthesis error] (CCONST (CAR A]) (CCOMMENT [LAMBDA (A) (* lmm "16-APR-82 00:18") (COND ((NOT EFF) [COMPERRM (CONS EXP (QUOTE (- value of comment used?] (COMP.STCONST (CAR A))) (T (QUOTE NOVALUE]) ) (PUTPROPS DECLARE BYTEMACRO CDECLARE) (DEFINEQ (CDECLARE [LAMBDA (A) (* rmk: "20-NOV-79 08:13") (CW compile DECLARE) [MAPC A (FUNCTION (LAMBDA (B) (SELECTQ (CAR B) (LOCALVARS (CDECLARE1 (CDR B) (QUOTE LOCALVARS) (QUOTE SPECVARS) SYSSPECVARS)) (SPECVARS (CDECLARE1 (CDR B) (QUOTE SPECVARS) (QUOTE LOCALVARS) SYSLOCALVARS)) ((ADDTOVAR DEFLIST PUTPROPS CONSTANTS SETQQ USEDFREE GLOBALVARS) (EVAL B)) (COMPERRM (CONS B (QUOTE (- used in DECLARE] (CCONST (CAR A]) (CDECLARE1 [LAMBDA (VAL VAR OTHERVAR SYSOTHERVAR) (* lmm "31-MAR-78 02:47") (SET VAR (COND ((LISTP VAL) (COND ((LISTP (SETQ VAR (EVALV VAR))) (APPEND VAL VAR)) ((EQ VAR T)) (T VAL))) ((EQ VAL T) (SET OTHERVAR SYSOTHERVAR) T) (T VAL))) (MAPC (fetch VARS of FRAME) (FUNCTION (LAMBDA (V VTAG) (COND ((NEQ (SETQ VTAG (VARTYPE (fetch OPARG of V))) (fetch OPNAME of V)) (* Already made some decision based on localvars (COMPERRM (CONS EXP (QUOTE (- illegal DECLARE))))) (replace OPNAME of V with VTAG]) ) (RPAQQ MCROPS (CAR CDR CAAR CDAR CADR CDDR CAAAR CDAAR CADAR CDDAR CAADR CDADR CADDR CDDDR CAAAAR CDAAAR CADAAR CDDAAR CAADAR CDADAR CADDAR CDDDAR CAAADR CDAADR CADADR CDDADR CAADDR CDADDR CADDDR CDDDDR)) (PUTPROPS CAR BYTEMACRO CCROP) (PUTPROPS CDR BYTEMACRO CCROP) (PUTPROPS CAAR BYTEMACRO CCROP) (PUTPROPS CDAR BYTEMACRO CCROP) (PUTPROPS CADR BYTEMACRO CCROP) (PUTPROPS CDDR BYTEMACRO CCROP) (PUTPROPS CAAAR BYTEMACRO CCROP) (PUTPROPS CDAAR BYTEMACRO CCROP) (PUTPROPS CADAR BYTEMACRO CCROP) (PUTPROPS CDDAR BYTEMACRO CCROP) (PUTPROPS CAADR BYTEMACRO CCROP) (PUTPROPS CDADR BYTEMACRO CCROP) (PUTPROPS CADDR BYTEMACRO CCROP) (PUTPROPS CDDDR BYTEMACRO CCROP) (PUTPROPS CAAAAR BYTEMACRO CCROP) (PUTPROPS CDAAAR BYTEMACRO CCROP) (PUTPROPS CADAAR BYTEMACRO CCROP) (PUTPROPS CDDAAR BYTEMACRO CCROP) (PUTPROPS CAADAR BYTEMACRO CCROP) (PUTPROPS CDADAR BYTEMACRO CCROP) (PUTPROPS CADDAR BYTEMACRO CCROP) (PUTPROPS CDDDAR BYTEMACRO CCROP) (PUTPROPS CAAADR BYTEMACRO CCROP) (PUTPROPS CDAADR BYTEMACRO CCROP) (PUTPROPS CADADR BYTEMACRO CCROP) (PUTPROPS CDDADR BYTEMACRO CCROP) (PUTPROPS CAADDR BYTEMACRO CCROP) (PUTPROPS CDADDR BYTEMACRO CCROP) (PUTPROPS CADDDR BYTEMACRO CCROP) (PUTPROPS CDDDDR BYTEMACRO CCROP) (PUTPROPS CAR CROPS (A)) (PUTPROPS CDR CROPS (D)) (PUTPROPS CAAR CROPS (A A)) (PUTPROPS CDAR CROPS (A D)) (PUTPROPS CADR CROPS (D A)) (PUTPROPS CDDR CROPS (D D)) (PUTPROPS CAAAR CROPS (A A A)) (PUTPROPS CDAAR CROPS (A A D)) (PUTPROPS CADAR CROPS (A D A)) (PUTPROPS CDDAR CROPS (A D D)) (PUTPROPS CAADR CROPS (D A A)) (PUTPROPS CDADR CROPS (D A D)) (PUTPROPS CADDR CROPS (D D A)) (PUTPROPS CDDDR CROPS (D D D)) (PUTPROPS CAAAAR CROPS (A A A A)) (PUTPROPS CDAAAR CROPS (A A A D)) (PUTPROPS CADAAR CROPS (A A D A)) (PUTPROPS CDDAAR CROPS (A A D D)) (PUTPROPS CAADAR CROPS (A D A A)) (PUTPROPS CDADAR CROPS (A D A D)) (PUTPROPS CADDAR CROPS (A D D A)) (PUTPROPS CDDDAR CROPS (A D D D)) (PUTPROPS CAAADR CROPS (D A A A)) (PUTPROPS CDAADR CROPS (D A A D)) (PUTPROPS CADADR CROPS (D A D A)) (PUTPROPS CDDADR CROPS (D A D D)) (PUTPROPS CAADDR CROPS (D D A A)) (PUTPROPS CDADDR CROPS (D D A D)) (PUTPROPS CADDDR CROPS (D D D A)) (PUTPROPS CDDDDR CROPS (D D D D)) (DEFINEQ (CCROP [LAMBDA (A) (* lmm "16-APR-82 00:16") (* Used for compiling CAR/CDR etc) (SETQ A (CVAL1 A EFF)) (COND (EFF (CW CAR/CDR in EFF) A) (T (MAPC (GETPROP (CAR EXP) (QUOTE CROPS)) (FUNCTION (LAMBDA (X) (COMP.STFN (SELECTQ X (A (QUOTE CAR)) (QUOTE CDR)) 1]) (COMP.STCROP [LAMBDA (X) (* lmm "16-APR-82 00:16") (COMP.STFN (SELECTQ X (A (QUOTE CAR)) (QUOTE CDR)) 1]) ) (PUTPROPS NOT BYTEMACRO CNOT) (PUTPROPS NULL BYTEMACRO CNOT) (DEFINEQ (CNOT [LAMBDA (A) (* lmm "16-APR-82 00:16") (PROG ((PREDF (NOTJUMP PREDF))) (RETURN (COND ((AND PREDF (NULL EFF)) (CW NULL in PREDF) (CPROG1 A)) (T (CW call to NULL) (CVAL1 A) (COMP.STFN (QUOTE NULL) 1]) ) (PUTPROPS SETQ BYTEMACRO CSETQ) (PUTPROPS SETN BYTEMACRO CSETN) (DEFINEQ (CSETQ [LAMBDA (A) (* lmm "16-APR-82 00:29") (CVAL1 (CDR A)) (COMP.STSETQ (LOOKUPVAR (CAR A]) (CSETN [LAMBDA (A) (* lmm: "20-OCT-76 01:33:55") [COMPERRM (CONS (CAR A) (QUOTE (- warning: SETN compiled as SETQ] (CSETQ A]) ) (DEFINEQ (CLAM [LAMBDA (FN VALS) (* lmm "16-APR-82 00:28") (PROG ((VARS (CADR FN)) F (EXPS (CDDR FN)) V E (I 0) SUBOLD SUBNEW VAR) [SELECTQ (ARGTYPE FN) (0 (CW open LAMBDA)) [1 (CW open NLAMBDA nospread) (SETQ VALS (MAPCAR VALS (FUNCTION KWOTE] (2 (CW open LAMBDA nospread) (RETURN (CCALL (CLAM1 FN) VALS 2))) [3 (CW open NLAMBDA spread) (SETQ VARS (LIST VARS)) (SETQ VALS (LIST (KWOTE VALS] (COND [(EQ (CAR FN) (QUOTE OPENLAMBDA)) (CW compile OPENLAMBDA expression) [while VARS do (CVAL (pop VALS)) (COND ((EQ (fetch OP of (CAR CODE)) (QUOTE CONST)) (push SUBOLD (pop VARS)) [push SUBNEW (KWOTE (fetch OPARG of (CAR CODE] (COMP.DELPUSH)) (T (push V (pop VARS] (MAPC VALS (FUNCTION CEFFECT)) (while (AND V (SETQ VAR (SELECTQ (fetch OP of (CAR CODE)) ((AVAR HVAR FVAR GVAR) (PROG1 (fetch OPARG of (CAR CODE)) (COMP.DELPUSH))) (SETQ (PROG1 (fetch OPARG of (fetch OPARG of (CAR CODE))) (COMP.STPOP))) NIL))) do (CW substitute for variable in OPENLAMBDA) (push SUBNEW VAR) (push SUBOLD (pop V))) [COND ((NULL V) (CW OPENLAMBDA with all variables substituted for) (RETURN (CPROGN (SUBPAIR SUBOLD SUBNEW EXPS] (while V do ([push SUBNEW (CAR (push VARS (GENFN] (push SUBOLD (pop V)) (push VALS DONOTHING))) (SETQ EXPS (CONS (QUOTE (DECLARE (LOCALVARS . T))) (SUBPAIR SUBOLD SUBNEW EXPS] (T (COMPERROR (CONS FN (QUOTE (- illegal open function] (SETQ F (BINDVARS VARS VALS (QUOTE LAMBDA))) (PROG ((ALLVARS (APPEND (fetch VARS of F) ALLVARS)) (LOCALVARS LOCALVARS) (SPECVARS SPECVARS)) (COMP.STBIND F) (CVALN EXPS EFF (AND MERGEUNBINDFLG RETF))) (RETURN (UNBINDVARS F]) ) (PUTPROPS PROG BYTEMACRO CPROG) (PUTPROPS GO BYTEMACRO CGO) (PUTPROPS RETURN BYTEMACRO CRETURN) (DEFINEQ (CPROG [LAMBDA (A) (* lmm "16-APR-82 00:29") (PROG ([VARS (MAPCAR (CAR A) (FUNCTION (LAMBDA (X) (COND ((LITATOM X) X) [(NLISTP X) (COMPERROR (CONS X (QUOTE (- bad PROG variable] (T (CAR X] [VALS (MAPCAR (CAR A) (FUNCTION (LAMBDA (X) (AND (LISTP X) (COND ((CDDR X) (CONS (QUOTE PROG1) (CDR X))) (T (CADR X] F) (SETQ F (BINDVARS VARS VALS (QUOTE PROG))) (PROG ((ALLVARS (APPEND (fetch VARS of F) ALLVARS)) (LOCALVARS LOCALVARS) (SPECVARS SPECVARS) TAGS (RETURNLABEL (create TAG LEVEL ←(COND (EFF 0) (T 1)) FRAME ← F)) PROGLEVEL (PROGEFF EFF) (PROGRETF RETF) FLG (LOCALVARS LOCALVARS)) (COMP.STBIND F) [MAPC (CDR A) (FUNCTION (LAMBDA (X) (COND ((LISTP X)) [(NOT (LITATOM X)) (COMPERROR (CONS X (QUOTE (- illegal tag] [(FASSOC X TAGS) (COMPERROR (CONS X (QUOTE (- multiply defined tag] (T (SETQ TAGS (CONS (CONS X (SETQ X (create TAG LBNO ← X))) TAGS)) (replace (TAG FRAME) of X with FRAME) (replace (TAG LEVEL) of X with 0] (replace PROGLABELS of F with TAGS) (SETQ FLG (COND ((OR TAGS OPTIMIZATIONSOFF (NULL MERGEUNBINDFLG)) NIL) (RETF (COND ((NOT (DELPOPP)) (CW pop even though higher PROG labels))) T))) (* Check if can delete extra POP's) [MAPC (CDR A) (FUNCTION (LAMBDA (X) (COND [(LITATOM X) (COMP.STTAG (CDR (FASSOC X TAGS] (T (CEFFECT X) (AND FLG (while (EQ (CAR CODE) OPPOP) do (CW delete POP in PROG) (COMP.DELPOP] (COND ((NOT (OR EFF (JUMPCHECK CODE))) (CW PROG dropped off) (CEXPR NIL NIL NIL))) (OR (AND MERGEUNBINDFLG RETF) (COMP.STTAG RETURNLABEL))) (RETURN (UNBINDVARS F]) (CGO [LAMBDA (A) (* lmm "16-APR-82 00:28") (PROG (D ANYPROG) [COND ((JUMPCHECK CODE) (CW UNREACHABLE GO -- DON'T COMPILE) (RETURN (QUOTE NOVALUE] LP [SELECTQ (fetch FRAMETYPE of FRAME) (PROG [COND ((SETQ D (FASSOC (CAR A) (fetch PROGLABELS of FRAME))) (COND ((NOT (ZEROP LEVEL)) (CW GO needs to POP) (COMP.STPOP LEVEL))) (COMP.STJUMP (QUOTE JUMP) (CDR D)) (RETURN (QUOTE NOVALUE] (SETQ ANYPROG T)) [LAMBDA] (COMPERROR (CONS (CAR A) (COND (ANYPROG (QUOTE (- undefined tag))) (T (QUOTE (- illegal GO] (CW non local GO) (COMP.STUNBIND T) (GO LP]) (CRETURN [LAMBDA (A) (* lmm "16-MAY-82 12:38") (PROG ((PROGFRAME FRAME)) [COND ((NOT (AND MERGEUNBINDFLG PROGRETF)) (COND ([NOT (OR PROGEFF (EQ LEVEL 0) (NEQ (fetch FRAMETYPE of FRAME) (QUOTE PROG] (CW RETURN POPs beforehand) (COMP.STPOP LEVEL] CHKLP [SELECTQ (fetch FRAMETYPE of PROGFRAME) (PROG) [LAMBDA (SETQ PROGFRAME (fetch PARENT of PROGFRAME)) (GO CHKLP] (COMPERROR (CONS COMFN (QUOTE (- illegal RETURN] (CVAL1 A PROGEFF (AND MERGEUNBINDFLG PROGRETF)) [COND ((JUMPCHECK CODE) (RETURN (QUOTE NOVALUE] (COND ((NOT (AND MERGEUNBINDFLG PROGRETF)) [PROG NIL LP (SELECTQ (fetch FRAMETYPE of FRAME) (PROG (CCHECK (EQ FRAME PROGFRAME))) [LAMBDA (CW RETURN inside LAMBDA) (COMP.STUNBIND PROGEFF) (GO LP] (COMPERROR (CONS COMFN (QUOTE (- illegal RETURN] [COND (PROGEFF (COMP.STPOP LEVEL)) ((NEQ LEVEL 1) (COMPILERERROR (QUOTE (unimplemented RETURN] (COMP.STJUMP (QUOTE JUMP) RETURNLABEL))) (RETURN (QUOTE NOVALUE]) ) (RPAQQ NUMBERFNS (ITIMES2 LOGOR2 LOGXOR2 LOGAND2 LLSH1 LRSH1 LLSH8 LRSH8 IPLUS ITIMES LOGOR LOGXOR LOGAND IDIFFERENCE IQUOTIENT IREMAINDER IMINUS LSH LLSH RSH LRSH FIX)) (RPAQQ GLOBALVARFLG T) (RPAQQ NEWOPTFLG NIL) (RPAQ COMPVERSION (DATE)) (PUTPROPS IPLUS BYTEMACRO (APPLY* CNUMBER IPLUS)) (PUTPROPS ITIMES BYTEMACRO (APPLY* CNUMBER ITIMES FIX 0)) (PUTPROPS LOGOR BYTEMACRO (APPLY* CNUMBER LOGOR FIX -1)) (PUTPROPS LOGXOR BYTEMACRO (APPLY* CNUMBER LOGXOR)) (PUTPROPS LOGAND BYTEMACRO (APPLY* CNUMBER LOGAND FIX 0)) (PUTPROPS IDIFFERENCE BYTEMACRO CNCALL) (PUTPROPS IQUOTIENT BYTEMACRO CNCALL) (PUTPROPS IREMAINDER BYTEMACRO CNCALL) (PUTPROPS IMINUS BYTEMACRO ((X) (IDIFFERENCE 0 X))) (PUTPROPS LSH BYTEMACRO CNCALL) (PUTPROPS LLSH BYTEMACRO CNCALL) (PUTPROPS RSH BYTEMACRO CNCALL) (PUTPROPS LRSH BYTEMACRO CNCALL) (PUTPROPS FIX BYTEMACRO CFIX) (PUTPROPS PLUS BYTEMACRO (APPLY* CNUMBER PLUS PLUS)) (PUTPROPS DIFFERENCE BYTEMACRO (APPLY* CNCALL PLUS)) (PUTPROPS TIMES BYTEMACRO (APPLY* CNUMBER TIMES PLUS 0)) (PUTPROPS QUOTIENT BYTEMACRO (APPLY* CNCALL PLUS)) (PUTPROPS FPLUS BYTEMACRO (APPLY* CNUMBER FPLUS FLOAT)) (PUTPROPS FDIFFERENCE BYTEMACRO (APPLY* CNCALL FLOAT)) (PUTPROPS FTIMES BYTEMACRO (APPLY* CNUMBER FTIMES FLOAT 0)) (PUTPROPS FQUOTIENT BYTEMACRO (APPLY* CNCALL FLOAT)) (DEFINEQ (CNUMBER [LAMBDA (A 2FN TYPE ZERO) (* lmm "28-MAR-83 22:18") (* compile call to number function of arbitrary args. 2FN is holder of opcode. TYPE is FIX, FLOAT, PLUS (NIL->FIX)) (* ZERO IF GIVEN IS ZERO OF FUNCTION, E.G. 0 FOR TIMES, -1 FOR LOGOR) (PROG ((N 0) V (FN (CAR EXP))) [COND ((AND EFF (NOT OPTIMIZATIONSOFF)) (RETURN (CPROGN A] (OR 2FN (SETQ 2FN FN)) [while A do (CVAL (pop A)) (SETQ N (ADD1 N)) (COND ((NOT OPTIMIZATIONSOFF) (DELFIX TYPE) (while (CALLP (CAR CODE) 2FN) do (SETQ N (IPLUS N (CAR (fetch OPARG of (CAR CODE))) -1)) (CW merge nested arithmetic calls) (COMP.DELFN)) (COND ((AND (EQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST)) (IGREATERP N 0)) [SETQ V (COND [V (CW combine number args) (APPLY* FN V (fetch OPARG of (CAR CODE] (T (CW move number constants to end) (fetch OPARG of (CAR CODE] (COMP.DELPUSH) (SETQ N (SUB1 N] [COND (V (COND ((EQUAL (APPLY* FN V) (APPLY* FN)) (* I.E., IS UNIT OF FUNCTION: 1 FOR TIMES, ETC) ) ((EQUAL V ZERO) (FRPTQ N (COMP.STPOP)) (RETURN (COMP.STCONST V))) ((AND (IGREATERP N 0) (MINUSP V) (EQ 2FN (QUOTE IPLUS))) (CW turn IPLUS of negative to IDIFFERENCE) (COMP.STCONST (IMINUS V)) (COMP.STFN (QUOTE IDIFFERENCE) 2)) (T (COMP.STCONST V) (add N 1] (COND ((EQ N 0) (CW number function, 0 args) (COMP.STCONST (APPLY* FN))) ((EQ N 1) (CW number fn, 1 arg) (STFIX TYPE)) (T (FRPTQ (SUB1 N) (COMP.STFN 2FN 2]) (CNCALL [LAMBDA (A TYPE) (* lmm "16-APR-82 00:28") (PROG ((N 0)) [COND ((AND EFF (NOT OPTIMIZATIONSOFF)) (RETURN (CPROGN A] (while A do (CVAL (pop A)) (OR OPTIMIZATIONSOFF (DELFIX TYPE)) (SETQ N (ADD1 N))) [COND ((AND (NOT OPTIMIZATIONSOFF) (EQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST)) (EQ N 2)) (COND ((EQ (fetch OPNAME of (CAR (fetch PREV of CODE))) (QUOTE CONST)) (COMP.STCONST (PROG1 (APPLY* (CAR EXP) (fetch OPARG of (CAR (fetch PREV of CODE))) (fetch OPARG of (CAR CODE))) (COMP.DELPUSH) (COMP.DELPUSH))) (RETURN (STFIX TYPE))) ((FMEMB (CAR EXP) (SELECTQ (fetch OPARG of (CAR CODE)) (0 (QUOTE (IDIFFERENCE LSH RSH LLSH LRSH))) (1 (QUOTE (IQUOTIENT))) NIL)) (COMP.DELPUSH) (RETURN (STFIX TYPE] (RETURN (COMP.STFN (CAR EXP) N]) (CFIX [LAMBDA (A) (* lmm "18-APR-80 18:28") (CVAL1 A) (STFIX]) (STFIX [LAMBDA (TYPE) (* lmm "16-APR-82 00:28") (OR TYPE (SETQ TYPE (QUOTE FIX))) (COND [[AND (EQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST)) (NUMBERP (fetch OPARG of (CAR CODE] (CW COMPILE TIME FIX) (COMP.STCONST (PROG1 (APPLY* TYPE (fetch OPARG of (CAR CODE))) (COMP.DELPUSH] ((AND (EQ TYPE (QUOTE FIX)) (CALLP (CAR CODE) NUMBERFNS))) (T (COMP.STFN TYPE 1]) (DELFIX [LAMBDA (TYPE) (* lmm "16-APR-82 00:19") (* have compiled call to number function; delete any coersions-to-TYPE) (while (CALLP (CAR CODE) (SELECTQ TYPE ((FIX NIL) (QUOTE (IPLUS FIX))) (FLOAT (QUOTE FLOAT)) (QUOTE PLUS)) 1) do (COMP.DELFN]) ) (PUTPROPS EQ BYTEMACRO CEQ) (PUTPROPS EQUAL BYTEMACRO CEQ) (PUTPROPS EQP BYTEMACRO CEQ) (DEFINEQ (CEQ [LAMBDA (A) (* lmm "16-APR-82 00:28") (COND (EFF (CPROGN A)) (T (PROG (C) (CVAL (pop A)) [COND ((OR OPTIMIZATIONSOFF (NEQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST))) (CVAL1 A)) ([NULL (SETQ C (fetch OPARG of (CAR CODE] (CW (EQ NIL --)) (COMP.DELPUSH) (RETURN (CNOT A))) (T (COMP.DELPUSH) (CVAL1 A) (COND [(EQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST)) (CW (EQ CONST CONST)) (RETURN (COMP.STCONST (PROG1 (APPLY* (CAR EXP) C (fetch OPARG of (CAR CODE))) (COMP.DELPUSH] (T (CW (EQ CONST EXPRESSION)) (COMP.STCONST C] (RETURN (COMP.STFN (COND ([AND (EQ (fetch OPNAME of (CAR CODE)) (QUOTE CONST)) (LITATOM (fetch OPARG of (CAR CODE] (* EQ IFF EQUAL) (QUOTE EQ)) (T (CAR EXP))) 2]) ) (PUTPROPS .TEST. BYTEMACRO (APPLY CNTEST)) (DEFINEQ (CNTEST [LAMBDA (X FORM FLG) (* lmm "16-APR-82 00:29") (PROG (EXIT (TEST (SUBPAIR (QUOTE (*)) (LIST DONOTHING) FORM)) A) (CEXPR X) (RETURN (SELECTQ (fetch OPNAME of PREDF) ((FJUMP TJUMP NFJUMP) (CW .TEST. in PREDF) (CEXPR TEST NIL NIL PREDF)) [NTJUMP (COND ((OR (FMEMB (fetch OPNAME of (SETQ A (CAR CODE))) (QUOTE (AVAR HVAR GVAR FVAR))) (AND (EQ (fetch OPNAME of A) (QUOTE SETQ)) (PROGN (SETQ A (fetch OPARG of A)) T))) (CW .TEST. VAR in NTJUMP) [CEXPR TEST NIL NIL (create JUMP OPNAME ←(QUOTE FJUMP) TAG ←(SETQ EXIT (create TAG] (COMP.STVAR A) (COMP.STJUMP (QUOTE JUMP) (fetch (JUMP TAG) of PREDF)) (COMP.STTAG EXIT) (RETURN (QUOTE PREDVALUE))) (T (CW .TEST. in NTJUMP PREDF) (COMP.STCOPY) [CEXPR TEST NIL NIL (create JUMP OPNAME ←(QUOTE FJUMP) TAG ←(SETQ EXIT (create TAG] (COMP.STJUMP (QUOTE JUMP) (fetch (JUMP TAG) of PREDF)) (COMP.STTAG EXIT) (COMP.STPOP) (RETURN (QUOTE PREDVALUE] (COND ((OR (FMEMB (fetch OPNAME of (SETQ A (CAR CODE))) (QUOTE (AVAR HVAR GVAR FVAR))) (AND (EQ (fetch OPNAME of A) (QUOTE SETQ)) (PROGN (SETQ A (fetch OPARG of A)) T))) (CW .TEST. VAR not in PREDF) [CEXPR TEST NIL NIL (create JUMP OPNAME ←(QUOTE NFJUMP) TAG ←(SETQ EXIT (create TAG] (COMP.STVAR A) (COMP.STTAG EXIT)) (T (CW .TEST. not in PREDF) (COMP.STCOPY) [CEXPR TEST NIL NIL (create JUMP OPNAME ←(QUOTE TJUMP) TAG ←(SETQ EXIT (create TAG] (COMP.STPOP) (COMP.STCONST) (COMP.STTAG EXIT]) ) (RPAQQ MAPFNS (MAP MAPC MAPLIST MAPCAR MAPCON MAPCONC SUBSET SOME EVERY NOTANY NOTEVERY)) (PUTPROPS MAP BYTEMACRO (APPLY* CMAPC)) (PUTPROPS MAPC BYTEMACRO (APPLY* CMAPC T)) (PUTPROPS MAPLIST BYTEMACRO (APPLY* CMAPC NIL T)) (PUTPROPS MAPCAR BYTEMACRO (APPLY* CMAPC T T)) (PUTPROPS MAPCON BYTEMACRO (APPLY* CMAPC NIL J)) (PUTPROPS MAPCONC BYTEMACRO (APPLY* CMAPC T J)) (PUTPROPS SUBSET BYTEMACRO (APPLY* CMAPC T S)) (PUTPROPS SOME BYTEMACRO (APPLY* CMAPC BOTH NIL TJUMP)) (PUTPROPS EVERY BYTEMACRO (APPLY* CMAPC BOTH NIL FJUMP T)) (PUTPROPS NOTANY BYTEMACRO (APPLY* CMAPC BOTH NIL TJUMP T)) (PUTPROPS NOTEVERY BYTEMACRO (APPLY* CMAPC BOTH NIL FJUMP NIL)) (PUTPROPS .DOCOLLECT. BYTEMACRO [(VAL TAIL ITEM) (COND [(NOT TAIL) (SETQ TAIL (SETQ VAL (LIST ITEM] (T (FRPLACD TAIL (SETQ TAIL (LIST ITEM]) (PUTPROPS .DOJOIN. BYTEMACRO [(VAL TAIL ITEM) (AND (LISTP ITEM) (COND (TAIL (FRPLACD (SETQ TAIL (LAST TAIL)) ITEM)) (T (SETQ TAIL (SETQ VAL ITEM]) (DEFINEQ (CMAPC [LAMBDA (L CARFLG COLLECT PRED NEG WHILEF) (* lmm "16-APR-82 00:29") (CW compile call to mapping function) (PROG [(FROMFORM (CAR L)) (DOF (CADR L)) (BYF (CADDR L)) BOUNDVARS BINDVALS F VAL (XARG (QUOTE ($X] [COND [(APFNP DOF) (SETQ DOF (CADR DOF)) (COND ((AND (NOT CARFLG) (EQ (CAR (LISTP DOF)) (QUOTE LAMBDA))) (* leave DOF alone) NIL) (T (SETQ DOF (LIST (QUOTE LAMBDA) XARG (CONS DOF (COND ([AND (EQ CARFLG (QUOTE BOTH)) (NOT (AND (CLEANFNP DOF (QUOTE NARGS)) (EQ (NARGS DOF) 1] (QUOTE ((CAR $X) $X))) [CARFLG (QUOTE ((CAR $X] (T (QUOTE ($X] (T (CW map function with computed functional arg) (SETQ BINDVALS (LIST DOF FROMFORM)) [SETQ BOUNDVARS (LIST (QUOTE $F1) (SETQ FROMFORM (QUOTE $L] (SETQ DOF (LIST (QUOTE LAMBDA) XARG (SELECTQ CARFLG (BOTH (QUOTE (APPLY* $F1 (CAR $X) $X))) (NIL (QUOTE (APPLY* $F1 $X))) (QUOTE (APPLY* $F1 (CAR $X] [COND ((NULL BYF) (SETQ BYF (QUOTE CDR))) [(APFNP BYF) (CW mapping function with BY argument) (OR (EQ [CAR (LISTP (SETQ BYF (CADR BYF] (QUOTE LAMBDA)) (SETQ BYF (LIST (QUOTE LAMBDA) XARG (LIST BYF (QUOTE $X] (T (CW mapping function with computed BY argument) (SETQ BINDVALS (CONS BYF BINDVALS)) (SETQ BOUNDVARS (CONS (QUOTE $F2) BOUNDVARS)) (SETQ BYF (QUOTE (LAMBDA ($X) (COND ((NULL $F2) (CDR $X)) (T (APPLY* $F2 $X] [COND ((NULL WHILEF) (SETQ WHILEF (QUOTE LISTP))) [(APFNP WHILEF) (OR (EQ [CAR (LISTP (SETQ WHILEF (CADR WHILEF] (QUOTE LAMBDA)) (SETQ WHILEF (LIST (QUOTE LAMBDA) XARG (LIST WHILEF (QUOTE $X] (T (SETQ BINDVALS (CONS (LIST (QUOTE OR) WHILEF (QUOTE (QUOTE LISTP))) BINDVALS)) (SETQ BOUNDVARS (CONS (QUOTE $F3) BOUNDVARS)) (SETQ WHILEF (QUOTE (LAMBDA ($X) (APPLY* $F3 $X] [COND (COLLECT (push BINDVALS NIL NIL NIL NIL) (push BOUNDVARS (SETQ VAL (QUOTE $V)) (QUOTE $Z) (QUOTE $W) (QUOTE $X] (* bind extra vars) (SETQ F (BINDVARS (DREV BOUNDVARS) (DREV BINDVALS) (QUOTE MAP))) [PROG ((ALLVARS (APPEND (fetch VARS of F) ALLVARS)) (SPECVARS SPECVARS) (LOCALVARS LOCALVARS) (LP (create TAG)) (ENDLP (create TAG)) (OUT (create TAG)) NXT) (COMP.STBIND F) [CEFFECT (QUOTE (DECLARE (LOCALVARS $F1 $F2 $X $V $Z $W $F3] (CVAL FROMFORM) (CCHECK (AND (EQ LEVEL 1) (EQ FRAME F))) (COMP.STJUMP (QUOTE JUMP) ENDLP) (SETQ LEVEL 1) (SETQ FRAME F) (COMP.STTAG LP) (COMP.STCOPY) [COND (COLLECT (CCHECK (NOT PRED)) (SELECTQ COLLECT [(T J) (* collect or join) (CEFFECT (LIST (QUOTE SETQ) (QUOTE $X) DONOTHING)) [CEFFECT (LIST (QUOTE SETQ) (QUOTE $W) (COND ((EQ (CADR DOF) XARG) (CADDR DOF)) (T (LIST DOF (QUOTE $X] (CEFFECT (SELECTQ COLLECT (J (QUOTE (.DOJOIN. $V $Z $W))) (QUOTE (.DOCOLLECT. $V $Z $W] (S (* SUBSET) [CEXPR (LIST DOF DONOTHING) NIL NIL (create JUMP OPNAME ←(QUOTE FJUMP) TAG ←(SETQ NXT (create TAG] (COMP.STCOPY) (CEFFECT (LIST (QUOTE SETQ) (QUOTE $W) (LIST (QUOTE CAR) DONOTHING))) (CEFFECT (QUOTE (.DOCOLLECT. $V $Z $W))) (COMP.STTAG NXT)) (SHOULDNT))) (PRED (CEXPR (LIST DOF DONOTHING) NIL NIL (create JUMP OPNAME ← PRED TAG ← OUT))) (T (CEFFECT (LIST DOF DONOTHING] (CCHECK (EQ LEVEL 1)) (CEXPR (LIST BYF DONOTHING)) (* get next element) (COMP.STTAG ENDLP) (CEXPR (LIST WHILEF DONOTHING)) (COMP.STJUMP (QUOTE NTJUMP) LP) (COND [PRED (COND ((AND (EQ PRED (QUOTE TJUMP)) (NULL NEG)) (CVAL NIL) (COMP.STTAG OUT)) (T (CVAL NEG) (COMP.STJUMP (QUOTE JUMP) (SETQ NXT (create TAG))) (COMP.STTAG OUT) (COMP.STPOP) (CVAL (NULL NEG)) (COMP.STTAG NXT] (T (CVAL VAL] (RETURN (UNBINDVARS F]) ) (PUTPROPS LISPXWATCH BYTEMACRO T) (PUTPROPS FETCHFIELD BYTEMACRO T) (PUTPROPS REPLACEFIELD BYTEMACRO T) (PUTPROPS FFETCHFIELD BYTEMACRO (= . FETCHFIELD)) (PUTPROPS FREPLACEFIELD BYTEMACRO (= . REPLACEFIELD)) (PUTPROPS REPLACEFIELDVAL BYTEMACRO T) (PUTPROPS FREPLACEFIELDVAL BYTEMACRO (= . REPLACEFIELDVAL)) (PUTPROPS GETPROP BYTEMACRO (= . GETP)) (PUTPROPS BLKAPPLY BYTEMACRO (= . APPLY)) (PUTPROPS BLKAPPLY* BYTEMACRO (= . APPLY*)) (PUTPROPS ADD1VAR BYTEMACRO ((X) (SETQ X (ADD1 X)))) (PUTPROPS SUB1VAR BYTEMACRO ((X) (SETQ X (SUB1 X)))) (PUTPROPS KWOTE BYTEMACRO (OPENLAMBDA (Q) (COND ((AND Q (NEQ Q T) (NOT (NUMBERP Q))) (LIST (QUOTE QUOTE) Q)) (T Q)))) (PUTPROPS FRPLNODE BYTEMACRO (OPENLAMBDA (X A D) (FRPLACD (FRPLACA X A) D))) (PUTPROPS RPLNODE BYTEMACRO (OPENLAMBDA (X A D) (RPLACD (RPLACA X A) D))) (PUTPROPS LISTGET1 BYTEMACRO (OPENLAMBDA (X Y) (CADR (MEMB Y X)))) (PUTPROPS FRPLNODE2 BYTEMACRO (OPENLAMBDA (X Y) (FRPLACD (FRPLACA X (CAR Y)) (CDR Y)))) (PUTPROPS JSYS BYTEMACRO PUNT) (PUTPROPS EQMEMB BYTEMACRO (OPENLAMBDA (X Y) (OR (EQ X Y) (AND (LISTP Y) (FMEMB X Y) T)))) (PUTPROPS MKLIST BYTEMACRO [OPENLAMBDA (X) (OR (LISTP X) (AND X (LIST X]) (* Pass 1 listing) (DEFINEQ (MLLIST [LAMBDA (FN CC) (* lmm: "13-NOV-76 06:56:28") (RESETLST (RESETSAVE (RADIX 10)) (RESETSAVE (LINELENGTH 72)) (PRIN2 FN) (MAPRINT (fetch ARGS of CC) NIL "(" ")" " " (FUNCTION MLLVAR)) (SPACES 5) [PRINT (CDR (FASSOC (fetch COMTYPE of CC) (QUOTE ((0 . LAMBDA) (2 . LAMBDA*) (1 . NLAMBDA) (2 . NLAMBDA*) (NIL . ???] (MLL (fetch CODE of CC]) (MLL [LAMBDA (LL) (* lmm " 8-MAY-81 23:29") [MAPC LL (FUNCTION (LAMBDA (X) (COND ((type? TAG X) (OR (ZEROP (POSITION)) (TERPRI)) (PRIN2 (fetch (TAG LBNO) of X)) (PRIN1 (QUOTE :))) (T (PROG ((S (GETP (fetch OPNAME of X) (QUOTE MLSYM))) (P (POSITION))) (COND ((ILESSP P 5) (SPACES (IDIFFERENCE 6 P))) ((IGREATERP P 60) (TERPRI) (SPACES 6)) (T (SPACES 1))) (AND (CAR S) (PRIN1 (CAR S))) [SELECTQ (CDDR S) (CONST (PRIN2 (fetch OPARG of X))) (VAR (MLLVAR X)) (FN (* FN and LINKEDFN) (MLLFN X)) (VREF (* SETQ ARG) (MLLVAR (fetch OPARG of X))) [JUMP (PRIN2 (fetch (TAG LBNO) of (fetch (JUMP TAG) of X] [BIND (PROG [NN N (F (CDR (fetch OPARG of X] (SETQ N (SETQ NN (fetch NVALS of F))) [MAPC (fetch VARS of F) (FUNCTION (LAMBDA (V) [PRIN1 (COND ((EQ N NN) (* 1st one) "") ((ZEROP N) (QUOTE ;)) (T (QUOTE ,] (SETQ N (SUB1 N)) (MLLVAR V] (COND ((ZEROP N) (* All val-bound) (PRIN1 ";"] [UNBIND (PRIN1 (CAR (fetch OPARG of X] (PROGN (PRIN1 (fetch OPNAME of X)) (AND (fetch OPARG of X) (PRIN1 (LIST (fetch OPARG of X] (AND (CADR S) (PRIN1 (CADR S] (TERPRI) (TERPRI]) (MLLVAR [LAMBDA (X N) (* lmm: "22-JUL-77 02:33") (SETQ N (fetch (VAR VARNAME) of X)) (PRIN2 (SELECTQ (fetch OPNAME of X) (HVAR (LCASE N)) (XVAR (QUOTE XVAR)) N]) (LCASE [LAMBDA (X) (* lmm: " 19-JUL-76 12:51:4") (OR (GETP X (QUOTE LCASE)) (AND X (PUT X (QUOTE LCASE) (L-CASE X]) (MLLFN [LAMBDA (X FN) (* lmm "27-OCT-81 20:26") [PRIN2 (SETQ FN (CDR (fetch OPARG of X] (SETQ X (CAR (fetch OPARG of X))) (AND (LITATOM FN) (OR (AND (ZEROP (ARGTYPE FN)) (EQ (NARGS FN) X)) (PROGN (SPACES 1) (PRIN2 X]) ) (RPAQQ COPS (BIND UNBIND DUNBIND ERRORSET JUMP TJUMP FJUMP NTJUMP NFJUMP POP COPY RETURN TAG FN CONST SETQ AVAR HVAR GVAR FVAR STORE)) (PUTPROPS BIND MLSYM ("BIND[" %] . BIND)) (PUTPROPS UNBIND MLSYM ("UNBIND(" %) . UNBIND)) (PUTPROPS DUNBIND MLSYM ("DUNBIND(" %) . UNBIND)) (PUTPROPS ERRORSET MLSYM ("ERRORSET " % . JUMP)) (PUTPROPS JUMP MLSYM ("JUMP " % . JUMP)) (PUTPROPS TJUMP MLSYM ("TJUMP " % . JUMP)) (PUTPROPS FJUMP MLSYM ("FJUMP " % . JUMP)) (PUTPROPS NTJUMP MLSYM ("NTJUMP " % . JUMP)) (PUTPROPS NFJUMP MLSYM ("NFJUMP " % . JUMP)) (PUTPROPS FN MLSYM (%[ %] . FN)) (PUTPROPS CONST MLSYM (' NIL . CONST)) (PUTPROPS SETQ MLSYM ("SETQ<" > . VREF)) (PUTPROPS AVAR MLSYM (< > . VAR)) (PUTPROPS HVAR MLSYM (#< > . VAR)) (PUTPROPS GVAR MLSYM (< > . VAR)) (PUTPROPS FVAR MLSYM (< > . VAR)) [DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY (BLOCK: MLL MLL MLLFN (NOLINKFNS . T)) ] (* ARJ - JUMP LENGTH RESOLVER) (DEFINEQ (RESOLVEJUMPS [LAMBDA (JL PROP FN) (* lmm "19-JUL-80 10:00") (PROG ((CU 0) Z NEW) [for X in JL do (replace JSN of X with (fetch JMIN of X)) (COND [(fetch JPT of X) (* Jump) (SETQ Z (CAR (GETPROP (fetch OPNAME of (CAR (fetch JPT of X))) PROP))) (replace JML of X with (CAR Z)) (add CU (replace JU of X with (IDIFFERENCE (CDR Z) (CAR Z] (T (* Tag) (replace JU of X with CU] (while (LISTP (SETQ NEW (JLENPASS JL PROP))) do (SETQ JL NEW)) (COND (NEW (JFIXPASS JL FN]) (JLENPASS [LAMBDA (JL PROP) (* lmm "19-JUL-80 10:08") (PROG ((INC 0) (DEC 0) (CU 0) X U U1 DEF MIN ML SMIN SMAX) (* JPT is NIL (for tags) or a pointer into ACODE (for jumps). JMIN is the lowest possible location for the instruction or tag. JU is the cumulative uncertainty (for tags) or the length uncertainty (for jumps). JML is the minimum length (for jumps). JSN is a serial number (the original JMIN) used to decide whether a jump goes forward or backward.) (* In the loop, CU is the cumulative uncertainty, DEC is the cumulative decrease in uncertainty, and INC is the cumulative increase in minimum location.) [for J in JL do (SETQ X (CAR (fetch JPT of J))) (add (fetch JMIN of J) INC) (COND ((NULL X) (SETQ DEC (IDIFFERENCE CU (fetch JU of J))) (replace JU of J with CU)) ((NEQ (SETQ U (fetch JU of J)) 0) [SETQ DEF (fetch (TAG JD) of (CAR (fetch OPARG of X] (SETQ MIN (IDIFFERENCE (fetch JMIN of DEF) (fetch JMIN of J))) (SETQ SMAX (JSIZE X (IPLUS (IDIFFERENCE (fetch JU of DEF) CU) (COND ((IGREATERP (fetch JSN of DEF) (fetch JSN of J)) (IPLUS (SETQ MIN (IPLUS MIN INC)) DEC)) (T MIN))) PROP)) (SETQ SMIN (JSIZE X MIN PROP)) [COND ((NEQ SMIN (SETQ ML (fetch JML of J))) (replace JML of J with SMIN) (add INC (IDIFFERENCE SMIN ML] (COND ((NEQ (SETQ U1 (IDIFFERENCE SMAX SMIN)) U) [COND ((ILESSP U1 0) (COMPILERERROR (QUOTE (U1 negative] (add DEC (IDIFFERENCE U1 U)) (replace JU of J with U1))) (add CU U1] (RETURN (COND ((AND (NEQ DEC 0) (NEQ CU 0)) JL) (T T]) (JFIXPASS [LAMBDA (JL FN) (* lmm "19-JUL-80 10:23") (PROG (X) (for J in JL do (COND ([NULL (SETQ X (CAR (fetch JPT of J] (replace JU of J with 0)) (T (APPLY* FN (fetch JPT of J) (IDIFFERENCE [fetch JMIN of (fetch (TAG JD) of (CAR (fetch OPARG of X] (fetch JMIN of J]) (JSIZE [LAMBDA (OP D FN) (* lmm "27-OCT-81 20:28") (PROG [(Z (CDR (GETPROP (fetch OPNAME of OP) FN] LP (COND ((NLISTP Z) (RETURN Z)) (T [SETQ Z (COND ((ILESSP D (CAR Z)) (CADR Z)) (T (CDDR Z] (GO LP]) ) [DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY (BLOCK: RESOLVEJUMPS RESOLVEJUMPS JLENPASS JFIXPASS (NOLINKFNS . T)) ] (* utilities used by all files) (DEFINEQ (CALLP [LAMBDA (OP FN N) (* lmm: "22-JUL-77 02:40") (AND (EQ (fetch OPNAME of OP) (QUOTE FN)) (OR (NULL N) (EQ (CAR (fetch OPARG of OP)) N)) (OR (NULL FN) (EQ (CDR (fetch OPARG of OP)) FN) (AND (LISTP FN) (FMEMB (CDR (fetch OPARG of OP)) FN]) (JUMPCHECK [LAMBDA (C) (* lmm: "22-JUL-77 02:39") (SELECTQ (fetch OPNAME of (CAR C)) ((JUMP RETURN) T) NIL]) (DREV [LAMBDA (L Z) (PROG (Y) R1 (COND ((NLISTP (SETQ Y L)) (RETURN Z))) (SETQ L (CDR L)) (SETQ Z (FRPLACD Y Z)) (GO R1]) (CHLEV [LAMBDA (N) (* lmm "14-MAR-81 09:54") (COND (LEVEL (PROG1 (add LEVEL N) (CCHECK (IGEQ LEVEL 0]) (CHECKTAG [LAMBDA (TAG TAGFLAG) (* lmm "14-MAR-81 09:15") (COND ((NULL LEVEL) (replace (TAG LEVEL) of TAG with NIL)) ((NULL (fetch (TAG LEVEL) of TAG)) (AND TAGFLAG (SETQ LEVEL NIL))) (T (CCHECK (EQ LEVEL (fetch (TAG LEVEL) of TAG))) T]) (NOTJUMP [LAMBDA (X) (* lmm: "22-JUL-77 03:39") (PROG NIL (RETURN (create OP OPNAME ←(OR (SELECTQ (fetch OPNAME of X) (FJUMP (QUOTE TJUMP)) (TJUMP (QUOTE FJUMP)) NIL) (RETURN)) OPARG ←(fetch OPARG of X]) (INITHASH [NLAMBDA (X) (* lmm: "22-JUL-77 15:39") (COND ([HARRAYP (CAR (LISTP (EVALV X] (CLRHASH (EVALV X))) (T (SET X (LIST (HARRAY 100]) (COMPINIT [LAMBDA NIL (* lmm: "22-JUL-77 16:51") [MAPC (QUOTE ((OPRETURN . RETURN) (OPPOP . POP) (OPCOPY . COPY) (OPNIL . CONST))) (FUNCTION (LAMBDA (X) (SET (CAR X) (create OP OPNAME ←(CDR X] (SETQ DONOTHING (LIST (QUOTE AC]) ) (MOVD? (QUOTE NILL) (QUOTE REFRAME)) (AND (GETD (QUOTE COMPINIT)) (COMPINIT)) (PUTPROPS LOADTIMECONSTANT BYTEMACRO (= . DEFERREDCONSTANT)) (PUTPROPS FRPTQ BYTEMACRO CFRPTQ) (DEFINEQ (CFRPTQ [LAMBDA (L) (* lmm "16-APR-82 00:29") (COND (EFF (PROG ((END (create TAG)) (ST (create TAG))) (CVAL (CAR L)) (* counter) (COMP.STTAG ST) (COMP.STCOPY) (CVAL 0) (COMP.STFN (QUOTE IGREATERP) 2) (COMP.STJUMP (QUOTE FJUMP) END) (CVALN (CDR L) T) (CVAL 1) (COMP.STFN (QUOTE IDIFFERENCE) 2) (COMP.STJUMP (QUOTE JUMP) ST) (COMP.STTAG END))) (T (CEXP1 (CONS (QUOTE RPTQ) L]) ) [DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY (BLOCK: BYTECOMPBLOCK ANONP APFNP ATYP BINDLIS BINDVARS BYTEBLOCKCOMPILE2 BYTECOMPILE2 CAC CBOOL CCALL CCOMMENT CCOND CCONST CCROP CDECLARE CDECLARE1 CEFFECT CEQ CEXP1 CEXPR CFRPTQ CFUNCTION CGO CKVAR CLAM CLAM1 CMAC CMAPC CNCALL CNOT CNTEST CNUMBER CPI CPI1 CPROG CPROG1 CPROGN CQUOTE CRETURN CSELECTQ CSETN CSETQ CVAL CVAL1 CVALN CVAR DELPOPP GENFN LOOKUPVAR MC1 MC2 MC2A PICOUNT TRYCUSERFN UNBINDVARS VARTYPE (ENTRIES BYTEBLOCKCOMPILE2 BYTECOMPILE2 CVAL1 CVAL CEFFECT CEXPR CEXP1 CLAM1 CCALL LOOKUPVAR CCONST CPROGN) (BLKAPPLYFNS CAC CBOOL CCOMMENT CCOND CCROP CDECLARE CEQ CEXP1 CEXPR CFUNCTION CGO CLAM1 CMAPC CNCALL CNOT CNTEST CNUMBER CPROG CPROG1 CPROGN CQUOTE CRETURN CSELECTQ CSETN CSETQ CFRPTQ) (SPECVARS AC ALAMS1 ALLVARS ARGS ARGVARS BLKDEFS BLKFLG CODE COMFN COMFNS COMTYPE CONSTS EFF EMFLAG EXP FRAME FREELST FREEVARS LAPFLG LBCNT LEVEL LOCALVARS LOCALVARS LSTFIL MACEXP NLAMS1 PIFN PREDF PROGEFF PROGRETF RETF RETURNLABEL SPECVARS SPECVARS SUBFNFREEVARS TAGS TOPFN TOPFRAME TOPLAB VARS INTERNALBLKFNS) (RETFNS CVAR MC2) (NOLINKFNS COMPPRINT COMPERRM)) (BLOCK: NIL CUSERFN COMPERRM (SPECVARS PLVLFILEFLG)) ] (PUTPROPS IMAX2 BYTEMACRO (OPENLAMBDA (X Y) (COND ((NOT (IGREATERP X Y)) Y) (T X)))) (PUTPROPS IMIN2 BYTEMACRO (OPENLAMBDA (X Y) (COND ((IGREATERP X Y) Y) (T X)))) (ADDTOVAR COMPILETYPELST ) (RPAQQ POSTOPTCOMS [(* POST OPTIMIZATION) (FNS POSTOPT SETUPOPT SCANOPT XVARSCAN XVARSCAN1 JUMPOPT JUMPTHRU LBMERGE PRDEL UBDEL LBDEL LABELNTHPR JUMPREV COMMONBACK DELTAGREF FINDEND RETOPT RETFIND RETPOP RETOPT1 RETTEST RETMERGE CODELEV CODEFRAME DEFREFS SETDEFREFS) (FNS FRAMEOPT FRAMEMERGE NONILVAR MERGEFRAMEP FRAMELOCAL CLEANFRAME FRAMEDEL FRAMEVAR DELETEFRAMECHECK ONLYMEMB) (VARS MERGEFRAMETYPES (OPTIMIZATIONSOFF)) (FNS SKIPPUSH DELCODE PRATTACH JUMPCOPYTEST EQOP EQVALUE DELCOPYFN) (FNS DEADSETQP DS1) (BLOCKS (NIL PRDEL PRATTACH EQOP EQVALUE SKIPPUSH CODEFRAME LABELNTHPR UBDEL DELCODE (LOCALVARS . T) (SPECVARS CODE LEVEL)) (NIL POSTOPT SETUPOPT JUMPOPT (LOCALVARS . T) (SPECVARS LABELS PASS ANY CODE FRAME FRAMES)) (FRAMEOPT FRAMEOPT CLEANFRAME DELETEFRAMECHECK FRAMEDEL FRAMELOCAL FRAMEMERGE FRAMEVAR MERGEFRAMEP NONILVAR ONLYMEMB (GLOBALVARS MERGEFRAMEMAX MERGEFRAMEFLG MERGEFRAMETYPES) (SPECVARS VARS ANY FRAME) (NOLINKFNS . T)) (SCANOPT SCANOPT DEADSETQP DS1 (SPECVARS TAGS) (NOLINKFNS . T) (LOCALFREEVARS ICNT)) (NIL DELCOPYFN JUMPTHRU LBMERGE LBDEL JUMPCOPYTEST (LOCALVARS . T) (SPECVARS FRAME LEVEL ANY) (NOLINKFNS . T)) (JUMPREV JUMPREV COMMONBACK DELTAGREF FINDEND (SPECVARS FRAME LEVEL ANY) (NOLINKFNS . T)) (RETOPT RETOPT RETFIND RETPOP RETTEST RETOPT1 RETMERGE (SPECVARS TAGS ANY) (NOLINKFNS . T]) (* POST OPTIMIZATION) (DEFINEQ (POSTOPT [LAMBDA (CODE) (* lmm "18-DEC-82 00:05") (COND [OPTIMIZATIONSOFF (while CODE bind C VAL do (SETQ TAGS NIL) (while (EQ (fetch OPNAME of (SETQ C (pop CODE))) (QUOTE TAG)) do (push TAGS C)) (while (AND (EQ (fetch OPNAME of C) (QUOTE JUMP)) (FMEMB (fetch OPARG of C) TAGS)) do (SETQ C (pop CODE))) (for TAG in TAGS do (push VAL TAG)) (push VAL C) finally (RETURN (CDR VAL] (T (PROG ((FRAME TOPFRAME) LABELS ANY (FRAMES (LIST (LIST TOPFRAME))) (PASS 1) DELETEDBINDS) (SETQ CODE (CONS NIL (NCONC1 CODE NIL))) (SETUPOPT) OPTLP (SETQ ANY) (CW optimization pass) (AND (FRAMEOPT (EQ PASS 1)) (SETQ ANY T)) (SCANOPT) (JUMPOPT) (RETOPT) (CCHECK (OPTCHECK)) [COND ((NOT ANY) (AND [NOT (OR (AND XVARFLG (PROGN (XVARSCAN) (FRAMEOPT T NIL T))) (AND MERGEFRAMEFLG (FRAMEOPT T T XVARFLG] (RETURN (CDR (DREV (CDR CODE] (SETQ PASS (ADD1 PASS)) (GO OPTLP]) (SETUPOPT [LAMBDA NIL (* lmm: "22-JUL-77 02:59") (* set up code list as doubly linked list, scan for tags) (PROG ((C CODE) P B) LPC (COND ((NULL C) (RETURN))) (SELECTQ (fetch OPNAME of (CAR C)) [TAG (COND ((SETQ B (FASSOC (CAR C) LABELS)) (FRPLACA (CDR B) C)) (T (SETQ LABELS (CONS (LIST (CAR C) C) LABELS] [(JUMP TJUMP FJUMP NTJUMP NFJUMP ERRORSET) (COND ((SETQ B (FASSOC (fetch (JUMP TAG) of (CAR C)) LABELS)) (NCONC1 B C)) (T (SETQ LABELS (CONS (LIST (fetch (JUMP TAG) of (CAR C)) NIL C) LABELS] NIL) (SELECTQ (fetch OPNAME of (CAR C)) [(ERRORSET BIND) (COND ((SETQ B (FASSOC (CDR (fetch OPARG of (CAR C))) FRAMES)) (RPLACA (CDR B) C)) (T (SETQ FRAMES (CONS (LIST (CDR (fetch OPARG of (CAR C))) C) FRAMES] [(UNBIND DUNBIND) (COND ((SETQ B (FASSOC (CDR (fetch OPARG of (CAR C))) FRAMES)) (NCONC1 B C)) (T (SETQ FRAMES (CONS (LIST (CDR (fetch OPARG of (CAR C))) NIL C) FRAMES] NIL) (SETQ B (CDR C)) (replace PREV of C with B) (replace NXT of C with P) (SETQ P C) (SETQ C B) (GO LPC]) (SCANOPT [LAMBDA NIL (* lmm "11-AUG-83 22:22") (PROG ((CD CODE) A B P X Y) LP (SETQ B (fetch PREV of CD)) [AND P (CCHECK (EQ CD (fetch PREV of P] (SELECTQ (fetch OPNAME of (SETQ A (CAR CD))) (CONST (COND ((AND (CALLP (CAR P) NIL 1) (OR (FMEMB [SETQ X (CDR (fetch OPARG of (CAR P] CONSTFNS) (FMEMB X VCONDITIONALS) (FMEMB X CONDITIONALS))) (CW CONST FN.1 -> (FN CONST)) [RPLACA CD (create OP OPNAME ←(QUOTE CONST) OPARG ←(APPLY* X (fetch OPARG of A] (PRDEL P) (GO BLP)) ([AND (SETQ A (FASSOC (fetch OPARG of A) CONST.FNS)) (SOME (CDR A) (FUNCTION (LAMBDA (X) (CALLP (CAR P) (CAR (SETQ A (CDR X))) (CAR X] (CW constant + fn -> otherfn) (PRDEL CD) (PRDEL P) [MAPC (CDR A) (FUNCTION (LAMBDA (X) (SETQ B (PRATTACH (create OP OPNAME ←(CAR X) OPARG ←(CDR X)) B] (GO BLP))) (GO CHECKPUSH)) (HVAR (GO CHECKPUSH)) ((AVAR GVAR FVAR) (GO CHECKPUSH)) [SETQ (COND ((DEADSETQP (fetch OPARG of A) P) (CW delete dead SETQ) (PRDEL CD) (GO BLP] (POP (SELECTQ (fetch OPNAME of (CAR B)) ((AVAR HVAR FVAR GVAR COPY CONST) (CW push POP deleted) (PRDEL B) (PRDEL CD) (SETQ B P) (GO BLP)) [FN (COND ((CLEANFNOP (CDR (fetch OPARG of (CAR B))) (QUOTE NOSIDE)) (CW cleanfn POP deleted) (RPTQ (PROG1 (CAR (fetch OPARG of (CAR B))) (PRDEL B) (PRDEL CD) (SETQ B (fetch PREV of P))) (SETQ B (PRATTACH OPPOP B))) (GO BLP] [SETQ (COND ([EQUAL (CAR (fetch PREV of B)) (CONSTANT (create OP OPNAME ←(QUOTE COPY] (CW COPY SETQ POP -> SETQ) (PRDEL (fetch PREV of B)) (PRDEL CD) (SETQ B P) (GO BLP] NIL)) [DUNBIND (COND ((EQ (CAR B) OPPOP) (CW merge pop with DUNBIND) (PRDEL B) (* (DUNBIND level . frame)) [RPLACA (fetch OPARG of (CAR CD)) (ADD1 (CAR (fetch OPARG of (CAR CD] (GO ALP] [UNBIND (AND MERGEFRAMEFLG (COND ((SELECTQ (fetch OPNAME of (CAR B)) [CONST (CW CONST UNBIND) (replace OPNAME of A with (QUOTE DUNBIND)) (* change to DUNBIND) (* level is 1 less) (RPLACA (fetch OPARG of A) (SUB1 (CAR (fetch OPARG of A] (FN (COND ((AND (EQ (CAR (fetch OPARG of (CAR B))) 1) (CLEANFNOP (CDR (fetch OPARG of (CAR B))) (QUOTE FREEVARS))) (CW clean FN UNBIND) T))) NIL) (RPLACA CD (CAR B)) (RPLACA B A) (* switch CONST and DUNBIND) (RPLACA (MEMB CD (CDDR (FASSOC (CDR (fetch OPARG of A)) FRAMES))) B) (GO BLP] NIL) TAG2(COND ((NULL B) (RETURN))) (SETQ P CD) (SETQ CD B) (GO LP) BLP (SETQ CD B) CLP (SETQ P (fetch NXT of CD)) ALP (SETQ ANY T) (GO LP) CHECKPUSH (AND NEWOPTFLG (SELECTQ (fetch OPNAME of (CAR B)) [POP (COND ((EQVALUE (fetch PREV of B) CD) (CW X POP X) (PRDEL CD) (PRDEL B) (SETQ CD (fetch PREV of P)) (GO ALP] NIL)) [COND (NEWOPTFLG (COND ((SETQ X (JUMPCOPYTEST CD B)) (* can insert COPY at X and then delete CD) (SETQ X (DELCOPYFN P X)) (SETQ P (fetch NXT of CD)) [COND ((EQ X (fetch PREV of CD)) (PRDEL CD)) (T (FRPLACA CD (QUOTE (SWAP] (PRATTACH OPCOPY X) (SETQ CD (fetch PREV of P)) (GO ALP))) (COND ((AND (SETQ X (SKIPPUSH B 1 CD T)) (SETQ X (JUMPCOPYTEST CD X))) (SETQ X (DELCOPYFN P X)) (PRATTACH OPCOPY X) (FRPLACA CD (QUOTE (SWAP))) (GO ALP))) (GO TAG2)) (T (COND ((EQVALUE B CD) (CW val val -> val COPY) (FRPLACA CD OPCOPY)) ((EQ (CAR B) OPPOP) (COND ((EQVALUE (fetch PREV of B) CD) (CW SETQ POP PUSH) (PRDEL CD) [PRDEL (PROG1 B (SETQ CD (fetch PREV of B] (GO ALP] (GO TAG2]) (XVARSCAN [LAMBDA NIL (* lmm " 8-MAY-81 15:01") (PROG ((CD CODE) A) [for X in FRAMES do (replace NOXVAR of (CAR X) with (NEQ NIL (OASSOC (QUOTE AVAR) (fetch VARS of (CAR X] LP (SELECTQ (fetch OPNAME of (SETQ A (CAR CD))) (HVAR (XVARSCAN1 A CD)) [SETQ (SETQ A (fetch OPARG of A)) (COND ((EQ (fetch OPNAME of A) (QUOTE HVAR)) (XVARSCAN1 A CD] ((UNBIND DUNBIND) (OR (CODELEV CD 0) (replace NOXVAR of (CDR (fetch OPARG of A)) with T))) NIL) (COND ((NULL (SETQ CD (fetch PREV of CD))) (RETURN))) (GO LP]) (XVARSCAN1 [LAMBDA (A CD) (* lmm "22-MAY-81 17:55") (PROG ((FR (CODEFRAME CD))) (OR FR (COMPILERERROR)) (COND ((FMEMB A (fetch VARS of FR)) (RETURN))) LP (SETQ FR (fetch PARENT of FR)) (COND ((FMEMB A (fetch VARS of FR)) (replace NOXVAR of FR with T) (RETURN))) (COND ((EQ FR TOPFRAME) (COMPILERERROR))) (GO LP]) (JUMPOPT [LAMBDA NIL (* lmm "11-NOV-81 21:17") (MAPC LABELS (FUNCTION (LAMBDA (X) (COND ((CADR X) (* Label defined) (COND ((OR (JUMPTHRU (CAR X) (CDR X)) (JUMPREV (CAR X) (CDR X))) (SETQ ANY T]) (JUMPTHRU [LAMBDA (TAG DEFREFS) (* lmm "19-JAN-82 21:46") (PROG ((DR DEFREFS) P APD ALST ANY INFO Y REF BR END (DEF (CAR DEFREFS)) PD B (FRAME (fetch (TAG FRAME) of TAG)) (LEVEL (fetch (TAG LEVEL) of TAG))) LQ (while [OR [type? TAG (SETQ APD (CAR (fetch PREV of DEF] (type? TAG (SETQ APD (CAR (SETQ PD (fetch NXT of DEF] do (* two adjacent tags - merge them) (LBMERGE TAG APD)) [COND ((NULL (CDR DR)) (* tag which is not reference; delete it) (RETURN (LBDEL TAG] [COND [(EQ APD OPNIL) (* instruction after the tag is NIL) (SETQQ ALST ((FJUMP NFJUMP . OPNIL] (T (SETQ ALST (SELECTQ (fetch OPNAME of APD) [JUMP (QUOTE ((JUMP) (TJUMP) (FJUMP) (NTJUMP) (NFJUMP] [TJUMP (QUOTE ((NTJUMP TJUMP) (NFJUMP FJUMP . 1] [FJUMP (QUOTE ((NTJUMP TJUMP . 1) (NFJUMP FJUMP] [NTJUMP (QUOTE ((NTJUMP) (NFJUMP FJUMP . 1] [NFJUMP (QUOTE ((NTJUMP TJUMP . 1) (NFJUMP] [POP (QUOTE ((NTJUMP TJUMP . 1) (NFJUMP FJUMP . 1) (JUMP NIL . JP] [RETURN (QUOTE ((JUMP NIL . R] [(AVAR GVAR FVAR HVAR) (QUOTE ((FJUMP NFJUMP . L) (TJUMP NTJUMP . L) (JUMP NIL . LL] (RETURN] LP (COND ((NOT (SETQ INFO (FASSOC [fetch OPNAME of (CAR (SETQ REF (CADR DR] ALST))) (GO NX))) (COND ((EQ REF PD) [COMPERRM (CONS COMFN (QUOTE (-- infinite loop] (GO NX))) (SETQ BR (fetch PREV of REF)) (SETQ Y (SELECTQ (CDDR INFO) (NIL (CW JUMP to JUMP) (fetch (JUMP TAG) of APD)) (R (CW JUMP to RETURN) (FRPLACA REF OPRETURN) NIL) [L (* VARIABLE REFERENCE) (COND ((OR (EQVALUE BR PD) (AND (EQ (fetch OPNAME of (CAR REF)) (QUOTE TJUMP)) (CALLP (CAR BR) VCONDITIONALS 1) (EQVALUE (fetch PREV of BR) PD))) (CW VAR CJUMP to VAR) (LABELNTHPR DEF 1 LEVEL 1)) [(SETQ Y (JUMPCOPYTEST PD BR)) (CW VAR CJUMP .. VAR -> VAR COPY CJUMP POP .. VAR) (PROG ((N 1) PDN) [COND (NEWOPTFLG (SETQ PDN (fetch NXT of PD)) (while (AND (CALLP (CAR (SETQ INFO (fetch NXT of Y))) NIL 1) (CLEANFNOP (CDR (fetch OPARG of (CAR INFO))) (QUOTE NOSIDE)) (EQOP (CAR INFO) (CAR PDN))) do (SETQ Y INFO) (SETQ PDN (fetch NXT of PDN)) (add N 1] (PRATTACH OPCOPY Y) (PRATTACH OPPOP REF) (SETQ INFO) (RETURN (LABELNTHPR DEF N LEVEL 1] (T (GO NX] [LL (COND ((AND (EQ (CAR BR) OPPOP) (EQVALUE (fetch PREV of BR) PD)) (CW SETQ var POP JUMP to var) (PRDEL BR) (LABELNTHPR DEF 1 LEVEL 1)) (T (GO NX] (1 (CW NTJUMP to POP) (LABELNTHPR DEF 1 LEVEL -1)) (OPNIL (CW FJUMP to NIL) (LABELNTHPR DEF 1 LEVEL 1)) [JP (COND ((SETQ B (SKIPPUSH BR 1 NIL T)) (CW JUMP to POP) [PROG NIL LPB (SETQ BR (PROG1 (fetch PREV of BR) (PRDEL BR))) (COND ((NEQ BR B) (GO LPB] (LABELNTHPR DEF 1 LEVEL -1)) (T (GO NX] (COMPILERERROR))) (COND (Y (replace (JUMP TAG) of (CAR REF) with Y) (NCONC1 (DEFREFS Y) REF))) (SETQ ANY T) (* Since the jump to this tag was redirected, delete the jump from the REFS for this tag) (FRPLACD DR (CDDR DR)) [COND ((CADR INFO) (replace OPNAME of (CAR REF) with (CADR INFO] (GO LX) NX (SETQ DR (CDR DR)) LX (COND ((CDR DR) (GO LP))) [COND ((NULL (CDR DEFREFS)) (RETURN (LBDEL TAG] (RETURN ANY]) (LBMERGE [LAMBDA (TO FROM) (* lmm: "22-JUL-77 16:03") (PROG [(REFS (CDR (DEFREFS FROM] [MAPC REFS (FUNCTION (LAMBDA (X) (replace (JUMP TAG) of (CAR X) with TO] (NCONC (DEFREFS TO) REFS) [OR (fetch (TAG LEVEL) of FROM) (PROGN (replace (TAG LEVEL) of TO with NIL) (OR (fetch FRAME of FROM) (replace FRAME of TO with NIL] (RETURN (LBDEL FROM]) (PRDEL [LAMBDA (X) (* lmm: "22-JUL-77 02:59") (PROG ((B (fetch PREV of X)) (P (fetch NXT of X))) (AND B (replace NXT of B with P)) (AND P (replace PREV of P with B)) (replace NXT of X with NIL]) (UBDEL [LAMBDA (CD) (* lmm "14-MAR-81 09:16") (DREMOVE CD (OR (FASSOC (CDR (fetch OPARG of (CAR CD))) FRAMES) (COMPILERERROR]) (LBDEL [LAMBDA (TAG) (* lmm: "22-JUL-77 16:14") (PROG ((DEF (CAR (DEFREFS TAG))) B) (SETQ B (fetch PREV of DEF)) (PRDEL DEF) (SETDEFREFS TAG NIL) [COND ((JUMPCHECK B) (CW delete code before deleted tag) (DELCODE (fetch NXT of B] (RETURN T]) (LABELNTHPR [LAMBDA (CODE CNT LEVEL DL) (* lmm: "22-JUL-77 16:12") (PROG ((CD CODE) G) (CHLEV DL) LP (SETQ CD (fetch NXT of CD)) (COND ((IGREATERP CNT 0) (OR (type? TAG (CAR CD)) (SUB1VAR CNT)) (GO LP)) (T (RETURN (COND ((type? TAG (CAR CD)) (CHECKTAG (CAR CD) T) (CAR CD)) (T (PROG1 (SETQ G (create TAG)) (replace (TAG FRAME) of G with FRAME) (SETQ CD (PRATTACH G (fetch PREV of CD))) (SETDEFREFS G (LIST CD)) (replace (TAG LEVEL) of G with LEVEL]) (JUMPREV [LAMBDA (TAG DEFREFS) (* edited: "21-DEC-79 16:05") (* JUMPREV checks the things that PRECEDE particular kinds of jumps) (PROG ((DR DEFREFS) R (D (CAR DEFREFS)) END ANY LB CD (LEVEL (fetch (TAG LEVEL) of TAG)) (FRAME (fetch (TAG FRAME) of TAG)) BD ABD FLG BR ABR OABR PR APD OAR TMP) LP (SETQ R (CADR DR)) (SETQ PR (fetch NXT of R)) (SETQ BD (fetch PREV of D)) (SETQ ABD (CAR BD)) (SETQ BR (fetch PREV of R)) (SETQ ABR (CAR BR)) (SETQ OABR (fetch OPNAME of ABR)) (SETQ OAR (fetch OPNAME of (CAR R))) (* variable code: last letter is R for reference {i.e. place of jump}, D for definition {i.e. place where TAG is} - preceding letters: - A for CAR - O for COP {op code} - P for CPR {next byte} - B for CBR {previous byte}) (SELECTQ OAR [JUMP (COND ((EQ R BD) (CW JUMP to next location deleted) (PRDEL R)) [(AND (EQOP ABD ABR) (SETQ TMP (COMMONBACK BD R LEVEL))) (* COMMONBACK returns NIL if does nothing; T if deleted safe code or SAME if it deleted some code that contained a reference to the label that is now being worked on.) (CW merge similar code before JUMP and TAG) (* IF SAME don't continue with this label! could have deleted other references to it) (COND ((EQ TMP T) (SETQ ANY T) (GO LX)) (T (RETURN T] [[AND (CAR PR) (NOT (type? TAG (CAR PR] (CW delete code after JUMP) (COND ((DELCODE PR) (* returns T if it deleted any jumps (may have deleted a jump for this tag)) (RETURN)) (T (GO NX] ([AND (SELECTQ (fetch OPNAME of ABD) (RETURN T) (JUMP (NOT (FMEMB BD DR))) NIL) (SETQ END (fetch NXT of (FINDEND D R] (CW move jumped-to code in line) (PROGN (replace NXT of BD with END) (replace PREV of (PROG1 END (SETQ END (fetch PREV of END))) with BD)) (PROGN (replace NXT of BR with D) (replace PREV of D with BR) (replace PREV of PR with END) (replace NXT of END with PR))) (T (SELECTQ OABR (CONST (* CONST JUMP) (SELECTQ (fetch OPNAME of APD) ((TJUMP NTJUMP) (SETQ FLG (fetch OPARG of ABR))) [(FJUMP NFJUMP) (SETQ FLG (NULL (fetch OPARG of ABR] (GO NX)) (NCONC1 [DEFREFS (replace (JUMP TAG) of (CAR R) with (COND (FLG (SELECTQ (fetch OPNAME of APD) ((TJUMP FJUMP) (CW T JUMP to TJUMP) (PRDEL BR)) (CW T JUMP to NTJUMP)) (fetch (JUMP TAG) of APD)) (T (CW T JUMP to NF/FJUMP) (PRDEL BR) (LABELNTHPR D 1 LEVEL -1] R)) [(TJUMP FJUMP) (COND ((EQ (fetch (JUMP TAG) of (CAR R)) (fetch (JUMP TAG) of ABR)) (CW TJUMP->TAG JUMP->TAG => POP JUMP->TAG) (PRDEL R) (PRATTACH OPPOP (fetch PREV of BR)) (replace OPNAME of ABR with (QUOTE JUMP))) (T (GO NX] (GO NX] [(FJUMP TJUMP) (COND ((EQ R BD) (CW TJUMP to next location) (FRPLACA R OPPOP)) [(EQ OABR (QUOTE CONST)) (COND ((SELECTQ OAR (TJUMP (fetch OPARG of ABR)) (NULL (fetch OPARG of ABR))) (CW T TJUMP -> JUMP) (replace OPNAME of (CAR R) with (QUOTE JUMP)) (PRDEL BR) (SETQ ANY T) (* try again) (GO LP)) (T (CW T FJUMP -> NOOP) (PRDEL R) (PRDEL BR] ((CALLP ABR (QUOTE (NOT NULL)) 1) (CW NULL TJUMP) (FRPLACA R (NOTJUMP (CAR R))) (PRDEL BR) (GO REDO)) ((AND (EQ ABR OPCOPY) (EQ (CAR PR) OPPOP)) (CW COPY TJUMP POP -> NTJUMP) (PRDEL BR) (PRDEL PR) (replace OPNAME of (CAR R) with (SELECTQ OAR (TJUMP (QUOTE NTJUMP)) (QUOTE NFJUMP))) (GO REDO)) ((AND (EQ (fetch OPNAME of ABD) (QUOTE JUMP)) (EQ (fetch PREV of BD) R)) (CW FJUMP.1 JUMP.2 1: => TJUMP.2) (replace OPNAME of ABD with (SELECTQ OAR (TJUMP (QUOTE FJUMP)) (QUOTE TJUMP))) (PRDEL R)) ((SETQ CD (JUMPCOPYTEST PR BR)) (* What is before the jump is also after - e.g. X TJUMP X) (COND ((EQ (CAR PR) (CAR (fetch NXT of D))) (CW X TJUMP.1 X ... 1:X ... -> X COPY TJUMP.2 ... 1:X 2: ...) (PRATTACH OPCOPY CD) (SETQ LB (LABELNTHPR D 1 LEVEL 1))) ((AND (JUMPCHECK (fetch PREV of D)) (OR (EQVALUE BR PR) (AND (EQ OAR (QUOTE FJUMP)) (CALLP ABR VCONDITIONALS 1) (EQVALUE (fetch PREV of BR) PR))) (SETQ END (FINDEND D R))) (CW X FJUMP.1 X .a. 1: .b. -> X NTJUMP.2 1: .b. ... 2: .a.) (PROGN (replace NXT of (fetch PREV of D) with (fetch NXT of END)) (replace PREV of (fetch NXT of END) with (fetch PREV of D))) (PROGN (replace NXT of R with D) (replace PREV of D with R) (replace PREV of PR with END) (replace NXT of END with PR)) (replace OPNAME of (CAR R) with (SELECTQ OAR (FJUMP (QUOTE NTJUMP)) (QUOTE NFJUMP))) (SETQ LB (LABELNTHPR PR 0 LEVEL 1))) (T (GO NX))) (PRDEL PR) (replace (JUMP TAG) of (CAR R) with LB) (NCONC1 (DEFREFS LB) R)) (T (GO NX] [(NFJUMP NTJUMP) (COND [(EQ OABR (QUOTE CONST)) (COND ((SELECTQ OAR (NTJUMP (fetch OPARG of ABR)) (NULL (fetch OPARG of ABR))) (CW T NTJUMP -> JUMP) (replace OPNAME of (CAR R) with (QUOTE JUMP)) (GO REDO)) (T (CW T NFJUMP -> NOOP) (PRDEL BR) (PRDEL R] ((EQVALUE BR PR) (CW X NTJUMP X -> X COPY TJUMP) (PRATTACH OPCOPY (fetch PREV of R)) (PRDEL PR) (replace OPNAME of (CAR R) with (SELECTQ OAR (NTJUMP (QUOTE TJUMP)) (QUOTE FJUMP))) (GO REDO)) [(EQ OAR (QUOTE NTJUMP)) (COND [(NOT (OR (CALLP ABR CONDITIONALS) (CALLP ABR VCONDITIONALS))) (COND ((EQ (CAR (fetch NXT of R)) OPNIL) (CW NTJUMP NIL -> COPY TJUMP) (PRDEL (fetch NXT of R)) (PRATTACH OPCOPY BR) (replace OPNAME of (CAR R) with (QUOTE TJUMP)) (GO REDO)) (T (GO NX] [(CALLP ABR VCONDITIONALS 1) (COND ((EQVALUE (fetch PREV of BR) PR) (CW X LISTP NTJUMP X -> X COPY LISTP TJUMP) (PRATTACH OPCOPY (fetch PREV of BR)) (PRDEL PR) (replace OPNAME of (CAR R) with (QUOTE TJUMP)) (GO REDO)) (T (GO NX] (T (GO NX] (T (GO NX] (GO NX)) (SETQ ANY T) (FRPLACD DR (CDDR DR)) (GO LX) NX (SETQ DR (CDR DR)) LX (COND ((CDR DR) (GO LP))) (RETURN ANY) REDO(SETQ ANY T) (GO LP]) (COMMONBACK [LAMBDA (BDEF REF LEVEL) (* DD: "21-FEB-83 18:29") (* When the code preceding a jump is the same as the code preceding the label, can delete the code preceding the jump and move the label back - BDEF is the code preceding the label and REF is the jump and the code that precedes it) (PROG ((BREF (fetch PREV of REF)) G FLG TMP (FRAME FRAME)) M (COND ((EQ (fetch OPNAME of (CAR BDEF)) (QUOTE TAG)) (CHECKTAG (CAR BDEF) LEVEL) (SETQ BDEF (fetch PREV of BDEF)) (GO M))) (COND ((EQOP (CAR BDEF) (CAR BREF)) [SELECTQ (fetch OPNAME of (CAR BREF)) ((AVAR HVAR GVAR FVAR CONST COPY) (CHLEV -1)) ((SETQ STORE SWAP)) (POP (COND ((AND [NOT (EQOP (CAR (fetch PREV of BREF)) (CAR (fetch PREV of BDEF] (EQ (fetch OPNAME of (CAR (fetch PREV of BREF))) (QUOTE SETQ)) (EQ (fetch OPNAME of (CAR (fetch PREV of BDEF))) (QUOTE SETQ))) (CW no COMMONBACK for different SETQ pop.) (GO EXIT))) (CHLEV 1)) ((TJUMP FJUMP NTJUMP NFJUMP) (CHLEV 1) [COND ((EQ (fetch (JUMP TAG) of (CAR BREF)) (fetch (JUMP TAG) of (CAR REF))) (SETQ FLG (QUOTE SAME] (DELTAGREF BREF)) [FN (CHLEV (SUB1 (CAR (fetch OPARG of (CAR BDEF] [(UNBIND DUNBIND) (UBDEL BREF) [SETQ LEVEL (CAR (fetch OPARG of (CAR BREF] (SETQ FRAME (CDR (fetch OPARG of (CAR BREF] (COMPILERERROR (QUOTE (COMMONBACK shouldn't get here] (OR FLG (SETQ FLG T)) (SETQ BDEF (fetch PREV of BDEF)) (SETQ BREF (PROG1 (fetch PREV of BREF) (PRDEL BREF))) (GO M))) EXIT(COND (FLG (SETQ G (LABELNTHPR BDEF 0 LEVEL 0)) (DELTAGREF REF) (replace (JUMP TAG) of (CAR REF) with G) (NCONC1 (DEFREFS G) REF) (RETURN FLG]) (DELTAGREF [LAMBDA (REF) (* edited: "21-DEC-79 15:57") (for X on (DEFREFS (fetch (JUMP TAG) of (CAR REF))) when (EQ (CADR X) REF) do (RETURN (RPLACD X (CDDR X))) finally (COMPILERERROR]) (FINDEND [LAMBDA (C STOP) (* lmm: "22-JUL-77 03:38") (PROG NIL LP (COND ((EQ C STOP) (RETURN))) (COND ((JUMPCHECK C) (RETURN C))) (COND ((SETQ C (fetch NXT of C)) (GO LP]) (RETOPT [LAMBDA NIL (* DD: "21-FEB-83 17:17") (* optimizations involving RETURN) (PROG ((RL (RETFIND CODE)) TESTL TARGL) [MAPC RL (FUNCTION (LAMBDA (C) (COND ((RETPOP C) (SETQ ANY T))) (COND ((RETTEST C C) (* Test if C is a possible test.) (* Looking for the case where two identical sequences ending with RETURN one of which is preceded by a conditional jump; - TJUMP->x stuff RETURN x: ... stuff RETURN ... becomes - FJUMP->y x: ... y: stuff RETURN) (SETQ TESTL (CONS C TESTL))) (T (SETQ TARGL (CONS C TARGL] (OR TESTL (RETURN ANY)) [SETQ TESTL (SUBSET TESTL (FUNCTION (LAMBDA (X) (NOT (RETOPT1 X TARGL] [MAP TESTL (FUNCTION (LAMBDA (Z) (AND (LISTP Z) (RETOPT1 (CAR Z) (CDR Z] (RETURN ANY]) (RETFIND [LAMBDA (C) (* lmm: "18-AUG-76 02:12:31") (* returns the list of all RETURN's in the code) (PROG ((L1 C) R) LP (COND ((SETQ L1 (FMEMB OPRETURN (CDR L1))) (SETQ R (CONS L1 R)) (GO LP))) (RETURN R]) (RETPOP [LAMBDA (RET) (* lmm " 4-MAY-81 17:03") (* can delete any UNBIND's preceding a RETURN - the RETURN does it automatically) (AND MERGEUNBINDFLG (PROG (ANY TAGS VAL) LP (SELECTQ [fetch OPNAME of (CAR (SETQ RET (fetch PREV of RET] [UNBIND (SELECTQ (fetch OPNAME of VAL) ((AVAR HVAR) (CW don't delete UNBIND when followed by VAR RETURN)) (PROGN (CW delete UNBIND before RETURN) (UBDEL RET) (GO DEL] [POP (COND (VAL (CW delete POP before VAR RETURN) (GO DEL] [DUNBIND (COND (VAL (CW delete DUNBIND before VAR RETURN) (UBDEL RET) (GO DEL] [COPY (COND ((NOT (fetch OPARG of (CAR RET))) (CW delete COPY before RETURN) (GO DEL] [(AVAR HVAR FVAR GVAR CONST) (COND ((NULL VAL) (SETQ VAL (CAR RET)) (GO LP)) (T (CW VAR VAR RETURN) (GO DEL] (TAG (SETQ TAGS (CONS (CAR RET) TAGS)) (GO LP)) NIL) (RETURN ANY) DEL (PRDEL RET) DOIT(SETQ ANY T) [MAPC TAGS (FUNCTION (LAMBDA (X) (replace (TAG LEVEL) of X with NIL] (SETQ TAGS) (GO LP]) (RETOPT1 [LAMBDA (X L) (* lmm: "13-OCT-76 18:45:46") (PROG (END Y1) (RETURN (COND ([SETQ Y1 (SOME L (FUNCTION (LAMBDA (Y) (SETQ END (RETTEST X Y] (RETMERGE X END (CAR Y1)) (SETQ ANY T]) (RETTEST [LAMBDA (TEST TARGET) (* DD: "21-FEB-83 17:38") (PROG ((L1 TEST) (L2 TARGET) F1 F2 ONLYIFSAMEFRAME) [COND ((EQ L1 L2) (SETQ F1 (SETQ F2 T] LP (SETQ L1 (fetch PREV of L1)) (SETQ L2 (fetch PREV of L2)) L1 (COND ((type? TAG (CAR L1)) [OR F1 (SETQ F1 (fetch (TAG FRAME) of (CAR L1] (SETQ L1 (fetch PREV of L1)) (GO L1))) L2 (COND ((type? TAG (CAR L2)) [OR F2 (SETQ F2 (fetch (TAG FRAME) of (CAR L2] (SETQ L2 (fetch PREV of L2)) (GO L2))) (SELECTQ (fetch OPNAME of (CAR L1)) (RETURN (GO RET)) (JUMP (GO RETJ)) [(FJUMP TJUMP) (COND ((EQ (fetch (JUMP TAG) of (CAR L1)) (CAR (fetch NXT of TEST))) (GO RETJ] [(HVAR AVAR) (COND ((EQ (CAR L1) (CAR L2)) (SETQ ONLYIFSAMEFRAME T) (GO LP] [(UNBIND DUNBIND) (COND ([AND [EQ [CAR (LISTP (fetch OPARG of (LISTP (CAR L1] (CAR (LISTP (fetch OPARG of (LISTP (CAR L2] (EQ [CDR (fetch OPARG of (LISTP (CAR L1] (CDR (fetch OPARG of (LISTP (CAR L2] (SETQ F1 (SETQ F2 T)) (* same frame) (GO LP] [FN (COND ((EQOP (CAR L1) (CAR L2)) (GO LP] (BIND (* don't merge binds) NIL) [(POP CONST FVAR GVAR SWAP) (COND ((EQ (CAR L1) (CAR L2)) (GO LP] [(STORE COPY) (COND ((EQUAL (CAR L1) (CAR L2)) (GO LP] NIL) (RETURN) RETJ[OR F1 (SETQ F1 (fetch (TAG FRAME) of (fetch (JUMP TAG) of (CAR L1] RET [COND (ONLYIFSAMEFRAME (COND ((NEQ (OR F1 (CODEFRAME L1)) (OR F2 (CODEFRAME L2))) (CW RETTEST fail because not same frame) (RETURN] (RETURN L1]) (RETMERGE [LAMBDA (TEST END TARGET) (* lmm "13-OCT-78 21:25") (PROG ((L1 TEST) (L2 TARGET) G VEQ FEQ LEV) [COND ([AND (SETQ LEV (CODEFRAME (fetch PREV of TEST))) (EQ LEV (CODEFRAME (fetch PREV of TARGET] (SETQ FEQ T) (COND ((AND (SETQ LEV (CODELEV (fetch PREV of TEST) 0)) (EQ LEV (CODELEV (fetch PREV of TARGET) 0))) (SETQ VEQ T] LP (COND ((EQ L1 END) (SELECTQ (fetch OPNAME of (CAR L1)) ((TJUMP FJUMP) [COND [[NOT (type? TAG (SETQ G (CAR L2] (SETQ G (create TAG)) [COND (FEQ [replace (TAG FRAME) of G with (fetch (TAG FRAME) of (fetch (JUMP TAG) of (CAR L1] (COND (VEQ (replace (TAG LEVEL) of G with (fetch (TAG LEVEL) of (fetch (JUMP TAG) of (CAR L1] (SETDEFREFS G (LIST (PRATTACH G L2] (T (OR VEQ (replace (TAG LEVEL) of G with NIL)) (OR FEQ (replace (TAG FRAME) of G with NIL] (FRPLACA L1 (NOTJUMP (CAR L1))) [DREMOVE L1 (DEFREFS (fetch (JUMP TAG) of (CAR L1] (replace (JUMP TAG) of (CAR L1) with G) (NCONC1 (DEFREFS G) L1)) ((JUMP RETURN)) (COMPILERERROR)) (RETURN))) (COND ((type? TAG (CAR L1)) (OR VEQ (replace (TAG LEVEL) of (CAR L1) with NIL)) (OR FEQ (replace (TAG FRAME) of (CAR L1) with NIL)) (RPLACA (DEFREFS (CAR L1)) (PRATTACH (CAR L1) L2)) (SETQ L1 (PROG1 (fetch PREV of L1) (PRDEL L1))) (GO LP))) L2 (COND ((type? TAG (CAR L2)) (OR VEQ (replace (TAG LEVEL) of (CAR L2) with NIL)) (OR FEQ (replace (TAG FRAME) of (CAR L2) with NIL)) (SETQ L2 (fetch PREV of L2)) (GO L2))) (SELECTQ (fetch OPNAME of (CAR L1)) ((UNBIND DUNBIND) (UBDEL L1)) ((TJUMP NTJUMP FJUMP NFJUMP JUMP BIND ERRORSET) (COMPILERERROR)) NIL) (SETQ L1 (PROG1 (fetch PREV of L1) (PRDEL L1))) (SETQ L2 (fetch PREV of L2)) (GO LP]) (CODELEV [LAMBDA (CD LEV) (* lmm " 8-JAN-82 09:07") (PROG NIL (RETURN (IPLUS (SELECTQ (fetch OPNAME of (CAR CD)) (TAG (OR (fetch (TAG LEVEL) of (CAR CD)) (RETURN))) [(NTJUMP NFJUMP) (SUB1VAR LEV) (OR (fetch (TAG LEVEL) of (fetch (JUMP TAG) of (CAR CD))) (RETURN (CODELEV (fetch PREV of CD) LEV] [(TJUMP FJUMP) (OR (fetch (TAG LEVEL) of (fetch (JUMP TAG) of (CAR CD))) (RETURN (CODELEV (fetch PREV of CD) (SUB1 LEV] [(AVAR HVAR COPY CONST FVAR GVAR) (RETURN (CODELEV (fetch PREV of CD) (ADD1 LEV] [FN (RETURN (CODELEV (fetch PREV of CD) (ADD1 (IDIFFERENCE LEV (CAR (fetch OPARG of (CAR CD] [POP (RETURN (CODELEV (fetch PREV of CD) (SUB1 LEV] ((BIND ERRORSET) 0) [DUNBIND (fetch (FRAME LEVEL) of (CDR (fetch OPARG of (CAR CD] [UNBIND (ADD1 (OR [fetch (FRAME LEVEL) of (CDR (fetch OPARG of (CAR CD] (RETURN] ((SETQ STORE SWAP) (RETURN (CODELEV (fetch PREV of CD) LEV))) (NIL (CCHECK (NOT (CDR CD))) 0) (COMPILERERROR (CAR CD))) LEV]) (CODEFRAME [LAMBDA (CD) (* lmm " 8-JAN-82 09:13") (SELECTQ (fetch OPNAME of (CAR CD)) [TAG (OR (fetch (TAG FRAME) of (CAR CD)) (CODEFRAME (fetch PREV of CD] [(NTJUMP NFJUMP TJUMP FJUMP) (OR (fetch (TAG FRAME) of (fetch (JUMP TAG) of (CAR CD))) (CODEFRAME (fetch PREV of CD] [(BIND ERRORSET) (CDR (fetch OPARG of (CAR CD] [(UNBIND DUNBIND) (fetch PARENT of (CDR (fetch OPARG of (CAR CD] (NIL TOPFRAME) ((JUMP RETURN) NIL) (CODEFRAME (fetch PREV of CD]) (DEFREFS [LAMBDA (D) (* lmm: "22-JUL-77 15:58") (CDR (FASSOC D LABELS]) (SETDEFREFS [LAMBDA (D V) (* lmm: "22-JUL-77 15:58") (FRPLACD [OR (FASSOC D LABELS) (CAR (SETQ LABELS (CONS (CONS D) LABELS] V]) ) (DEFINEQ (FRAMEOPT [LAMBDA (TRYLOCAL TRYMERGE TRYXVAR) (* lmm "16-DEC-81 17:05") (PROG (ANY) [COND (TRYLOCAL (MAPC FRAMES (FUNCTION (LAMBDA (X) (AND (FRAMELOCAL (CAR X)) (SETQ ANY T] [MAPC FRAMES (FUNCTION (LAMBDA (F) (AND (CADR F) (FRAMEVAR F) (SETQ ANY T] [COND (TRYMERGE (MAPC FRAMES (FUNCTION (LAMBDA (F) (AND (CADR F) (FRAMEMERGE F) (SETQ ANY T] [SETQ FRAMES (SUBSET FRAMES (FUNCTION (LAMBDA (F) (NOT (AND (CADR F) (FRAMEDEL F TRYXVAR) (SETQ ANY T] (RETURN ANY]) (FRAMEMERGE [LAMBDA (F) (* lmm "20-OCT-82 18:10") (AND MERGEFRAMEFLG (PROG ((FR (CAR F)) VAR VARS P) (COND ((AND (SETQ VARS (fetch VARS of FR)) (NULL (CDR (FNTH VARS MERGEFRAMEMAX))) (SETQ P (fetch PARENT of FR)) (MERGEFRAMEP FR P VARS)) [PROG ((N (fetch NVALS of FR)) (V VARS) (CD (fetch PREV of (CADR F))) P2) PLP (COND ((AND (SETQ P2 (fetch PARENT of P)) (MERGEFRAMEP FR P2 VARS)) (SETQ P P2) (GO PLP))) (replace VARS of P with (NCONC (fetch VARS of P) VARS)) (replace VARS of FR with NIL) (replace NNILS of P with (IPLUS (fetch NNILS of P) (fetch NNILS of FR) (fetch NVALS of FR))) (replace NNILS of FR with (replace NVALS of FR with 0)) LP (COND (V (SETQ VAR (create OP OPNAME ←(QUOTE SETQ) OPARG ←(CAR V))) [COND ((IGREATERP N 0) (PRATTACH OPPOP (PRATTACH VAR CD))) (T [COND ((ZEROP N) (SETQ CD (PRATTACH OPNIL CD] (OR (NONILVAR (CAR V) CD P) (SETQ CD (PRATTACH VAR CD] (SETQ N (SUB1 N)) (SETQ V (CDR V)) (GO LP))) (COND ((MINUSP N) (PRATTACH OPPOP CD] (RETURN T]) (NONILVAR [LAMBDA (V CD FR) (* lmm " 8-JAN-82 09:06") (* used by FRAMEMERGE) (PROG NIL (RETURN (AND (SELECTQ (fetch OPNAME of (CAR CD)) ((CONST POP COPY AVAR HVAR FVAR GVAR TJUMP FJUMP NTJUMP NFJUMP SETQ STORE SWAP) T) (NIL NIL) (FN (CLEANFNOP (CDR (fetch OPARG of (CAR CD))) (QUOTE FREEVARS))) (BIND (COND ([EQ FR (CDR (fetch OPARG of (CAR CD] (RETURN T)) (T T))) ((TAG RETURN) NIL) ((UNBIND DUNBIND ERRORSET) T) NIL) (NONILVAR V (CDR CD) FR]) (MERGEFRAMEP [LAMBDA (FR PARENT VARS) (* lmm: "22-JUL-77 02:39") (AND (FMEMB (fetch FRAMETYPE of PARENT) MERGEFRAMETYPES) (COND [(OASSOC (QUOTE AVAR) VARS) (AND (CLEANFRAME PARENT FR) (PROG NIL [for V in VARS do [for F in FRAMES when (NEQ (CAR F) FR) do (for V2 in (fetch VARS of (CAR F)) do (COND ((EQ (fetch OPARG of V2) (fetch OPARG of V)) (GO BAD] (for V2 in FREEVARS do (COND ((EQ (fetch OPARG of V2) (fetch OPARG of V)) (GO BAD] (RETURN T) BAD (RETURN] (T (EQ MERGEFRAMEFLG T]) (FRAMELOCAL [LAMBDA (F) (* lmm " 6-MAY-81 21:41") (PROG (VARS) (COND ((AND (OASSOC (QUOTE AVAR) (SETQ VARS (fetch (FRAME VARS) of F))) (CLEANFRAME F)) (CW make vars local when no external calls) [MAPC VARS (FUNCTION (LAMBDA (X) (replace OPNAME of X with (QUOTE HVAR] (RETURN T]) (CLEANFRAME [LAMBDA (FRAME AVOIDING) (* lmm: " 9-NOV-76 16:20:20") (AND (NOT (fetch EXTCALL of FRAME)) (for F in FRAMES when (AND (EQ (fetch PARENT of (CAR F)) FRAME) (NEQ (CAR F) AVOIDING)) always (CLEANFRAME (CAR F) AVOIDING]) (FRAMEDEL [LAMBDA (F TRYXVAR) (* lmm " 4-APR-83 23:25") (PROG (VARS (FRM (CAR F)) PARENT OP FLV TMP DOXVAR) (SELECTQ (fetch FRAMETYPE of FRM) ((NIL ERRORSET) (RETURN)) NIL) (SETQ VARS (fetch VARS of FRM)) (SETQ FLV (fetch (FRAME LEVEL) of FRM)) (SETQ DOXVAR NIL) (COND ([AND [NOT (SOME (CDDR F) (FUNCTION (LAMBDA (X) (AND (EQ (fetch OPNAME of (CAR X)) (QUOTE UNBIND)) (IGREATERP (CAR (fetch OPARG of (CAR X))) 1] (OR (NULL VARS) (AND (NOT (OASSOC (QUOTE AVAR) VARS)) (OR (DELETEFRAMECHECK VARS F) (AND TRYXVAR (NOT (fetch NOXVAR of FRM)) (SETQ DOXVAR T] (* frame with no specvars, no UNBIND's with LEVEL gt 1) (COND ((EQ (fetch FRAMETYPE of FRM) (QUOTE MAP)) (CW delete MAP frame)) (T (CW delete frame))) (OR (SETQ PARENT (fetch PARENT of FRM)) (COMPILERERROR)) [COND (DOXVAR (add FLV (fetch NNILS of FRM) (fetch NVALS of FRM] [for VR on VARS do (for CD on CODE do (COND [(AND (EQ (fetch OPARG of (CAR CD)) (CAR VR)) (EQ (fetch OPNAME of (CAR CD)) (QUOTE SETQ))) (COND [DOXVAR (CCHECK (EQ FRM (CODEFRAME CD))) (RPLACA CD (create OP OPNAME ←(QUOTE STORE) OPARG ←(OR (CODELEV CD (LENGTH (CDR VR))) (COMPILERERROR] (T (PRDEL CD) (CW delete SETQ in FRAMEDEL)] ((AND DOXVAR (EQ (CAR CD) (CAR VR))) (CCHECK (EQ (CODEFRAME CD) FRM)) (RPLACA CD (COND ([ZEROP (SETQ TMP (CODELEV (fetch PREV of CD) (LENGTH (CDR VR] OPCOPY) (T (create OP OPNAME ←(QUOTE COPY) OPARG ← TMP] [MAPC LABELS (FUNCTION (LAMBDA (X) (COND ((EQ (fetch (TAG FRAME) of (CAR X)) FRM) (replace (TAG FRAME) of (CAR X) with PARENT) (AND (fetch (TAG LEVEL) of (CAR X)) FLV (replace (TAG LEVEL) of (CAR X) with (IPLUS (fetch (TAG LEVEL) of (CAR X)) FLV] [PROG ((CD (CADR F))) (* delete the bind and all of the var references after) [MAPC (CONS NIL (AND (NOT DOXVAR) VARS)) (FUNCTION (LAMBDA NIL (SETQ CD (PROG1 (fetch NXT of CD) (PRDEL CD] (FRPTQ (fetch NNILS of FRM) (PRATTACH OPNIL (fetch PREV of CD] (COND ((fetch EXTCALL of FRM) (replace EXTCALL of PARENT with T))) [MAPC (CDDR F) (FUNCTION (LAMBDA (CD) (* change DUNBIND to POP of LEVEL) (SELECTQ [PROG1 (fetch OPNAME of (SETQ OP (CAR CD))) (SETQ CD (PROG1 (fetch PREV of CD) (PRDEL CD] [UNBIND (COND [DOXVAR (COND ([NOT (ZEROP (SETQ TMP (IPLUS (CAR (fetch OPARG of OP)) (LENGTH VARS) -1] (SETQ CD (PRATTACH (create OP OPNAME ←(QUOTE STORE) OPARG ← TMP) CD)) (FRPTQ TMP (PRATTACH OPPOP CD] (T (CCHECK (EQ (CAR (fetch OPARG of OP)) 1] (DUNBIND (FRPTQ [COND (DOXVAR (IPLUS (CAR (fetch OPARG of OP)) (fetch NVALS of FRM) (fetch NNILS of FRM))) (T (CAR (fetch OPARG of OP] (PRATTACH OPPOP CD))) (COMPILERERROR] [MAPC FRAMES (FUNCTION (LAMBDA (F2) (COND ((EQ (fetch PARENT of (CAR F2)) FRM) (replace PARENT of (CAR F2) with PARENT) (replace (FRAME LEVEL) of (CAR F2) with (AND FLV (SETQ TMP (fetch (FRAME LEVEL) of (CAR F2))) (IPLUS TMP FLV] (RETURN T]) (FRAMEVAR [LAMBDA (F) (* lmm "26-DEC-81 15:53") (PROG (VARS CD (FR (CAR F)) VAL ANY NNILS NVALS) [SETQ VARS (REVERSE (OR (fetch VARS of FR) (RETURN] (SETQ NNILS (fetch NNILS of FR)) (SETQ NVALS (fetch NVALS of FR)) [for V on VARS as I from NNILS to 0 by -1 when (NEQ (fetch OPNAME of (CAR V)) (QUOTE AVAR)) do (COND ((NOT (SETQ CD (FMEMB (CAR V) CODE))) [COND ((ZEROP I) (SETQ I 1) (PRATTACH OPPOP (fetch PREV of (CADR F))) (SETQ NVALS (SUB1 NVALS))) (T (SETQ NNILS (SUB1 NNILS] (CW local var bound but not used) (PROG ((CD CODE)) LP (COND ((NOT CD) (RETURN))) (* delete all SETQ's) (COND ((AND (EQ (fetch OPARG of (CAR CD)) (CAR V)) (EQ (fetch OPNAME of (CAR CD)) (QUOTE SETQ))) (CW local var set but never used) (PRDEL CD))) (SETQ CD (fetch PREV of CD)) (GO LP)) (RPLACA V NIL) (SETQ ANY T)) ([NOTANY CODE (FUNCTION (LAMBDA (X) (AND (EQ (fetch OPNAME of X) (QUOTE SETQ)) (EQ (fetch OPARG of X) (CAR V] (COND ([SETQ VAL (COND ((NEQ I 0) (CW NIL var never set) (SETQ NNILS (SUB1 NNILS)) OPNIL) ((AND (EQ [fetch OPNAME of (SETQ VAL (CAR (fetch PREV of (CADR F] (QUOTE CONST)) (APPLY* EQCONSTFN (fetch OPARG of VAL))) (SETQ I 1) (SETQ NVALS (SUB1 NVALS)) (* delete this var, can try next) (CW var bound to CONST and never set) (PROG1 (CAR (fetch PREV of (CADR F))) (PRDEL (fetch PREV of (CADR F] (do (FRPLACA CD VAL) repeatwhile (SETQ CD (FMEMB (CAR V) CD))) (FRPLACA V NIL) (SETQ ANY T] (COND (ANY [replace VARS of FR with (DREV (SUBSET VARS (FUNCTION (LAMBDA (X) X] (replace NNILS of FR with NNILS) (replace NVALS of FR with NVALS))) (RETURN ANY]) (DELETEFRAMECHECK [LAMBDA (VARS F) (* lmm: "22-JUL-77 02:58") (PROG ((CD (ONLYMEMB (CAR VARS) CODE))) (OR (AND CD (EQ (fetch PREV of CD) (CADR F))) (RETURN)) LP (SETQ VARS (CDR VARS)) (SETQ CD (fetch NXT of CD)) (COND ((NULL VARS) (RETURN T))) (COND ((EQ (ONLYMEMB (CAR VARS) CODE) CD) (GO LP]) (ONLYMEMB [LAMBDA (X Y) (* lmm: " 6-OCT-76 15:06:48") (AND (SETQ Y (FMEMB X Y)) (NOT (FMEMB X (CDR Y))) Y]) ) (RPAQQ MERGEFRAMETYPES (PROG LAMBDA MAP)) (RPAQQ OPTIMIZATIONSOFF NIL) (DEFINEQ (SKIPPUSH [LAMBDA (CD N VL LEVOPFLG) (* lmm "19-JAN-82 22:16") (OR N (SETQ N 1)) (COND ((ILESSP N 0) NIL) ((ZEROP N) CD) (T (SELECTQ (fetch OPNAME of (CAR CD)) ((AVAR HVAR FVAR GVAR CONST) (SKIPPUSH (fetch PREV of CD) (SUB1 N) VL LEVOPFLG)) (COPY (AND (NOT (fetch OPARG of (CAR CD))) (SKIPPUSH (fetch PREV of CD) (SUB1 N) VL LEVOPFLG))) (SWAP (AND (IGEQ N 2) (SKIPPUSH (fetch PREV of CD) N VL LEVOPFLG))) (POP (SKIPPUSH (fetch PREV of CD) (ADD1 N) VL LEVOPFLG)) ((FJUMP TJUMP NFJUMP NTJUMP) (AND NEWOPTFLG (NOT LEVOPFLG) (SKIPPUSH (fetch PREV of CD) (ADD1 N) VL LEVOPFLG))) [FN (COND ((OR (CLEANFNOP (CDR (fetch OPARG of (CAR CD))) (QUOTE NOSIDE)) (AND NEWOPTFLG (SELECTQ (fetch OPNAME of (CAR VL)) ((CONST HVAR) T) ((FVAR AVAR GVAR) (CLEANFNOP (CDR (fetch OPARG of (CAR CD))) (QUOTE FREEVARS))) NIL))) (SKIPPUSH (fetch PREV of CD) [SUB1 (IPLUS N (CAR (fetch OPARG of (CAR CD] VL LEVOPFLG] [SETQ (COND ([AND NEWOPTFLG VL (NEQ (CAR VL) (fetch OPARG of (CAR CD] (SKIPPUSH (fetch PREV of CD) N VL LEVOPFLG] NIL]) (DELCODE [LAMBDA (CD) (* DD: "21-FEB-83 17:08") (PROG (X FLG) LP (SELECTQ (fetch OPNAME of (SETQ X (CAR CD))) (NIL (RETURN FLG)) (TAG (RETURN FLG)) [(BIND ERRORSET) (RPLACA (CDR (FASSOC (CDR (fetch OPARG of X)) FRAMES)) NIL) (for LB in LABELS when (EQ (fetch (TAG FRAME) of (CAR LB)) (CDR (fetch OPARG of X))) do (MAPC (CDR LB) (FUNCTION PRDEL] [(UNBIND DUNBIND) (COND (MERGEUNBINDFLG (DREMOVE CD (FASSOC (CDR (fetch OPARG of X)) FRAMES))) (T (RETURN FLG] ((JUMP FJUMP TJUMP NFJUMP NTJUMP ERRORSET) (CW delete unreachable jump) (DREMOVE CD (DEFREFS (fetch (JUMP TAG) of X))) (SETQ FLG T)) (CW delete unreachable code)) (SETQ ANY T) (SETQ CD (PROG1 (fetch NXT of CD) (PRDEL CD))) (GO LP]) (PRATTACH [LAMBDA (ITEM BEFORE) (* lmm: "22-JUL-77 02:58") (PROG ((AFTER (fetch NXT of BEFORE)) (NEW (CONS))) (replace NXT of NEW with AFTER) (replace PREV of NEW with BEFORE) (FRPLACA NEW ITEM) (replace NXT of BEFORE with NEW) (AND AFTER (replace PREV of AFTER with NEW)) (RETURN NEW]) (JUMPCOPYTEST [LAMBDA (VL CDFROM) (* lmm "15-JAN-82 18:08") (* Where can a COPY be inserted such that VL would be on the stack - either returns the code list or NIL - used by transformation - var TJUMP->l var ... l: var - => var COPY TJUMP->l2 ... l: var l2:) (COND ((EQVALUE CDFROM VL) CDFROM) ((AND (CALLP (CAR CDFROM)) (OR (EQ (fetch OPNAME of (CAR VL)) (QUOTE HVAR)) (CLEANFNP (CDR (fetch OPARG of (CAR CDFROM))) (QUOTE FREEVARS))) (SETQ CDFROM (SKIPPUSH (fetch PREV of CDFROM) [SUB1 (CAR (fetch OPARG of (CAR CDFROM] VL T))) (JUMPCOPYTEST VL CDFROM]) (EQOP [LAMBDA (OP1 OP2) (* lmm " 8-JAN-82 09:04") (OR (EQ OP1 OP2) (AND (EQ (fetch OPNAME of OP1) (fetch OPNAME of OP2)) (SELECTQ (fetch OPNAME of OP1) ((FVAR GVAR CONST COPY STORE) (EQ (fetch OPARG of OP1) (fetch OPARG of OP2))) ((POP RETURN SWAP) [CCHECK (AND (NOT (fetch OPARG of OP1)) (NOT (fetch OPARG of OP2] T) (FN (EQUAL OP1 OP2)) [(JUMP TJUMP NTJUMP FJUMP NFJUMP BIND ERRORSET UNBIND DUNBIND) (AND (EQ (CAR (fetch OPARG of OP1)) (CAR (fetch OPARG of OP2))) (EQ (CDR (fetch OPARG of OP1)) (CDR (fetch OPARG of OP2] (SETQ (EQOP (fetch OPARG of OP1) (fetch OPARG of OP2))) NIL]) (EQVALUE [LAMBDA (CD V) (* lmm "19-JAN-82 22:25") (PROG NIL LP (RETURN (SELECTQ (fetch OPNAME of (CAR CD)) [COPY (COND ((NULL (fetch OPARG of (CAR CD))) (SETQ CD (fetch PREV of CD)) (GO LP] [SETQ (COND ((EQ (fetch OPARG of (CAR CD)) (CAR V))) (T (SETQ CD (fetch PREV of CD)) (GO LP] ((HVAR AVAR FVAR GVAR CONST) (EQ (CAR CD) (CAR V))) [(POP FJUMP TJUMP NFJUMP NTJUMP SWAP) (COND ((SETQ CD (SKIPPUSH (fetch PREV of CD) 1 V)) (GO LP] NIL]) (DELCOPYFN [LAMBDA (P X) (* lmm "18-JAN-82 13:17") (while (AND (CALLP (CAR P) NIL 1) (EQOP (CAR P) (CAR (fetch NXT of X))) (CLEANFNOP (CDR (fetch OPARG of (CAR P))) (QUOTE NOSIDE)) (for Z←P by (fetch PREV of Z) while (AND Z (NEQ Z X)) always (SELECTQ (fetch OPNAME of (CAR Z)) (FN (CLEANFNOP (CDR (fetch OPARG of (CAR Z))) (QUOTE NOSIDE))) ((FVAR AVAR HVAR GVAR SETQ) (* SETQ is OK since we have already guaranteed that the value skipped is not modified by intervening setqs) T) NIL))) do [SETQ P (fetch NXT of (PROG1 (fetch PREV of P) (PRDEL P] (SETQ X (fetch NXT of X))) X]) ) (DEFINEQ (DEADSETQP [LAMBDA (VAR CD) (* edited: " 9-JAN-80 14:51") (DECLARE (SPECVARS ICNT)) (SELECTQ (fetch OPNAME of VAR) [(AVAR HVAR) (PROG (TAGS (ICNT 50)) (* ICNT is used to limit the nmber of instructions looked at past the setq.) (CW look for dead SETQ) (RETURN (DS1 VAR CD] NIL]) (DS1 [LAMBDA (VAR CD) (* lmm "27-OCT-81 20:35") (* test if VAR is used in CD -- TAGS is a list of tags already visited) (PROG (A) LP [SELECTQ (fetch OPNAME of (SETQ A (CAR CD))) (SETQ (AND (EQ (fetch OPARG of A) VAR) (RETURN T))) (FN (AND (EQ (fetch OPNAME of VAR) (QUOTE AVAR)) (NOT (CLEANFNOP (CDR (fetch OPARG of A)) (QUOTE FREEVARS))) (RETURN))) [(UNBIND DUNBIND) (COND ([FMEMB VAR (fetch (FRAME VARS) of (CDR (fetch OPARG of A] (RETURN T] [RETURN (RETURN (AND (SETQ A (CODEFRAME (fetch PREV of CD))) (never (EQ (fetch FRAMETYPE of A) (QUOTE ERRORSET)) repeatwhile (SETQ A (fetch PARENT of A] (JUMP (OR [SETQ CD (CAR (DEFREFS (fetch (JUMP TAG) of A] (RETURN)) (GO LP)) ((TJUMP FJUMP NTJUMP NFJUMP ERRORSET) (OR [DS1 VAR (CAR (DEFREFS (fetch (JUMP TAG) of A] (RETURN))) [TAG (COND ((FMEMB A TAGS) (RETURN T)) (T (SETQ TAGS (CONS A TAGS] (COND ((EQ A VAR) (RETURN] (OR (SETQ CD (fetch NXT of CD)) (COMPILERERROR)) NX [COND ((ZEROP ICNT) (CW DEADSETP gives up) (RETURN)) (T (SETQ ICNT (SUB1 ICNT] (GO LP]) ) [DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY (BLOCK: NIL PRDEL PRATTACH EQOP EQVALUE SKIPPUSH CODEFRAME LABELNTHPR UBDEL DELCODE (LOCALVARS . T) (SPECVARS CODE LEVEL)) (BLOCK: NIL POSTOPT SETUPOPT JUMPOPT (LOCALVARS . T) (SPECVARS LABELS PASS ANY CODE FRAME FRAMES)) (BLOCK: FRAMEOPT FRAMEOPT CLEANFRAME DELETEFRAMECHECK FRAMEDEL FRAMELOCAL FRAMEMERGE FRAMEVAR MERGEFRAMEP NONILVAR ONLYMEMB (GLOBALVARS MERGEFRAMEMAX MERGEFRAMEFLG MERGEFRAMETYPES) (SPECVARS VARS ANY FRAME) (NOLINKFNS . T)) (BLOCK: SCANOPT SCANOPT DEADSETQP DS1 (SPECVARS TAGS) (NOLINKFNS . T) (LOCALFREEVARS ICNT)) (BLOCK: NIL DELCOPYFN JUMPTHRU LBMERGE LBDEL JUMPCOPYTEST (LOCALVARS . T) (SPECVARS FRAME LEVEL ANY) (NOLINKFNS . T)) (BLOCK: JUMPREV JUMPREV COMMONBACK DELTAGREF FINDEND (SPECVARS FRAME LEVEL ANY) (NOLINKFNS . T)) (BLOCK: RETOPT RETOPT RETFIND RETPOP RETTEST RETOPT1 RETMERGE (SPECVARS TAGS ANY) (NOLINKFNS . T)) ] (* CONSISTENCY CHECKS) (DECLARE: EVAL@COMPILE DONTCOPY (DECLARE: EVAL@COMPILE (PUTPROPS CCHECK MACRO [ARGS (COND (COMPILECOMPILERCHECKS (LIST (QUOTE AND) (LIST (QUOTE NOT) (CAR ARGS)) (LIST (QUOTE COMPILERERROR) (CADR ARGS]) ) (RPAQQ COMPILECOMPILERCHECKS NIL) ) (DEFINEQ (COMPILERERROR [LAMBDA (MESS1 MESS2) (* lmm " 1-MAR-78 02:55") (LISPXPRIN1 "Compiler error " T) (HELP MESS1 MESS2]) (OPTCHECK [LAMBDA NIL (* lmm "14-MAR-81 11:03") (* set up code list as doubly linked list, scan for tags) (PROG ((CD CODE) P B) LPC (COND ((NULL CD) [for X in LABELS do (COND ((CDR X) [OR (FMEMB (CAR X) CODE) (COMPILERERROR (CAR X) (QUOTE (not in code] [MAPC (CDR X) (FUNCTION (LAMBDA (Y) (OR (TAILP Y CODE) (COMPILERERROR Y (QUOTE (NOT CODE TAIL] [OR (EQ (CAR (CADR X)) (CAR X)) (COMPILERERROR X (QUOTE (TAG wrong] (EVERY (CDDR X) (FUNCTION (LAMBDA (Y) (OR (EQ (fetch (JUMP TAG) of (CAR Y)) (CAR X)) (COMPILERERROR X (QUOTE (TAG wrong] [for X in FRAMES do (COND [(EQ (CAR X) TOPFRAME) (AND (CDR X) (COMPILERERROR (CONS (QUOTE TOPFRAME) X] (T [for Y in (CDR X) do (OR (TAILP Y CODE) (COMPILERERROR (LIST (QUOTE (NOT IN CODE)) Y X))) (OR (EQ (CDR (fetch OPARG of (CAR Y))) (CAR X)) (COMPILERERROR (LIST (QUOTE (WRONG FRAME)) Y X] (OR (FASSOC (fetch PARENT of (CAR X)) FRAMES) (COMPILERERROR (QUOTE (PARENT NOT FRAME)) X] (RETURN T))) (SELECTQ (fetch OPNAME of (CAR CD)) (TAG (OR (SETQ B (FASSOC (CAR CD) LABELS)) (COMPILERERROR)) (OR (EQ (CAR (CDR B)) CD) (COMPILERERROR)) (OR (OR (NULL (fetch (TAG FRAME) of (CAR CD))) (FASSOC (fetch (TAG FRAME) of (CAR CD)) FRAMES)) (COMPILERERROR))) ((BIND ERRORSET) (OR (EQ (CADR (FASSOC (CDR (fetch OPARG of (CAR CD))) FRAMES)) CD) (COMPILERERROR))) ((UNBIND DUNBIND) (OR (FMEMB CD (CDDR (FASSOC (CDR (fetch OPARG of (CAR CD))) FRAMES))) (COMPILERERROR))) [(JUMP TJUMP FJUMP NTJUMP NFJUMP) (OR (SETQ B (FASSOC (fetch (JUMP TAG) of (CAR CD)) LABELS)) (COMPILERERROR)) (OR (MEMB CD B) (COMPILERERROR CD (QUOTE (NOT IN JUMP LIST] NIL) (SETQ B (CDR CD)) (OR (AND (EQ (fetch PREV of CD) B) (EQ (fetch NXT of CD) P)) (COMPILERERROR)) (SETQ P CD) (SETQ CD B) (GO LPC]) (CCHECK [LAMBDA (X) (* lmm "14-MAR-81 09:18") (OR X (COMPILERERROR]) ) (DECLARE: EVAL@COMPILE DONTCOPY (ADDTOVAR PRETTYPRINTMACROS (CW LAMBDA (L) (PROG ((**COMMENT**FLG (AND **COMMENT**FLG " **compwatch** "))) (COMMENT1 L T))) (CWN LAMBDA (L) (PROG ((**COMMENT**FLG (AND **COMMENT**FLG " **compwatch** "))) (COMMENT1 L T)))) (SETTEMPLATE (QUOTE CW) (QUOTE (NIL))) (SETTEMPLATE (QUOTE CWN) (QUOTE (EVAL))) (DECLARE: EVAL@COMPILE (PUTPROPS CW VAXMACRO (= . *)) (PUTPROPS CW MACRO (X NIL)) (PUTPROPS CWN VAXMACRO (= . *)) (PUTPROPS CWN MACRO (X NIL)) ) (ADDTOVAR NLAML CW) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS ALAMS BLKLIBRARY BYTE.EXT BYTEASSEMFN BYTECOMPFLG COMPILERMACROPROPS CIA CLEANFNLIST COMP.SCRATCH COMPILETYPELST COMPILEUSERFN COMPSTATLST COMPSTATS CONDITIONALS CONST.FNS CONSTOPS DONOTHING FILERDTBL FNA FORSHALLOW FRA GLOBALVARS HEADERBYTES HOKEYDEFPROP LAMBDANOBIND LAMS LBA LEVELARRAY LINKEDFNS LINKFNS LOADTIMECONSTANT MAXBNILS MAXBVALS MCONSTOPS MERGEFRAMEFLG MERGEFRAMEMAX MERGEFRAMETYPES MOPARRAY MOPCODES NLAMA NLAML NODARR NOLINKFNS NOSTATSFLG NUMBERFNS OPCOPY OPNIL OPPOP OPRETURN PRA SELECTQFMEMB SELECTVARTYPES STATAR STATMAX STATN SYSSPECVARS UNIQUE#ARRAY VCA VCONDITIONALS VREFFRA COUTFILE XVARFLG MERGEFRAMEFLG OPTIMIZATIONSOFF NOFREEVARSFNS EQCONSTFN MERGEUNBINDFLG NEWOPTFLG) ) (DECLARE: DONTCOPY (* for compiling compiler) EVAL@COMPILE [DECLARE: EVAL@COMPILE (RECORD CODELST (OP . PREV) [ACCESSFNS CODELST ((NXT (GETHASH DATUM PRA) (PUTHASH DATUM NEWVALUE PRA]) ] (PUTPROPS OASSOC MACRO ((X Y) (FASSOC X Y))) [DECLARE: EVAL@COMPILE (RECORD OP (OPNAME . OPARG)) (RECORD JUMP (OPNAME TAG . JT) (* kind of OP) ) (TYPERECORD TAG (LBNO . LEVEL) (* kind of OP) LBNO ←(SETQ LBCNT (ADD1 LBCNT)) [ACCESSFNS TAG ((FRAME (GETHASH DATUM FRA) (PUTHASH DATUM NEWVALUE FRA)) (JD (GETHASH DATUM LBA) (PUTHASH DATUM NEWVALUE LBA]) (RECORD VAR (VARTYPE . VARNAME) (* A particular kind of OP) ) ] [DECLARE: EVAL@COMPILE (RECORD FRAME (FRAMETYPE (NNILS . VARS) LEVEL (BINDLST NVALS EXTCALL . CPIOK) . PROGLABELS) (* FRAMETYPE is one of PROG LAMBDA ERRORSET MAP NIL - VARS are variables bound, NNILS are # which are bound to NIL - LEVEL is # of things on stack between this and next higher frame) (ACCESSFNS FRAME ((PARENT (GETHASH DATUM FRA) (PUTHASH DATUM NEWVALUE FRA)) (VREFFROM (GETHASH DATUM VREFFRA) (PUTHASH DATUM NEWVALUE VREFFRA)) (NODBIND (GETHASH DATUM NODARR) (PUTHASH DATUM NEWVALUE NODARR)) (PRIMARYRETURN (GETHASH DATUM BCINFO) (PUTHASH DATUM NEWVALUE BCINFO))) (* PARENT is next higher enclosing frame - shares hash table with TAG.FRAME) ) (RECORD CPIOK NOXVAR (* Share the CPIOK field used by the compiler pass 1 and the NOXVAR field used by the maxc assembler)) NNILS ← 0) (RECORD COMINFO (COMTYPE TOPFRAME CODE ARGS)) (ACCESSFNS COMP (CLEAR (PROGN (INITHASH FRA) (INITHASH LBA) (INITHASH PRA) (INITHASH VREFFRA) (INITHASH NODARR) (INITHASH BCINFO)))) (RECORD JD (JPT (JMIN . JSN) JU . JML) (* JPT is NIL (for tags) or a pointer into ACODE (for jumps). JMIN is the lowest possible location for the instruction or tag. JU is the cumulative uncertainty (for tags) or the length uncertainty (for jumps). JML is the minimum length (for jumps). JSN is a serial number (the original JMIN) used to decide whether a jump goes forward or backward.) ) ] ) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDTOVAR NLAMA ) (ADDTOVAR NLAML INITHASH) (ADDTOVAR LAMA ) ) (PUTPROPS BYTECOMPILER COPYRIGHT ("Xerox Corporation" 1981 1982 1983)) (DECLARE: DONTCOPY (FILEMAP (NIL (6239 10398 (BYTEBLOCKCOMPILE2 6251 . 7679) (BYTECOMPILE2 7683 . 7848) (MC1 7852 . 8803) (MC2 8807 . 9393) (COMPERROR 9397 . 9550) (COMPPRINT 9554 . 9756) (COMPERRM 9760 . 10395)) (10400 15341 (MC2A 10412 . 13430) (BINDLIS 13434 . 13640) (CKVAR 13644 . 14002) (BINDVARS 14006 . 15024) ( UNBINDVARS 15028 . 15338)) (15343 24478 (CVALN 15355 . 15456) (CPROGN 15460 . 16070) (DELPOPP 16074 . 16406) (CEXP1 16410 . 16470) (CEXPR 16474 . 18273) (TRYCUSERFN 18277 . 18503) (CUSERFN 18507 . 18985) (CCONST 18989 . 19803) (CCALL 19807 . 21128) (CVAR 21132 . 21345) (CVAL1 21349 . 21450) (CPROG1 21454 . 21689) (CEFFECT 21693 . 22083) (CVAL 22087 . 22469) (CMAC 22473 . 24475)) (24480 25711 (VARTYPE 24492 . 24687) (LOOKUPVAR 24691 . 25362) (LOOKUPCONST 25366 . 25708)) (25713 31360 (COMP.ST 25725 . 26084) (COMP.STFN 26088 . 26363) (COMP.STCONST 26367 . 26499) (COMP.STVAR 26503 . 26611) (COMP.STPOP 26615 . 26744) (COMP.DELFN 26748 . 26945) (COMP.STRETURN 26949 . 27094) (COMP.STTAG 27098 . 27883) ( COMP.STJUMP 27887 . 29224) (COMP.STSETQ 29228 . 29443) (COMP.STCOPY 29447 . 29596) (COMP.DELPUSH 29600 . 29736) (COMP.DELPOP 29740 . 29881) (COMP.STBIND 29885 . 30958) (COMP.STUNBIND 30962 . 31357)) ( 31362 33474 (ATYP 31374 . 32053) (CLEANEXPP 32057 . 32286) (CLEANFNP 32290 . 32581) (CLEANFNOP 32585 . 32700) (GLOBALVARP 32704 . 32849) (LINKCALLP 32853 . 33230) (ANONP 33234 . 33471)) (33476 35736 (CPI 33488 . 34715) (CPI1 34719 . 35257) (PICOUNT 35261 . 35733)) (35775 35963 (CEVQ 35787 . 35960)) (36064 37323 (CBOOL 36076 . 37320)) (37325 37655 (APFNP 37337 . 37652)) (37811 38272 (CAC 37823 . 37970) ( PUNT 37974 . 38269)) (38321 39212 (CFUNCTION 38333 . 38657) (CLAM1 38661 . 39147) (GENFN 39151 . 39209 )) (39298 43779 (CCOND 39310 . 40448) (CSELECTQ 40452 . 43776)) (43943 44385 (CQUOTE 43955 . 44153) ( CCOMMENT 44157 . 44382)) (44432 45818 (CDECLARE 44444 . 45069) (CDECLARE1 45073 . 45815)) (48418 49046 (CCROP 48430 . 48876) (COMP.STCROP 48880 . 49043)) (49123 49497 (CNOT 49135 . 49494)) (49577 49925 ( CSETQ 49589 . 49736) (CSETN 49740 . 49922)) (49927 52507 (CLAM 49939 . 52504)) (52626 57182 (CPROG 52638 . 54920) (CGO 54924 . 55838) (CRETURN 55842 . 57179)) (58664 62945 (CNUMBER 58676 . 60795) ( CNCALL 60799 . 61897) (CFIX 61901 . 62013) (STFIX 62017 . 62541) (DELFIX 62545 . 62942)) (63056 64213 (CEQ 63068 . 64210)) (64265 66492 (CNTEST 64277 . 66489)) (67590 72854 (CMAPC 67602 . 72851)) (74366 77398 (MLLIST 74378 . 74882) (MLL 74886 . 76672) (MLLVAR 76676 . 76918) (LCASE 76922 . 77083) (MLLFN 77087 . 77395)) (78464 82181 (RESOLVEJUMPS 78476 . 79270) (JLENPASS 79274 . 81407) (JFIXPASS 81411 . 81870) (JSIZE 81874 . 82178)) (82350 84437 (CALLP 82362 . 82719) (JUMPCHECK 82723 . 82899) (DREV 82903 . 83091) (CHLEV 83095 . 83256) (CHECKTAG 83260 . 83584) (NOTJUMP 83588 . 83921) (INITHASH 83925 . 84115) (COMPINIT 84119 . 84434)) (84642 85324 (CFRPTQ 84654 . 85321)) (88367 127289 (POSTOPT 88379 . 89689) (SETUPOPT 89693 . 91237) (SCANOPT 91241 . 96692) (XVARSCAN 96696 . 97481) (XVARSCAN1 97485 . 97992) (JUMPOPT 97996 . 98300) (JUMPTHRU 98304 . 103234) (LBMERGE 103238 . 103757) (PRDEL 103761 . 104082) (UBDEL 104086 . 104275) (LBDEL 104279 . 104697) (LABELNTHPR 104701 . 105373) (JUMPREV 105377 . 114169) (COMMONBACK 114173 . 116338) (DELTAGREF 116342 . 116617) (FINDEND 116621 . 116908) (RETOPT 116912 . 117919) (RETFIND 117923 . 118251) (RETPOP 118255 . 119942) (RETOPT1 119946 . 120216) (RETTEST 120220 . 122330) (RETMERGE 122334 . 124798) (CODELEV 124802 . 126276) (CODEFRAME 126280 . 126989) ( DEFREFS 126993 . 127101) (SETDEFREFS 127105 . 127286)) (127291 139376 (FRAMEOPT 127303 . 127983) ( FRAMEMERGE 127987 . 129619) (NONILVAR 129623 . 130345) (MERGEFRAMEP 130349 . 131134) (FRAMELOCAL 131138 . 131558) (CLEANFRAME 131562 . 131892) (FRAMEDEL 131896 . 136307) (FRAMEVAR 136311 . 138757) ( DELETEFRAMECHECK 138761 . 139221) (ONLYMEMB 139225 . 139373)) (139463 145864 (SKIPPUSH 139475 . 141035 ) (DELCODE 141039 . 142080) (PRATTACH 142084 . 142524) (JUMPCOPYTEST 142528 . 143305) (EQOP 143309 . 144199) (EQVALUE 144203 . 144915) (DELCOPYFN 144919 . 145861)) (145866 147827 (DEADSETQP 145878 . 146306) (DS1 146310 . 147824)) (149118 152019 (COMPILERERROR 149130 . 149278) (OPTCHECK 149282 . 151903) (CCHECK 151907 . 152016))))) STOP