Skip to content

Commit 829e61e

Browse files
committed
Continue transition from asm to wasmExports. NFC
I missed a few cases back in #19816. This change completely the transition saving even more on code size.
1 parent fecf679 commit 829e61e

File tree

44 files changed

+46
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+46
-44
lines changed

emscripten.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ def install_wrapper(sym):
755755
args = ', '.join(args)
756756
wrapper += f"({args}) => ({mangled} = {exported}wasmExports['{name}'])({args});"
757757
else:
758-
wrapper += 'asm["%s"]' % name
758+
wrapper += 'wasmExports["%s"]' % name
759759

760760
wrappers.append(wrapper)
761761
return wrappers
@@ -815,7 +815,7 @@ def create_module(receiving, metadata, library_symbols):
815815
module.append('Asyncify.instrumentWasmImports(wasmImports);\n')
816816

817817
if not settings.MINIMAL_RUNTIME:
818-
module.append("var asm = createWasm();\n")
818+
module.append("var wasmExports = createWasm();\n")
819819

820820
module.append(receiving)
821821
if settings.SUPPORT_LONGJMP == 'emscripten' or not settings.DISABLE_EXCEPTION_CATCHING:

src/preamble.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ if (typeof WebAssembly != 'object') {
5353
// Wasm globals
5454

5555
var wasmMemory;
56-
var wasmExports;
5756

5857
#if SHARED_MEMORY
5958
// For sending to workers.

src/runtime_debug.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function missingGlobal(sym, msg) {
5353
}
5454

5555
missingGlobal('buffer', 'Please use HEAP8.buffer or wasmMemory.buffer');
56+
#if !MINIMAL_RUNTIME
57+
missingGlobal('asm', 'Please use wasmExports instead');
58+
#endif
5659

5760
function missingLibrarySymbol(sym) {
5861
if (typeof globalThis !== 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) {

test/interop/test_add_function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main(int argc, char **argv) {
2626
#if defined(GROWTH)
2727
EM_ASM({
2828
// Get an export that isn't in the table (we never took its address in C).
29-
var baz = asm["baz"];
29+
var baz = wasmExports["baz"];
3030
var tableSizeBefore = wasmTable.length;
3131
var bazIndex = addFunction(baz);
3232
assert(bazIndex >= tableSizeBefore, "we actually added it");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
25131
1+
25125
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
25099
1+
25093
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29309
1+
29302
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24899
1+
24893
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29308
1+
29301
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
25131
1+
25125

0 commit comments

Comments
 (0)