diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-19 18:17:28 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-19 18:17:28 -0800 |
commit | 0d6c96a9e5ca386f0f62daf4e95912517fa21893 (patch) | |
tree | 7341d088986fa68480000d88e1799aab443bb14e /tools/test-js-optimizer.js | |
parent | 379953396230438ab975ca282c40b75f59017be9 (diff) |
collapse elses after the if block breaks or continues, other minor js optimizer fixes
Diffstat (limited to 'tools/test-js-optimizer.js')
-rw-r--r-- | tools/test-js-optimizer.js | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/tools/test-js-optimizer.js b/tools/test-js-optimizer.js index 95985bc8..18c9ac75 100644 --- a/tools/test-js-optimizer.js +++ b/tools/test-js-optimizer.js @@ -226,6 +226,65 @@ function hoisting() { $if_then72$$if_end73$126 : do { if (__label__ == 40) {} else if (__label__ == 41) {} } while (0); + pause(10); + while(check()) { + if ($i < $N) { + __label__ = 2; + } else { + __label__ = 3; + } + if (__label__ == 2) { + callOther(); + break; + } else if (__label__ == 3) { + somethingElse(); + } + if ($i1 < $N) { + __label__ = 2; + } else { + __label__ = 3; + } + if (__label__ == 2) { + callOther(); + continue; + } else if (__label__ == 3) { + somethingElse(); + } + if ($i2 < $N) { + __label__ = 2; + } else { + __label__ = 3; + } + if (__label__ == 2) { + callOther(); + } else if (__label__ == 3) { + somethingElse(); + break; + } + if ($i3 < $N) { + __label__ = 2; + } else { + __label__ = 3; + } + if (__label__ == 2) { + callOther(); + } else if (__label__ == 3) { + somethingElse(); + continue; + } + if ($i4 < $N) { + __label__ = 2; + } else { + __label__ = 3; + } + if (__label__ == 2) { + callOther(); + break; + } else if (__label__ == 3) { + somethingElse(); + continue; + } + } } function innerShouldAlsoBeHoisted() { function hoisting() { @@ -358,4 +417,9 @@ function moreLabels() { var $_lcssa; cheez(); } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths", "hoisting", "demangle", "lua", "moreLabels"] +function notComps() { + if (!(HEAP32[$incdec_ptr71_i + 8 >> 2] == 0)) { + shoo(); + } +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths", "hoisting", "demangle", "lua", "moreLabels", "notComps"] |