From f0d35b6faab7983de66e2127af4f4a67dc6acd59 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 1 Feb 2011 04:14:22 +0000 Subject: * interp/g-opt.boot (optCallSpecially): Remove. (optSpeciallCall): Likeise. (optCall): Adjust. (optCallEval): Move to wi2.boot, sole user. --- src/ChangeLog | 7 +++++++ src/interp/g-opt.boot | 32 -------------------------------- src/interp/nruncomp.boot | 4 ++-- src/interp/wi2.boot | 8 ++++++++ 4 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9df7baa8..4e8c39e4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-01-31 Gabriel Dos Reis + + * interp/g-opt.boot (optCallSpecially): Remove. + (optSpeciallCall): Likeise. + (optCall): Adjust. + (optCallEval): Move to wi2.boot, sole user. + 2011-01-31 Gabriel Dos Reis * interp/g-opt.boot (optQSMINUS): Remove. diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index b7b90ed9..4806b103 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -243,25 +243,10 @@ optCall (x is ['%call,:u]) == 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)) => resetTo(x,w) q = 'CONST => ['spadConstant,R,n] emitIndirectCall(fn,a,x) systemErrorHere ['optCall,x] -optCallSpecially(q,x,n,R) == - optimizableDomain? R => optSpecialCall(x,R,n) - (y:= get(R,"value",$e)) and optimizableDomain? y.expr => - optSpecialCall(x,y.expr,n) - nil - -optCallEval u == - u is ["List",:.] => List Integer() - u is ["Vector",:.] => Vector Integer() - u is ["PrimitiveArray",:.] => PrimitiveArray Integer() - u is ["FactoredForm",:.] => FactoredForm Integer() - u is ["Matrix",:.] => Matrix Integer() - eval u - optCons (x is ["CONS",a,b]) == a="NIL" => b='NIL => (x.first := 'QUOTE; x.rest := ['NIL,:'NIL]; x) @@ -273,23 +258,6 @@ optCons (x is ["CONS",a,b]) == x x -optSpecialCall(x,y,n) == - yval := optCallEval y - CAAAR x="CONST" => - KAR yval.n = function Undef => - keyedSystemError("S2GE0016",['"optSpecialCall", - '"invalid constant"]) - MKQ yval.n - fn := getFunctionReplacement compileTimeBindingOf first yval.n => - x.rest := CDAR x - x.first := fn - if fn is ["XLAM",:.] then x := simplifyVMForm x - x is ["EQUAL",:args] => resetTo(x,DEF_-EQUAL args) - --DEF-EQUAL is really an optimiser - x - [fn,:a]:= first x - emitIndirectCall(fn,a,x) - compileTimeBindingOf u == null(name:= BPINAME u) => keyedSystemError("S2OO0001",[u]) name="Undef" => MOAN "optimiser found unknown function" diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index 68169169..ddcbb16e 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -171,8 +171,8 @@ optDeltaEntry(op,sig,dc,eltOrConst) == atom dc and (dcval := get(dc,'value,$e)) => dcval.expr dc sig := MSUBST(ndc,dc,sig) - -- Don't bothe if the domain of computation is not an instantiation, - -- or is candidate for inlining. + -- Don't bother if the domain of computation is not an instantiation + -- nor a candidate for inlining. atom ndc or not optimizableDomain? ndc => nil fun := lookupDefiningFunction(op,sig,ndc) -- following code is to handle selectors like first, rest diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot index 51d2fe33..f519b830 100644 --- a/src/interp/wi2.boot +++ b/src/interp/wi2.boot @@ -599,6 +599,14 @@ compMapCond''(cexpr,dc) == --====================================================================== -- From nruncomp.boot --====================================================================== +optCallEval u == + u is ["List",:.] => List Integer() + u is ["Vector",:.] => Vector Integer() + u is ["PrimitiveArray",:.] => PrimitiveArray Integer() + u is ["FactoredForm",:.] => FactoredForm Integer() + u is ["Matrix",:.] => Matrix Integer() + eval u + optDeltaEntry(op,sig,dc,eltOrConst) == return nil --------> kill it $killOptimizeIfTrue = true => nil -- cgit v1.2.3