aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/determinstic.js8
-rw-r--r--src/jsifier.js4
-rw-r--r--src/parseTools.js9
-rw-r--r--src/preamble.js1
4 files changed, 19 insertions, 3 deletions
diff --git a/src/determinstic.js b/src/determinstic.js
index 91f98ed9..1ec0bbfe 100644
--- a/src/determinstic.js
+++ b/src/determinstic.js
@@ -10,3 +10,11 @@ Date.now = function() {
};
performance.now = Date.now;
+function hashMemory(id) {
+ var ret = 0;
+ for (var i = 0; i < HEAPU8.length; i++) {
+ ret = (ret*17 + HEAPU8[i])|0;
+ }
+ print(id + ':' + ret);
+}
+
diff --git a/src/jsifier.js b/src/jsifier.js
index bcc179d7..77aff895 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1032,13 +1032,13 @@ function JSify(data, functionsOnly, givenFunctions) {
}
for (var i = 0; i < idents.length; i++) {
if (keys(deps[idents[i]]).length == 0) {
- pre = 'var ' + idents[i] + ' = ' + valueJSes[idents[i]] + ';' + pre;
+ post = 'var ' + idents[i] + ' = ' + valueJSes[idents[i]] + ';' + post;
remove(idents[i]);
continue mainLoop;
}
}
// If we got here, we have circular dependencies, and must break at least one.
- pre = 'var ' + idents[0] + '$phi = ' + valueJSes[idents[0]] + ';' + pre;
+ pre += 'var ' + idents[0] + '$phi = ' + valueJSes[idents[0]] + ';';
post += 'var ' + idents[0] + ' = ' + idents[0] + '$phi;';
remove(idents[0]);
}
diff --git a/src/parseTools.js b/src/parseTools.js
index 45046558..090d85ac 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -2038,12 +2038,19 @@ function processMathop(item) {
}
var bitsBefore = parseInt((item.params[0] ? item.params[0].type : item.type).substr(1)); // remove i to leave the number of bits left after this
var bitsLeft = parseInt(((item.params[1] && item.params[1].ident) ? item.params[1].ident : item.type).substr(1)); // remove i to leave the number of bits left after this operation
+ var rawBits = getBits(item.type);
+ assert(rawBits <= 64);
function integerizeBignum(value) {
return makeInlineCalculation('VALUE-VALUE%1', value, 'tempBigIntI');
}
- if ((type == 'i64' || paramTypes[0] == 'i64' || paramTypes[1] == 'i64' || idents[1] == '(i64)') && USE_TYPED_ARRAYS == 2) {
+ if ((type == 'i64' || paramTypes[0] == 'i64' || paramTypes[1] == 'i64' || idents[1] == '(i64)' || rawBits > 32) && USE_TYPED_ARRAYS == 2) {
+ // this code assumes i64 for the most part
+ if (ASSERTIONS && rawBits < 64) {
+ warnOnce('processMathop processing illegal non-i64 value: ' + [type, paramTypes, idents])
+ }
+
var warnI64_1 = function() {
warnOnce('Arithmetic on 64-bit integers in mode 1 is rounded and flaky, like mode 0!');
};
diff --git a/src/preamble.js b/src/preamble.js
index 35dfeba9..4c61a86e 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -879,6 +879,7 @@ var PGOMonitor = {
Module.print('-s DEAD_FUNCTIONS=\'' + JSON.stringify(dead) + '\'\n');
}
};
+Module['PGOMonitor'] = PGOMonitor;
__ATEXIT__.push({ func: function() { PGOMonitor.dump() } });
addPreRun(function() { addRunDependency('pgo') });
#endif