aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-11-05 12:24:46 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-11-06 10:26:10 -0800
commit33cdfe5819e789cb9a98b8b7f66447ceab861f84 (patch)
tree602ae78dc7437a1cd3d87b6bb46dcb598416d9e6 /src/parseTools.js
parent13b82208767b3af7a8716356c07b6eac26da5ac3 (diff)
split js compiler into three passes, to facilitate future parallization
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 2cdea7c0..e76d23be 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1598,8 +1598,6 @@ function isSignedOp(op, variant) {
}
var legalizedI64s = USE_TYPED_ARRAYS == 2; // We do not legalize globals, but do legalize function lines. This will be true in the latter case
-var preciseI64MathUsed = false; // Set to true if we actually use precise i64 math: If PRECISE_I64_MATH is set, and also such math is actually
- // needed (+,-,*,/,% - we do not need it for bitops)
function processMathop(item) {
var op = item.op;
@@ -1657,7 +1655,7 @@ function processMathop(item) {
}
}
function i64PreciseOp(type, lastArg) {
- preciseI64MathUsed = true;
+ Types.preciseI64MathUsed = true;
return finish(['(i64Math.' + type + '(' + low1 + ',' + high1 + ',' + low2 + ',' + high2 +
(lastArg ? ',' + lastArg : '') + '),i64Math.result[0])', 'i64Math.result[1]']);
}
@@ -1818,7 +1816,7 @@ function processMathop(item) {
case 'sdiv': case 'udiv': return makeRounding(getFastValue(idents[0], '/', idents[1], item.type), bits, op[0] === 's');
case 'mul': {
if (bits == 32 && PRECISE_I32_MUL) {
- preciseI64MathUsed = true;
+ Types.preciseI64MathUsed = true;
return '(i64Math.multiply(' + idents[0] + ',0,' + idents[1] + ',0),i64Math.result[0])';
} else {
return handleOverflow(getFastValue(idents[0], '*', idents[1], item.type), bits);
@@ -2002,7 +2000,9 @@ function parseBlockAddress(segment) {
}
function finalizeBlockAddress(param) {
- return Functions.currFunctions[param.func].labelIds[param.label]; // XXX We rely on currFunctions here...?
+ assert(param.func in Functions.blockAddresses);
+ assert(param.label in Functions.blockAddresses[param.func]);
+ return Functions.blockAddresses[param.func][param.label];
}
function stripCorrections(param) {