aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-22 18:41:37 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-22 18:55:13 -0800
commitc00e097d60100c7a562ac25664eb3c25bb9403ae (patch)
treef724c92e09a6c24c85110a33fc40561a2b0dcbb4 /src/preamble.js
parent90710c0c8ee4425c06402cc7831abdee8c519a43 (diff)
always use Math.imul, with fast polyfill. will be useful for faster 64-bit math
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 503b09f1..b355f130 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -742,6 +742,8 @@ Module['writeArrayToMemory'] = writeArrayToMemory;
{{{ unSign }}}
{{{ reSign }}}
+if (!Math.imul) Math.imul = function(x, y) { return (x*y)|0 }; // # not a real polyfill since semantics not identical, but close and fast
+
// A counter of dependencies for calling run(). If we need to
// do asynchronous work before running, increment this and
// decrement it. Incrementing must happen in a place like