diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-10 17:28:20 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-11 14:54:56 -0800 |
commit | 79db56a186db69c6617b0670e4675c9f321bee7d (patch) | |
tree | e81dbcbc7e571c4a9e0a9a060d26c711dc236d91 /src | |
parent | 8c69b59fcd8bdc560bceba221496ad271f4a35d3 (diff) |
remove variable eliminator in analyzer; we do that in the eliminator in -O1 and above anyhow
Diffstat (limited to 'src')
-rw-r--r-- | src/analyzer.js | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index bb9ab27d..bba617a7 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -820,33 +820,7 @@ function analyzer(data, sidePass) { //if (dcheck('vars')) dprint('analyzed variables: ' + dump(func.variables)); } - // Filter out no longer used variables, collapsing more as we go - while (true) { - analyzeVariableUses(); - - var recalc = false; - - keys(func.variables).forEach(function(vname) { - var variable = func.variables[vname]; - if (variable.uses == 0 && variable.origin != 'funcparam') { - // Eliminate this variable if we can - var sideEffects = false; - walkInterdata(func.lines[variable.rawLinesIndex], function(item) { - if (item.intertype in SIDE_EFFECT_CAUSERS) sideEffects = true; - }); - if (!sideEffects) { - dprint('vars', 'Eliminating ' + vname); - func.lines[variable.rawLinesIndex].intertype = 'noop'; - func.lines[variable.rawLinesIndex].assignTo = null; - // in theory we can also null out some fields here to save memory - delete func.variables[vname]; - recalc = true; - } - } - }); - - if (!recalc) break; - } + analyzeVariableUses(); // Decision time |