Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make_export_wrappers: Limit module exports to EXPORTED_FUNCTIONS #18564

Merged
merged 1 commit into from Jan 21, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 20, 2023

This is code size win in pretty much all cases since there are always a few wasm exports that don't need to be set on the module object.

@sbc100 sbc100 force-pushed the limit_exports branch 2 times, most recently from 585655d to e00c0b1 Compare January 20, 2023 16:53
@sbc100 sbc100 requested a review from kripken January 20, 2023 16:53
@sbc100 sbc100 force-pushed the limit_exports branch 6 times, most recently from f0e0047 to b70e491 Compare January 20, 2023 22:44
sbc100 added a commit that referenced this pull request Jan 20, 2023
Rather than relying on them being exported on the Module object we can
just can these function directly.

The deps here already exist in deps_info.py, but adding them here
increases robustness.

This change was split out from #18564 (which disabled the exporting
of all symbols by default on the Module object).
test/optimizer/applyDCEGraphRemovals.js Outdated Show resolved Hide resolved
@@ -584,6 +584,28 @@ function isDynamicDynCall(node) {
);
}

function isExportWrapperFunction(f) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment with some examples of what this detects.

tools/acorn-optimizer.js Outdated Show resolved Hide resolved
tools/acorn-optimizer.js Outdated Show resolved Hide resolved
sbc100 added a commit that referenced this pull request Jan 20, 2023
…18570)

Rather than relying on them being exported on the Module object we can
just can these function directly.

The deps here already exist in deps_info.py, but adding them here
increases robustness.

This change was split out from #18564 (which disabled the exporting
of all symbols by default on the Module object).
tools/acorn-optimizer.js Outdated Show resolved Hide resolved
This is code size win in pretty much all cases since thee are always
a few wasm exports that don't need to be set on the module object.
@sbc100 sbc100 merged commit 355b970 into main Jan 21, 2023
@sbc100 sbc100 deleted the limit_exports branch January 21, 2023 15:22
manxorist added a commit to OpenMPT/openmpt that referenced this pull request Jul 14, 2023
…g malloc and free by default (see <emscripten-core/emscripten#18564>). As memory needs to get transferred to and from libopenmpt in all use cases, these really should get exported. Revert Emscripten change by exporting these function manually. Fixes <#16>.

Patch-by: Essem <smswessem@gmail.com>


git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@19469 56274372-70c3-4bfc-bfc3-4c3a0b034d27
manxorist added a commit to OpenMPT/openmpt that referenced this pull request Jul 14, 2023
[Fix] build: Makefile: Emscripten: Emscripten 3.1.31 stopped exporting malloc and free by default (see <emscripten-core/emscripten#18564>). As memory needs to get transferred to and from libopenmpt in all use cases, these really should get exported. Revert Emscripten change by exporting these function manually. Fixes <#16>.
Patch-by: Essem <smswessem@gmail.com>
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@19470 56274372-70c3-4bfc-bfc3-4c3a0b034d27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants