summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-10-05 15:18:22 -0700
committerGitHub <noreply@github.com>2022-10-05 15:18:22 -0700
commitc43721a1ae80539aea5ea9d8d295b7e377aa03f5 (patch)
tree4a796dd8baa33f6edd44b16addb967483f6b1479
parent9b5ba422bf670754a5ac4fb39b0199ac8e1edb84 (diff)
downloadbinaryen-c43721a1ae80539aea5ea9d8d295b7e377aa03f5.tar.gz
binaryen-c43721a1ae80539aea5ea9d8d295b7e377aa03f5.tar.bz2
binaryen-c43721a1ae80539aea5ea9d8d295b7e377aa03f5.zip
wasm2js: Support for flexible module import naming (#5114)
The previous code was making emscripten-specific assumptions about imports basically all coming from the `env` module. I can't find a way to make this backwards compatible so may do a combined roll with the emscripten-side change: https://github.com/emscripten-core/emscripten/pull/17806
-rw-r--r--src/wasm2js.h115
-rw-r--r--test/binaryen.js/emit_asmjs.js.txt3
-rw-r--r--test/wasm2js.asserts.js3
-rw-r--r--test/wasm2js.traps.js3
-rw-r--r--test/wasm2js/add_div.2asm.js3
-rw-r--r--test/wasm2js/add_div.2asm.js.opt3
-rw-r--r--test/wasm2js/atomic_fence.2asm.js3
-rw-r--r--test/wasm2js/atomic_fence.2asm.js.opt3
-rw-r--r--test/wasm2js/atomics_32.2asm.js3
-rw-r--r--test/wasm2js/atomics_32.2asm.js.opt3
-rw-r--r--test/wasm2js/base64.2asm.js3
-rw-r--r--test/wasm2js/base64.2asm.js.opt3
-rw-r--r--test/wasm2js/br.2asm.js8
-rw-r--r--test/wasm2js/br_table.2asm.js8
-rw-r--r--test/wasm2js/br_table_hoisting.2asm.js3
-rw-r--r--test/wasm2js/br_table_hoisting.2asm.js.opt3
-rw-r--r--test/wasm2js/br_table_temp.2asm.js3
-rw-r--r--test/wasm2js/br_table_temp.2asm.js.opt3
-rw-r--r--test/wasm2js/br_table_to_loop.2asm.js3
-rw-r--r--test/wasm2js/br_table_to_loop.2asm.js.opt3
-rw-r--r--test/wasm2js/break-drop.2asm.js3
-rw-r--r--test/wasm2js/bulk-memory.2asm.js19
-rw-r--r--test/wasm2js/bulk-memory.2asm.js.opt17
-rw-r--r--test/wasm2js/comments.2asm.js6
-rw-r--r--test/wasm2js/conversions-modified.2asm.js8
-rw-r--r--test/wasm2js/conversions-modified.2asm.js.opt8
-rw-r--r--test/wasm2js/deterministic.2asm.js6
-rw-r--r--test/wasm2js/deterministic.2asm.js.opt6
-rw-r--r--test/wasm2js/dot_import.2asm.js10
-rw-r--r--test/wasm2js/dot_import.2asm.js.opt10
-rw-r--r--test/wasm2js/dynamicLibrary.2asm.js13
-rw-r--r--test/wasm2js/dynamicLibrary.2asm.js.opt13
-rw-r--r--test/wasm2js/empty_export.2asm.js3
-rw-r--r--test/wasm2js/empty_export.2asm.js.opt3
-rw-r--r--test/wasm2js/empty_table.2asm.js3
-rw-r--r--test/wasm2js/emscripten-grow-no.2asm.js6
-rw-r--r--test/wasm2js/emscripten-grow-no.2asm.js.opt6
-rw-r--r--test/wasm2js/emscripten-grow-yes.2asm.js6
-rw-r--r--test/wasm2js/emscripten-grow-yes.2asm.js.opt6
-rw-r--r--test/wasm2js/emscripten.2asm.js6
-rw-r--r--test/wasm2js/emscripten.2asm.js.opt6
-rw-r--r--test/wasm2js/endianness.2asm.js8
-rw-r--r--test/wasm2js/excess_fallthrough.2asm.js3
-rw-r--r--test/wasm2js/excess_fallthrough.2asm.js.opt3
-rw-r--r--test/wasm2js/export_global.2asm.js3
-rw-r--r--test/wasm2js/export_global.2asm.js.opt3
-rw-r--r--test/wasm2js/f32.2asm.js3
-rw-r--r--test/wasm2js/f32_cmp.2asm.js3
-rw-r--r--test/wasm2js/f64_cmp.2asm.js3
-rw-r--r--test/wasm2js/fac.2asm.js8
-rw-r--r--test/wasm2js/float-ops.2asm.js3
-rw-r--r--test/wasm2js/float-ops.2asm.js.opt3
-rw-r--r--test/wasm2js/float_literals-modified.2asm.js8
-rw-r--r--test/wasm2js/float_literals-modified.2asm.js.opt8
-rw-r--r--test/wasm2js/float_misc.2asm.js3
-rw-r--r--test/wasm2js/forward.2asm.js3
-rw-r--r--test/wasm2js/func-ptr-offset.2asm.js3
-rw-r--r--test/wasm2js/func-ptr-offset.2asm.js.opt3
-rw-r--r--test/wasm2js/func_ptrs.2asm.js16
-rw-r--r--test/wasm2js/get-set-local.2asm.js3
-rw-r--r--test/wasm2js/get-set-local.2asm.js.opt3
-rw-r--r--test/wasm2js/get_local.2asm.js8
-rw-r--r--test/wasm2js/global_i64.2asm.js3
-rw-r--r--test/wasm2js/global_i64.2asm.js.opt3
-rw-r--r--test/wasm2js/grow-memory-tricky.2asm.js3
-rw-r--r--test/wasm2js/grow-memory-tricky.2asm.js.opt3
-rw-r--r--test/wasm2js/grow_memory.2asm.js3
-rw-r--r--test/wasm2js/i32.2asm.js3
-rw-r--r--test/wasm2js/i64-add-sub.2asm.js3
-rw-r--r--test/wasm2js/i64-add-sub.2asm.js.opt3
-rw-r--r--test/wasm2js/i64-ctz.2asm.js8
-rw-r--r--test/wasm2js/i64-ctz.2asm.js.opt8
-rw-r--r--test/wasm2js/i64-lowering.2asm.js3
-rw-r--r--test/wasm2js/i64-lowering.2asm.js.opt3
-rw-r--r--test/wasm2js/i64-rotate.2asm.js3
-rw-r--r--test/wasm2js/i64-rotate.2asm.js.opt3
-rw-r--r--test/wasm2js/i64-select.2asm.js3
-rw-r--r--test/wasm2js/i64-select.2asm.js.opt3
-rw-r--r--test/wasm2js/i64-shifts.2asm.js3
-rw-r--r--test/wasm2js/i64-shifts.2asm.js.opt3
-rw-r--r--test/wasm2js/if_unreachable.2asm.js3
-rw-r--r--test/wasm2js/if_unreachable.2asm.js.opt3
-rw-r--r--test/wasm2js/indirect-select.2asm.js8
-rw-r--r--test/wasm2js/indirect-select.2asm.js.opt8
-rw-r--r--test/wasm2js/int_exprs.2asm.js147
-rw-r--r--test/wasm2js/labels.2asm.js3
-rw-r--r--test/wasm2js/left-to-right.2asm.js3
-rw-r--r--test/wasm2js/minified-memory.2asm.js6
-rw-r--r--test/wasm2js/minified-memory.2asm.js.opt6
-rw-r--r--test/wasm2js/minus_minus.2asm.js3
-rw-r--r--test/wasm2js/minus_minus.2asm.js.opt3
-rw-r--r--test/wasm2js/nested-selects.2asm.js3
-rw-r--r--test/wasm2js/nested-selects.2asm.js.opt3
-rw-r--r--test/wasm2js/ordering.2asm.js8
-rw-r--r--test/wasm2js/ordering.2asm.js.opt8
-rw-r--r--test/wasm2js/reinterpret.2asm.js3
-rw-r--r--test/wasm2js/reinterpret.2asm.js.opt3
-rw-r--r--test/wasm2js/reinterpret_scratch.2asm.js3
-rw-r--r--test/wasm2js/reinterpret_scratch.2asm.js.opt3
-rw-r--r--test/wasm2js/set_local.2asm.js8
-rw-r--r--test/wasm2js/sign_ext.2asm.js8
-rw-r--r--test/wasm2js/sign_ext.2asm.js.opt8
-rw-r--r--test/wasm2js/stack-modified.2asm.js8
-rw-r--r--test/wasm2js/stack-modified.2asm.js.opt8
-rw-r--r--test/wasm2js/start_func.2asm.js3
-rw-r--r--test/wasm2js/start_func.2asm.js.opt3
-rw-r--r--test/wasm2js/switch.2asm.js8
-rw-r--r--test/wasm2js/tee_local.2asm.js8
-rw-r--r--test/wasm2js/traps.2asm.js12
-rw-r--r--test/wasm2js/unaligned.2asm.js8
-rw-r--r--test/wasm2js/unaligned.2asm.js.opt8
-rw-r--r--test/wasm2js/unary-ops.2asm.js3
-rw-r--r--test/wasm2js/unary-ops.2asm.js.opt3
-rw-r--r--test/wasm2js/unreachable-get-cycle.2asm.js3
-rw-r--r--test/wasm2js/unreachable-get-cycle.2asm.js.opt3
-rw-r--r--test/wasm2js/unreachable-insts.2asm.js3
-rw-r--r--test/wasm2js/unreachable-insts.2asm.js.opt3
-rw-r--r--test/wasm2js/unreachable-later.2asm.js3
-rw-r--r--test/wasm2js/unreachable-later.2asm.js.opt3
119 files changed, 402 insertions, 450 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h
index ab9fae0d9..ceae32eb9 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -53,7 +53,7 @@ namespace wasm {
using namespace cashew;
-static IString importObject("importObject");
+static IString importObject("imports");
// Appends extra to block, flattening out if extra is a block as well
void flattenAppend(Ref ast, Ref extra) {
@@ -296,12 +296,15 @@ private:
wasmNameToMangledName[(int)NameScope::Max];
// Set of all mangled names in each scope.
std::unordered_set<IString> mangledNames[(int)NameScope::Max];
+ std::unordered_set<IString> seenModuleImports;
// If a function is callable from outside, we'll need to cast the inputs
// and our return value. Otherwise, internally, casts are only needed
// on operations.
std::unordered_set<Name> functionsCallableFromOutside;
+ void ensureModuleVar(Ref ast, const Importable& imp);
+ Ref getImportName(const Importable& imp);
void addBasics(Ref ast, Module* wasm);
void addFunctionImport(Ref ast, Function* import);
void addGlobalImport(Ref ast, Global* import);
@@ -415,31 +418,16 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) {
ret[1]->push_back(asmFunc);
ValueBuilder::appendArgumentToFunction(asmFunc, importObject);
- // Retrieve `env` object from info. Older version of emscripten pass `env`
- // *as* `info` so for now we make this conditional.
- // TODO(sbc): Remove the makeBinary here once emscripten change has landed.
- Ref envVar = ValueBuilder::makeVar();
- asmFunc[3]->push_back(envVar);
- ValueBuilder::appendToVar(
- envVar,
- ENV,
- ValueBuilder::makeBinary(
- ValueBuilder::makeDot(ValueBuilder::makeName(importObject),
- ValueBuilder::makeName(ENV)),
- "||",
- ValueBuilder::makeName(importObject)));
-
// add memory import
if (!wasm->memories.empty()) {
if (wasm->memories[0]->imported()) {
+ ensureModuleVar(asmFunc[3], *wasm->memories[0]);
+
// find memory and buffer in imports
Ref theVar = ValueBuilder::makeVar();
asmFunc[3]->push_back(theVar);
ValueBuilder::appendToVar(
- theVar,
- "memory",
- ValueBuilder::makeDot(ValueBuilder::makeName(ENV),
- ValueBuilder::makeName(wasm->memories[0]->base)));
+ theVar, "memory", getImportName(*wasm->memories[0]));
// Assign `buffer = memory.buffer`
Ref buf = ValueBuilder::makeVar();
@@ -475,12 +463,10 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) {
// add imported tables
ModuleUtils::iterImportedTables(*wasm, [&](Table* table) {
+ ensureModuleVar(asmFunc[3], *table);
Ref theVar = ValueBuilder::makeVar();
asmFunc[3]->push_back(theVar);
- ValueBuilder::appendToVar(
- theVar,
- FUNCTION_TABLE,
- ValueBuilder::makeDot(ValueBuilder::makeName(ENV), table->base));
+ ValueBuilder::appendToVar(theVar, FUNCTION_TABLE, getImportName(*table));
});
// create heaps, etc
@@ -542,7 +528,7 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) {
if (hasActiveSegments(*wasm)) {
asmFunc[3]->push_back(
ValueBuilder::makeCall(ValueBuilder::makeName("initActiveSegments"),
- ValueBuilder::makeName(ENV)));
+ ValueBuilder::makeName(importObject)));
}
addTable(asmFunc[3], wasm);
@@ -599,29 +585,60 @@ void Wasm2JSBuilder::addBasics(Ref ast, Module* wasm) {
infinityVar, "infinity", ValueBuilder::makeName("Infinity"));
}
+static bool needsQuoting(Name name) {
+ auto mangled = asmangle(name.str);
+ return mangled != name.str;
+}
+
+void Wasm2JSBuilder::ensureModuleVar(Ref ast, const Importable& imp) {
+ if (seenModuleImports.count(imp.module) > 0) {
+ return;
+ }
+ Ref theVar = ValueBuilder::makeVar();
+ ast->push_back(theVar);
+ Ref rhs;
+ if (needsQuoting(imp.module)) {
+ rhs = ValueBuilder::makeSub(ValueBuilder::makeName(importObject),
+ ValueBuilder::makeString(imp.module));
+ } else {
+ rhs = ValueBuilder::makeDot(ValueBuilder::makeName(importObject),
+ ValueBuilder::makeName(imp.module));
+ }
+
+ ValueBuilder::appendToVar(theVar, fromName(imp.module, NameScope::Top), rhs);
+ seenModuleImports.insert(imp.module);
+}
+
+Ref Wasm2JSBuilder::getImportName(const Importable& imp) {
+ if (needsQuoting(imp.base)) {
+ return ValueBuilder::makeSub(
+ ValueBuilder::makeName(fromName(imp.module, NameScope::Top)),
+ ValueBuilder::makeString(imp.base));
+ } else {
+ return ValueBuilder::makeDot(
+ ValueBuilder::makeName(fromName(imp.module, NameScope::Top)),
+ ValueBuilder::makeName(imp.base));
+ }
+}
+
void Wasm2JSBuilder::addFunctionImport(Ref ast, Function* import) {
// The scratch memory helpers are emitted in the glue, see code and comments
// below.
if (ABI::wasm2js::isHelper(import->base)) {
return;
}
+ ensureModuleVar(ast, *import);
Ref theVar = ValueBuilder::makeVar();
ast->push_back(theVar);
- // TODO: handle nested module imports
- Ref module = ValueBuilder::makeName(ENV);
ValueBuilder::appendToVar(
- theVar,
- fromName(import->name, NameScope::Top),
- ValueBuilder::makeDot(module, fromName(import->base, NameScope::Top)));
+ theVar, fromName(import->name, NameScope::Top), getImportName(*import));
}
void Wasm2JSBuilder::addGlobalImport(Ref ast, Global* import) {
+ ensureModuleVar(ast, *import);
Ref theVar = ValueBuilder::makeVar();
ast->push_back(theVar);
- // TODO: handle nested module imports
- Ref module = ValueBuilder::makeName(ENV);
- Ref value =
- ValueBuilder::makeDot(module, fromName(import->base, NameScope::Top));
+ Ref value = getImportName(*import);
if (import->type == Type::i32) {
value = makeJsCoercion(value, JS_INT);
}
@@ -2586,6 +2603,7 @@ void Wasm2JSGlue::emitPreEmscripten() {
void Wasm2JSGlue::emitPreES6() {
std::unordered_map<Name, Name> baseModuleMap;
+ std::unordered_set<Name> seenModules;
auto noteImport = [&](Name module, Name base) {
// Right now codegen requires a flat namespace going into the module,
@@ -2596,9 +2614,11 @@ void Wasm2JSGlue::emitPreES6() {
<< "two different modules yet";
}
baseModuleMap[base] = module;
-
- out << "import { " << asmangle(base.str) << " } from '" << module.str
- << "';\n";
+ if (seenModules.count(module) == 0) {
+ out << "import * as " << asmangle(module.str) << " from '" << module.str
+ << "';\n";
+ seenModules.insert(module);
+ }
};
ImportInfo imports(wasm);
@@ -2647,13 +2667,20 @@ void Wasm2JSGlue::emitPostES6() {
// values followed by all imports
out << "var ret" << moduleName.str << " = " << moduleName.str << "({\n";
+ std::unordered_set<Name> seenModules;
+
ModuleUtils::iterImportedFunctions(wasm, [&](Function* import) {
// The special helpers are emitted in the glue, see code and comments
// below.
if (ABI::wasm2js::isHelper(import->base)) {
return;
}
- out << " " << asmangle(import->base.str) << ",\n";
+ if (seenModules.count(import->module) > 0) {
+ return;
+ }
+ out << " \"" << import->module << "\": " << asmangle(import->module.str)
+ << ",\n";
+ seenModules.insert(import->module);
});
ModuleUtils::iterImportedMemories(wasm, [&](Memory* import) {
@@ -2662,8 +2689,10 @@ void Wasm2JSGlue::emitPostES6() {
if (ABI::wasm2js::isHelper(import->base)) {
return;
}
+ out << " \"" << import->module << "\": {\n";
out << " " << asmangle(import->base.str) << ": { buffer : mem"
<< moduleName.str << " }\n";
+ out << " },\n";
});
ModuleUtils::iterImportedTables(wasm, [&](Table* import) {
@@ -2672,7 +2701,12 @@ void Wasm2JSGlue::emitPostES6() {
if (ABI::wasm2js::isHelper(import->base)) {
return;
}
- out << " " << asmangle(import->base.str) << ",\n";
+ if (seenModules.count(import->module) > 0) {
+ return;
+ }
+ out << " \"" << import->module << "\": " << asmangle(import->module.str)
+ << ",\n";
+ seenModules.insert(import->module);
});
out << "});\n";
@@ -2781,8 +2815,9 @@ void Wasm2JSGlue::emitMemory() {
}
if (auto* get = segment.offset->dynCast<GlobalGet>()) {
auto internalName = get->name;
- auto importedName = wasm.getGlobal(internalName)->base;
- return std::string("imports[") + asmangle(importedName.str) + "]";
+ auto importedGlobal = wasm.getGlobal(internalName);
+ return std::string("imports['") + importedGlobal->module.str + "']['" +
+ importedGlobal->base.str + "']";
}
Fatal() << "non-constant offsets aren't supported yet\n";
};
diff --git a/test/binaryen.js/emit_asmjs.js.txt b/test/binaryen.js/emit_asmjs.js.txt
index a91383f7b..b4511455c 100644
--- a/test/binaryen.js/emit_asmjs.js.txt
+++ b/test/binaryen.js/emit_asmjs.js.txt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js.asserts.js b/test/wasm2js.asserts.js
index e04de2990..2fff25126 100644
--- a/test/wasm2js.asserts.js
+++ b/test/wasm2js.asserts.js
@@ -30,8 +30,7 @@
return (actual_lo | 0) == (expected_lo | 0) && (actual_hi | 0) == (expected_hi | 0);
}
-function asmFunc0(importObject) {
- var env = importObject.env || importObject;
+function asmFunc0(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js.traps.js b/test/wasm2js.traps.js
index 31d9557e0..0b1d24b95 100644
--- a/test/wasm2js.traps.js
+++ b/test/wasm2js.traps.js
@@ -30,8 +30,7 @@
return (actual_lo | 0) == (expected_lo | 0) && (actual_hi | 0) == (expected_hi | 0);
}
-function asmFunc0(importObject) {
- var env = importObject.env || importObject;
+function asmFunc0(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/add_div.2asm.js b/test/wasm2js/add_div.2asm.js
index ff9bdc01c..07e1a9ce4 100644
--- a/test/wasm2js/add_div.2asm.js
+++ b/test/wasm2js/add_div.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/add_div.2asm.js.opt b/test/wasm2js/add_div.2asm.js.opt
index 142330e02..6a6b29c92 100644
--- a/test/wasm2js/add_div.2asm.js.opt
+++ b/test/wasm2js/add_div.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/atomic_fence.2asm.js b/test/wasm2js/atomic_fence.2asm.js
index efe176159..825918383 100644
--- a/test/wasm2js/atomic_fence.2asm.js
+++ b/test/wasm2js/atomic_fence.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(1507328);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/atomic_fence.2asm.js.opt b/test/wasm2js/atomic_fence.2asm.js.opt
index 543f6b6cc..f201b8e44 100644
--- a/test/wasm2js/atomic_fence.2asm.js.opt
+++ b/test/wasm2js/atomic_fence.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/atomics_32.2asm.js b/test/wasm2js/atomics_32.2asm.js
index 6d97947ba..bd9f10fb2 100644
--- a/test/wasm2js/atomics_32.2asm.js
+++ b/test/wasm2js/atomics_32.2asm.js
@@ -89,8 +89,7 @@ memorySegments[1] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "d29y
bufferView.set(memorySegments[segment].subarray(offset, offset + size), dest);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(16777216);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/atomics_32.2asm.js.opt b/test/wasm2js/atomics_32.2asm.js.opt
index 0a7e3a252..eecd0eb56 100644
--- a/test/wasm2js/atomics_32.2asm.js.opt
+++ b/test/wasm2js/atomics_32.2asm.js.opt
@@ -89,8 +89,7 @@ memorySegments[1] = base64DecodeToExistingUint8Array(new Uint8Array(6), 0, "d29y
bufferView.set(memorySegments[segment].subarray(offset, offset + size), dest);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(16777216);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/base64.2asm.js b/test/wasm2js/base64.2asm.js
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/base64.2asm.js
+++ b/test/wasm2js/base64.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/base64.2asm.js.opt b/test/wasm2js/base64.2asm.js.opt
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/base64.2asm.js.opt
+++ b/test/wasm2js/base64.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/br.2asm.js b/test/wasm2js/br.2asm.js
index 9e2c48d63..91d02229a 100644
--- a/test/wasm2js/br.2asm.js
+++ b/test/wasm2js/br.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function dummy() {
@@ -717,7 +717,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var type_i32 = retasmFunc.type_i32;
export var type_i64 = retasmFunc.type_i64;
diff --git a/test/wasm2js/br_table.2asm.js b/test/wasm2js/br_table.2asm.js
index dbc584ddb..84f6e4db0 100644
--- a/test/wasm2js/br_table.2asm.js
+++ b/test/wasm2js/br_table.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function dummy() {
@@ -13422,7 +13422,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var type_i32 = retasmFunc.type_i32;
export var type_i64 = retasmFunc.type_i64;
diff --git a/test/wasm2js/br_table_hoisting.2asm.js b/test/wasm2js/br_table_hoisting.2asm.js
index 8a4fad19d..70d3e64ab 100644
--- a/test/wasm2js/br_table_hoisting.2asm.js
+++ b/test/wasm2js/br_table_hoisting.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/br_table_hoisting.2asm.js.opt b/test/wasm2js/br_table_hoisting.2asm.js.opt
index 3966c2b28..cd77a53a8 100644
--- a/test/wasm2js/br_table_hoisting.2asm.js.opt
+++ b/test/wasm2js/br_table_hoisting.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/br_table_temp.2asm.js b/test/wasm2js/br_table_temp.2asm.js
index 2c81be4e1..fc039ab53 100644
--- a/test/wasm2js/br_table_temp.2asm.js
+++ b/test/wasm2js/br_table_temp.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/br_table_temp.2asm.js.opt b/test/wasm2js/br_table_temp.2asm.js.opt
index d1407a51d..eee9e5604 100644
--- a/test/wasm2js/br_table_temp.2asm.js.opt
+++ b/test/wasm2js/br_table_temp.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/br_table_to_loop.2asm.js b/test/wasm2js/br_table_to_loop.2asm.js
index 9d318bf4d..67ac434f1 100644
--- a/test/wasm2js/br_table_to_loop.2asm.js
+++ b/test/wasm2js/br_table_to_loop.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/br_table_to_loop.2asm.js.opt b/test/wasm2js/br_table_to_loop.2asm.js.opt
index cac6dc28c..94280b2e7 100644
--- a/test/wasm2js/br_table_to_loop.2asm.js.opt
+++ b/test/wasm2js/br_table_to_loop.2asm.js.opt
@@ -1,8 +1,7 @@
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/break-drop.2asm.js b/test/wasm2js/break-drop.2asm.js
index 2954ee937..8cde78806 100644
--- a/test/wasm2js/break-drop.2asm.js
+++ b/test/wasm2js/break-drop.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/bulk-memory.2asm.js b/test/wasm2js/bulk-memory.2asm.js
index 3712f6a10..49017368c 100644
--- a/test/wasm2js/bulk-memory.2asm.js
+++ b/test/wasm2js/bulk-memory.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -30,8 +29,7 @@ var retasmFunc = asmFunc({
bufferView.fill(value, dest, dest + size);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -133,8 +131,7 @@ function initActiveSegments(imports) {
bufferView.copyWithin(dest, source, source + size);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -169,7 +166,7 @@ function asmFunc(importObject) {
}
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
@@ -214,8 +211,7 @@ memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(4), 0, "qrvM
bufferView.set(memorySegments[segment].subarray(offset, offset + size), dest);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -324,8 +320,7 @@ function initActiveSegments(imports) {
bufferView.set(memorySegments[segment].subarray(offset, offset + size), dest);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -364,7 +359,7 @@ function asmFunc(importObject) {
}
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
diff --git a/test/wasm2js/bulk-memory.2asm.js.opt b/test/wasm2js/bulk-memory.2asm.js.opt
index eb58d1556..50c1eb136 100644
--- a/test/wasm2js/bulk-memory.2asm.js.opt
+++ b/test/wasm2js/bulk-memory.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -30,8 +29,7 @@ var retasmFunc = asmFunc({
bufferView.fill(value, dest, dest + size);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -133,8 +131,7 @@ function initActiveSegments(imports) {
bufferView.copyWithin(dest, source, source + size);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -169,7 +166,7 @@ function asmFunc(importObject) {
}
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
@@ -214,8 +211,7 @@ memorySegments[0] = base64DecodeToExistingUint8Array(new Uint8Array(4), 0, "qrvM
bufferView.set(memorySegments[segment].subarray(offset, offset + size), dest);
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -290,8 +286,7 @@ export var load8_u = retasmFunc.load8_u;
var bufferView;
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/comments.2asm.js b/test/wasm2js/comments.2asm.js
index 9eab5c8c1..9ee9d1ce7 100644
--- a/test/wasm2js/comments.2asm.js
+++ b/test/wasm2js/comments.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -21,8 +20,7 @@ function asmFunc(importObject) {
var retasmFunc = asmFunc({
});
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/conversions-modified.2asm.js b/test/wasm2js/conversions-modified.2asm.js
index cfc407353..892bdf030 100644
--- a/test/wasm2js/conversions-modified.2asm.js
+++ b/test/wasm2js/conversions-modified.2asm.js
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var scratchBuffer = new ArrayBuffer(16);
@@ -30,8 +30,7 @@ import { setTempRet0 } from 'env';
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -44,6 +43,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(x) {
@@ -620,7 +620,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i64_extend_s_i32 = retasmFunc.i64_extend_s_i32;
export var i64_extend_u_i32 = retasmFunc.i64_extend_u_i32;
diff --git a/test/wasm2js/conversions-modified.2asm.js.opt b/test/wasm2js/conversions-modified.2asm.js.opt
index 97ad69028..36bfda8cb 100644
--- a/test/wasm2js/conversions-modified.2asm.js.opt
+++ b/test/wasm2js/conversions-modified.2asm.js.opt
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var scratchBuffer = new ArrayBuffer(16);
@@ -30,8 +30,7 @@ import { setTempRet0 } from 'env';
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -44,6 +43,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $3($0) {
@@ -197,7 +197,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i64_extend_s_i32 = retasmFunc.i64_extend_s_i32;
export var i64_extend_u_i32 = retasmFunc.i64_extend_u_i32;
diff --git a/test/wasm2js/deterministic.2asm.js b/test/wasm2js/deterministic.2asm.js
index 2fd378080..09731cfb5 100644
--- a/test/wasm2js/deterministic.2asm.js
+++ b/test/wasm2js/deterministic.2asm.js
@@ -2,8 +2,8 @@
var bufferView;
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -46,6 +46,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(65536);
var retasmFunc = asmFunc({
+ "env": {
memory: { buffer : memasmFunc }
+ },
});
export var foo = retasmFunc.foo;
diff --git a/test/wasm2js/deterministic.2asm.js.opt b/test/wasm2js/deterministic.2asm.js.opt
index 4c9e0a139..a5bc1b337 100644
--- a/test/wasm2js/deterministic.2asm.js.opt
+++ b/test/wasm2js/deterministic.2asm.js.opt
@@ -2,8 +2,8 @@
var bufferView;
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -45,6 +45,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(65536);
var retasmFunc = asmFunc({
+ "env": {
memory: { buffer : memasmFunc }
+ },
});
export var foo = retasmFunc.foo;
diff --git a/test/wasm2js/dot_import.2asm.js b/test/wasm2js/dot_import.2asm.js
index d49304e2d..f2b5fa1c8 100644
--- a/test/wasm2js/dot_import.2asm.js
+++ b/test/wasm2js/dot_import.2asm.js
@@ -1,7 +1,6 @@
-import { ba_se } from 'mod.ule';
+import * as mod_ule from 'mod.ule';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,7 +13,8 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
- var base = env.ba_se;
+ var mod_ule = imports["mod.ule"];
+ var base = mod_ule["ba.se"];
function $0() {
base();
}
@@ -25,6 +25,6 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- ba_se,
+ "mod.ule": mod_ule,
});
export var exported = retasmFunc.exported;
diff --git a/test/wasm2js/dot_import.2asm.js.opt b/test/wasm2js/dot_import.2asm.js.opt
index d49304e2d..f2b5fa1c8 100644
--- a/test/wasm2js/dot_import.2asm.js.opt
+++ b/test/wasm2js/dot_import.2asm.js.opt
@@ -1,7 +1,6 @@
-import { ba_se } from 'mod.ule';
+import * as mod_ule from 'mod.ule';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,7 +13,8 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
- var base = env.ba_se;
+ var mod_ule = imports["mod.ule"];
+ var base = mod_ule["ba.se"];
function $0() {
base();
}
@@ -25,6 +25,6 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- ba_se,
+ "mod.ule": mod_ule,
});
export var exported = retasmFunc.exported;
diff --git a/test/wasm2js/dynamicLibrary.2asm.js b/test/wasm2js/dynamicLibrary.2asm.js
index 93faf062b..bae9aeb57 100644
--- a/test/wasm2js/dynamicLibrary.2asm.js
+++ b/test/wasm2js/dynamicLibrary.2asm.js
@@ -1,5 +1,4 @@
-import { memoryBase } from 'env';
-import { tableBase } from 'env';
+import * as env from 'env';
function Table(ret) {
// grow method not included; table is not growable
@@ -34,10 +33,10 @@ function Table(ret) {
return uint8Array;
}
function initActiveSegments(imports) {
- base64DecodeToExistingUint8Array(bufferView, imports[memoryBase], "ZHluYW1pYyBkYXRh");
+ base64DecodeToExistingUint8Array(bufferView, imports['env']['memoryBase'], "ZHluYW1pYyBkYXRh");
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -75,7 +74,7 @@ function asmFunc(importObject) {
}
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
var FUNCTION_TABLE = Table(new Array(10));
FUNCTION_TABLE[import$tableBase + 0] = foo;
FUNCTION_TABLE[import$tableBase + 1] = bar;
@@ -91,6 +90,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(16777216);
var retasmFunc = asmFunc({
+ "env": {
memory: { buffer : memasmFunc }
+ },
});
export var baz = retasmFunc.baz;
diff --git a/test/wasm2js/dynamicLibrary.2asm.js.opt b/test/wasm2js/dynamicLibrary.2asm.js.opt
index 44b3411a0..61bdab183 100644
--- a/test/wasm2js/dynamicLibrary.2asm.js.opt
+++ b/test/wasm2js/dynamicLibrary.2asm.js.opt
@@ -1,5 +1,4 @@
-import { memoryBase } from 'env';
-import { tableBase } from 'env';
+import * as env from 'env';
function Table(ret) {
// grow method not included; table is not growable
@@ -34,10 +33,10 @@ function Table(ret) {
return uint8Array;
}
function initActiveSegments(imports) {
- base64DecodeToExistingUint8Array(bufferView, imports[memoryBase], "ZHluYW1pYyBkYXRh");
+ base64DecodeToExistingUint8Array(bufferView, imports['env']['memoryBase'], "ZHluYW1pYyBkYXRh");
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -67,7 +66,7 @@ function asmFunc(importObject) {
}
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
var FUNCTION_TABLE = Table(new Array(10));
FUNCTION_TABLE[import$tableBase + 0] = foo;
FUNCTION_TABLE[import$tableBase + 1] = foo;
@@ -83,6 +82,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(16777216);
var retasmFunc = asmFunc({
+ "env": {
memory: { buffer : memasmFunc }
+ },
});
export var baz = retasmFunc.baz;
diff --git a/test/wasm2js/empty_export.2asm.js b/test/wasm2js/empty_export.2asm.js
index eb162b810..7a6a012e7 100644
--- a/test/wasm2js/empty_export.2asm.js
+++ b/test/wasm2js/empty_export.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/empty_export.2asm.js.opt b/test/wasm2js/empty_export.2asm.js.opt
index eb162b810..7a6a012e7 100644
--- a/test/wasm2js/empty_export.2asm.js.opt
+++ b/test/wasm2js/empty_export.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/empty_table.2asm.js b/test/wasm2js/empty_table.2asm.js
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/empty_table.2asm.js
+++ b/test/wasm2js/empty_table.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/emscripten-grow-no.2asm.js b/test/wasm2js/emscripten-grow-no.2asm.js
index 68ffdbe2c..66e3305ab 100644
--- a/test/wasm2js/emscripten-grow-no.2asm.js
+++ b/test/wasm2js/emscripten-grow-no.2asm.js
@@ -23,8 +23,8 @@ function instantiate(info) {
function initActiveSegments(imports) {
base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj");
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -52,7 +52,7 @@ function asmFunc(importObject) {
// EMSCRIPTEN_END_FUNCS
;
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
diff --git a/test/wasm2js/emscripten-grow-no.2asm.js.opt b/test/wasm2js/emscripten-grow-no.2asm.js.opt
index 68ffdbe2c..66e3305ab 100644
--- a/test/wasm2js/emscripten-grow-no.2asm.js.opt
+++ b/test/wasm2js/emscripten-grow-no.2asm.js.opt
@@ -23,8 +23,8 @@ function instantiate(info) {
function initActiveSegments(imports) {
base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj");
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
var HEAP8 = new Int8Array(buffer);
@@ -52,7 +52,7 @@ function asmFunc(importObject) {
// EMSCRIPTEN_END_FUNCS
;
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
diff --git a/test/wasm2js/emscripten-grow-yes.2asm.js b/test/wasm2js/emscripten-grow-yes.2asm.js
index 68a8c556c..8fe28321c 100644
--- a/test/wasm2js/emscripten-grow-yes.2asm.js
+++ b/test/wasm2js/emscripten-grow-yes.2asm.js
@@ -23,8 +23,8 @@ function instantiate(info) {
function initActiveSegments(imports) {
base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj");
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
memory.grow = __wasm_memory_grow;
@@ -57,7 +57,7 @@ function asmFunc(importObject) {
// EMSCRIPTEN_END_FUNCS
;
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
diff --git a/test/wasm2js/emscripten-grow-yes.2asm.js.opt b/test/wasm2js/emscripten-grow-yes.2asm.js.opt
index 68a8c556c..8fe28321c 100644
--- a/test/wasm2js/emscripten-grow-yes.2asm.js.opt
+++ b/test/wasm2js/emscripten-grow-yes.2asm.js.opt
@@ -23,8 +23,8 @@ function instantiate(info) {
function initActiveSegments(imports) {
base64DecodeToExistingUint8Array(bufferView, 1600, "YWJj");
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.memory;
var buffer = memory.buffer;
memory.grow = __wasm_memory_grow;
@@ -57,7 +57,7 @@ function asmFunc(importObject) {
// EMSCRIPTEN_END_FUNCS
;
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
function __wasm_memory_size() {
return buffer.byteLength / 65536 | 0;
}
diff --git a/test/wasm2js/emscripten.2asm.js b/test/wasm2js/emscripten.2asm.js
index 5156c63a6..81d272c6f 100644
--- a/test/wasm2js/emscripten.2asm.js
+++ b/test/wasm2js/emscripten.2asm.js
@@ -26,9 +26,9 @@ function initActiveSegments(imports) {
}
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(16777216);
+ var env = imports.env;
var FUNCTION_TABLE = env.table;
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -214,7 +214,7 @@ function asmFunc(importObject) {
// EMSCRIPTEN_END_FUNCS
;
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
FUNCTION_TABLE[1] = foo;
FUNCTION_TABLE[2] = bar;
FUNCTION_TABLE[3] = tabled;
diff --git a/test/wasm2js/emscripten.2asm.js.opt b/test/wasm2js/emscripten.2asm.js.opt
index a9217f159..dd28fd880 100644
--- a/test/wasm2js/emscripten.2asm.js.opt
+++ b/test/wasm2js/emscripten.2asm.js.opt
@@ -38,9 +38,9 @@ function initActiveSegments(imports) {
}
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(16777216);
+ var env = imports.env;
var FUNCTION_TABLE = env.table;
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -209,7 +209,7 @@ function asmFunc(importObject) {
// EMSCRIPTEN_END_FUNCS
;
bufferView = HEAPU8;
- initActiveSegments(env);
+ initActiveSegments(imports);
FUNCTION_TABLE[1] = foo;
FUNCTION_TABLE[2] = bar;
FUNCTION_TABLE[3] = internal;
diff --git a/test/wasm2js/endianness.2asm.js b/test/wasm2js/endianness.2asm.js
index e87d6ed5e..12b4c8d14 100644
--- a/test/wasm2js/endianness.2asm.js
+++ b/test/wasm2js/endianness.2asm.js
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var bufferView;
@@ -31,8 +31,7 @@ import { setTempRet0 } from 'env';
return f32ScratchView[2];
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -54,6 +53,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function i16_store_little(address, value) {
@@ -701,7 +701,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i32_load16_s = retasmFunc.i32_load16_s;
export var i32_load16_u = retasmFunc.i32_load16_u;
diff --git a/test/wasm2js/excess_fallthrough.2asm.js b/test/wasm2js/excess_fallthrough.2asm.js
index 2327fba9b..9bad3f3a7 100644
--- a/test/wasm2js/excess_fallthrough.2asm.js
+++ b/test/wasm2js/excess_fallthrough.2asm.js
@@ -1,8 +1,7 @@
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/excess_fallthrough.2asm.js.opt b/test/wasm2js/excess_fallthrough.2asm.js.opt
index de165ddf5..0a71bff5e 100644
--- a/test/wasm2js/excess_fallthrough.2asm.js.opt
+++ b/test/wasm2js/excess_fallthrough.2asm.js.opt
@@ -1,8 +1,7 @@
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/export_global.2asm.js b/test/wasm2js/export_global.2asm.js
index fa1b49774..b2efa0b56 100644
--- a/test/wasm2js/export_global.2asm.js
+++ b/test/wasm2js/export_global.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/export_global.2asm.js.opt b/test/wasm2js/export_global.2asm.js.opt
index 9352d898b..2b60adaf6 100644
--- a/test/wasm2js/export_global.2asm.js.opt
+++ b/test/wasm2js/export_global.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/f32.2asm.js b/test/wasm2js/f32.2asm.js
index 904fd1586..728d9eb84 100644
--- a/test/wasm2js/f32.2asm.js
+++ b/test/wasm2js/f32.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/f32_cmp.2asm.js b/test/wasm2js/f32_cmp.2asm.js
index 80766d46d..85a02897b 100644
--- a/test/wasm2js/f32_cmp.2asm.js
+++ b/test/wasm2js/f32_cmp.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/f64_cmp.2asm.js b/test/wasm2js/f64_cmp.2asm.js
index da2676499..d39175278 100644
--- a/test/wasm2js/f64_cmp.2asm.js
+++ b/test/wasm2js/f64_cmp.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/fac.2asm.js b/test/wasm2js/fac.2asm.js
index 087e7635d..ac0640d36 100644
--- a/test/wasm2js/fac.2asm.js
+++ b/test/wasm2js/fac.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0($0_1, $0$hi) {
@@ -575,7 +575,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var fac_rec = retasmFunc.fac_rec;
export var fac_rec_named = retasmFunc.fac_rec_named;
diff --git a/test/wasm2js/float-ops.2asm.js b/test/wasm2js/float-ops.2asm.js
index 22c838398..c9fe7cde6 100644
--- a/test/wasm2js/float-ops.2asm.js
+++ b/test/wasm2js/float-ops.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/float-ops.2asm.js.opt b/test/wasm2js/float-ops.2asm.js.opt
index 3a04777f3..620948556 100644
--- a/test/wasm2js/float-ops.2asm.js.opt
+++ b/test/wasm2js/float-ops.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/float_literals-modified.2asm.js b/test/wasm2js/float_literals-modified.2asm.js
index d354f6817..2792deed7 100644
--- a/test/wasm2js/float_literals-modified.2asm.js
+++ b/test/wasm2js/float_literals-modified.2asm.js
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var scratchBuffer = new ArrayBuffer(16);
@@ -18,8 +18,7 @@ import { setTempRet0 } from 'env';
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -32,6 +31,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -1149,7 +1149,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var f32_nan = retasmFunc.f32_nan;
export var f32_positive_nan = retasmFunc.f32_positive_nan;
diff --git a/test/wasm2js/float_literals-modified.2asm.js.opt b/test/wasm2js/float_literals-modified.2asm.js.opt
index 96f68b803..1e69b6304 100644
--- a/test/wasm2js/float_literals-modified.2asm.js.opt
+++ b/test/wasm2js/float_literals-modified.2asm.js.opt
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var scratchBuffer = new ArrayBuffer(16);
@@ -14,8 +14,7 @@ import { setTempRet0 } from 'env';
f64ScratchView[0] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -28,6 +27,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -365,7 +365,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var f32_nan = retasmFunc.f32_nan;
export var f32_positive_nan = retasmFunc.f32_positive_nan;
diff --git a/test/wasm2js/float_misc.2asm.js b/test/wasm2js/float_misc.2asm.js
index 86f4c1124..e175aa6ac 100644
--- a/test/wasm2js/float_misc.2asm.js
+++ b/test/wasm2js/float_misc.2asm.js
@@ -29,8 +29,7 @@
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/forward.2asm.js b/test/wasm2js/forward.2asm.js
index 15b7425e9..d20479bf5 100644
--- a/test/wasm2js/forward.2asm.js
+++ b/test/wasm2js/forward.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/func-ptr-offset.2asm.js b/test/wasm2js/func-ptr-offset.2asm.js
index f612ea71b..a6e8289c8 100644
--- a/test/wasm2js/func-ptr-offset.2asm.js
+++ b/test/wasm2js/func-ptr-offset.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/func-ptr-offset.2asm.js.opt b/test/wasm2js/func-ptr-offset.2asm.js.opt
index 4b51ebfcc..04b4c640d 100644
--- a/test/wasm2js/func-ptr-offset.2asm.js.opt
+++ b/test/wasm2js/func-ptr-offset.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/func_ptrs.2asm.js b/test/wasm2js/func_ptrs.2asm.js
index f98102a03..3da7a5064 100644
--- a/test/wasm2js/func_ptrs.2asm.js
+++ b/test/wasm2js/func_ptrs.2asm.js
@@ -1,7 +1,6 @@
-import { print_i32 } from 'spectest';
+import * as spectest from 'spectest';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,7 +13,8 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
- var print = env.print_i32;
+ var spectest = imports.spectest;
+ var print = spectest.print_i32;
function $3() {
return 13 | 0;
}
@@ -43,15 +43,14 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- print_i32,
+ "spectest": spectest,
});
export var one = retasmFunc.one;
export var two = retasmFunc.two;
export var three = retasmFunc.three;
export var four = retasmFunc.four;
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -106,8 +105,7 @@ var retasmFunc = asmFunc({
export var callt = retasmFunc.callt;
export var callu = retasmFunc.callu;
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/get-set-local.2asm.js b/test/wasm2js/get-set-local.2asm.js
index 0c9ab3fa4..30557e584 100644
--- a/test/wasm2js/get-set-local.2asm.js
+++ b/test/wasm2js/get-set-local.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/get-set-local.2asm.js.opt b/test/wasm2js/get-set-local.2asm.js.opt
index fb0520b91..e9dd6604f 100644
--- a/test/wasm2js/get-set-local.2asm.js.opt
+++ b/test/wasm2js/get-set-local.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/get_local.2asm.js b/test/wasm2js/get_local.2asm.js
index da694991b..8eed0e992 100644
--- a/test/wasm2js/get_local.2asm.js
+++ b/test/wasm2js/get_local.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -239,7 +239,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var type_local_i32 = retasmFunc.type_local_i32;
export var type_local_i64 = retasmFunc.type_local_i64;
diff --git a/test/wasm2js/global_i64.2asm.js b/test/wasm2js/global_i64.2asm.js
index 77436ccae..71073de91 100644
--- a/test/wasm2js/global_i64.2asm.js
+++ b/test/wasm2js/global_i64.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/global_i64.2asm.js.opt b/test/wasm2js/global_i64.2asm.js.opt
index 619a4a1f0..9399e09d5 100644
--- a/test/wasm2js/global_i64.2asm.js.opt
+++ b/test/wasm2js/global_i64.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/grow-memory-tricky.2asm.js b/test/wasm2js/grow-memory-tricky.2asm.js
index 0cb4aa818..74305009f 100644
--- a/test/wasm2js/grow-memory-tricky.2asm.js
+++ b/test/wasm2js/grow-memory-tricky.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/grow-memory-tricky.2asm.js.opt b/test/wasm2js/grow-memory-tricky.2asm.js.opt
index e134fb9fa..e1b090e3f 100644
--- a/test/wasm2js/grow-memory-tricky.2asm.js.opt
+++ b/test/wasm2js/grow-memory-tricky.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/grow_memory.2asm.js b/test/wasm2js/grow_memory.2asm.js
index 413a31728..598b027b3 100644
--- a/test/wasm2js/grow_memory.2asm.js
+++ b/test/wasm2js/grow_memory.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/i32.2asm.js b/test/wasm2js/i32.2asm.js
index c9b3e319e..6aa4ef05e 100644
--- a/test/wasm2js/i32.2asm.js
+++ b/test/wasm2js/i32.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-add-sub.2asm.js b/test/wasm2js/i64-add-sub.2asm.js
index 4dfbc10c8..0351d89e0 100644
--- a/test/wasm2js/i64-add-sub.2asm.js
+++ b/test/wasm2js/i64-add-sub.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-add-sub.2asm.js.opt b/test/wasm2js/i64-add-sub.2asm.js.opt
index 2bf310f02..4d7248586 100644
--- a/test/wasm2js/i64-add-sub.2asm.js.opt
+++ b/test/wasm2js/i64-add-sub.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-ctz.2asm.js b/test/wasm2js/i64-ctz.2asm.js
index 2a12ea0eb..9fb18e5e7 100644
--- a/test/wasm2js/i64-ctz.2asm.js
+++ b/test/wasm2js/i64-ctz.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function popcnt64($0, $0$hi) {
@@ -234,7 +234,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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 a20760aac..c232bef7c 100644
--- a/test/wasm2js/i64-ctz.2asm.js.opt
+++ b/test/wasm2js/i64-ctz.2asm.js.opt
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function legalstub$popcnt64($0, $1) {
@@ -66,7 +66,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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 06ac51abb..75d4db3c6 100644
--- a/test/wasm2js/i64-lowering.2asm.js
+++ b/test/wasm2js/i64-lowering.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-lowering.2asm.js.opt b/test/wasm2js/i64-lowering.2asm.js.opt
index 829e26082..52d13859c 100644
--- a/test/wasm2js/i64-lowering.2asm.js.opt
+++ b/test/wasm2js/i64-lowering.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-rotate.2asm.js b/test/wasm2js/i64-rotate.2asm.js
index 6b23a464c..cd1a40dba 100644
--- a/test/wasm2js/i64-rotate.2asm.js
+++ b/test/wasm2js/i64-rotate.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-rotate.2asm.js.opt b/test/wasm2js/i64-rotate.2asm.js.opt
index 5a5725f1b..5cf2e36bb 100644
--- a/test/wasm2js/i64-rotate.2asm.js.opt
+++ b/test/wasm2js/i64-rotate.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-select.2asm.js b/test/wasm2js/i64-select.2asm.js
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/i64-select.2asm.js
+++ b/test/wasm2js/i64-select.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-select.2asm.js.opt b/test/wasm2js/i64-select.2asm.js.opt
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/i64-select.2asm.js.opt
+++ b/test/wasm2js/i64-select.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-shifts.2asm.js b/test/wasm2js/i64-shifts.2asm.js
index 0e8c005ac..5feee598f 100644
--- a/test/wasm2js/i64-shifts.2asm.js
+++ b/test/wasm2js/i64-shifts.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/i64-shifts.2asm.js.opt b/test/wasm2js/i64-shifts.2asm.js.opt
index 336aef645..797cbbcf5 100644
--- a/test/wasm2js/i64-shifts.2asm.js.opt
+++ b/test/wasm2js/i64-shifts.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/if_unreachable.2asm.js b/test/wasm2js/if_unreachable.2asm.js
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/if_unreachable.2asm.js
+++ b/test/wasm2js/if_unreachable.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/if_unreachable.2asm.js.opt b/test/wasm2js/if_unreachable.2asm.js.opt
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/if_unreachable.2asm.js.opt
+++ b/test/wasm2js/if_unreachable.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/indirect-select.2asm.js b/test/wasm2js/indirect-select.2asm.js
index c79b0ae49..a5036ecf2 100644
--- a/test/wasm2js/indirect-select.2asm.js
+++ b/test/wasm2js/indirect-select.2asm.js
@@ -1,7 +1,7 @@
-import { table } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var FUNCTION_TABLE = env.table;
var Math_imul = Math.imul;
var Math_fround = Math.fround;
@@ -32,7 +32,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- table,
+ "env": env,
});
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 71cf64269..6bb594e37 100644
--- a/test/wasm2js/indirect-select.2asm.js.opt
+++ b/test/wasm2js/indirect-select.2asm.js.opt
@@ -1,7 +1,7 @@
-import { table } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var FUNCTION_TABLE = env.table;
var Math_imul = Math.imul;
var Math_fround = Math.fround;
@@ -32,7 +32,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- table,
+ "env": env,
});
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 3d5c27638..bd627c177 100644
--- a/test/wasm2js/int_exprs.2asm.js
+++ b/test/wasm2js/int_exprs.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -236,10 +235,9 @@ 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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -252,6 +250,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(x, x$hi) {
@@ -316,13 +315,12 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i64_no_fold_wrap_extend_s = retasmFunc.i64_no_fold_wrap_extend_s;
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -335,6 +333,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(x, x$hi) {
@@ -398,13 +397,12 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i64_no_fold_wrap_extend_u = retasmFunc.i64_no_fold_wrap_extend_u;
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -417,6 +415,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(x) {
@@ -592,16 +591,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -614,6 +612,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(x) {
@@ -789,16 +788,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -811,6 +809,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -1601,16 +1600,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -1623,6 +1621,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -2319,16 +2318,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -2341,6 +2339,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -3019,16 +3018,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -3041,6 +3039,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -3831,16 +3830,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -3853,6 +3851,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -4485,14 +4484,13 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -4505,6 +4503,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -5119,14 +5118,13 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -5139,6 +5137,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -5835,16 +5834,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -5857,6 +5855,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -6553,16 +6552,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -6575,6 +6573,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -7271,16 +7270,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -7293,6 +7291,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -7989,16 +7988,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -8011,6 +8009,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -8689,16 +8688,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -8711,6 +8709,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -9389,16 +9388,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -9411,6 +9409,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -10089,16 +10088,15 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -10111,6 +10109,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var __wasm_intrinsics_temp_i64 = 0;
var __wasm_intrinsics_temp_i64$hi = 0;
@@ -10743,7 +10742,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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 5a7699514..f63a2f251 100644
--- a/test/wasm2js/labels.2asm.js
+++ b/test/wasm2js/labels.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/left-to-right.2asm.js b/test/wasm2js/left-to-right.2asm.js
index 68524fb75..fc091fd81 100644
--- a/test/wasm2js/left-to-right.2asm.js
+++ b/test/wasm2js/left-to-right.2asm.js
@@ -26,8 +26,7 @@
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/minified-memory.2asm.js b/test/wasm2js/minified-memory.2asm.js
index defabfcab..bdbeb5232 100644
--- a/test/wasm2js/minified-memory.2asm.js
+++ b/test/wasm2js/minified-memory.2asm.js
@@ -1,6 +1,6 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.a;
var buffer = memory.buffer;
memory.grow = __wasm_memory_grow;
@@ -61,6 +61,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(65536);
var retasmFunc = asmFunc({
+ "env": {
a: { buffer : 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 701f1d40a..12d852176 100644
--- a/test/wasm2js/minified-memory.2asm.js.opt
+++ b/test/wasm2js/minified-memory.2asm.js.opt
@@ -1,6 +1,6 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var memory = env.a;
var buffer = memory.buffer;
memory.grow = __wasm_memory_grow;
@@ -61,6 +61,8 @@ function asmFunc(importObject) {
var memasmFunc = new ArrayBuffer(65536);
var retasmFunc = asmFunc({
+ "env": {
a: { buffer : memasmFunc }
+ },
});
export var foo = retasmFunc.foo;
diff --git a/test/wasm2js/minus_minus.2asm.js b/test/wasm2js/minus_minus.2asm.js
index 46f0ee763..5420df7a7 100644
--- a/test/wasm2js/minus_minus.2asm.js
+++ b/test/wasm2js/minus_minus.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/minus_minus.2asm.js.opt b/test/wasm2js/minus_minus.2asm.js.opt
index 095615602..823345fa3 100644
--- a/test/wasm2js/minus_minus.2asm.js.opt
+++ b/test/wasm2js/minus_minus.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/nested-selects.2asm.js b/test/wasm2js/nested-selects.2asm.js
index 64bfa1eaf..c6c48fa69 100644
--- a/test/wasm2js/nested-selects.2asm.js
+++ b/test/wasm2js/nested-selects.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/nested-selects.2asm.js.opt b/test/wasm2js/nested-selects.2asm.js.opt
index 4c453ec06..4fb7e5e14 100644
--- a/test/wasm2js/nested-selects.2asm.js.opt
+++ b/test/wasm2js/nested-selects.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/ordering.2asm.js b/test/wasm2js/ordering.2asm.js
index 99794e58a..c2d4d8a0d 100644
--- a/test/wasm2js/ordering.2asm.js
+++ b/test/wasm2js/ordering.2asm.js
@@ -1,7 +1,7 @@
-import { table } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var FUNCTION_TABLE = env.table;
var Math_imul = Math.imul;
var Math_fround = Math.fround;
@@ -55,6 +55,6 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- table,
+ "env": env,
});
export var main = retasmFunc.main;
diff --git a/test/wasm2js/ordering.2asm.js.opt b/test/wasm2js/ordering.2asm.js.opt
index ff459dd39..3e45117e9 100644
--- a/test/wasm2js/ordering.2asm.js.opt
+++ b/test/wasm2js/ordering.2asm.js.opt
@@ -1,7 +1,7 @@
-import { table } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
+ var env = imports.env;
var FUNCTION_TABLE = env.table;
var Math_imul = Math.imul;
var Math_fround = Math.fround;
@@ -46,6 +46,6 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- table,
+ "env": env,
});
export var main = retasmFunc.main;
diff --git a/test/wasm2js/reinterpret.2asm.js b/test/wasm2js/reinterpret.2asm.js
index 5082c3839..ada204192 100644
--- a/test/wasm2js/reinterpret.2asm.js
+++ b/test/wasm2js/reinterpret.2asm.js
@@ -29,8 +29,7 @@
return f32ScratchView[2];
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/reinterpret.2asm.js.opt b/test/wasm2js/reinterpret.2asm.js.opt
index 7b9b87c3b..b14ea3c8d 100644
--- a/test/wasm2js/reinterpret.2asm.js.opt
+++ b/test/wasm2js/reinterpret.2asm.js.opt
@@ -21,8 +21,7 @@
f64ScratchView[0] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/reinterpret_scratch.2asm.js b/test/wasm2js/reinterpret_scratch.2asm.js
index c36595d33..d5f098724 100644
--- a/test/wasm2js/reinterpret_scratch.2asm.js
+++ b/test/wasm2js/reinterpret_scratch.2asm.js
@@ -18,8 +18,7 @@
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/reinterpret_scratch.2asm.js.opt b/test/wasm2js/reinterpret_scratch.2asm.js.opt
index caf289186..8f48bc983 100644
--- a/test/wasm2js/reinterpret_scratch.2asm.js.opt
+++ b/test/wasm2js/reinterpret_scratch.2asm.js.opt
@@ -14,8 +14,7 @@
f64ScratchView[0] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/set_local.2asm.js b/test/wasm2js/set_local.2asm.js
index 4f989942f..1ebf653ba 100644
--- a/test/wasm2js/set_local.2asm.js
+++ b/test/wasm2js/set_local.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -218,7 +218,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var type_local_i32 = retasmFunc.type_local_i32;
export var type_local_i64 = retasmFunc.type_local_i64;
diff --git a/test/wasm2js/sign_ext.2asm.js b/test/wasm2js/sign_ext.2asm.js
index 1900cfeff..ec3ae37a6 100644
--- a/test/wasm2js/sign_ext.2asm.js
+++ b/test/wasm2js/sign_ext.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(x) {
@@ -201,7 +201,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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 1ba32e2dd..64f9f0744 100644
--- a/test/wasm2js/sign_ext.2asm.js.opt
+++ b/test/wasm2js/sign_ext.2asm.js.opt
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0($0_1) {
@@ -56,7 +56,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
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 66423631a..91bfded1e 100644
--- a/test/wasm2js/stack-modified.2asm.js
+++ b/test/wasm2js/stack-modified.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(var$0, var$0$hi) {
@@ -564,7 +564,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var fac_expr = retasmFunc.fac_expr;
export var fac_stack = retasmFunc.fac_stack;
diff --git a/test/wasm2js/stack-modified.2asm.js.opt b/test/wasm2js/stack-modified.2asm.js.opt
index 239dc6d98..c3d9d7d57 100644
--- a/test/wasm2js/stack-modified.2asm.js.opt
+++ b/test/wasm2js/stack-modified.2asm.js.opt
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function legalstub$0($0, $1) {
@@ -61,7 +61,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var fac_expr = retasmFunc.fac_expr;
export var fac_stack = retasmFunc.fac_stack;
diff --git a/test/wasm2js/start_func.2asm.js b/test/wasm2js/start_func.2asm.js
index a6b87a02f..629f58a86 100644
--- a/test/wasm2js/start_func.2asm.js
+++ b/test/wasm2js/start_func.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/start_func.2asm.js.opt b/test/wasm2js/start_func.2asm.js.opt
index 957931a62..7b692ac63 100644
--- a/test/wasm2js/start_func.2asm.js.opt
+++ b/test/wasm2js/start_func.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/switch.2asm.js b/test/wasm2js/switch.2asm.js
index 984d0e9a7..219fb33d5 100644
--- a/test/wasm2js/switch.2asm.js
+++ b/test/wasm2js/switch.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0(i) {
@@ -184,7 +184,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var stmt = retasmFunc.stmt;
export var expr = retasmFunc.expr;
diff --git a/test/wasm2js/tee_local.2asm.js b/test/wasm2js/tee_local.2asm.js
index a528e7999..871131ae2 100644
--- a/test/wasm2js/tee_local.2asm.js
+++ b/test/wasm2js/tee_local.2asm.js
@@ -1,7 +1,6 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -14,6 +13,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -325,7 +325,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var type_local_i32 = retasmFunc.type_local_i32;
export var type_local_i64 = retasmFunc.type_local_i64;
diff --git a/test/wasm2js/traps.2asm.js b/test/wasm2js/traps.2asm.js
index 8ad162cfc..ea76eff71 100644
--- a/test/wasm2js/traps.2asm.js
+++ b/test/wasm2js/traps.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -732,8 +731,7 @@ 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(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -1447,8 +1445,7 @@ 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(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
@@ -1572,8 +1569,7 @@ export var no_dce_i64_trunc_f32_u = retasmFunc.no_dce_i64_trunc_f32_u;
export var no_dce_i64_trunc_f64_s = retasmFunc.no_dce_i64_trunc_f64_s;
export var no_dce_i64_trunc_f64_u = retasmFunc.no_dce_i64_trunc_f64_u;
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
diff --git a/test/wasm2js/unaligned.2asm.js b/test/wasm2js/unaligned.2asm.js
index 4f3ffe8bd..bfcffadb9 100644
--- a/test/wasm2js/unaligned.2asm.js
+++ b/test/wasm2js/unaligned.2asm.js
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var bufferView;
@@ -31,8 +31,7 @@ import { setTempRet0 } from 'env';
f32ScratchView[2] = value;
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -54,6 +53,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -178,7 +178,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i32_load = retasmFunc.i32_load;
export var i64_load = retasmFunc.i64_load;
diff --git a/test/wasm2js/unaligned.2asm.js.opt b/test/wasm2js/unaligned.2asm.js.opt
index 3178bb364..701a839ea 100644
--- a/test/wasm2js/unaligned.2asm.js.opt
+++ b/test/wasm2js/unaligned.2asm.js.opt
@@ -1,4 +1,4 @@
-import { setTempRet0 } from 'env';
+import * as env from 'env';
var bufferView;
@@ -27,8 +27,7 @@ import { setTempRet0 } from 'env';
return f32ScratchView[2];
}
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var buffer = new ArrayBuffer(65536);
var HEAP8 = new Int8Array(buffer);
var HEAP16 = new Int16Array(buffer);
@@ -50,6 +49,7 @@ function asmFunc(importObject) {
var Math_sqrt = Math.sqrt;
var nan = NaN;
var infinity = Infinity;
+ var env = imports.env;
var setTempRet0 = env.setTempRet0;
var i64toi32_i32$HIGH_BITS = 0;
function $0() {
@@ -127,7 +127,7 @@ function asmFunc(importObject) {
}
var retasmFunc = asmFunc({
- setTempRet0,
+ "env": env,
});
export var i32_load = retasmFunc.i32_load;
export var i64_load = retasmFunc.i64_load;
diff --git a/test/wasm2js/unary-ops.2asm.js b/test/wasm2js/unary-ops.2asm.js
index f5b97ad1e..f00d4a388 100644
--- a/test/wasm2js/unary-ops.2asm.js
+++ b/test/wasm2js/unary-ops.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unary-ops.2asm.js.opt b/test/wasm2js/unary-ops.2asm.js.opt
index 44c4c59c0..4da12af66 100644
--- a/test/wasm2js/unary-ops.2asm.js.opt
+++ b/test/wasm2js/unary-ops.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unreachable-get-cycle.2asm.js b/test/wasm2js/unreachable-get-cycle.2asm.js
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/unreachable-get-cycle.2asm.js
+++ b/test/wasm2js/unreachable-get-cycle.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unreachable-get-cycle.2asm.js.opt b/test/wasm2js/unreachable-get-cycle.2asm.js.opt
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/unreachable-get-cycle.2asm.js.opt
+++ b/test/wasm2js/unreachable-get-cycle.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unreachable-insts.2asm.js b/test/wasm2js/unreachable-insts.2asm.js
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/unreachable-insts.2asm.js
+++ b/test/wasm2js/unreachable-insts.2asm.js
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unreachable-insts.2asm.js.opt b/test/wasm2js/unreachable-insts.2asm.js.opt
index 35bd685e8..91dfa174c 100644
--- a/test/wasm2js/unreachable-insts.2asm.js.opt
+++ b/test/wasm2js/unreachable-insts.2asm.js.opt
@@ -1,6 +1,5 @@
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unreachable-later.2asm.js b/test/wasm2js/unreachable-later.2asm.js
index a8b05658d..e3fd358d0 100644
--- a/test/wasm2js/unreachable-later.2asm.js
+++ b/test/wasm2js/unreachable-later.2asm.js
@@ -1,8 +1,7 @@
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
diff --git a/test/wasm2js/unreachable-later.2asm.js.opt b/test/wasm2js/unreachable-later.2asm.js.opt
index 8adbd1efd..c6a2de682 100644
--- a/test/wasm2js/unreachable-later.2asm.js.opt
+++ b/test/wasm2js/unreachable-later.2asm.js.opt
@@ -1,8 +1,7 @@
function wasm2js_trap() { throw new Error('abort'); }
-function asmFunc(importObject) {
- var env = importObject.env || importObject;
+function asmFunc(imports) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;