Repository navigation
Reuse Wasm locals in functions with exception handlers - #171
Closed
vishvananda wants to merge 1 commit into
Closed
vishvananda wants to merge 1 commit into
vishvananda wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functions containing
try_tableskipped Wasm local reuse. Exception-enabled programs therefore kept many more locals than needed. Track catch targets and add exceptional control-flow edges at throwing instructions, so local reuse also handles these functions safely.The frozen cppgm Wasm compiler drops from 349,888 to 110,213 declared locals. The largest function drops from 2,177 to 695 locals. A local WebKit A/B/B/A comparison improved OpenLara compilation from 9.29–10.32 seconds to 6.88–7.86 seconds. Every project object was identical. The Mac Safari comparison had large host-load changes and lost its final browser session, so it does not establish a reliable Mac speedup. Physical iPhone cold-run validation is still needed.
Add a PA37 fixture that checks normal returns, throws from two call sites, values kept across landing paths, and RAII cleanup. Its local-count limit fails before this fix (425 locals at O1).
Validation: PA37 224/224; strict report 11,313/11,313; debug-info tests; self-host through PA5; native inception; PA36 smoke; architecture, formatting, file and placement audits. WASI self-build matched all 467 objects and the final compiler. All 934 native/WASI x86 comparisons passed. All 290 OpenLara object hashes were unchanged. Harness and student-export validation are running. Native cycle measurements are inconclusive because A/A noise exceeds the 0.5% budget.
This PR is stacked on #170. Browser process reuse and heap growth are separate changes in that PR and the demo site.