From 69508720a277db7727cceb57943a4af34280c30c Mon Sep 17 00:00:00 2001 From: "Ioanna M. Dimitriou H" Date: Mon, 6 Mar 2023 15:46:26 +0100 Subject: [PATCH 1/4] Added "Exception Handling" entry to `document/core/appendix/changes.rst`. Please note: Apart from try-catch and try-delegate, all other instructions in `changes.rst` are given without the immediates or any arguments that follow them. Since try-catch and try-delegate are the only new structured block instructions I guessed it is ok to include the full form of these new instructions here. --- document/core/appendix/changes.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/document/core/appendix/changes.rst b/document/core/appendix/changes.rst index 339cb25f..d2bf502c 100644 --- a/document/core/appendix/changes.rst +++ b/document/core/appendix/changes.rst @@ -138,6 +138,24 @@ Added vector type and instructions that manipulate multiple numeric values in pa * New injection/projection :ref:`vector instructions `: :math:`\K{i}\!N\!\K{x}\!M\!\K{.splat}`, :math:`\K{f}\!N\!\K{x}\!M\!\K{.splat}`, :math:`\K{i}\!N\!\K{x}\!M\!\K{.bitmask}` +.. index:: instructions, exception, tag type, tag, handler + +Exception Handling +.................. + +Added tag type, instructions that throw exceptions of a tag type, and instructions that handle exceptions. [#proposal-eh]_ + +* New :ref:`tag type `: :math:`[t^\ast]\to[]`- + +* New :ref:`tag section ` in binary format. + +* New exception throwing :ref:`control instructions `: :math:`\THROW` and :math:`\RETHROW`. + +* New handler :ref:`control instructions `: :math:`\TRY~\bt~\instr^\ast~(\CATCH~\tagidx~\instr^\ast)^\ast~(\CATCHALL~\instr^\ast)^?\END`, :math:`\TRY~\bt~\instr^\ast~\DELEGATE~\labelidx`. + +* New uncaught exception :ref:`result `. + + .. [#proposal-signext] https://github.com/WebAssembly/spec/tree/main/proposals/sign-extension-ops/ @@ -155,3 +173,6 @@ Added vector type and instructions that manipulate multiple numeric values in pa .. [#proposal-vectype] https://github.com/WebAssembly/spec/tree/main/proposals/simd/ + +.. [#proposal-eh] + https://github.com/WebAssembly/spec/tree/main/proposals/exception-handling/ From aba5bf7d38f31e09b4ee4b611bdbffff3a3cd552 Mon Sep 17 00:00:00 2001 From: "Ioanna M. Dimitriou H" Date: Mon, 6 Mar 2023 20:16:00 +0100 Subject: [PATCH 2/4] More compact formulation for try-catch and try-delegate Fixes the build fail caused by the typo `\bt` (should have been `\blocktype`. --- document/core/appendix/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document/core/appendix/changes.rst b/document/core/appendix/changes.rst index d2bf502c..94c1f328 100644 --- a/document/core/appendix/changes.rst +++ b/document/core/appendix/changes.rst @@ -151,7 +151,7 @@ Added tag type, instructions that throw exceptions of a tag type, and instructio * New exception throwing :ref:`control instructions `: :math:`\THROW` and :math:`\RETHROW`. -* New handler :ref:`control instructions `: :math:`\TRY~\bt~\instr^\ast~(\CATCH~\tagidx~\instr^\ast)^\ast~(\CATCHALL~\instr^\ast)^?\END`, :math:`\TRY~\bt~\instr^\ast~\DELEGATE~\labelidx`. +* New handler :ref:`control instructions `: :math:`\TRY~\X{bt}~\instr_1^\ast~(\CATCH~x~\instr_2^\ast)^\ast~(\CATCHALL~\instr_3^\ast)^?\END`, :math:`\TRY~\X{bt}~\instr^\ast~\DELEGATE~l`. * New uncaught exception :ref:`result `. From c8775cde3f5008df702559bb4368266e2f571ca7 Mon Sep 17 00:00:00 2001 From: Ioanna M Dimitriou H <9728696+ioannad@users.noreply.github.com> Date: Fri, 17 Mar 2023 17:19:42 +0100 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Andreas Rossberg --- document/core/appendix/changes.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/document/core/appendix/changes.rst b/document/core/appendix/changes.rst index 94c1f328..24abd4cb 100644 --- a/document/core/appendix/changes.rst +++ b/document/core/appendix/changes.rst @@ -143,7 +143,7 @@ Added vector type and instructions that manipulate multiple numeric values in pa Exception Handling .................. -Added tag type, instructions that throw exceptions of a tag type, and instructions that handle exceptions. [#proposal-eh]_ +Added tag definitions, imports, and exports, and instructions to throw and catch exceptions [#proposal-eh]_ * New :ref:`tag type `: :math:`[t^\ast]\to[]`- @@ -151,7 +151,7 @@ Added tag type, instructions that throw exceptions of a tag type, and instructio * New exception throwing :ref:`control instructions `: :math:`\THROW` and :math:`\RETHROW`. -* New handler :ref:`control instructions `: :math:`\TRY~\X{bt}~\instr_1^\ast~(\CATCH~x~\instr_2^\ast)^\ast~(\CATCHALL~\instr_3^\ast)^?\END`, :math:`\TRY~\X{bt}~\instr^\ast~\DELEGATE~l`. +* New handler :ref:`control instructions `: :math:`(\TRY~\X{bt}~\instr_1^\ast~(\CATCH~x~\instr_2^\ast)^\ast~(\CATCHALL~\instr_3^\ast)^?\END)` and :math:`(\TRY~\X{bt}~\instr^\ast~\DELEGATE~l)`. * New uncaught exception :ref:`result `. @@ -174,5 +174,5 @@ Added tag type, instructions that throw exceptions of a tag type, and instructio .. [#proposal-vectype] https://github.com/WebAssembly/spec/tree/main/proposals/simd/ -.. [#proposal-eh] +.. [#proposal-exceptions] https://github.com/WebAssembly/spec/tree/main/proposals/exception-handling/ From d0ab214448a5658b95b819a1d1a1b05331df58a3 Mon Sep 17 00:00:00 2001 From: "Ioanna M. Dimitriou H" Date: Fri, 17 Mar 2023 17:31:55 +0100 Subject: [PATCH 4/4] Address review comments. --- document/core/appendix/changes.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/document/core/appendix/changes.rst b/document/core/appendix/changes.rst index 24abd4cb..16ea3ff7 100644 --- a/document/core/appendix/changes.rst +++ b/document/core/appendix/changes.rst @@ -143,17 +143,15 @@ Added vector type and instructions that manipulate multiple numeric values in pa Exception Handling .................. -Added tag definitions, imports, and exports, and instructions to throw and catch exceptions [#proposal-eh]_ +Added tag definitions, imports, and exports, and instructions to throw and catch exceptions [#proposal-exceptions]_ -* New :ref:`tag type `: :math:`[t^\ast]\to[]`- - -* New :ref:`tag section ` in binary format. +* Modules may :ref:`define `, :ref:`import `, and :ref:`export ` tags. * New exception throwing :ref:`control instructions `: :math:`\THROW` and :math:`\RETHROW`. * New handler :ref:`control instructions `: :math:`(\TRY~\X{bt}~\instr_1^\ast~(\CATCH~x~\instr_2^\ast)^\ast~(\CATCHALL~\instr_3^\ast)^?\END)` and :math:`(\TRY~\X{bt}~\instr^\ast~\DELEGATE~l)`. -* New uncaught exception :ref:`result `. +* New :ref:`tag section ` in binary format. .. [#proposal-signext]