diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-25 14:13:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-25 14:13:17 -0800 |
commit | aab26adc6a63c770dae29d1cc5d8c0e29e02871a (patch) | |
tree | ee9d4c5c4764b2fe0757128e6a9714917da44265 /tools | |
parent | 7869ed3239dcd6ccef1fab2db9e6a3be582ff33e (diff) |
invalidate calls in if bodies in eliminator
Diffstat (limited to 'tools')
-rw-r--r-- | tools/eliminator/eliminator-test-output.js | 2 | ||||
-rw-r--r-- | tools/js-optimizer.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tools/eliminator/eliminator-test-output.js b/tools/eliminator/eliminator-test-output.js index 6a454299..37a5d104 100644 --- a/tools/eliminator/eliminator-test-output.js +++ b/tools/eliminator/eliminator-test-output.js @@ -6142,7 +6142,7 @@ function phi() { } function intoCond() { var $115 = 22; - $NumWords = __ZN4llvm15BitstreamCursor4ReadEj($117, 32); + var $NumWords = __ZN4llvm15BitstreamCursor4ReadEj($117, 32); if (($115 | 0) != 0) { HEAP32[$115 >> 2] = $NumWords; } diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 62161738..dbef9c0c 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1715,6 +1715,10 @@ function eliminate(ast, memSafe) { } else if (type == 'if') { if (allowTracking) { traverseInOrder(node[1]); // can eliminate into condition, but nowhere else + if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into an if that may not execute! + invalidateCalls(); + callsInvalidated = true; + } allowTracking = false; traverseInOrder(node[2]); // 2 and 3 could be 'parallel', really.. if (node[3]) traverseInOrder(node[3]); |