diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-28 18:18:32 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-28 18:18:32 -0800 |
commit | fb8bb521a9dd60778430e7a6fffa0fefac434728 (patch) | |
tree | 1339789cd3ef434cc568e70fd1c9aa9a5c99c641 /tools/js-optimizer.js | |
parent | 81334dd1aa4bb03a50eb6274a8b95832d42e25e8 (diff) |
do not recombine large shifts in optimizeShifts
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 7bb0b403..435a64de 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -497,7 +497,8 @@ function optimizeShifts(ast) { more = false; traverse(fun, function(node, type) { if (node[0] == 'binary' && node[1] in SIMPLE_SHIFTS && node[2][0] == 'binary' && node[2][1] in SIMPLE_SHIFTS && - node[3][0] == 'num' && node[2][3][0] == 'num') { // do not turn a << b << c into a << b + c; while logically identical, it is slower + node[3][0] == 'num' && node[2][3][0] == 'num' && // do not turn a << b << c into a << b + c; while logically identical, it is slower + Math.abs(node[3][1]) < 8 && Math.abs(node[2][3][1]) < 8) { // do not modify things like x << 24 >> 24 (which removes some bits) more = true; var combinedShift = '>>'; var sign1 = node[1] == '>>' ? 1 : -1; |