diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-27 07:17:27 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-27 07:17:27 -0500 |
commit | 970e5bec31f12af53563c56e548ca4673854854f (patch) | |
tree | a1e0d613206d12d30c51493c446e6bc89b9ee676 /tools/test-js-optimizer.js | |
parent | 17f3cf205d40468c4739066978fb0ad434e084ee (diff) |
improve js optimizer removal of unnecessary |0's
Diffstat (limited to 'tools/test-js-optimizer.js')
-rw-r--r-- | tools/test-js-optimizer.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/test-js-optimizer.js b/tools/test-js-optimizer.js index 31f314e3..e2bcb903 100644 --- a/tools/test-js-optimizer.js +++ b/tools/test-js-optimizer.js @@ -80,8 +80,19 @@ function ignoreLoopy() { var $inc=$ok+1; } } -function bits() { // TODO: optimize this! +function bits() { print((($s & 65535) + ((($f & 65535) << 16 >> 16) * (($f & 65535) << 16 >> 16) | 0 | 0) % 256 | 0) & 65535); + z(HEAP32[($id + 40 | 0) >> 2]); + z(($f | 0) << 2); + z(($f | 0) | 255); + z(($f | 0) & 255); + z(($f | 0) ^ 1); + z(($f | 0) << 2); + z((($f | 0) * 100) << 2); + z((($f | 0) % 2) | 255); + z((($f | 0) / 55) & 255); + z((($f | 0) - 22) ^ 1); + z((($f | 0) + 15) << 2); } function maths() { check(5+12); |