aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-14 17:10:01 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-14 17:10:01 -0800
commit1e37a593bb27d0f3f43ebfb16bdb55c1d11955ce (patch)
tree2fa7f5bc84e1f4e4c08bf371f5d288e04fe3df0e /tools/js-optimizer.js
parente758e7cd11035424bafe92ae18645e8507fba0b2 (diff)
do not remove asm heap coercion in js optimizer when optimizing h8 & 255
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 8db40bc6..49911bb9 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -473,6 +473,12 @@ function simplifyExpressionsPre(ast) {
if (!unsigned) {
input[1][1] = 'HEAPU' + bits; // make unsigned
}
+ if (asm) {
+ // we cannot return HEAPU8 without a coercion, but at least we do HEAP8 & 255 => HEAPU8 | 0
+ node[1] = '|';
+ node[3][1] = 0;
+ return node;
+ }
return input;
}
}