-
Notifications
You must be signed in to change notification settings - Fork 16
Add resume_throw_ref to the explainer #132
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
Conversation
Give it opcode 0xe5 to be adjacent to `resume_throw` at 0xe4, and as a result bump `switch` to 0xe6. Redefine the execution semantics of `resume_throw` in terms of `resume_throw_ref`. As a drive-by, fix the nullability of reference operands in the initial introduction of each other instruction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo nits
aborted with `resume_throw`; directly switched to via `switch`; or | ||
partially applied with `cont.bind`. | ||
There are five different ways in which suspended continuations are | ||
consumed (`resume,resume_throw,resume_throw_ref,switch,cont.bind`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, while here:
consumed (`resume,resume_throw,resume_throw_ref,switch,cont.bind`). | |
consumed (`resume`, `resume_throw`, `resume_throw_ref`, `switch`, `cont.bind`). |
- iff `S.conts[ca] = epsilon` | ||
|
||
* `S; F; v^m (ref.cont ca) (resume_throw $ct $e hdl*) --> S''; F; prompt{hdl'*} E[(ref.exn |S'.exns|) throw_ref] end` | ||
* `S; F; (ref.null t) (ref.cont ca) (resume_throw_ref $ct hdl*) --> S; F; trap` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the rules non-overlapping:
* `S; F; (ref.null t) (ref.cont ca) (resume_throw_ref $ct hdl*) --> S; F; trap` | |
* `S; F; (ref.null t) (ref.cont ca) (resume_throw_ref $ct hdl*) --> S; F; trap` | |
- iff `S.conts[ca] = (E : n)` |
Can you bump the opcode in the implementation in this PR, too? The numbering will break in coordinating between tools that do use |
Give it opcode 0xe5 to be adjacent to
resume_throw
at 0xe4, and as aresult bump
switch
to 0xe6.Redefine the execution semantics of
resume_throw
in terms ofresume_throw_ref
.As a drive-by, fix the nullability of reference operands in the initial
introduction of each other instruction.