diff options
author | dos-reis <gdr@axiomatics.org> | 2011-12-08 00:46:22 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-12-08 00:46:22 +0000 |
commit | e37be16362b844403c5d4c47fa91fd2540389041 (patch) | |
tree | 318be19e821a8a05be39652848235d123708d99b | |
parent | 1328fa0128ebf17c274b230eb724df195be8a915 (diff) | |
download | open-axiom-e37be16362b844403c5d4c47fa91fd2540389041.tar.gz |
* interp/g-opt.boot: %writeString, %writeNewline and %writeLine
are side-effect full.
(removeSeq!): Tidy. Skip side-effectfree statements.
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 8 |
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 |