diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-04 12:08:54 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-04 12:08:54 -0700 |
commit | 55db51c497309174ed857bceedd2268b860b8d49 (patch) | |
tree | 0b2825dd788642ccc89e7a8266dbf8ec9b7b3d30 /tools/eliminator | |
parent | 986fafd6677cbb8fbbb62ce565cac6311ff7cbfa (diff) |
optimize eliminator transitive calculation
Diffstat (limited to 'tools/eliminator')
-rw-r--r-- | tools/eliminator/eliminator.coffee | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/eliminator/eliminator.coffee b/tools/eliminator/eliminator.coffee index 4a8c3d26..4d06c1ec 100644 --- a/tools/eliminator/eliminator.coffee +++ b/tools/eliminator/eliminator.coffee @@ -183,19 +183,26 @@ class Eliminator todo = {} for element of @affects todo[element] = 1 + + #process.stdout.write 'pre ' + JSON.stringify(@affects, null, ' ') + '\n' + while incomplete incomplete = false nextTodo = {} - for source of todo + for source of @affects targets = @affects[source] for target of targets - for target2 of @affects[target] - if not @affects[source][target2] - if not @isLocal[source] then @dependsOnAGlobal[target2] = true - @affects[source][target2] = true - nextTodo[source] = 1 - incomplete = true + if todo[target] + for target2 of @affects[target] + if not @affects[source][target2] + if not @isLocal[source] then @dependsOnAGlobal[target2] = true + @affects[source][target2] = true + nextTodo[source] = 1 + incomplete = true todo = nextTodo + + #process.stdout.write 'post ' + JSON.stringify(@affects, null, ' ') + '\n' + return undefined # Analyzes the live ranges of single-def variables. Requires dependencies to |