diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-05-13 14:14:29 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-05-13 14:14:29 -0700 |
commit | eef1e214a698ae6e4f8b2c375536b268f0a95dd2 (patch) | |
tree | efc182b2d4a1f114e4a2c880a10530d86937dc8f | |
parent | a2440907aeb89069a6f2a13bdaff888984cd3c62 (diff) |
update heuristic
-rw-r--r-- | tools/js-optimizer.js | 2 | ||||
-rw-r--r-- | tools/test-js-optimizer-asm-pre-output.js | 2 | ||||
-rw-r--r-- | tools/test-js-optimizer-asm-pre.js | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 678ba0d5..d79e8f23 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -753,7 +753,7 @@ function simplifyExpressions(ast) { // expensive | cheap can be turned into cheap ? 1 : expensive, // so that we can avoid the expensive computation, if it has no side effects. function conditionalize(ast) { - var MIN_COST = 4; + var MIN_COST = 7; traverse(ast, function(node, type) { if (type === 'if' || type === 'while') { var cond = node[1]; diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js index ce45645c..d6a7a04b 100644 --- a/tools/test-js-optimizer-asm-pre-output.js +++ b/tools/test-js-optimizer-asm-pre-output.js @@ -593,7 +593,7 @@ function conditionalizeMe() { if ($sub$i480 >= Math_fround(+0) ? !($sub4$i483 >= Math_fround(HEAPF32[x + y | 0])) : 1) { b(); } - if (x > 10 ? 1 : HEAP[20] > 5) { + if (x > 10 | HEAP[20] + 2 > 5) { b(); } } diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js index b9773bb5..f930fc13 100644 --- a/tools/test-js-optimizer-asm-pre.js +++ b/tools/test-js-optimizer-asm-pre.js @@ -605,7 +605,7 @@ function conditionalizeMe() { if (!($sub$i480 >= Math_fround(+0)) | !($sub4$i483 >= Math_fround(HEAPF32[x+y|0]))) { b(); } - if (x > 10 | HEAP[20] > 5) { + if (x > 10 | (HEAP[20] + 2) > 5) { b(); } } |