diff options
111 files changed, 2408 insertions, 1329 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h index db3a250aa..013e56335 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -272,7 +272,7 @@ private: // on operations. std::unordered_set<Name> functionsCallableFromOutside; - void addBasics(Ref ast); + void addBasics(Ref ast, Module* wasm); void addFunctionImport(Ref ast, Function* import); void addGlobalImport(Ref ast, Global* import); void addTable(Ref ast, Module* wasm); @@ -383,16 +383,18 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) { ret[1]->push_back(asmFunc); ValueBuilder::appendArgumentToFunction(asmFunc, GLOBAL); ValueBuilder::appendArgumentToFunction(asmFunc, ENV); - ValueBuilder::appendArgumentToFunction(asmFunc, BUFFER); - // add memory import - if (wasm->memory.exists && wasm->memory.imported()) { - Ref theVar = ValueBuilder::makeVar(); - asmFunc[3]->push_back(theVar); - ValueBuilder::appendToVar( - theVar, - "memory", - ValueBuilder::makeDot(ValueBuilder::makeName(ENV), - ValueBuilder::makeName(wasm->memory.base))); + if (wasm->memory.exists) { + ValueBuilder::appendArgumentToFunction(asmFunc, BUFFER); + // add memory import + if (wasm->memory.imported()) { + Ref theVar = ValueBuilder::makeVar(); + asmFunc[3]->push_back(theVar); + ValueBuilder::appendToVar( + theVar, + "memory", + ValueBuilder::makeDot(ValueBuilder::makeName(ENV), + ValueBuilder::makeName(wasm->memory.base))); + } } // add table import if (wasm->table.exists && wasm->table.imported()) { @@ -404,7 +406,7 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) { ValueBuilder::makeDot(ValueBuilder::makeName(ENV), wasm->table.base)); } // create heaps, etc - addBasics(asmFunc[3]); + addBasics(asmFunc[3], wasm); ModuleUtils::iterImportedFunctions( *wasm, [&](Function* import) { addFunctionImport(asmFunc[3], import); }); ModuleUtils::iterImportedGlobals( @@ -459,26 +461,28 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) { return ret; } -void Wasm2JSBuilder::addBasics(Ref ast) { - // heaps, var HEAP8 = new global.Int8Array(buffer); etc - auto addHeap = [&](IString name, IString view) { - Ref theVar = ValueBuilder::makeVar(); - ast->push_back(theVar); - ValueBuilder::appendToVar( - theVar, - name, - ValueBuilder::makeNew(ValueBuilder::makeCall( - ValueBuilder::makeDot(ValueBuilder::makeName(GLOBAL), view), - ValueBuilder::makeName(BUFFER)))); - }; - addHeap(HEAP8, INT8ARRAY); - addHeap(HEAP16, INT16ARRAY); - addHeap(HEAP32, INT32ARRAY); - addHeap(HEAPU8, UINT8ARRAY); - addHeap(HEAPU16, UINT16ARRAY); - addHeap(HEAPU32, UINT32ARRAY); - addHeap(HEAPF32, FLOAT32ARRAY); - addHeap(HEAPF64, FLOAT64ARRAY); +void Wasm2JSBuilder::addBasics(Ref ast, Module* wasm) { + if (wasm->memory.exists) { + // heaps, var HEAP8 = new global.Int8Array(buffer); etc + auto addHeap = [&](IString name, IString view) { + Ref theVar = ValueBuilder::makeVar(); + ast->push_back(theVar); + ValueBuilder::appendToVar( + theVar, + name, + ValueBuilder::makeNew(ValueBuilder::makeCall( + ValueBuilder::makeDot(ValueBuilder::makeName(GLOBAL), view), + ValueBuilder::makeName(BUFFER)))); + }; + addHeap(HEAP8, INT8ARRAY); + addHeap(HEAP16, INT16ARRAY); + addHeap(HEAP32, INT32ARRAY); + addHeap(HEAPU8, UINT8ARRAY); + addHeap(HEAPU16, UINT16ARRAY); + addHeap(HEAPU32, UINT32ARRAY); + addHeap(HEAPF32, FLOAT32ARRAY); + addHeap(HEAPF64, FLOAT64ARRAY); + } // core asm.js imports auto addMath = [&](IString name, IString base) { Ref theVar = ValueBuilder::makeVar(); @@ -2419,33 +2423,32 @@ void Wasm2JSGlue::emitPostES6() { // // Note that the translation here expects that the lower values of this memory // can be used for conversions, so make sure there's at least one page. - { - auto pages = wasm.memory.initial == 0 ? 1 : wasm.memory.initial.addr; + if (wasm.memory.exists) { out << "var mem" << moduleName.str << " = new ArrayBuffer(" - << pages * Memory::kPageSize << ");\n"; - } + << wasm.memory.initial.addr * Memory::kPageSize << ");\n"; - emitMemory(std::string("mem") + moduleName.str, - std::string("assign") + moduleName.str, - [](std::string globalName) { return globalName; }); + emitMemory(std::string("mem") + moduleName.str, + std::string("assign") + moduleName.str, + [](std::string globalName) { return globalName; }); + } // Actually invoke the `asmFunc` generated function, passing in all global // values followed by all imports - out << "var ret" << moduleName.str << " = " << moduleName.str << "({" - << "Math," - << "Int8Array," - << "Uint8Array," - << "Int16Array," - << "Uint16Array," - << "Int32Array," - << "Uint32Array," - << "Float32Array," - << "Float64Array," - << "NaN," - << "Infinity" - << "}, {"; - - out << "abort:function() { throw new Error('abort'); }"; + out << "var ret" << moduleName.str << " = " << moduleName.str << "({\n" + << " Math,\n" + << " Int8Array,\n" + << " Uint8Array,\n" + << " Int16Array,\n" + << " Uint16Array,\n" + << " Int32Array,\n" + << " Uint32Array,\n" + << " Float32Array,\n" + << " Float64Array,\n" + << " NaN,\n" + << " Infinity\n" + << " }, {\n"; + + out << " abort: function() { throw new Error('abort'); }"; ModuleUtils::iterImportedFunctions(wasm, [&](Function* import) { // The special helpers are emitted in the glue, see code and comments @@ -2453,7 +2456,7 @@ void Wasm2JSGlue::emitPostES6() { if (ABI::wasm2js::isHelper(import->base)) { return; } - out << "," << asmangle(import->base.str); + out << ",\n " << asmangle(import->base.str); }); ModuleUtils::iterImportedTables(wasm, [&](Table* import) { @@ -2462,10 +2465,14 @@ void Wasm2JSGlue::emitPostES6() { if (ABI::wasm2js::isHelper(import->base)) { return; } - out << "," << asmangle(import->base.str); + out << ",\n " << asmangle(import->base.str); }); - out << "},mem" << moduleName.str << ");\n"; + if (wasm.memory.exists) { + out << "\n },\n mem" << moduleName.str << "\n);\n"; + } else { + out << "\n });\n"; + } if (flags.allowAsserts) { return; diff --git a/test/binaryen.js/emit_asmjs.js.txt b/test/binaryen.js/emit_asmjs.js.txt index 5404ce4d8..d44413dc4 100644 --- a/test/binaryen.js/emit_asmjs.js.txt +++ b/test/binaryen.js/emit_asmjs.js.txt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -30,7 +22,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var main = retasmFunc.main; diff --git a/test/wasm2js.asserts.js b/test/wasm2js.asserts.js index f2bbe1d81..329bf1698 100644 --- a/test/wasm2js.asserts.js +++ b/test/wasm2js.asserts.js @@ -30,15 +30,7 @@ return (actual_lo | 0) == (expected_lo | 0) && (actual_hi | 0) == (expected_hi | 0); } -function asmFunc0(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc0(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -74,8 +66,21 @@ function asmFunc0(global, env, buffer) { }; } -var memasmFunc0 = new ArrayBuffer(65536); -var retasmFunc0 = asmFunc0({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc0); +var retasmFunc0 = asmFunc0({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); function check1() { retasmFunc0.empty(); return 1 | 0; diff --git a/test/wasm2js.traps.js b/test/wasm2js.traps.js index ea9caa66c..e45709330 100644 --- a/test/wasm2js.traps.js +++ b/test/wasm2js.traps.js @@ -30,15 +30,7 @@ return (actual_lo | 0) == (expected_lo | 0) && (actual_hi | 0) == (expected_hi | 0); } -function asmFunc0(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc0(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -74,8 +66,21 @@ function asmFunc0(global, env, buffer) { }; } -var memasmFunc0 = new ArrayBuffer(65536); -var retasmFunc0 = asmFunc0({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc0); +var retasmFunc0 = asmFunc0({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); function check1() { retasmFunc0.empty(); return 1 | 0; diff --git a/test/wasm2js/add_div.2asm.js b/test/wasm2js/add_div.2asm.js index a0b4e7b37..1b1ebae7e 100644 --- a/test/wasm2js/add_div.2asm.js +++ b/test/wasm2js/add_div.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -30,6 +22,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/add_div.2asm.js.opt b/test/wasm2js/add_div.2asm.js.opt index 8ce9da46c..85a64172f 100644 --- a/test/wasm2js/add_div.2asm.js.opt +++ b/test/wasm2js/add_div.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -30,6 +22,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/atomic_fence.2asm.js b/test/wasm2js/atomic_fence.2asm.js index 76e784147..5ce7d8ce1 100644 --- a/test/wasm2js/atomic_fence.2asm.js +++ b/test/wasm2js/atomic_fence.2asm.js @@ -57,5 +57,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(1507328); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var atomic_fence = retasmFunc.atomic_fence; diff --git a/test/wasm2js/atomic_fence.2asm.js.opt b/test/wasm2js/atomic_fence.2asm.js.opt index 31bb40ca2..a52324d34 100644 --- a/test/wasm2js/atomic_fence.2asm.js.opt +++ b/test/wasm2js/atomic_fence.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -29,6 +21,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var atomic_fence = retasmFunc.atomic_fence; diff --git a/test/wasm2js/atomics_32.2asm.js b/test/wasm2js/atomics_32.2asm.js index 98e552ca3..c01f71706 100644 --- a/test/wasm2js/atomics_32.2asm.js +++ b/test/wasm2js/atomics_32.2asm.js @@ -151,5 +151,21 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "aGVsbG8s"); memorySegments[1] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "d29ybGQh"); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var test = retasmFunc.test; diff --git a/test/wasm2js/atomics_32.2asm.js.opt b/test/wasm2js/atomics_32.2asm.js.opt index 8be224284..516d67aee 100644 --- a/test/wasm2js/atomics_32.2asm.js.opt +++ b/test/wasm2js/atomics_32.2asm.js.opt @@ -147,5 +147,21 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "aGVsbG8s"); memorySegments[1] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "d29ybGQh"); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var test = retasmFunc.test; diff --git a/test/wasm2js/base64.2asm.js b/test/wasm2js/base64.2asm.js index c54b71743..6444e8c31 100644 --- a/test/wasm2js/base64.2asm.js +++ b/test/wasm2js/base64.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/base64.2asm.js.opt b/test/wasm2js/base64.2asm.js.opt index c54b71743..6444e8c31 100644 --- a/test/wasm2js/base64.2asm.js.opt +++ b/test/wasm2js/base64.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/br.2asm.js b/test/wasm2js/br.2asm.js index 0c88764d3..73484e457 100644 --- a/test/wasm2js/br.2asm.js +++ b/test/wasm2js/br.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -717,8 +709,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var type_i32 = retasmFunc.type_i32; export var type_i64 = retasmFunc.type_i64; export var type_f32 = retasmFunc.type_f32; diff --git a/test/wasm2js/br_table.2asm.js b/test/wasm2js/br_table.2asm.js index 3dec96a3f..4171374b9 100644 --- a/test/wasm2js/br_table.2asm.js +++ b/test/wasm2js/br_table.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -13422,8 +13414,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var type_i32 = retasmFunc.type_i32; export var type_i64 = retasmFunc.type_i64; export var type_f32 = retasmFunc.type_f32; diff --git a/test/wasm2js/br_table_hoisting.2asm.js b/test/wasm2js/br_table_hoisting.2asm.js index 45eb9cb76..e7f8d03e0 100644 --- a/test/wasm2js/br_table_hoisting.2asm.js +++ b/test/wasm2js/br_table_hoisting.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -184,8 +176,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var foo1 = retasmFunc.foo1; export var foo2 = retasmFunc.foo2; export var foo3 = retasmFunc.foo3; diff --git a/test/wasm2js/br_table_hoisting.2asm.js.opt b/test/wasm2js/br_table_hoisting.2asm.js.opt index 32d9125ae..0af270551 100644 --- a/test/wasm2js/br_table_hoisting.2asm.js.opt +++ b/test/wasm2js/br_table_hoisting.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -174,8 +166,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var foo1 = retasmFunc.foo1; export var foo2 = retasmFunc.foo2; export var foo3 = retasmFunc.foo3; diff --git a/test/wasm2js/br_table_temp.2asm.js b/test/wasm2js/br_table_temp.2asm.js index d2acc92cc..3a56dda00 100644 --- a/test/wasm2js/br_table_temp.2asm.js +++ b/test/wasm2js/br_table_temp.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -13265,8 +13257,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var type_i32 = retasmFunc.type_i32; export var type_i64 = retasmFunc.type_i64; export var type_f32 = retasmFunc.type_f32; diff --git a/test/wasm2js/br_table_temp.2asm.js.opt b/test/wasm2js/br_table_temp.2asm.js.opt index 79b36521d..4d73ee3b6 100644 --- a/test/wasm2js/br_table_temp.2asm.js.opt +++ b/test/wasm2js/br_table_temp.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -12695,8 +12687,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var type_i32 = retasmFunc.type_i32; export var type_i64 = retasmFunc.type_i64; export var type_f32 = retasmFunc.type_f32; diff --git a/test/wasm2js/br_table_to_loop.2asm.js b/test/wasm2js/br_table_to_loop.2asm.js index a1bb85f65..3c0acdf6f 100644 --- a/test/wasm2js/br_table_to_loop.2asm.js +++ b/test/wasm2js/br_table_to_loop.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -48,7 +40,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var exp1 = retasmFunc.exp1; export var exp2 = retasmFunc.exp2; diff --git a/test/wasm2js/br_table_to_loop.2asm.js.opt b/test/wasm2js/br_table_to_loop.2asm.js.opt index f6f21127f..1e3f4f762 100644 --- a/test/wasm2js/br_table_to_loop.2asm.js.opt +++ b/test/wasm2js/br_table_to_loop.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -34,7 +26,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var exp1 = retasmFunc.exp1; export var exp2 = retasmFunc.exp2; diff --git a/test/wasm2js/break-drop.2asm.js b/test/wasm2js/break-drop.2asm.js index cfaffe956..45bf464bb 100644 --- a/test/wasm2js/break-drop.2asm.js +++ b/test/wasm2js/break-drop.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -39,8 +31,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var br = retasmFunc.br; export var br_if = retasmFunc.br_if; export var br_table = retasmFunc.br_table; diff --git a/test/wasm2js/bulk-memory.2asm.js b/test/wasm2js/bulk-memory.2asm.js index 3cf4e0dc9..5983db235 100644 --- a/test/wasm2js/bulk-memory.2asm.js +++ b/test/wasm2js/bulk-memory.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,8 +17,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); var scratchBuffer = new ArrayBuffer(16); @@ -108,7 +113,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var fill = retasmFunc.fill; export var load8_u = retasmFunc.load8_u; @@ -188,7 +209,23 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 0, "qrvM3Q=="); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var copy = retasmFunc.copy; export var load8_u = retasmFunc.load8_u; @@ -292,7 +329,23 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(4), 0, "qrvM3Q=="); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var init = retasmFunc.init; export var load8_u = retasmFunc.load8_u; @@ -408,7 +461,23 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(0), 0, ""); base64DecodeToExistingUint8Array(bufferView, 0, ""); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var drop_passive = retasmFunc.drop_passive; export var init_passive = retasmFunc.init_passive; export var drop_active = retasmFunc.drop_active; diff --git a/test/wasm2js/bulk-memory.2asm.js.opt b/test/wasm2js/bulk-memory.2asm.js.opt index db449cd0e..6616ef8f1 100644 --- a/test/wasm2js/bulk-memory.2asm.js.opt +++ b/test/wasm2js/bulk-memory.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,8 +17,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); var scratchBuffer = new ArrayBuffer(16); @@ -108,7 +113,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var fill = retasmFunc.fill; export var load8_u = retasmFunc.load8_u; @@ -188,7 +209,23 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i return uint8Array; } base64DecodeToExistingUint8Array(bufferView, 0, "qrvM3Q=="); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var copy = retasmFunc.copy; export var load8_u = retasmFunc.load8_u; @@ -292,7 +329,23 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i return uint8Array; } memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(4), 0, "qrvM3Q=="); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var init = retasmFunc.init; export var load8_u = retasmFunc.load8_u; @@ -363,7 +416,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var drop_passive = retasmFunc.drop_passive; export var init_passive = retasmFunc.init_passive; export var drop_active = retasmFunc.drop_active; diff --git a/test/wasm2js/comments.2asm.js b/test/wasm2js/comments.2asm.js index 295e25fc7..c6d13626f 100644 --- a/test/wasm2js/comments.2asm.js +++ b/test/wasm2js/comments.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,18 +17,23 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -54,5 +51,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/conversions-modified.2asm.js b/test/wasm2js/conversions-modified.2asm.js index 718cf3d1f..6280333a4 100644 --- a/test/wasm2js/conversions-modified.2asm.js +++ b/test/wasm2js/conversions-modified.2asm.js @@ -30,15 +30,7 @@ import { setTempRet0 } from 'env'; f32ScratchView[2] = value; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -626,8 +618,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i64_extend_s_i32 = retasmFunc.i64_extend_s_i32; export var i64_extend_u_i32 = retasmFunc.i64_extend_u_i32; export var i32_wrap_i64 = retasmFunc.i32_wrap_i64; diff --git a/test/wasm2js/conversions-modified.2asm.js.opt b/test/wasm2js/conversions-modified.2asm.js.opt index c4dddbb84..befce2489 100644 --- a/test/wasm2js/conversions-modified.2asm.js.opt +++ b/test/wasm2js/conversions-modified.2asm.js.opt @@ -30,15 +30,7 @@ import { setTempRet0 } from 'env'; f32ScratchView[2] = value; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -217,8 +209,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i64_extend_s_i32 = retasmFunc.i64_extend_s_i32; export var i64_extend_u_i32 = retasmFunc.i64_extend_u_i32; export var i32_wrap_i64 = retasmFunc.i32_wrap_i64; diff --git a/test/wasm2js/deterministic.2asm.js b/test/wasm2js/deterministic.2asm.js index c03a3e93c..b5ed9b88e 100644 --- a/test/wasm2js/deterministic.2asm.js +++ b/test/wasm2js/deterministic.2asm.js @@ -40,5 +40,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/deterministic.2asm.js.opt b/test/wasm2js/deterministic.2asm.js.opt index a0272b0db..5c3d6cea6 100644 --- a/test/wasm2js/deterministic.2asm.js.opt +++ b/test/wasm2js/deterministic.2asm.js.opt @@ -39,5 +39,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/dot_import.2asm.js b/test/wasm2js/dot_import.2asm.js index 07a3a51b1..98c1d0156 100644 --- a/test/wasm2js/dot_import.2asm.js +++ b/test/wasm2js/dot_import.2asm.js @@ -1,14 +1,6 @@ import { ba_se } from 'mod.ule'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -31,6 +23,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },ba_se},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + ba_se + }); export var exported = retasmFunc.exported; diff --git a/test/wasm2js/dot_import.2asm.js.opt b/test/wasm2js/dot_import.2asm.js.opt index 07a3a51b1..98c1d0156 100644 --- a/test/wasm2js/dot_import.2asm.js.opt +++ b/test/wasm2js/dot_import.2asm.js.opt @@ -1,14 +1,6 @@ import { ba_se } from 'mod.ule'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -31,6 +23,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },ba_se},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + ba_se + }); export var exported = retasmFunc.exported; diff --git a/test/wasm2js/dynamicLibrary.2asm.js b/test/wasm2js/dynamicLibrary.2asm.js index 13b52d003..c750310b7 100644 --- a/test/wasm2js/dynamicLibrary.2asm.js +++ b/test/wasm2js/dynamicLibrary.2asm.js @@ -83,5 +83,21 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i return uint8Array; } base64DecodeToExistingUint8Array(bufferView, memoryBase, "ZHluYW1pYyBkYXRh"); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var baz = retasmFunc.baz; diff --git a/test/wasm2js/dynamicLibrary.2asm.js.opt b/test/wasm2js/dynamicLibrary.2asm.js.opt index d8f0ec348..d503abf0b 100644 --- a/test/wasm2js/dynamicLibrary.2asm.js.opt +++ b/test/wasm2js/dynamicLibrary.2asm.js.opt @@ -75,5 +75,21 @@ for (var base64ReverseLookup = new Uint8Array(123/*'z'+1*/), i = 25; i >= 0; --i return uint8Array; } base64DecodeToExistingUint8Array(bufferView, memoryBase, "ZHluYW1pYyBkYXRh"); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var baz = retasmFunc.baz; diff --git a/test/wasm2js/empty_export.2asm.js b/test/wasm2js/empty_export.2asm.js index 46326ad1e..cff3b2dc7 100644 --- a/test/wasm2js/empty_export.2asm.js +++ b/test/wasm2js/empty_export.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -29,6 +21,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var $ = retasmFunc.$; diff --git a/test/wasm2js/empty_export.2asm.js.opt b/test/wasm2js/empty_export.2asm.js.opt index 46326ad1e..cff3b2dc7 100644 --- a/test/wasm2js/empty_export.2asm.js.opt +++ b/test/wasm2js/empty_export.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -29,6 +21,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var $ = retasmFunc.$; diff --git a/test/wasm2js/empty_table.2asm.js b/test/wasm2js/empty_table.2asm.js index c54b71743..6444e8c31 100644 --- a/test/wasm2js/empty_table.2asm.js +++ b/test/wasm2js/empty_table.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/endianness.2asm.js b/test/wasm2js/endianness.2asm.js index 4de4bb18e..cf4925f5b 100644 --- a/test/wasm2js/endianness.2asm.js +++ b/test/wasm2js/endianness.2asm.js @@ -698,7 +698,24 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }, + memasmFunc +); export var i32_load16_s = retasmFunc.i32_load16_s; export var i32_load16_u = retasmFunc.i32_load16_u; export var i32_load = retasmFunc.i32_load; diff --git a/test/wasm2js/excess_fallthrough.2asm.js b/test/wasm2js/excess_fallthrough.2asm.js index 48e67acca..d1290aa50 100644 --- a/test/wasm2js/excess_fallthrough.2asm.js +++ b/test/wasm2js/excess_fallthrough.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -47,6 +39,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/excess_fallthrough.2asm.js.opt b/test/wasm2js/excess_fallthrough.2asm.js.opt index a6d2cc75c..0dc045a5a 100644 --- a/test/wasm2js/excess_fallthrough.2asm.js.opt +++ b/test/wasm2js/excess_fallthrough.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -30,6 +22,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/f32.2asm.js b/test/wasm2js/f32.2asm.js index 84df7d8ee..55b58af19 100644 --- a/test/wasm2js/f32.2asm.js +++ b/test/wasm2js/f32.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -119,8 +111,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var add = retasmFunc.add; export var sub = retasmFunc.sub; export var mul = retasmFunc.mul; diff --git a/test/wasm2js/f32_cmp.2asm.js b/test/wasm2js/f32_cmp.2asm.js index a798b5297..326902d6b 100644 --- a/test/wasm2js/f32_cmp.2asm.js +++ b/test/wasm2js/f32_cmp.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -66,8 +58,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var eq = retasmFunc.eq; export var ne = retasmFunc.ne; export var lt = retasmFunc.lt; diff --git a/test/wasm2js/f64_cmp.2asm.js b/test/wasm2js/f64_cmp.2asm.js index 47a3d0dc9..1123be87e 100644 --- a/test/wasm2js/f64_cmp.2asm.js +++ b/test/wasm2js/f64_cmp.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -66,8 +58,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var eq = retasmFunc.eq; export var ne = retasmFunc.ne; export var lt = retasmFunc.lt; diff --git a/test/wasm2js/fac.2asm.js b/test/wasm2js/fac.2asm.js index f87a06aa9..5c581e35d 100644 --- a/test/wasm2js/fac.2asm.js +++ b/test/wasm2js/fac.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -581,8 +573,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var fac_rec = retasmFunc.fac_rec; export var fac_rec_named = retasmFunc.fac_rec_named; export var fac_iter = retasmFunc.fac_iter; diff --git a/test/wasm2js/float-ops.2asm.js b/test/wasm2js/float-ops.2asm.js index c1b8b29fb..7cbebb218 100644 --- a/test/wasm2js/float-ops.2asm.js +++ b/test/wasm2js/float-ops.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -512,8 +504,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var f32_add = retasmFunc.f32_add; export var f32_sub = retasmFunc.f32_sub; export var f32_mul = retasmFunc.f32_mul; diff --git a/test/wasm2js/float-ops.2asm.js.opt b/test/wasm2js/float-ops.2asm.js.opt index fd740273c..1635dbc9a 100644 --- a/test/wasm2js/float-ops.2asm.js.opt +++ b/test/wasm2js/float-ops.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -322,8 +314,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var f32_add = retasmFunc.f32_add; export var f32_sub = retasmFunc.f32_sub; export var f32_mul = retasmFunc.f32_mul; diff --git a/test/wasm2js/float_literals-modified.2asm.js b/test/wasm2js/float_literals-modified.2asm.js index 18821308e..3792f9c74 100644 --- a/test/wasm2js/float_literals-modified.2asm.js +++ b/test/wasm2js/float_literals-modified.2asm.js @@ -18,15 +18,7 @@ import { setTempRet0 } from 'env'; f32ScratchView[2] = value; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -1155,8 +1147,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var f32_nan = retasmFunc.f32_nan; export var f32_positive_nan = retasmFunc.f32_positive_nan; export var f32_negative_nan = retasmFunc.f32_negative_nan; diff --git a/test/wasm2js/float_literals-modified.2asm.js.opt b/test/wasm2js/float_literals-modified.2asm.js.opt index 70040d824..88a833e1e 100644 --- a/test/wasm2js/float_literals-modified.2asm.js.opt +++ b/test/wasm2js/float_literals-modified.2asm.js.opt @@ -14,15 +14,7 @@ import { setTempRet0 } from 'env'; f64ScratchView[0] = value; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -371,8 +363,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var f32_nan = retasmFunc.f32_nan; export var f32_positive_nan = retasmFunc.f32_positive_nan; export var f32_negative_nan = retasmFunc.f32_negative_nan; diff --git a/test/wasm2js/float_misc.2asm.js b/test/wasm2js/float_misc.2asm.js index 794d65675..0ba6e60e9 100644 --- a/test/wasm2js/float_misc.2asm.js +++ b/test/wasm2js/float_misc.2asm.js @@ -29,15 +29,7 @@ f32ScratchView[2] = value; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -306,8 +298,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var f32_add = retasmFunc.f32_add; export var f32_sub = retasmFunc.f32_sub; export var f32_mul = retasmFunc.f32_mul; diff --git a/test/wasm2js/forward.2asm.js b/test/wasm2js/forward.2asm.js index 04fdbf860..1a66c9d56 100644 --- a/test/wasm2js/forward.2asm.js +++ b/test/wasm2js/forward.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -48,7 +40,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var even = retasmFunc.even; export var odd = retasmFunc.odd; diff --git a/test/wasm2js/func-ptr-offset.2asm.js b/test/wasm2js/func-ptr-offset.2asm.js index ac436c6d6..2cb5e290e 100644 --- a/test/wasm2js/func-ptr-offset.2asm.js +++ b/test/wasm2js/func-ptr-offset.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -43,6 +35,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var call = retasmFunc.call; diff --git a/test/wasm2js/func-ptr-offset.2asm.js.opt b/test/wasm2js/func-ptr-offset.2asm.js.opt index b1198607d..b6e55fc40 100644 --- a/test/wasm2js/func-ptr-offset.2asm.js.opt +++ b/test/wasm2js/func-ptr-offset.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -43,6 +35,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var call = retasmFunc.call; diff --git a/test/wasm2js/func_ptrs.2asm.js b/test/wasm2js/func_ptrs.2asm.js index 927a838b4..046c68039 100644 --- a/test/wasm2js/func_ptrs.2asm.js +++ b/test/wasm2js/func_ptrs.2asm.js @@ -1,14 +1,6 @@ import { print_i32 } from 'spectest'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -49,22 +41,28 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },print_i32},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + print_i32 + }); export var one = retasmFunc.one; export var two = retasmFunc.two; export var three = retasmFunc.three; export var four = retasmFunc.four; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -114,20 +112,25 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var callt = retasmFunc.callt; export var callu = retasmFunc.callu; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -159,6 +162,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var callt = retasmFunc.callt; diff --git a/test/wasm2js/get-set-local.2asm.js b/test/wasm2js/get-set-local.2asm.js index 683853437..3f5790de0 100644 --- a/test/wasm2js/get-set-local.2asm.js +++ b/test/wasm2js/get-set-local.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -68,6 +60,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var check_extend_ui32 = retasmFunc.check_extend_ui32; diff --git a/test/wasm2js/get-set-local.2asm.js.opt b/test/wasm2js/get-set-local.2asm.js.opt index 99a9be9ab..3a6590125 100644 --- a/test/wasm2js/get-set-local.2asm.js.opt +++ b/test/wasm2js/get-set-local.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -29,6 +21,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var check_extend_ui32 = retasmFunc.check_extend_ui32; diff --git a/test/wasm2js/get_local.2asm.js b/test/wasm2js/get_local.2asm.js index 2e7b6ff8c..09a30db37 100644 --- a/test/wasm2js/get_local.2asm.js +++ b/test/wasm2js/get_local.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -248,8 +240,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var type_local_i32 = retasmFunc.type_local_i32; export var type_local_i64 = retasmFunc.type_local_i64; export var type_local_f32 = retasmFunc.type_local_f32; diff --git a/test/wasm2js/global_i64.2asm.js b/test/wasm2js/global_i64.2asm.js index 031db6447..c599efffc 100644 --- a/test/wasm2js/global_i64.2asm.js +++ b/test/wasm2js/global_i64.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -41,6 +33,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var exp = retasmFunc.exp; diff --git a/test/wasm2js/global_i64.2asm.js.opt b/test/wasm2js/global_i64.2asm.js.opt index 50542fb8c..268ab21ad 100644 --- a/test/wasm2js/global_i64.2asm.js.opt +++ b/test/wasm2js/global_i64.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -29,6 +21,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var exp = retasmFunc.exp; diff --git a/test/wasm2js/grow-memory-tricky.2asm.js b/test/wasm2js/grow-memory-tricky.2asm.js index 6e3dc5e63..230791c87 100644 --- a/test/wasm2js/grow-memory-tricky.2asm.js +++ b/test/wasm2js/grow-memory-tricky.2asm.js @@ -81,7 +81,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var memory = retasmFunc.memory; export var f1 = retasmFunc.f1; export var f2 = retasmFunc.f2; diff --git a/test/wasm2js/grow-memory-tricky.2asm.js.opt b/test/wasm2js/grow-memory-tricky.2asm.js.opt index d0c474560..176d1085f 100644 --- a/test/wasm2js/grow-memory-tricky.2asm.js.opt +++ b/test/wasm2js/grow-memory-tricky.2asm.js.opt @@ -71,7 +71,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var memory = retasmFunc.memory; export var f1 = retasmFunc.f1; export var f2 = retasmFunc.f2; diff --git a/test/wasm2js/grow_memory.2asm.js b/test/wasm2js/grow_memory.2asm.js index 5f8caa925..5a952950b 100644 --- a/test/wasm2js/grow_memory.2asm.js +++ b/test/wasm2js/grow_memory.2asm.js @@ -74,7 +74,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var memory = retasmFunc.memory; export var grow = retasmFunc.grow; export var current = retasmFunc.current; diff --git a/test/wasm2js/i32.2asm.js b/test/wasm2js/i32.2asm.js index f8ea0161d..0b4bd61ab 100644 --- a/test/wasm2js/i32.2asm.js +++ b/test/wasm2js/i32.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -266,8 +258,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var add = retasmFunc.add; export var sub = retasmFunc.sub; export var mul = retasmFunc.mul; diff --git a/test/wasm2js/i64-add-sub.2asm.js b/test/wasm2js/i64-add-sub.2asm.js index f792d3b6e..e14a21fc0 100644 --- a/test/wasm2js/i64-add-sub.2asm.js +++ b/test/wasm2js/i64-add-sub.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -237,7 +229,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var check_add_i64 = retasmFunc.check_add_i64; export var check_sub_i64 = retasmFunc.check_sub_i64; diff --git a/test/wasm2js/i64-add-sub.2asm.js.opt b/test/wasm2js/i64-add-sub.2asm.js.opt index 24b05c224..4913c4587 100644 --- a/test/wasm2js/i64-add-sub.2asm.js.opt +++ b/test/wasm2js/i64-add-sub.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -49,7 +41,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var check_add_i64 = retasmFunc.check_add_i64; export var check_sub_i64 = retasmFunc.check_sub_i64; diff --git a/test/wasm2js/i64-ctz.2asm.js b/test/wasm2js/i64-ctz.2asm.js index c90710c8d..1d1095990 100644 --- a/test/wasm2js/i64-ctz.2asm.js +++ b/test/wasm2js/i64-ctz.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -240,7 +232,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var a = retasmFunc.a; export var b = retasmFunc.b; diff --git a/test/wasm2js/i64-ctz.2asm.js.opt b/test/wasm2js/i64-ctz.2asm.js.opt index 44876ac37..caadb1516 100644 --- a/test/wasm2js/i64-ctz.2asm.js.opt +++ b/test/wasm2js/i64-ctz.2asm.js.opt @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -82,7 +74,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var a = retasmFunc.a; export var b = retasmFunc.b; diff --git a/test/wasm2js/i64-lowering.2asm.js b/test/wasm2js/i64-lowering.2asm.js index 5a8ce4ecb..628079ac1 100644 --- a/test/wasm2js/i64-lowering.2asm.js +++ b/test/wasm2js/i64-lowering.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -796,8 +788,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var eq_i64 = retasmFunc.eq_i64; export var ne_i64 = retasmFunc.ne_i64; export var ge_s_i64 = retasmFunc.ge_s_i64; diff --git a/test/wasm2js/i64-lowering.2asm.js.opt b/test/wasm2js/i64-lowering.2asm.js.opt index f1003e043..1908dffe4 100644 --- a/test/wasm2js/i64-lowering.2asm.js.opt +++ b/test/wasm2js/i64-lowering.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -74,8 +66,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var eq_i64 = retasmFunc.eq_i64; export var ne_i64 = retasmFunc.ne_i64; export var ge_s_i64 = retasmFunc.ge_s_i64; diff --git a/test/wasm2js/i64-rotate.2asm.js b/test/wasm2js/i64-rotate.2asm.js index a219e72b9..b30b79bab 100644 --- a/test/wasm2js/i64-rotate.2asm.js +++ b/test/wasm2js/i64-rotate.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -449,7 +441,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var rotl = retasmFunc.rotl; export var rotr = retasmFunc.rotr; diff --git a/test/wasm2js/i64-rotate.2asm.js.opt b/test/wasm2js/i64-rotate.2asm.js.opt index 7b2ff5474..a024ec830 100644 --- a/test/wasm2js/i64-rotate.2asm.js.opt +++ b/test/wasm2js/i64-rotate.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -128,7 +120,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var rotl = retasmFunc.rotl; export var rotr = retasmFunc.rotr; diff --git a/test/wasm2js/i64-select.2asm.js b/test/wasm2js/i64-select.2asm.js index c54b71743..6444e8c31 100644 --- a/test/wasm2js/i64-select.2asm.js +++ b/test/wasm2js/i64-select.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/i64-select.2asm.js.opt b/test/wasm2js/i64-select.2asm.js.opt index c54b71743..6444e8c31 100644 --- a/test/wasm2js/i64-select.2asm.js.opt +++ b/test/wasm2js/i64-select.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/i64-shifts.2asm.js b/test/wasm2js/i64-shifts.2asm.js index 6e91b429b..88c4465d5 100644 --- a/test/wasm2js/i64-shifts.2asm.js +++ b/test/wasm2js/i64-shifts.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -254,7 +246,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var shl_i64 = retasmFunc.shl_i64; export var shr_i64 = retasmFunc.shr_i64; diff --git a/test/wasm2js/i64-shifts.2asm.js.opt b/test/wasm2js/i64-shifts.2asm.js.opt index 4d3bae5a6..b04fc3b8f 100644 --- a/test/wasm2js/i64-shifts.2asm.js.opt +++ b/test/wasm2js/i64-shifts.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -70,7 +62,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var shl_i64 = retasmFunc.shl_i64; export var shr_i64 = retasmFunc.shr_i64; diff --git a/test/wasm2js/if_unreachable.2asm.js b/test/wasm2js/if_unreachable.2asm.js index c54b71743..6444e8c31 100644 --- a/test/wasm2js/if_unreachable.2asm.js +++ b/test/wasm2js/if_unreachable.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/if_unreachable.2asm.js.opt b/test/wasm2js/if_unreachable.2asm.js.opt index c54b71743..6444e8c31 100644 --- a/test/wasm2js/if_unreachable.2asm.js.opt +++ b/test/wasm2js/if_unreachable.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/indirect-select.2asm.js b/test/wasm2js/indirect-select.2asm.js index 9ac076ebc..b3c5664d3 100644 --- a/test/wasm2js/indirect-select.2asm.js +++ b/test/wasm2js/indirect-select.2asm.js @@ -1,15 +1,7 @@ import { table } from 'env'; -function asmFunc(global, env, buffer) { +function asmFunc(global, env) { var FUNCTION_TABLE = env.table; - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -38,7 +30,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },table},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + table + }); export var foo_true = retasmFunc.foo_true; export var foo_false = retasmFunc.foo_false; diff --git a/test/wasm2js/indirect-select.2asm.js.opt b/test/wasm2js/indirect-select.2asm.js.opt index 215e9941f..3a7e9b61c 100644 --- a/test/wasm2js/indirect-select.2asm.js.opt +++ b/test/wasm2js/indirect-select.2asm.js.opt @@ -1,15 +1,7 @@ import { table } from 'env'; -function asmFunc(global, env, buffer) { +function asmFunc(global, env) { var FUNCTION_TABLE = env.table; - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -38,7 +30,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },table},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + table + }); export var foo_true = retasmFunc.foo_true; export var foo_false = retasmFunc.foo_false; diff --git a/test/wasm2js/int_exprs.2asm.js b/test/wasm2js/int_exprs.2asm.js index 338ed2de7..551960c25 100644 --- a/test/wasm2js/int_exprs.2asm.js +++ b/test/wasm2js/int_exprs.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -237,23 +229,28 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var i32_no_fold_cmp_s_offset = retasmFunc.i32_no_fold_cmp_s_offset; export var i32_no_fold_cmp_u_offset = retasmFunc.i32_no_fold_cmp_u_offset; export var i64_no_fold_cmp_s_offset = retasmFunc.i64_no_fold_cmp_s_offset; export var i64_no_fold_cmp_u_offset = retasmFunc.i64_no_fold_cmp_u_offset; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -329,20 +326,26 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i64_no_fold_wrap_extend_s = retasmFunc.i64_no_fold_wrap_extend_s; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -417,20 +420,26 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i64_no_fold_wrap_extend_u = retasmFunc.i64_no_fold_wrap_extend_u; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -617,23 +626,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_shl_shr_s = retasmFunc.i32_no_fold_shl_shr_s; export var i32_no_fold_shl_shr_u = retasmFunc.i32_no_fold_shl_shr_u; export var i64_no_fold_shl_shr_s = retasmFunc.i64_no_fold_shl_shr_s; export var i64_no_fold_shl_shr_u = retasmFunc.i64_no_fold_shl_shr_u; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -820,23 +835,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_shr_s_shl = retasmFunc.i32_no_fold_shr_s_shl; export var i32_no_fold_shr_u_shl = retasmFunc.i32_no_fold_shr_u_shl; export var i64_no_fold_shr_s_shl = retasmFunc.i64_no_fold_shr_s_shl; export var i64_no_fold_shr_u_shl = retasmFunc.i64_no_fold_shr_u_shl; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -1642,23 +1663,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_div_s_mul = retasmFunc.i32_no_fold_div_s_mul; export var i32_no_fold_div_u_mul = retasmFunc.i32_no_fold_div_u_mul; export var i64_no_fold_div_s_mul = retasmFunc.i64_no_fold_div_s_mul; export var i64_no_fold_div_u_mul = retasmFunc.i64_no_fold_div_u_mul; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -2370,23 +2397,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_div_s_self = retasmFunc.i32_no_fold_div_s_self; export var i32_no_fold_div_u_self = retasmFunc.i32_no_fold_div_u_self; export var i64_no_fold_div_s_self = retasmFunc.i64_no_fold_div_s_self; export var i64_no_fold_div_u_self = retasmFunc.i64_no_fold_div_u_self; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -3080,23 +3113,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_rem_s_self = retasmFunc.i32_no_fold_rem_s_self; export var i32_no_fold_rem_u_self = retasmFunc.i32_no_fold_rem_u_self; export var i64_no_fold_rem_s_self = retasmFunc.i64_no_fold_rem_s_self; export var i64_no_fold_rem_u_self = retasmFunc.i64_no_fold_rem_u_self; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -3902,23 +3941,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_mul_div_s = retasmFunc.i32_no_fold_mul_div_s; export var i32_no_fold_mul_div_u = retasmFunc.i32_no_fold_mul_div_u; export var i64_no_fold_mul_div_s = retasmFunc.i64_no_fold_mul_div_s; export var i64_no_fold_mul_div_u = retasmFunc.i64_no_fold_mul_div_u; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -4566,21 +4611,27 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_div_s_2 = retasmFunc.i32_no_fold_div_s_2; export var i64_no_fold_div_s_2 = retasmFunc.i64_no_fold_div_s_2; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -5210,21 +5261,27 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_rem_s_2 = retasmFunc.i32_no_fold_rem_s_2; export var i64_no_fold_rem_s_2 = retasmFunc.i64_no_fold_rem_s_2; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -5936,23 +5993,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_div_s_0 = retasmFunc.i32_div_s_0; export var i32_div_u_0 = retasmFunc.i32_div_u_0; export var i64_div_s_0 = retasmFunc.i64_div_s_0; export var i64_div_u_0 = retasmFunc.i64_div_u_0; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -6664,23 +6727,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_div_s_3 = retasmFunc.i32_div_s_3; export var i32_div_u_3 = retasmFunc.i32_div_u_3; export var i64_div_s_3 = retasmFunc.i64_div_s_3; export var i64_div_u_3 = retasmFunc.i64_div_u_3; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -7392,23 +7461,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_div_s_5 = retasmFunc.i32_div_s_5; export var i32_div_u_5 = retasmFunc.i32_div_u_5; export var i64_div_s_5 = retasmFunc.i64_div_s_5; export var i64_div_u_5 = retasmFunc.i64_div_u_5; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -8120,23 +8195,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_div_s_7 = retasmFunc.i32_div_s_7; export var i32_div_u_7 = retasmFunc.i32_div_u_7; export var i64_div_s_7 = retasmFunc.i64_div_s_7; export var i64_div_u_7 = retasmFunc.i64_div_u_7; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -8830,23 +8911,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_rem_s_3 = retasmFunc.i32_rem_s_3; export var i32_rem_u_3 = retasmFunc.i32_rem_u_3; export var i64_rem_s_3 = retasmFunc.i64_rem_s_3; export var i64_rem_u_3 = retasmFunc.i64_rem_u_3; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -9540,23 +9627,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_rem_s_5 = retasmFunc.i32_rem_s_5; export var i32_rem_u_5 = retasmFunc.i32_rem_u_5; export var i64_rem_s_5 = retasmFunc.i64_rem_s_5; export var i64_rem_u_5 = retasmFunc.i64_rem_u_5; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -10250,23 +10343,29 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_rem_s_7 = retasmFunc.i32_rem_s_7; export var i32_rem_u_7 = retasmFunc.i32_rem_u_7; export var i64_rem_s_7 = retasmFunc.i64_rem_s_7; export var i64_rem_u_7 = retasmFunc.i64_rem_u_7; import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -10914,7 +11013,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var i32_no_fold_div_neg1 = retasmFunc.i32_no_fold_div_neg1; export var i64_no_fold_div_neg1 = retasmFunc.i64_no_fold_div_neg1; diff --git a/test/wasm2js/labels.2asm.js b/test/wasm2js/labels.2asm.js index d4b1c197e..a9300bd40 100644 --- a/test/wasm2js/labels.2asm.js +++ b/test/wasm2js/labels.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -349,8 +341,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var block = retasmFunc.block; export var loop1 = retasmFunc.loop1; export var loop2 = retasmFunc.loop2; diff --git a/test/wasm2js/left-to-right.2asm.js b/test/wasm2js/left-to-right.2asm.js index 4c595c3b0..54a909cef 100644 --- a/test/wasm2js/left-to-right.2asm.js +++ b/test/wasm2js/left-to-right.2asm.js @@ -2165,7 +2165,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var i32_add = retasmFunc.i32_add; export var i32_sub = retasmFunc.i32_sub; export var i32_mul = retasmFunc.i32_mul; diff --git a/test/wasm2js/minified-memory.2asm.js b/test/wasm2js/minified-memory.2asm.js index f3a9eda36..d7c73a6bb 100644 --- a/test/wasm2js/minified-memory.2asm.js +++ b/test/wasm2js/minified-memory.2asm.js @@ -59,5 +59,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/minified-memory.2asm.js.opt b/test/wasm2js/minified-memory.2asm.js.opt index 2dadad349..1e79d3202 100644 --- a/test/wasm2js/minified-memory.2asm.js.opt +++ b/test/wasm2js/minified-memory.2asm.js.opt @@ -59,5 +59,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/minus_minus.2asm.js b/test/wasm2js/minus_minus.2asm.js index d0b68a755..36c60f10c 100644 --- a/test/wasm2js/minus_minus.2asm.js +++ b/test/wasm2js/minus_minus.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -33,6 +25,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var func_44_invoker = retasmFunc.func_44_invoker; diff --git a/test/wasm2js/minus_minus.2asm.js.opt b/test/wasm2js/minus_minus.2asm.js.opt index 6b2aec5b0..ff58a1eaa 100644 --- a/test/wasm2js/minus_minus.2asm.js.opt +++ b/test/wasm2js/minus_minus.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -29,6 +21,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var func_44_invoker = retasmFunc.func_44_invoker; diff --git a/test/wasm2js/nested-selects.2asm.js b/test/wasm2js/nested-selects.2asm.js index 48090a1e4..bcd76170b 100644 --- a/test/wasm2js/nested-selects.2asm.js +++ b/test/wasm2js/nested-selects.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -30,6 +22,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var sign = retasmFunc.sign; diff --git a/test/wasm2js/nested-selects.2asm.js.opt b/test/wasm2js/nested-selects.2asm.js.opt index 8f35477e3..852d99960 100644 --- a/test/wasm2js/nested-selects.2asm.js.opt +++ b/test/wasm2js/nested-selects.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -30,6 +22,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var sign = retasmFunc.sign; diff --git a/test/wasm2js/ordering.2asm.js b/test/wasm2js/ordering.2asm.js index 9f452dcd5..f671e2d21 100644 --- a/test/wasm2js/ordering.2asm.js +++ b/test/wasm2js/ordering.2asm.js @@ -1,15 +1,7 @@ import { table } from 'env'; -function asmFunc(global, env, buffer) { +function asmFunc(global, env) { var FUNCTION_TABLE = env.table; - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -61,6 +53,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },table},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + table + }); export var main = retasmFunc.main; diff --git a/test/wasm2js/ordering.2asm.js.opt b/test/wasm2js/ordering.2asm.js.opt index 11bc171dd..9d3cee6f9 100644 --- a/test/wasm2js/ordering.2asm.js.opt +++ b/test/wasm2js/ordering.2asm.js.opt @@ -1,15 +1,7 @@ import { table } from 'env'; -function asmFunc(global, env, buffer) { +function asmFunc(global, env) { var FUNCTION_TABLE = env.table; - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -52,6 +44,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },table},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + table + }); export var main = retasmFunc.main; diff --git a/test/wasm2js/reinterpret.2asm.js b/test/wasm2js/reinterpret.2asm.js index 02eaf8469..a84b56c0d 100644 --- a/test/wasm2js/reinterpret.2asm.js +++ b/test/wasm2js/reinterpret.2asm.js @@ -29,15 +29,7 @@ return f32ScratchView[2]; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -104,7 +96,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var i32_roundtrip = retasmFunc.i32_roundtrip; export var i64_roundtrip = retasmFunc.i64_roundtrip; diff --git a/test/wasm2js/reinterpret.2asm.js.opt b/test/wasm2js/reinterpret.2asm.js.opt index 54f013d25..7ddd6aa0b 100644 --- a/test/wasm2js/reinterpret.2asm.js.opt +++ b/test/wasm2js/reinterpret.2asm.js.opt @@ -29,15 +29,7 @@ return f32ScratchView[2]; } -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -76,7 +68,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var i32_roundtrip = retasmFunc.i32_roundtrip; export var i64_roundtrip = retasmFunc.i64_roundtrip; diff --git a/test/wasm2js/reinterpret_scratch.2asm.js b/test/wasm2js/reinterpret_scratch.2asm.js index 032b6f206..83ad38dc6 100644 --- a/test/wasm2js/reinterpret_scratch.2asm.js +++ b/test/wasm2js/reinterpret_scratch.2asm.js @@ -59,5 +59,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/reinterpret_scratch.2asm.js.opt b/test/wasm2js/reinterpret_scratch.2asm.js.opt index 2552bbbc8..7dd385e06 100644 --- a/test/wasm2js/reinterpret_scratch.2asm.js.opt +++ b/test/wasm2js/reinterpret_scratch.2asm.js.opt @@ -54,5 +54,21 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var foo = retasmFunc.foo; diff --git a/test/wasm2js/set_local.2asm.js b/test/wasm2js/set_local.2asm.js index 304d2b7a7..8fc0b698a 100644 --- a/test/wasm2js/set_local.2asm.js +++ b/test/wasm2js/set_local.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -227,8 +219,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var type_local_i32 = retasmFunc.type_local_i32; export var type_local_i64 = retasmFunc.type_local_i64; export var type_local_f32 = retasmFunc.type_local_f32; diff --git a/test/wasm2js/sign_ext.2asm.js b/test/wasm2js/sign_ext.2asm.js index c1abab59f..3530c46ee 100644 --- a/test/wasm2js/sign_ext.2asm.js +++ b/test/wasm2js/sign_ext.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -36,7 +28,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var test8 = retasmFunc.test8; export var test16 = retasmFunc.test16; diff --git a/test/wasm2js/sign_ext.2asm.js.opt b/test/wasm2js/sign_ext.2asm.js.opt index 9b05256ae..6e3c4eb40 100644 --- a/test/wasm2js/sign_ext.2asm.js.opt +++ b/test/wasm2js/sign_ext.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -36,7 +28,20 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var test8 = retasmFunc.test8; export var test16 = retasmFunc.test16; diff --git a/test/wasm2js/stack-modified.2asm.js b/test/wasm2js/stack-modified.2asm.js index e62f8706f..3cbda4341 100644 --- a/test/wasm2js/stack-modified.2asm.js +++ b/test/wasm2js/stack-modified.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -578,8 +570,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var fac_expr = retasmFunc.fac_expr; export var fac_stack = retasmFunc.fac_stack; export var fac_stack_raw = retasmFunc.fac_stack_raw; diff --git a/test/wasm2js/stack-modified.2asm.js.opt b/test/wasm2js/stack-modified.2asm.js.opt index b6c0c61ee..9a9a10314 100644 --- a/test/wasm2js/stack-modified.2asm.js.opt +++ b/test/wasm2js/stack-modified.2asm.js.opt @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -75,8 +67,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var fac_expr = retasmFunc.fac_expr; export var fac_stack = retasmFunc.fac_stack; export var fac_stack_raw = retasmFunc.fac_stack_raw; diff --git a/test/wasm2js/start_func.2asm.js b/test/wasm2js/start_func.2asm.js index 309bbb814..c18514dba 100644 --- a/test/wasm2js/start_func.2asm.js +++ b/test/wasm2js/start_func.2asm.js @@ -58,4 +58,20 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); diff --git a/test/wasm2js/start_func.2asm.js.opt b/test/wasm2js/start_func.2asm.js.opt index 1162e7940..6ff7c1cba 100644 --- a/test/wasm2js/start_func.2asm.js.opt +++ b/test/wasm2js/start_func.2asm.js.opt @@ -58,4 +58,20 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); diff --git a/test/wasm2js/switch.2asm.js b/test/wasm2js/switch.2asm.js index 91adedb05..3664145c6 100644 --- a/test/wasm2js/switch.2asm.js +++ b/test/wasm2js/switch.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -190,8 +182,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var stmt = retasmFunc.stmt; export var expr = retasmFunc.expr; export var arg = retasmFunc.arg; diff --git a/test/wasm2js/tee_local.2asm.js b/test/wasm2js/tee_local.2asm.js index c380a863a..002baae1e 100644 --- a/test/wasm2js/tee_local.2asm.js +++ b/test/wasm2js/tee_local.2asm.js @@ -1,14 +1,6 @@ import { setTempRet0 } from 'env'; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -334,8 +326,22 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }); export var type_local_i32 = retasmFunc.type_local_i32; export var type_local_i64 = retasmFunc.type_local_i64; export var type_local_f32 = retasmFunc.type_local_f32; diff --git a/test/wasm2js/traps.2asm.js b/test/wasm2js/traps.2asm.js index 25acefe76..497761090 100644 --- a/test/wasm2js/traps.2asm.js +++ b/test/wasm2js/traps.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -736,22 +728,27 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var no_dce_i32_div_s = retasmFunc.no_dce_i32_div_s; export var no_dce_i32_div_u = retasmFunc.no_dce_i32_div_u; export var no_dce_i64_div_s = retasmFunc.no_dce_i64_div_s; export var no_dce_i64_div_u = retasmFunc.no_dce_i64_div_u; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -1462,22 +1459,27 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var no_dce_i32_rem_s = retasmFunc.no_dce_i32_rem_s; export var no_dce_i32_rem_u = retasmFunc.no_dce_i32_rem_u; export var no_dce_i64_rem_s = retasmFunc.no_dce_i64_rem_s; export var no_dce_i64_rem_u = retasmFunc.no_dce_i64_rem_u; -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -1590,8 +1592,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var no_dce_i32_trunc_f32_s = retasmFunc.no_dce_i32_trunc_f32_s; export var no_dce_i32_trunc_f32_u = retasmFunc.no_dce_i32_trunc_f32_u; export var no_dce_i32_trunc_f64_s = retasmFunc.no_dce_i32_trunc_f64_s; @@ -1744,7 +1759,23 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }, + memasmFunc +); export var no_dce_i32_load = retasmFunc.no_dce_i32_load; export var no_dce_i32_load16_s = retasmFunc.no_dce_i32_load16_s; export var no_dce_i32_load16_u = retasmFunc.no_dce_i32_load16_u; diff --git a/test/wasm2js/unaligned.2asm.js b/test/wasm2js/unaligned.2asm.js index 4ea170809..cb5c661be 100644 --- a/test/wasm2js/unaligned.2asm.js +++ b/test/wasm2js/unaligned.2asm.js @@ -175,7 +175,24 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }, + memasmFunc +); export var i32_load = retasmFunc.i32_load; export var i64_load = retasmFunc.i64_load; export var f32_load = retasmFunc.f32_load; diff --git a/test/wasm2js/unaligned.2asm.js.opt b/test/wasm2js/unaligned.2asm.js.opt index 6f2342b71..717bfc1a6 100644 --- a/test/wasm2js/unaligned.2asm.js.opt +++ b/test/wasm2js/unaligned.2asm.js.opt @@ -128,7 +128,24 @@ function asmFunc(global, env, buffer) { var memasmFunc = new ArrayBuffer(65536); var bufferView = new Uint8Array(memasmFunc); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); },setTempRet0},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); }, + setTempRet0 + }, + memasmFunc +); export var i32_load = retasmFunc.i32_load; export var i64_load = retasmFunc.i64_load; export var f32_load = retasmFunc.f32_load; diff --git a/test/wasm2js/unary-ops.2asm.js b/test/wasm2js/unary-ops.2asm.js index 14ce607ba..e7743700f 100644 --- a/test/wasm2js/unary-ops.2asm.js +++ b/test/wasm2js/unary-ops.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -524,8 +516,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var i32_popcnt = retasmFunc.i32_popcnt; export var check_popcnt_i64 = retasmFunc.check_popcnt_i64; export var check_extend_ui32 = retasmFunc.check_extend_ui32; diff --git a/test/wasm2js/unary-ops.2asm.js.opt b/test/wasm2js/unary-ops.2asm.js.opt index ef689019b..8922b6fb7 100644 --- a/test/wasm2js/unary-ops.2asm.js.opt +++ b/test/wasm2js/unary-ops.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -144,8 +136,21 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var i32_popcnt = retasmFunc.i32_popcnt; export var check_popcnt_i64 = retasmFunc.check_popcnt_i64; export var check_extend_ui32 = retasmFunc.check_extend_ui32; diff --git a/test/wasm2js/unreachable-get-cycle.2asm.js b/test/wasm2js/unreachable-get-cycle.2asm.js index c54b71743..6444e8c31 100644 --- a/test/wasm2js/unreachable-get-cycle.2asm.js +++ b/test/wasm2js/unreachable-get-cycle.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/unreachable-get-cycle.2asm.js.opt b/test/wasm2js/unreachable-get-cycle.2asm.js.opt index c54b71743..6444e8c31 100644 --- a/test/wasm2js/unreachable-get-cycle.2asm.js.opt +++ b/test/wasm2js/unreachable-get-cycle.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/unreachable-insts.2asm.js b/test/wasm2js/unreachable-insts.2asm.js index c54b71743..6444e8c31 100644 --- a/test/wasm2js/unreachable-insts.2asm.js +++ b/test/wasm2js/unreachable-insts.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/unreachable-insts.2asm.js.opt b/test/wasm2js/unreachable-insts.2asm.js.opt index c54b71743..6444e8c31 100644 --- a/test/wasm2js/unreachable-insts.2asm.js.opt +++ b/test/wasm2js/unreachable-insts.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -25,5 +17,18 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); diff --git a/test/wasm2js/unreachable-later.2asm.js b/test/wasm2js/unreachable-later.2asm.js index 7fcf87d54..515304d32 100644 --- a/test/wasm2js/unreachable-later.2asm.js +++ b/test/wasm2js/unreachable-later.2asm.js @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -71,6 +63,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var func_50 = retasmFunc.func_50; diff --git a/test/wasm2js/unreachable-later.2asm.js.opt b/test/wasm2js/unreachable-later.2asm.js.opt index a7f7e2966..443a64b1c 100644 --- a/test/wasm2js/unreachable-later.2asm.js.opt +++ b/test/wasm2js/unreachable-later.2asm.js.opt @@ -1,13 +1,5 @@ -function asmFunc(global, env, buffer) { - var HEAP8 = new global.Int8Array(buffer); - var HEAP16 = new global.Int16Array(buffer); - var HEAP32 = new global.Int32Array(buffer); - var HEAPU8 = new global.Uint8Array(buffer); - var HEAPU16 = new global.Uint16Array(buffer); - var HEAPU32 = new global.Uint32Array(buffer); - var HEAPF32 = new global.Float32Array(buffer); - var HEAPF64 = new global.Float64Array(buffer); +function asmFunc(global, env) { var Math_imul = global.Math.imul; var Math_fround = global.Math.fround; var Math_abs = global.Math.abs; @@ -44,6 +36,19 @@ function asmFunc(global, env, buffer) { }; } -var memasmFunc = new ArrayBuffer(65536); -var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc); +var retasmFunc = asmFunc({ + Math, + Int8Array, + Uint8Array, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + NaN, + Infinity + }, { + abort: function() { throw new Error('abort'); } + }); export var func_50 = retasmFunc.func_50; |