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
Implementation limits #15
Comments
IIRC V8 had a placeholder limit of 1000 values on the stack and @askeksa-google was running into that limit using I suspect that users will want to push If we additionally want a limit on the byte length of initializers, it should be high enough that it is not possible to reach with an |
I think we should not have too[1] small a limit on initializer expressions. For example, Virgil generates binaries that include a full initialized heap snapshot. When targeting the JVM, it generates code that creates that initial heap snapshot. It's now routine to exceed the 64KB method size limitation of the JVM, and that's a pain because the compiler must split the initialization across multiple functions. Virgil runs on Wasm linear memory now, so this is no issue for data segments, but when ported to Wasm GC it would be unfortunate to have to do the same workaround as the JVM. [1] I do agree there needs to be a limit though. IIRC we have a limit on the total size of a module, so initializers should be an appreciable fraction of that. |
The limitation that I ran into for dart2wasm was the limit of 10000 elements for A byte limit for initializer expressions would be difficult to work around for producers, since the byte size of an initializer is difficult (or, at best, cumbersome) to predict before generating it. If we must have one, I'd say that a reasonable size would be the same as the limit on the size of a function body, which is 7654321 bytes. |
I think we can add a length limit for If it seems like 10_000 bytes is too small, we can probably go with the function body limit of 7654321 bytes. There's a nice symmetry there. |
This was discussed in the CG meeting. The spec should be extended to have new entries for possible implementation limits around extended constants [1] and the JS-API should specify what those limits are for JS embeddings [2].
I propose a limit of 10000 bytes for the size of a initializer expression. But I'm interested in hearing if this is already surpassed by GC proposal users. @tlively do you know if that's the case?
[1] https://webassembly.github.io/spec/core/appendix/implementation.html
[2] https://webassembly.github.io/spec/js-api/index.html#limits
The text was updated successfully, but these errors were encountered: