Add compiler patch

This commit is contained in:
Michael Droettboom 2018-06-01 09:07:04 -04:00
parent f2e46063d6
commit 4df291a56f
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
index f6c9842ff..9f83181eb 100644
--- a/emsdk/emscripten/tag-1.38.4/src/support.js
+++ b/emsdk/emscripten/tag-1.38.4/src/support.js
@@ -158,7 +158,33 @@ function loadWebAssemblyModule(binary) {
'Infinity': Infinity,
},
'global.Math': Math,
- env: env
+ env: env,
+ 'asm2wasm': { // special asm2wasm imports
+ "f64-rem": function(x, y) {
+ return x % y;
+ },
+ "debugger": function() {
+ debugger;
+ }
+#if NEED_ALL_ASM2WASM_IMPORTS
+ ,
+ "f64-to-int": function(x) {
+ return x | 0;
+ },
+ "i32s-div": function(x, y) {
+ return ((x | 0) / (y | 0)) | 0;
+ },
+ "i32u-div": function(x, y) {
+ return ((x >>> 0) / (y >>> 0)) >>> 0;
+ },
+ "i32s-rem": function(x, y) {
+ return ((x | 0) % (y | 0)) | 0;
+ },
+ "i32u-rem": function(x, y) {
+ return ((x >>> 0) % (y >>> 0)) >>> 0;
+ }
+#endif // NEED_ALL_ASM2WASM_IMPORTS
+ },
};
#if ASSERTIONS
var oldTable = [];