diff options
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/interp/compiler.boot | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1ecae768..136d1d94 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2012-02-25 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/compiler.boot (extractCode): Rename from + extractCodeAndConstructTriple. Change Arity. Tidy. Adjust callers. + +2012-02-25 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/compiler.boot (finishLambdaExpression): Use %closure. (extractCodeAndConstructTriple): Likewise. * interp/g-opt.boot (optCall): Adjust. diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 4a1cd153..8d04a77a 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -351,20 +351,21 @@ compWithMappingMode(x,m is ["Mapping",m',:sl],oldE) == [.,.,e]:= compMakeDeclaration(v,m,e) (vl ~= nil) and not hasFormalMapVariable(x, vl) => [u,.,.] := comp([x,:vl],m',e) or return nil - extractCodeAndConstructTriple(u, m, oldE) + [extractCode(u,vl),m,oldE] null vl and (t := comp([x], m', e)) => [u,.,.] := t - extractCodeAndConstructTriple(u, m, oldE) + [extractCode(u,nil),m,oldE] [u,.,.]:= comp(x,m',e) or return nil [.,fun] := optimizeFunctionDef [nil,["LAMBDA",vl,u]] [finishLambdaExpression(fun,e),m,oldE] -extractCodeAndConstructTriple(u, m, oldE) == - u is ['%call,fn,:.] => - if fn is ['%apply,a] then fn := a - [fn,m,oldE] +extractCode(u,vars) == + u is ['%call,fn,: =vars] => + fn is ['%apply,a] => a + fn is [q,:.] and q in '(ELT CONST) => ['%tref,:fn.args] + fn [op,:.,env] := u - [['%closure,['%function,op],env],m,oldE] + ['%closure,['%function,op],env] compExpression(x,m,e) == $insideExpressionIfTrue: local:= true |