-
Notifications
You must be signed in to change notification settings - Fork 36
Rename catch_br #133
Comments
I don't mind either way. Do people have objections or other suggestions for the name? (Do we need a vote for this? I guess not, right?) |
I also don't mind changing the name, but I must say I didn't realise that |
Yes, I think we should verify it too. Whether EDIT: I think this comment is misleading and incorrect; I posted a new explanation here: #133 (comment) |
@ioannad, a regular |
Taking the "skip over" interpretation of |
It does, but it counts other control constructs as well. That makes finding the target try in the control stack O(1) in an implementation instead of O(N), and doesn't require a separate try stack. |
That makes sense. Note then that with the "skip over" interpretation, there is no need for the target to be a |
FWIW, if we do determine that this construct is sufficiently different from |
@tlively, sounds good to me. Given that it's part of a larger try construct, @RossTate's suggestion about generalising this is interesting. It essentially turns this into a |
Interesting idea, @rossberg, although this |
Sorry, I think I said something incorrect in #133 (comment). What I intended was the immediate arg for Do people here mean we should also count other blocks/loops as well? I'm little confused, but if there's a good enough reason, I think we can consider that. |
When we have two-phase, @tlively I think |
I had also thought that (counting other blocks/loops) was the intended behavior until this thread. I think if the |
This updates the explainer text according to the new spec we agreed in the 09-15-2020 CG meeting. Some of the text is taken from [the first version](https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions-v1.md) of the proposal. I renamed `catch_br` to `delegate` based on the perceived consensus in WebAssembly#133. There are some minor issues that need clarification, some of which is currently being discussed in the repo: - `rethrow`'s immmediate (or label) argument. I made it match the status in the first proposal for now. I believe keeping it makes it more versatile and lets us handle more languages. - It is not clear whether `rethrow` and `delegate`'s label (=immediate) argument should count non-try block-like structures, such as blocks and loops. It is currently being discussed for `delegate`. - `delegate`'s opcode should be decided. We exhausted all control-flow opcodes that begin with `0x0`.
This updates the explainer text according to the new spec we agreed in the 09-15-2020 CG meeting. Some of the text is taken from [the first version](https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions-v1.md) of the proposal. I renamed `catch_br` to `delegate` based on the perceived consensus in WebAssembly#133. There are some minor issues that need clarification, some of which is currently being discussed in the repo: - `rethrow`'s immmediate (or label) argument. I made it match the status in the first proposal for now. I believe keeping it makes it more versatile and lets us handle more languages. - It is not clear whether `rethrow` and `delegate`'s label (=immediate) argument should count non-try block-like structures, such as blocks and loops. It is currently being discussed for `delegate`. - `delegate`'s opcode should be decided. We exhausted all control-flow opcodes that begin with `0x0`.
I first thought the label of Do people agree with this..? |
The new proposal overview has renamed I just want to make sure @aheejin agrees with the semantics given in this comment, i.e., that
With emphasis on the |
Sorry for the delayed reply. I think this makes sense. Then how do you think try
...
catch_all
end ? |
@aheejin, I understood that comment's phrase "does not include the n+1 immediately enclosing control constructs" as starting to count outside of the Having said that, I was surprised to see that comment with the "n+1"-interpretation. We had understood I was about to ask whether to make
|
@ioannad Sorry, I think I meant "n"-interpretation and not "n+1" one. So
In this code, even though we write it as So we can also think
So here |
@aheejin, but |
I mean that the |
@aheejin I agree that this makes sense. I'm happy we don't have to special case |
Yeah, then let's close this. I'll update the explainer about this. Thanks. |
This updates the explainer text according to the new spec we agreed in the 09-15-2020 CG meeting and discussions afterwards. The following are modifications and clarifications we made after the 09-15-2020 CG meeting, and the relevant issue posts, if any: https://github.com/WebAssembly/meetings/blob/master/main/2020/CG-09-15.md - `catch_br` wasm renamed to `delegate` (#133) - `rethrow` gains an immediate argument (#126) - Removed dependences on the reference types proposal and the multivalue proposal. The multivalue proposal was previously listed as dependent because 1. `try` is basically a `block`, so it can have multivalue input/output 2. `br_on_exn` can extract multiple values from a `block`. We don't have `br_on_exn` anymore, and I'm not sure 1 is a strong enough reason to make it a dependence. - Mention `rethrow` cannot rethrow exceptions caught by `unwind` (#142 and #137) - Mention some runtimes, especially web VMs, can attach stack traces to the exception object, implying stack traces are not required for all VMs - Update label/validation rules for `delegate` and `rethrow` (#146) - Finalize opcodes for `delegate` (0x18) and `catch_all` (0x19) (#145 and #147) I believe this resolves many previous issue threads, so I'll close them. Please reopen them if you think there are things left for discussions in those issues. Resolves #113, resolves #126, resolves #127, resolves #128, resolves #130, resolves #142, resolves #145, resolves #146, resolves #147.
The name
catch_br
is misleading, since it is not a branch in the regular sense. In particular,catch_br $l
jumps to a different place thanbr $l
. Possible suggestion:catch_delegate
.The text was updated successfully, but these errors were encountered: