diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-14 20:49:26 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-14 20:49:50 -0700 |
commit | a0bcc754bea4485c24427001306284043925e9b1 (patch) | |
tree | ba0c0246d877cfb09f69cd62d5a92fa46f19b1d2 /tools | |
parent | 139c7755ed9b35b4c37c394c48bad58cf067e52b (diff) |
disable optimizeShifts; fixes #1518
Diffstat (limited to 'tools')
-rw-r--r-- | tools/js-optimizer.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 7d72b7b8..e61317af 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -801,7 +801,10 @@ function simplifyExpressions(ast) { // HEAP[x >> 2] // very often. We can in some cases do the shift on the variable itself when it is set, // to greatly reduce the number of shift operations. -// TODO: when shifting a variable, if there are other uses, keep an unshifted version too, to prevent slowdowns? +// XXX this optimization is deprecated and currently invalid: does not handle overflows +// or non-aligned (round numbers, x >> 2 is a multiple of 4). Both are ok to assume +// for pointers (undefined behavior otherwise), but invalid in general, and we do +// no sufficiently-well distinguish the cases. function optimizeShiftsInternal(ast, conservative) { var MAX_SHIFTS = 3; traverseGeneratedFunctions(ast, function(fun) { |