Skip to content

Commit

Permalink
Continue transition from asm to wasmExports. NFC
Browse files Browse the repository at this point in the history
I missed a few cases back in #19816.  This change completely the
transition saving even more on code size.
  • Loading branch information
sbc100 committed Jul 26, 2023
1 parent fecf679 commit d54e9d9
Show file tree
Hide file tree
Showing 42 changed files with 42 additions and 43 deletions.
4 changes: 2 additions & 2 deletions emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ def install_wrapper(sym):
args = ', '.join(args)
wrapper += f"({args}) => ({mangled} = {exported}wasmExports['{name}'])({args});"
else:
wrapper += 'asm["%s"]' % name
wrapper += 'wasmExports["%s"]' % name

wrappers.append(wrapper)
return wrappers
Expand Down Expand Up @@ -815,7 +815,7 @@ def create_module(receiving, metadata, library_symbols):
module.append('Asyncify.instrumentWasmImports(wasmImports);\n')

if not settings.MINIMAL_RUNTIME:
module.append("var asm = createWasm();\n")
module.append("var wasmExports = createWasm();\n")

module.append(receiving)
if settings.SUPPORT_LONGJMP == 'emscripten' or not settings.DISABLE_EXCEPTION_CATCHING:
Expand Down
1 change: 0 additions & 1 deletion src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ if (typeof WebAssembly != 'object') {
// Wasm globals
var wasmMemory;
var wasmExports;
#if SHARED_MEMORY
// For sending to workers.
Expand Down
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_ctors1.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25131
25125
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_ctors2.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25099
25093
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_except.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29309
29302
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_except_wasm.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24899
24893
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_mangle.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
29308
29301
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_noexcept.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25131
25125
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_cxx_wasmfs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12738
12731
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_files_js_fs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20006
20000
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_files_wasmfs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7248
7242
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_O0.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23618
23613
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_O1.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8099
8094
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_O2.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5753
5747
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_O3.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5599
5593
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_Os.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5599
5593
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_Oz.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5566
5559
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_dylink.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14947
14946
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4387
4381
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_hello_wasmfs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5599
5593
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4884
4878
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4943
4937
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5774
5768
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3_grow.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6094
6088
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5524
5519
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_mem_O3_standalone.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5454
5449
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4931
4929
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4943
4937
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4943
4937
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_64.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3800
3798
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_O0.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20085
20084
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_O1.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4581
4580
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_O2.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3504
3502
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_O3.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3433
3431
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_Os.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3433
3431
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_Oz-ctors.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3418
3416
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_Oz.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3433
3431
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_pthreads.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14536
14534
2 changes: 1 addition & 1 deletion test/other/metadce/test_metadce_minimal_wasmfs.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3433
3431
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
58278
58269
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_no_asserts.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
31987
31978
2 changes: 1 addition & 1 deletion test/other/test_unoptimized_code_size_strict.js.size
Original file line number Diff line number Diff line change
@@ -1 +1 @@
57244
57235

0 comments on commit d54e9d9

Please sign in to comment.