aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-output.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-20 10:32:59 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-20 11:04:45 -0800
commit8060c58d107a76d78526714e81c18e1344793620 (patch)
treed731c9b1246062474b4c8183679e45957146b190 /tools/test-js-optimizer-output.js
parent2f3cb58579bbca6645b144de339b73c19f37abed (diff)
hoist multiples into branchings right before them
Diffstat (limited to 'tools/test-js-optimizer-output.js')
-rw-r--r--tools/test-js-optimizer-output.js61
1 files changed, 60 insertions, 1 deletions
diff --git a/tools/test-js-optimizer-output.js b/tools/test-js-optimizer-output.js
index d171c5b5..4c5b073c 100644
--- a/tools/test-js-optimizer-output.js
+++ b/tools/test-js-optimizer-output.js
@@ -86,4 +86,63 @@ function maths() {
check(95);
__ZN6b2Vec2C1Ev($this1 + 76 | 0);
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths"]
+function hoisting() {
+ if ($i < $N) {
+ __label__ = 2;
+ callOther();
+ }
+ pause(1);
+ $for_body3$$for_end$5 : do {
+ if ($i < $N) {
+ __label__ = 2;
+ while (true) {
+ break $for_body3$$for_end$5;
+ }
+ callOther();
+ } else {
+ __label__ = 3;
+ }
+ } while (0);
+ pause(2);
+ do {
+ if ($i < $N) {
+ __label__ = 2;
+ if (callOther()) break;
+ } else {
+ __label__ = 3;
+ }
+ } while (0);
+ pause(3);
+ if ($i < $N) {
+ __label__ = 2;
+ callOther();
+ } else {
+ __label__ = 3;
+ }
+ pause(4);
+ if ($i < $N) {
+ __label__ = 2;
+ callOther();
+ } else {
+ __label__ = 3;
+ somethingElse();
+ }
+ pause(5);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ somethingElse();
+ }
+ if (__label__ == 55) {
+ callOther();
+ }
+ pause(6);
+ if ($i < $N) {
+ __label__ = 2;
+ } else {
+ __label__ = 3;
+ somethingElse();
+ }
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["abc", "xyz", "xyz2", "expr", "loopy", "bits", "maths", "hoisting"]