diff options
-rw-r--r-- | src/ChangeLog | 15 | ||||
-rw-r--r-- | src/interp/buildom.boot | 2 | ||||
-rw-r--r-- | src/interp/clam.boot | 6 | ||||
-rw-r--r-- | src/interp/compiler.boot | 8 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 32 | ||||
-rw-r--r-- | src/interp/i-special.boot | 4 | ||||
-rw-r--r-- | src/interp/lisp-backend.boot | 1 |
7 files changed, 42 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3364d23c..11316088 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,20 @@ 2011-12-02 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/buildom.boot (setelt): Change SEQ to %seq. + * interp/clam.boot (compHash): Likewise. + * interp/compiler.boot (freeVarUsage): Likewise. + (canReturn): Likewise. + * interp/i-special.boot (compileIs): Likewise. + * interp/g-opt.boot (changeVariableDefinitionToStore): Likewise. + (jumpToToplevel?): Likewise. + (groupVariableDefinitions): Likewise. + (changeLeaveToExit): Likewise. + (optLabelled): Likewise. + (optSeq): Rename from optSEQ. Adjust callers. + * interp/lisp-backend.boot: Translate %seq to SEQ. + +2011-12-02 Gabriel Dos Reis <gdr@cs.tamu.edu> + Fix SF/3448433 * interp/br-util.boot (bcPred): Do not compare pred against a string. diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot index 67785524..7c234e1e 100644 --- a/src/interp/buildom.boot +++ b/src/interp/buildom.boot @@ -605,7 +605,7 @@ seteltRecordFun(n,i) == field := formalRecordField(n,i) body := n > 2 => ['%store,field,"#3"] - ['SEQ,['%store,field,"#3"],['EXIT,field]] + ['%seq,['%store,field,"#3"],['EXIT,field]] ["XLAM",args,body] copyRecordFun n == diff --git a/src/interp/clam.boot b/src/interp/clam.boot index cfbd0287..6c1d6c55 100644 --- a/src/interp/clam.boot +++ b/src/interp/clam.boot @@ -229,7 +229,7 @@ compHash(op,argl,body,cacheNameOrNil,eqEtc,countFl) == ['tableValue,cacheNameOrNil,MKQ op],MKQ eqEtc] ['lassocShift,cacheArgKey,['tableValue,cacheNameOrNil,MKQ op]] ['tableValue,cacheName,g1] - secondPredPair:= [g2,optSEQ ['SEQ,:hitCountCode,['EXIT,returnFoundValue]]] + secondPredPair:= [g2,optSeq ['%seq,:hitCountCode,['EXIT,returnFoundValue]]] putCode:= null argl => cacheNameOrNil => @@ -247,8 +247,8 @@ compHash(op,argl,body,cacheNameOrNil,eqEtc,countFl) == ['UNWIND_-PROTECT,['PROG1,putCode,['%store,g2,'%true]], ['%when,[['%not,g2],['tableRemove!,cacheName,MKQ op]]]] thirdPredPair:= ['%otherwise,putCode] - codeBody:= optSEQ - ['SEQ,:callCountCode, + codeBody:= optSeq + ['%seq,:callCountCode, ['EXIT,['%bind,[[g2,getCode]],['%when,secondPredPair,thirdPredPair]]]] lamex:= ['LAM,arg,codeBody] mainFunction:= [op,lamex] diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index a4ee1cc7..9f9d0943 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -276,7 +276,7 @@ freeVarUsage([.,vars,body],env) == for v in CDDR u | cons? v repeat free := freeList(v,bound,free,e) free - op = "SEQ" => + op = '%seq => for v in rest u | cons? v repeat free := freeList(v,bound,free,e) free @@ -1153,7 +1153,7 @@ compSeq1(l,$exitModeStack,e) == for x in l] if c is "failed" then return nil catchTag := MKQ gensym() - form := ["SEQ",:replaceExitEtc(c,catchTag,"TAGGEDexit",first $exitModeStack)] + form := ['%seq,:replaceExitEtc(c,catchTag,"TAGGEDexit",first $exitModeStack)] [['%labelled,catchTag,form],first $exitModeStack,$finalEnv] compSeqItem(x,m,e) == @@ -1383,7 +1383,7 @@ canReturn(expr,level,exitCount,ValueFlag) == --SPAD: exit and friends op is "TAGGEDexit" => expr is [.,count,data] => canReturn(data.expr,level,count,count=level) level=exitCount and not ValueFlag => nil - op is "SEQ" => or/[canReturn(u,level+1,exitCount,false) for u in rest expr] + op is '%seq => or/[canReturn(u,level+1,exitCount,false) for u in rest expr] op is "TAGGEDreturn" => nil op is '%labelled => [.,gs,data]:= expr @@ -1392,7 +1392,7 @@ canReturn(expr,level,exitCount,ValueFlag) == --SPAD: exit and friends expr isnt [.,:.] => nil expr is ['%leave, =gs,data] => true --this is pessimistic, but I know of no more accurate idea - expr is ["SEQ",:l] => + expr is ['%seq,:l] => or/[findThrow(gs,u,level+1,exitCount,ValueFlag) for u in l] or/[findThrow(gs,u,level,exitCount,ValueFlag) for u in rest expr] canReturn(data,level,exitCount,ValueFlag) diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 24665e11..003f3d0a 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -97,7 +97,7 @@ changeVariableDefinitionToStore(form,vars) == abstractionOperator? form.op => changeVariableDefinitionToStore(form.absBody,[:form.absParms,:vars]) vars - form is ['SEQ,:stmts,['EXIT,val]] => + form is ['%seq,:stmts,['EXIT,val]] => for s in stmts repeat vars := changeVariableDefinitionToStore(s,vars) changeVariableDefinitionToStore(val,vars) @@ -109,7 +109,7 @@ changeVariableDefinitionToStore(form,vars) == jumpToToplevel? x == atomic? x => false op := x.op - op is 'SEQ => CONTAINED('%leave,x.args) -- FIXME: what about GO? + op is '%seq => CONTAINED('%leave,x.args) -- FIXME: what about GO? op in '(EXIT %leave) => true or/[jumpToToplevel? x' for x' in x] @@ -135,7 +135,7 @@ groupVariableDefinitions form == [form.absKind,form.absParms,groupVariableDefinitions form.absBody] form is ['%loop,:iters,body,val] => [form.op,:iters,groupVariableDefinitions body,val] - form isnt ['SEQ,:stmts,['EXIT,val]] => form + form isnt ['%seq,:stmts,['EXIT,val]] => form defs := nil for x in stmts while nonExitingSingleAssignment? x repeat defs := [x.args,:defs] @@ -143,7 +143,7 @@ groupVariableDefinitions form == stmts := drop(#defs,stmts) expr := stmts = nil => val - ['SEQ,:stmts,['EXIT,val]] + ['%seq,:stmts,['EXIT,val]] ['%bind,reverse! defs,expr] optimizeFunctionDef(def) == @@ -212,7 +212,7 @@ subrname u == nil changeLeaveToExit(s,g) == - s isnt [.,:.] or s.op in '(QUOTE SEQ REPEAT COLLECT %collect %loop) => nil + s isnt [.,:.] or s.op in '(QUOTE %seq REPEAT COLLECT %collect %loop) => nil s is ['%leave, =g,:u] => (s.first := "EXIT"; s.rest := u) changeLeaveToExit(first s,g) changeLeaveToExit(rest s,g) @@ -250,7 +250,7 @@ removeNeedlessLeave x == optLabelled (x is ['%labelled,g,a]) == a isnt [.,:.] => a removeNeedlessLeave a - if a is ["SEQ",:s,['%leave,=g,u]] then + if a is ['%seq,:s,['%leave,=g,u]] then changeLeaveToExit(s,g) a.rest := [:s,["EXIT",u]] a := simplifyVMForm a @@ -258,7 +258,7 @@ optLabelled (x is ['%labelled,g,a]) == resetTo(x,a) else changeLeaveToGo(a,g) - x.first := "SEQ" + x.first := '%seq x.rest := [["EXIT",a],second g,["EXIT",second g]] x @@ -410,8 +410,8 @@ replaceableTemporary?(g,x) == x is ['GO,=g] => true or/[jumpTarget?(g,x') for x' in x] -optSEQ ["SEQ",:l] == - tryToRemoveSEQ SEQToCOND getRidOfTemps splicePROGN l where +optSeq ['%seq,:l] == + tryToRemoveSeq seqToCOND getRidOfTemps splicePROGN l where splicePROGN l == atomic? l => l l is [["PROGN",:stmts],:l'] => [:stmts,:l'] @@ -421,17 +421,17 @@ optSEQ ["SEQ",:l] == l is [["%LET",g,x],:r] and replaceableTemporary?(g,r) => getRidOfTemps substitute(x,g,r) first l is "/throwAway" => getRidOfTemps rest l - --this gets rid of unwanted labels generated by declarations in SEQs + --this gets rid of unwanted labels generated by declarations in %seq [first l,:getRidOfTemps rest l] - SEQToCOND l == + seqToCOND l == transform:= [[a,b] for x in l while (x is ['%when,[a,["EXIT",b]]])] before:= take(#transform,l) aft:= after(l,before) - null before => ["SEQ",:aft] + null before => ['%seq,:aft] null aft => ['%when,:transform,'(%otherwise (conderr))] - optCond ['%when,:transform,['%otherwise,optSEQ ["SEQ",:aft]]] - tryToRemoveSEQ l == - l is ["SEQ",[op,a]] and op in '(EXIT RETURN %leave %return) => a + optCond ['%when,:transform,['%otherwise,optSeq ['%seq,:aft]]] + tryToRemoveSeq l == + l is ['%seq,[op,a]] and op in '(EXIT RETURN %leave %return) => a l optSuchthat [.,:u] == ["SUCHTHAT",:u] @@ -828,7 +828,7 @@ optIquo(x is ['%iquo,a,b]) == --% for x in '((%call optCall) _ - (SEQ optSEQ)_ + (%seq optSeq)_ (%bind optBind)_ (%try optTry)_ (%not optNot)_ diff --git a/src/interp/i-special.boot b/src/interp/i-special.boot index 210996ee..8cf776fc 100644 --- a/src/interp/i-special.boot +++ b/src/interp/i-special.boot @@ -1649,8 +1649,8 @@ compileIs(val,pattern) == for var in removeDuplicates vars repeat assignCode:=[["%LET",var,["CDR",["objectAssoc",MKQ var,g]]],:assignCode] null $opIsIs => - ['%when,[["EQ",predCode,MKQ "failed"],["SEQ",:assignCode,'%true]]] - ['%when,[['%not,["EQ",predCode,MKQ "failed"]],["SEQ",:assignCode,'%true]]] + ['%when,[["EQ",predCode,MKQ "failed"],['%seq,:assignCode,'%true]]] + ['%when,[['%not,["EQ",predCode,MKQ "failed"]],['%seq,:assignCode,'%true]]] evalIsPredicate(value,pattern,mode) == --This function pattern matches value to pattern, and returns diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot index 316a4ef9..0aba8664 100644 --- a/src/interp/lisp-backend.boot +++ b/src/interp/lisp-backend.boot @@ -637,6 +637,7 @@ for x in [ ['%funcall, :'FUNCALL], ['%function, :'FUNCTION], ['%lambda, :'LAMBDA], + ['%seq, :'SEQ], ['%when, :'COND], -- I/O stream functions |