Skip to content

Commit dda2d7b

Browse files
authored
Add pros and cons of the two proposals (WebAssembly#63)
1 parent 1cc5ba0 commit dda2d7b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

proposals/Exceptions.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,3 +724,30 @@ follows:
724724

725725
The event names subsection is a `name_map` which assigns names to a subset of
726726
the event indices (Used for both imports and module-defined).
727+
728+
729+
---
730+
731+
## Comparisons of the two proposals
732+
733+
- Proposal 2 is more expressive and possibly provides more flexibility
734+
for future frontend developers for other languages.
735+
736+
- As Proposal 2 introduces first-class exception reference type, we have to
737+
manage lifetime of exception objects, from which arises several questions.
738+
- How do we manage exception objects' lifetime in non-GC embeddings? Do we
739+
make reference counting mandatory?
740+
- Who is responsible for deleting exception objects?
741+
- What should we do for except_ref values of invalid exception objects already
742+
deleted?
743+
- How should exception reference type be related to the existing reference
744+
type or GC proposal?
745+
746+
- In Proposal 2, the unwinder must stop at every call stack frame with `catch`
747+
instruction because the tag matching happens within a `catch` block, whereas
748+
in Proposal 1 the unwinder does not need to stop at call stack frames that
749+
do not contain `catch`s with the current exception's tag. Stopping at every
750+
call frame might degrade performance.
751+
752+
- It is suggested that Proposal 2 may be more compatible with effect handlers,
753+
which can be might be added to wasm in the future.

0 commit comments

Comments
 (0)