-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[wasm] Make jiterpreter module size limit configurable + clean up technical debt #107318
Conversation
…ng jiterp codegen Add missing overflow checks to blob builder appends Make maximum trace size a runtime option Move blob builder capacity to a named constant near the top of the file
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
Incidentally, I tested size limits of 40960 and 16384 against the current limit of 4096. A size limit of 16384 seems to be a good balance, where it reduces the number of traces compiled while significantly reducing the number of bailouts caused by failed branches. The amount of code generated goes up, but it doesn't seem to meaningfully increase time spent compiling or generating WASM:
I think it would make sense to raise the limit in NET10 to at least 16KB, maybe more, as a step towards reducing the limit entirely. The logic for the limit is really complicated and could likely be replaced with something much simpler to remove some technical debt from the jiterpreter. |
…hnical debt (dotnet#107318) Fix spurious "block stack not empty" errors when an error occurs during jiterp codegen Add missing overflow checks to blob builder appends Make maximum trace size a runtime option Move blob builder capacity to a named constant near the top of the file
…hnical debt (dotnet#107318) Fix spurious "block stack not empty" errors when an error occurs during jiterp codegen Add missing overflow checks to blob builder appends Make maximum trace size a runtime option Move blob builder capacity to a named constant near the top of the file
…hnical debt (dotnet#107318) Fix spurious "block stack not empty" errors when an error occurs during jiterp codegen Add missing overflow checks to blob builder appends Make maximum trace size a runtime option Move blob builder capacity to a named constant near the top of the file
At present the jiterpreter has a hard-coded module size limit of approximately 4KB. This is because Chrome used to limit synchronously compiled modules to this size. As of Chrome 114 this is no longer the case (they raised the limit to a much, much bigger value we'll never hit.)
This PR makes the module size limit a configurable runtime option and cleans up some technical debt in the process (a couple missing bounds checks in the code generator, etc.)