aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-01 04:14:22 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-01 04:14:22 +0000
commitf0d35b6faab7983de66e2127af4f4a67dc6acd59 (patch)
tree86895ff5a496ef29b6677b7e6d9d900fa1bccca4
parentf1fe7d232e54727f76f7c550af0926487ce88f88 (diff)
downloadopen-axiom-f0d35b6faab7983de66e2127af4f4a67dc6acd59.tar.gz
* interp/g-opt.boot (optCallSpecially): Remove.
(optSpeciallCall): Likeise. (optCall): Adjust. (optCallEval): Move to wi2.boot, sole user.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/interp/g-opt.boot32
-rw-r--r--src/interp/nruncomp.boot4
-rw-r--r--src/interp/wi2.boot8
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,5 +1,12 @@
2011-01-31 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot (optCallSpecially): Remove.
+ (optSpeciallCall): Likeise.
+ (optCall): Adjust.
+ (optCallEval): Move to wi2.boot, sole user.
+
+2011-01-31 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot (optQSMINUS): Remove.
* algebra/data.spad.pamphlet: Tidy.
* algebra/plot.spad.pamphlet: Likewise.
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