diff options
author | dos-reis <gdr@axiomatics.org> | 2010-07-25 18:35:18 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-07-25 18:35:18 +0000 |
commit | 1031978e4e96cd079ab314b4b524d35bd8a51c00 (patch) | |
tree | e9e3fd3495e3d76df85fd6bf5aead0e2914d9d9a | |
parent | 2468be83428409b0ce7a0d8586d3d28fcf66c3ab (diff) | |
download | open-axiom-1031978e4e96cd079ab314b4b524d35bd8a51c00.tar.gz |
* interp/g-opt.boot (optCall): Don't call optimize again.
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 27 |
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 |