diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-04 15:02:20 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-04 15:22:53 -0700 |
commit | 3b6cd16ed015e90fa54127a903343e7bf65c86ce (patch) | |
tree | 9de6eb57a98463afa6a0538602fb4618a49bc420 /tools/test-js-optimizer-asm-last-output.js | |
parent | 3431eab292e0b9e2359b183fa2c954eb7e5cf7e7 (diff) |
pull code out of loops when they have a single break and it allows us to turn them into simpler do-whiles
Diffstat (limited to 'tools/test-js-optimizer-asm-last-output.js')
-rw-r--r-- | tools/test-js-optimizer-asm-last-output.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-last-output.js b/tools/test-js-optimizer-asm-last-output.js index 5e3685e2..95afaeb7 100644 --- a/tools/test-js-optimizer-asm-last-output.js +++ b/tools/test-js-optimizer-asm-last-output.js @@ -72,5 +72,31 @@ function looop() { break; } } + do { + blah(); + } while (!shah()); + a = b; + LABELED : while (1) { + blah(); + if (shah()) { + c = d; + break; + } + } + while (1) { + blah(); + if (check) break; + if (shah()) { + e = f; + break; + } + } + do { + blah(); + while (1) { + if (check) break; + } + } while (!shah()); + g = h; } |