aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-02-25 22:59:04 +0000
committerdos-reis <gdr@axiomatics.org>2012-02-25 22:59:04 +0000
commit005c2bd99d216a29ae3ea876cbb5b4f5490a2e7d (patch)
tree84ef05a355338b5dab44ad646c522939d11823bc /src
parentba636488b16b6fed9014dc1e51019622336b8425 (diff)
downloadopen-axiom-005c2bd99d216a29ae3ea876cbb5b4f5490a2e7d.tar.gz
* interp/compiler.boot (extractCode): Rename from
extractCodeAndConstructTriple. Change Arity. Tidy. Adjust callers.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/compiler.boot15
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