aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/interp/g-opt.boot27
2 files changed, 17 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index eacc35d1..4c852523 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2010-07-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot (optCall): Don't call optimize again.
+
+2010-07-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot (simplifyVMForm): Don't call optimize.
(optCall): Handle VM macro expansions here.
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 43c9705a..2e9a92f7 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -114,7 +114,7 @@ optimizeFunctionDef(def) ==
def' := simplifyVMForm COPY def
if $reportOptimization then
- sayBrightlyI bright '"Optimized LISP code:"
+ sayBrightlyI bright '"Intermediate VM code:"
pp def'
[name,[slamOrLam,args,body]] := def'
@@ -254,25 +254,24 @@ optCall (x is ['%call,:u]) ==
atom vars => body
#vars > #args => systemErrorHere ['optCall,x]
resetTo(x,optXLAMCond SUBLIS(pairList(vars,args),body))
- -- destructively optimizes this new x
- x:= optimize [u]
- -- next should happen only as result of macro expansion
- atom first x => first x
- [fn,:a] := u := first x
- atom fn => resetTo(x,u)
- fn is ["applyFun",name] =>
- (x.first := "SPADCALL"; x.rest := [:a,name]; x)
+ [fn,:a] := u
+ atom fn =>
+ opt := fn has OPTIMIZE => resetTo(x,FUNCALL(opt,u))
+ resetTo(x,u)
+ fn is ['applyFun,name] =>
+ x.first := 'SPADCALL
+ x.rest := [:a,name]
+ x
fn is [q,R,n] and q in '(getShellEntry ELT QREFELT CONST) =>
- not $bootStrapMode and (w:= optCallSpecially(q,x,n,R)) => w
- q="CONST" => ["spadConstant",R,n]
+ not $bootStrapMode and (w := optCallSpecially(q,x,n,R)) => resetTo(x,w)
+ q = 'CONST => ['spadConstant,R,n]
emitIndirectCall(fn,a,x)
- systemErrorHere ["optCall",x]
+ systemErrorHere ['optCall,x]
optCallSpecially(q,x,n,R) ==
y:= LASSOC(R,$specialCaseKeyList) => optSpecialCall(x,y,n)
optimizableDomain? R => optSpecialCall(x,R,n)
- (y:= get(R,"value",$e)) and
- optimizableDomain? y.expr =>
+ (y:= get(R,"value",$e)) and optimizableDomain? y.expr =>
optSpecialCall(x,y.expr,n)
(
(y:= lookup(R,$getDomainCode)) and ([op,y,prop]:= y) and