aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-11-28 19:19:44 +0000
committerdos-reis <gdr@axiomatics.org>2011-11-28 19:19:44 +0000
commit68e2e8c03b04972293096a507a4923df76772e46 (patch)
tree5fd9216bf26c3406879b6f75a138030781296e9a
parent76263e0ec3b3d0f39172ac4b84599b364d161d7a (diff)
downloadopen-axiom-68e2e8c03b04972293096a507a4923df76772e46.tar.gz
* interp/c-util.boot (inlineDirectCall): Inline a non-side effect
free argument in a unary pure function call if it is used exactly once. * algebra/integer.spad.pamphlet (Integer) [reducedSystem]: Fix typo.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/algebra/integer.spad.pamphlet2
-rw-r--r--src/interp/c-util.boot3
3 files changed, 10 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c1f7a1ad..4e2b98a0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
2011-11-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/c-util.boot (inlineDirectCall): Inline a non-side effect
+ free argument in a unary pure function call if it is used exactly once.
+ * algebra/integer.spad.pamphlet (Integer) [reducedSystem]: Fix typo.
+
+2011-11-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/define.boot (encodeCatform): Handle $ here.
* interp/nruncomp.boot (deltaTran): assocIndex now handles $.
(getLocalIndex): Likewise.
diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet
index 198b3afa..e7de9302 100644
--- a/src/algebra/integer.spad.pamphlet
+++ b/src/algebra/integer.spad.pamphlet
@@ -152,7 +152,7 @@ Integer: IntegerNumberSystem with
reducedSystem(m:Matrix %, v:Vector %):
Record(mat:Matrix(Integer), vec:Vector(Integer)) ==
- [m pretend Matrix(Integer), vec pretend Vector(Integer)]
+ [m pretend Matrix(Integer), v pretend Vector(Integer)]
abs(x) == %iabs x
random() == random()$Lisp
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index e9643db3..5cd74206 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1321,6 +1321,9 @@ inlineDirectCall call ==
newparms := [gensym() for p in parms]
body := applySubst(pairList(parms,newparms),body)
applySubst!(pairList(newparms,call.args),body)
+ -- a non-side effect free argument used exactly once is OK.
+ parms is [p] and numOfOccurencesOf(p,body) = 1 =>
+ substitute(first call.args,p,body)
-- get cute later.
call
call