aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog6
-rw-r--r--src/interp/g-opt.boot8
2 files changed, 10 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f0ba7b3f..9bf35886 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
2011-12-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot: %writeString, %writeNewline and %writeLine
+ are side-effect full.
+ (removeSeq!): Tidy. Skip side-effectfree statements.
+
+2011-12-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot (removeSeq!): New.
(inlineLocals!): Likewise.
(optimizeFunctionDef): Use them.
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 05708d68..1813d18e 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -228,11 +228,12 @@ removeSeq! x == walkWith!(x,function f) where
x := first xs
x is "/throwAway" => g rest xs -- skip garbages
x is ['%seq,:.] => -- splice sub-sequences
- ys := g x.args =>
- lastNode(ys).rest := g rest xs
- ys
+ ys := x.args =>
+ lastNode(ys).rest := rest xs
+ g ys
g rest xs -- skip empty statements
rest xs = nil => xs
+ sideEffectFree? x => g rest xs -- skip effect-less statements.
xs.rest := g rest xs
xs
@@ -564,7 +565,6 @@ $VMsideEffectFreeOperators ==
%bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor
%bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %bitveclt
%before? %equal %sptreq %ident? %property %tref
- %writeString %writeNewline %writeLine
%void %retract %pullback %lambda %closure)
++ List of simple VM operators