aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-opt.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-02-27 01:30:50 +0000
committerdos-reis <gdr@axiomatics.org>2012-02-27 01:30:50 +0000
commitf719c82a459f911b71b8f9e445c7d1c872ead927 (patch)
tree264798ddaf4907287557cbb823e1b39d69a53465 /src/interp/g-opt.boot
parent7f099548f4fce103f5eb285e20fcb5f0aebdfee9 (diff)
downloadopen-axiom-f719c82a459f911b71b8f9e445c7d1c872ead927.tar.gz
* interp/compiler.boot (emitLocalCallInsn): Mark external
operators as such, and local functions as such. (freeVarUsage): Do not count external and local functions. (extractCode): Tidy. Handle closure literals. * interp/g-opt.boot (optCall): Optimize external calls where possible. %external is a side-effect free operator.
Diffstat (limited to 'src/interp/g-opt.boot')
-rw-r--r--src/interp/g-opt.boot5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 51bc8cef..d771739b 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -547,9 +547,10 @@ optCall (x is ['%call,:u]) ==
x.first := op
x.rest := [:a,env]
x
- fn is ['%function,op] =>
+ fn is ['%external,op] =>
x.first := op
x.rest := a
+ opt := op has OPTIMIZE => resetTo(x,apply(opt,x,nil))
x
fn is ['ELT,:.] => emitIndirectCall(fn,a,x)
fn is ['CONST,R,n] => ['spadConstant,R,n]
@@ -656,7 +657,7 @@ $VMsideEffectFreeOperators ==
%bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor
%bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %bitveclt
%before? %equal %sptreq %ident? %property %tref
- %void %retract %pullback %lambda %closure)
+ %void %retract %pullback %lambda %closure %external)
++ List of simple VM operators
$simpleVMoperators ==