aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-asm-pre.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-18 16:43:00 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-18 16:43:00 -0800
commit425fcf6836b468bb75a77bd547c22c4c45bee43b (patch)
tree5ceb0158af5c7d7c69c06011e44b88f270167a8b /tools/test-js-optimizer-asm-pre.js
parentd268ea5b93c49a6dafafd5683ef25cdbc955b9c9 (diff)
fix simplyExpressions bug with removing too many |0s
Diffstat (limited to 'tools/test-js-optimizer-asm-pre.js')
-rw-r--r--tools/test-js-optimizer-asm-pre.js46
1 files changed, 45 insertions, 1 deletions
diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js
index 6c9e64c1..3042ef66 100644
--- a/tools/test-js-optimizer-asm-pre.js
+++ b/tools/test-js-optimizer-asm-pre.js
@@ -5,4 +5,48 @@ function a() {
f(347 | 12);
f(347 & 12);
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a"]
+function b($this, $__n) {
+ $this = $this | 0;
+ $__n = $__n | 0;
+ var $4 = 0, $5 = 0, $10 = 0, $13 = 0, $14 = 0, $15 = 0, $23 = 0, $30 = 0, $38 = 0, $40 = 0;
+ if (($__n | 0) == 0) {
+ return;
+ }
+ $4 = $this;
+ $5 = HEAP8[$4 & 16777215] | 0;
+ if (($5 & 1) << 24 >> 24 == 0) {
+ $14 = 10;
+ $13 = $5;
+ } else {
+ $10 = HEAP32[(($this | 0) & 16777215) >> 2] | 0;
+ $14 = ($10 & -2) - 1 | 0;
+ $13 = $10 & 255;
+ }
+ $15 = $13 & 255;
+ if (($15 & 1 | 0) == 0) {
+ $23 = $15 >>> 1;
+ } else {
+ $23 = HEAP32[(($this + 4 | 0) & 16777215) >> 2] | 0;
+ }
+ if (($14 - $23 | 0) >>> 0 < $__n >>> 0) {
+ __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEjjjjjj($this, $14, ($__n - $14 | 0) + $23 | 0, $23, $23);
+ $30 = HEAP8[$4 & 16777215] | 0;
+ } else {
+ $30 = $13;
+ }
+ if (($30 & 1) << 24 >> 24 == 0) {
+ $38 = $this + 1 | 0;
+ } else {
+ $38 = HEAP32[(($this + 8 | 0) & 16777215) >> 2] | 0;
+ }
+ _memset($38 + $23 | 0 | 0 | 0, 0 | 0 | 0, $__n | 0 | 0, 1 | 0 | 0, 1213141516);
+ $40 = $23 + $__n | 0;
+ if (((HEAP8[$4 & 16777215] | 0) & 1) << 24 >> 24 == 0) {
+ HEAP8[$4 & 16777215] = $40 << 1 & 255;
+ } else {
+ HEAP32[(($this + 4 | 0) & 16777215) >> 2] = $40;
+ }
+ HEAP8[($38 + $40 | 0) & 16777215] = 0;
+ return;
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b"]