diff options
author | dos-reis <gdr@axiomatics.org> | 2011-02-01 04:14:22 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-02-01 04:14:22 +0000 |
commit | f0d35b6faab7983de66e2127af4f4a67dc6acd59 (patch) | |
tree | 86895ff5a496ef29b6677b7e6d9d900fa1bccca4 /src/interp | |
parent | f1fe7d232e54727f76f7c550af0926487ce88f88 (diff) | |
download | open-axiom-f0d35b6faab7983de66e2127af4f4a67dc6acd59.tar.gz |
* interp/g-opt.boot (optCallSpecially): Remove.
(optSpeciallCall): Likeise.
(optCall): Adjust.
(optCallEval): Move to wi2.boot, sole user.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/g-opt.boot | 32 | ||||
-rw-r--r-- | src/interp/nruncomp.boot | 4 | ||||
-rw-r--r-- | src/interp/wi2.boot | 8 |
3 files changed, 10 insertions, 34 deletions
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 |