diff options
author | dos-reis <gdr@axiomatics.org> | 2011-12-13 13:37:32 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-12-13 13:37:32 +0000 |
commit | 7184b9c19ca049b7bfab83b5a9998fdf64beab63 (patch) | |
tree | 4b13f5d30bd428fe3c859a2089fed66d3f0ef3b5 | |
parent | bf49bd60354641b393c53e10b40862199fd31151 (diff) | |
download | open-axiom-7184b9c19ca049b7bfab83b5a9998fdf64beab63.tar.gz |
* interp/g-opt.boot (replaceableTemporary?): Remove.
(optSeq,getRidOfTemps): Likewise.
(optSeq): Rewrite.
* interp/slam.boot (compileRecurrenceRelation): Tidy.
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 24 | ||||
-rw-r--r-- | src/interp/slam.boot | 4 |
3 files changed, 12 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bbab7ecb..1decdafa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2011-12-13 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/g-opt.boot (replaceableTemporary?): Remove. + (optSeq,getRidOfTemps): Likewise. + (optSeq): Rewrite. + * interp/slam.boot (compileRecurrenceRelation): Tidy. + +2011-12-13 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/g-opt.boot (removeJunk!): Rename from removeSeq! (cancelScopeLeave!): New. (inlineLocals!): Tidy. diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 851e7eb6..6c68c642 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -573,27 +573,9 @@ EqualBarGensym(x,y) == x isnt [.,:.] or y isnt [.,:.] => false fn(first x,first y) and fn(rest x,rest y) -++ Determine whether the symbol `g' is the name of a temporary that -++ can be replaced in the form `x', if it is of linear usage and not -++ the name of a program point. The latter occurs when %leave forms -++ are changed to %LET form followed by a GO form -- see optScope. -replaceableTemporary?(g,x) == - gensym? g and numOfOccurencesOf(g,x) < 2 and not jumpTarget?(g,x) where - jumpTarget?(g,x) == - atomic? x => false - x is ['GO,=g] => true - or/[jumpTarget?(g,x') for x' in x] - -optSeq ['%seq,:l] == - tryToRemoveSeq ['%seq,:getRidOfTemps l] where - getRidOfTemps l == - null l => nil - l is [["%LET",g,x],:r] and replaceableTemporary?(g,r) => - getRidOfTemps substitute(x,g,r) - [first l,:getRidOfTemps rest l] - tryToRemoveSeq l == - l is ['%seq,[op,a]] and op in '(%exit RETURN %leave %return) => a - l +optSeq x == + x is ['%seq,[op,a]] and op in '(%exit RETURN %leave %return) => a + x optSuchthat [.,:u] == ["SUCHTHAT",:u] diff --git a/src/interp/slam.boot b/src/interp/slam.boot index 64e5159a..10695b03 100644 --- a/src/interp/slam.boot +++ b/src/interp/slam.boot @@ -303,8 +303,8 @@ compileRecurrenceRelation(op,nam,argl,junk,[body,sharpArg,n,:initCode]) == fromScratchInit:= [["%LET",gIndex,n],:[["%LET",g,x] for g in gsList for x in initCode]] continueInit:= - [["%LET",gIndex,["%ELT",stateVar,0]], - :[["%LET",g,["%ELT",stateVar,i]] for g in gsList for i in 1..]] + [["%LET",gIndex,["ELT",stateVar,0]], + :[["%LET",g,["ELT",stateVar,i]] for g in gsList for i in 1..]] mainFunction:= [nam,["LAM",margl,mbody]] where margl:= [:argl,'envArg] max:= gensym() |