aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-15 10:41:34 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-15 10:41:34 -0800
commitde5edf96ce5ad0e48a6386a108dbad36ba448894 (patch)
treeca7dfd049e272fc79b96f455657a818ca7758cd4 /src/analyzer.js
parentcd98696a7af53f8805e09eb612a440abb3656e61 (diff)
asm coercions on args to bitshift64
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index cafd4745..229bda9f 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -654,9 +654,12 @@ function analyzer(data, sidePass) {
// We can't statically legalize this, do the operation at runtime TODO: optimize
assert(sourceBits == 64, 'TODO: handle nonconstant shifts on != 64 bits');
value.intertype = 'value';
- value.ident = 'Runtime' + (ASM_JS ? '_' : '.') + 'bitshift64(' + sourceElements[0].ident + ', ' +
- sourceElements[1].ident + ',' + Runtime['BITSHIFT64_' + value.op.toUpperCase()] + ',' + value.params[1].ident + '$0);' +
- 'var ' + value.assignTo + '$0 = ' + makeGetTempDouble(0, 'i32') + ', ' + value.assignTo + '$1 = ' + makeGetTempDouble(1, 'i32') + ';';
+ value.ident = 'Runtime' + (ASM_JS ? '_' : '.') + 'bitshift64(' +
+ asmCoercion(sourceElements[0].ident, 'i32') + ',' +
+ asmCoercion(sourceElements[1].ident, 'i32') + ',' +
+ Runtime['BITSHIFT64_' + value.op.toUpperCase()] + ',' +
+ asmCoercion(value.params[1].ident + '$0', 'i32') + ');' +
+ 'var ' + value.assignTo + '$0 = ' + makeGetTempDouble(0, 'i32') + ', ' + value.assignTo + '$1 = ' + makeGetTempDouble(1, 'i32') + ';';
value.assignTo = null;
i++;
continue;