aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-opt.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-03-07 01:00:16 +0000
committerdos-reis <gdr@axiomatics.org>2010-03-07 01:00:16 +0000
commit0e88b70dfbb109f73fe0e8cac2c25ef445cb2c50 (patch)
tree5d1195c4744a08d97377bbb9d0a5bf6f4f152c8a /src/interp/g-opt.boot
parent0d4a863f2fa7e85a9bbd044626df9ea20704cb9e (diff)
downloadopen-axiom-0e88b70dfbb109f73fe0e8cac2c25ef445cb2c50.tar.gz
* interp/g-opt.boot ($VMsideEffectFreeOperators): New.
($simpleVMoperators): Augment it. (semiSimpleRelativeTo?): New. (isSimpleVMForm): Use it. * interp/c-util.boot (forwardingCall?): New. (usesVariablesLinearly?): Likewise. (expandableDefinition?): Likewise. (foldSpadcall): Tidy. (foldExportedFunctionReferences): If a function is discovered to be expandable, make it so. * interp/define.boot (spadCompileOrSetq): Tidy.
Diffstat (limited to 'src/interp/g-opt.boot')
-rw-r--r--src/interp/g-opt.boot29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 8110587e..38613f11 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -392,16 +392,31 @@ optLESSP u ==
['GREATERP,b,a]
u
-$simpleVMoperators ==
- '(CONS CAR CDR LENGTH SIZE EQUAL EQL EQ NOT NULL OR AND
- SPADfirst QVELT _+ _- _* _< _= ASH INTEGER_-LENGTH
+++ List of VM side effect free operators.
+$VMsideEffectFreeOperators ==
+ '(CAR CDR LENGTH SIZE EQUAL EQL EQ NOT NULL OR AND
+ SPADfirst QVELT _+ _- _* _< _= _<_= _> _>_= ASH INTEGER_-LENGTH
QEQCAR QCDR QCAR INTEGERP FLOATP STRINGP IDENTP SYMBOLP
- MINUSP GREATERP)
+ MINUSP GREATERP ZEROP ODDP FLOAT_-RADIX FLOAT FLOAT_-SIGN FLOAT_-DIGITS
+ CGREATERP GGREATERP CHAR BOOLE GET BVEC_-GREATER FUNCALL)
-isSimpleVMForm form ==
+++ List of simple VM operators
+$simpleVMoperators ==
+ append($VMsideEffectFreeOperators,
+ ["CONS","LIST","VECTOR","STRINGIMAGE",
+ "MAKE-FULL-CVEC","BVEC-MAKE-FULL","COND"])
+
+++ Return true if the `form' is semi-simple with respect to
+++ to the list of operators `ops'.
+semiSimpleRelativeTo?(form,ops) ==
isAtomicForm form => true
- form is [op,:args] and MEMQ(op,$simpleVMoperators)
- and ("and"/[isAtomicForm arg for arg in args])
+ form isnt [op,:args] or not MEMQ(op,ops) => false
+ and/[semiSimpleRelativeTo?(f,ops) for f in args]
+
+++ Return true if `form' is a simple VM form.
+++ See $simpleVMoperators for the definition of simple operators.
+isSimpleVMForm form ==
+ semiSimpleRelativeTo?(form,$simpleVMoperators)
++ Return true if `form' is a VM form whose evaluation does not depend
++ on the program point where it is evaluated.