Skip to content

[wasm] Don't generate unused imports in jiterpreter traces - #83061

Merged
lewing merged 2 commits into
dotnet:mainfrom
kg:wasm-jiterpreter-unused-imports
Mar 7, 2023
Merged

[wasm] Don't generate unused imports in jiterpreter traces#83061
lewing merged 2 commits into
dotnet:mainfrom
kg:wasm-jiterpreter-unused-imports

Conversation

@kg

@kgkg commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

This PR restructures trace generation so that we generate the trace body before the rest of the module, which allows us to identify which imports are actually used and only emit those. This frees up more space for the actual trace and probably also makes instantiating the module a bit faster since it will typically have 1-8 imports instead of the dozens it does now. This should help a lot for #82963, and it also will allow #82773 to potentially do direct calls (by dynamically adding new imports) instead of indirect calls.

This PR also fixes a bug that was causing the heat estimation mode to undercount failed traces.

kg added 2 commits March 6, 2023 17:23
Generate functions into a temporary buffer before generating all the sections, so we know which imports are used
Fix estimateHeat
@ghost

ghost commented Mar 7, 2023

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

This PR restructures trace generation so that we generate the trace body before the rest of the module, which allows us to identify which imports are actually used and only emit those. This frees up more space for the actual trace and probably also makes instantiating the module a bit faster since it will typically have 1-8 imports instead of the dozens it does now. This should help a lot for #82963, and it also will allow #82773 to potentially do direct calls (by dynamically adding new imports) instead of indirect calls.

This PR also fixes a bug that was causing the heat estimation mode to undercount failed traces.

Author:kg
Assignees:-
Labels:

arch-wasm, area-Codegen-Jiterpreter-mono

Milestone:-

@lewing
lewing merged commit c9a7a2d into dotnet:mainMar 7, 2023
@ghostghost locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@kg@vargaz@lewing