-
Notifications
You must be signed in to change notification settings - Fork 36
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
exception lifetime question #287
Comments
I don't think so -- my understanding is that in a GC-less profile, exnref will be constrained so that runtimes can represent it as a copyable value type of reasonable size (a sum type / variant of any possible exception), rather than as a reference. In particular, in the GC-less profile, it will be malformed for a tag type to include an exnref param, and there will be an implementation-defined limit on the number of parameters in a tag type (distinct from the existing limit on the number of parameters in a function type) that could be set small enough so that a max-size serialized exception is small enough to keep as a value and copy as needed. Discussion here: #280 (comment) |
ok. |
I think that's probably right, although the rules haven't been written down formally yet afaik. I think plausibly the spec could say that the implementation-defined limit is on the total size of values in a tag type (rather than the number of values), and a reasonable value for the limit could be 16 bytes (one v128, two i64's, or four i32's) without breaking real modules in practice. |
What @keithw said. Note that his suggestion is just one possible implementation strategy. It would also be possible to reference-count them, since they cannot form cycles. A tracing of GC would of course be a correct implementation. Since Wasm up-until-now has no other GC requirement, adding GC of just With Wasm GC being now Phase 4, the tracing option would only apply in the no-gc profile that will be later defined. |
my understanding is that, funcref can already form cycles and exnref can be a part of such cycles. |
FYI, i implemented EH in toywasm that way. |
reading the latest overview https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md
to me, it seems that some kind of GC is assumed to track the lifetime of an exception referenced by exnref.
is it right?
The text was updated successfully, but these errors were encountered: