diff options
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/interp/compiler.boot | 14 | ||||
-rw-r--r-- | src/interp/define.boot | 2 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 12 | ||||
-rw-r--r-- | src/interp/g-util.boot | 6 |
5 files changed, 24 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f8548185..f5054894 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-12-03 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/compiler.boot: Replace %labelled with %scope. + * interp/define.boot: Likewise. + * interp/g-opt.boot: Likewise. + * interp/g-util.boot: Likewise. Rename mkLabelled to mkScope. + 2011-12-02 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/g-opt.boot (groupVariableDefinitions): Simplify a bit. diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 9f9d0943..d1a58bd3 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1154,7 +1154,7 @@ compSeq1(l,$exitModeStack,e) == if c is "failed" then return nil catchTag := MKQ gensym() form := ['%seq,:replaceExitEtc(c,catchTag,"TAGGEDexit",first $exitModeStack)] - [['%labelled,catchTag,form],first $exitModeStack,$finalEnv] + [['%scope,catchTag,form],first $exitModeStack,$finalEnv] compSeqItem(x,m,e) == $insideExpressionIfTrue := false @@ -1385,7 +1385,7 @@ canReturn(expr,level,exitCount,ValueFlag) == --SPAD: exit and friends level=exitCount and not ValueFlag => nil op is '%seq => or/[canReturn(u,level+1,exitCount,false) for u in rest expr] op is "TAGGEDreturn" => nil - op is '%labelled => + op is '%scope => [.,gs,data]:= expr (findThrow(gs,data,level,exitCount,ValueFlag) => true) where findThrow(gs,expr,level,exitCount,ValueFlag) == @@ -1865,7 +1865,7 @@ coerceExit: (%Triple,%Mode) -> %Maybe %Triple coerceExit([x,m,e],m') == m' := resolve(m,m') x' := replaceExitEtc(x,catchTag := MKQ gensym(),"TAGGEDexit",$exitMode) - coerce([['%labelled,catchTag,x'],m,e],m') + coerce([['%scope,catchTag,x'],m,e],m') compAtSign: (%Form,%Mode,%Env) -> %Maybe %Triple compAtSign(["@",x,m'],m,e) == @@ -2433,16 +2433,16 @@ nullifyTargetingLeaves(x,tag) == massageLoop x == main x where main x == - x isnt ['%labelled,tag,['REPEAT,:iters,body]] => x + x isnt ['%scope,tag,['REPEAT,:iters,body]] => x nullifyTargetingLeaves(body,tag) containsNonLocalControl?(body,nil) => systemErrorHere ['massageLoop,x] - ['%labelled,tag,['%loop,:iters,body,'%nil]] + ['%scope,tag,['%loop,:iters,body,'%nil]] containsNonLocalControl?(x,tags) == atomic? x => false x is ['%leave,tag,x'] => tag = nil => false -- see NOTES in nullifyTargetingLeaves. not symbolMember?(tag,tags) or containsNonLocalControl?(x',tags) - x is ['%labelled,tag,x'] => + x is ['%scope,tag,x'] => containsNonLocalControl?(x',[tag,:tags]) or/[containsNonLocalControl?(x',tags) for x' in x] @@ -2481,7 +2481,7 @@ compRepeatOrCollect(form,m,e) == [body',m',e'] := compOrCroak(body,bodyMode,e) or return nil -- Massage the loop body if we have a structured jump. if $iterateCount > 0 then - body' := ['%labelled,$loopBodyTag,body'] + body' := ['%scope,$loopBodyTag,body'] if $until then [untilCode,.,e']:= comp($until,$Boolean,e') itl':= substitute(["UNTIL",untilCode],'$until,itl') diff --git a/src/interp/define.boot b/src/interp/define.boot index 21a03ae5..32517f80 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -1908,7 +1908,7 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body], catchTag := MKQ gensym() body' := replaceExitEtc(T.expr,catchTag,"TAGGEDreturn",$returnMode) body' := addArgumentConditions(body',$op) - finalBody := ['%labelled,catchTag,body'] + finalBody := ['%scope,catchTag,body'] compile(db,[op',["LAM",[:argl,'_$],finalBody]],signature) $functorStats:= addStats($functorStats,$functionStats) diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 5872dbe8..1e2d5ff8 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -165,8 +165,8 @@ groupVariableDefinitions form == for clause in form.args while not CONTAINED('%LET, first clause) repeat second(clause) := groupVariableDefinitions second clause form - form is ['%labelled,tag,expr] => - mkLabelled(tag,groupVariableDefinitions expr) + form is ['%scope,tag,expr] => + mkScope(tag,groupVariableDefinitions expr) form is ['%bind,inits,expr] => mkBind(inits,groupVariableDefinitions expr) form is ['%lambda,:.] => @@ -200,7 +200,7 @@ optimizeFunctionDef(def) == expr.absBody := removeTopLevelLabel expr.absBody where removeTopLevelLabel body == - body is ['%labelled,g,u] => + body is ['%scope,g,u] => removeTopLevelLabel replaceLeaveByReturn(u,g) body replaceLeaveByReturn(x,g) == @@ -278,7 +278,7 @@ removeNeedlessLeave x == for x' in x repeat removeNeedlessLeave x' -optLabelled (x is ['%labelled,g,a]) == +optScope (x is ['%scope,g,a]) == a isnt [.,:.] => a removeNeedlessLeave a if a is ['%seq,:s,['%leave,=g,u]] then @@ -433,7 +433,7 @@ optIF2COND ["IF",a,b,c] == ++ Determine whether the symbol `g' is the name of a temporary that ++ can be replaced in the form `x', if it is of linear usage and not ++ the name of a program point. The latter occurs when %leave forms -++ are changed to %LET form followed by a GO form -- see optLabelled. +++ are changed to %LET form followed by a GO form -- see optScope. replaceableTemporary?(g,x) == gensym? g and numOfOccurencesOf(g,x) < 2 and not jumpTarget?(g,x) where jumpTarget?(g,x) == @@ -885,7 +885,7 @@ for x in '((%call optCall) _ (%list optList)_ (SPADCALL optSPADCALL)_ (_| optSuchthat)_ - (%labelled optLabelled)_ + (%scope optScope)_ (%when optCond)_ (%retract optRetract)_ (%pullback optPullback)_ diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index b9a6e99c..8a3254ac 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -53,12 +53,12 @@ hasNoLeave?(expr,g) == expr isnt [.,:.] => true hasNoLeave?(first expr,g) and hasNoLeave?(rest expr,g) -mkLabelled(tag,expr) == +mkScope(tag,expr) == expr is ['%leave,=tag,expr'] and hasNoLeave?(expr',tag) => expr' expr is ['%bind,inits,expr'] and hasNoLeave?(inits,tag) => - mkBind(inits,mkLabelled(tag,expr')) + mkBind(inits,mkScope(tag,expr')) hasNoLeave?(expr,tag) => expr - ['%labelled,tag,expr] + ['%scope,tag,expr] mkBind(inits,expr) == expr is ['%leave,tag,expr'] => |