Skip to content

Commit

Permalink
Merge branch 'main' into spec.soundness
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg committed Sep 12, 2023
2 parents 6ac373e + 5d31ec1 commit 3823205
Show file tree
Hide file tree
Showing 42 changed files with 757 additions and 462 deletions.
6 changes: 3 additions & 3 deletions document/core/appendix/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Added more precise types for references [#proposal-typedref]_.
* Extended :ref:`table definitions <syntax-table>` with optional initializer expression


.. index:: reference, reference type, heap type, field type, storage type, structure type, array type, composite type, sub type, recrusive type
.. index:: reference, reference type, heap type, field type, storage type, structure type, array type, composite type, sub type, recursive type

Garbage Collection
~~~~~~~~~~~~~~~~~~
Expand All @@ -182,15 +182,15 @@ Added managed reference types [#proposal-gc]_.

* New generic :ref:`reference instructions <syntax-instr-ref>`: |REFEQ|, |REFTEST|, |REFCAST|, |BRONCAST|, |BRONCASTFAIL|

* New :ref:`reference instructions <syntax-instr-ref>` for :ref:`unboxed scalars <syntax-i31>`: |I31NEW|, :math:`\I31GET\K{\_}\sx`
* New :ref:`reference instructions <syntax-instr-ref>` for :ref:`unboxed scalars <syntax-i31>`: |REFI31|, :math:`\I31GET\K{\_}\sx`

* New :ref:`reference instructions <syntax-instr-ref>` for :ref:`structure types <syntax-structtype>`: |STRUCTNEW|, |STRUCTNEWDEFAULT|, :math:`\STRUCTGET\K{\_}\sx^?`, |STRUCTSET|

* New :ref:`reference instructions <syntax-instr-ref>` for :ref:`array types <syntax-structtype>`: |ARRAYNEW|, |ARRAYNEWDEFAULT|, |ARRAYNEWFIXED|, |ARRAYNEWDATA|, |ARRAYNEWELEM|, :math:`\ARRAYGET\K{\_}\sx^?`, |ARRAYSET|, |ARRAYLEN|, |ARRAYFILL|, |ARRAYCOPY|, |ARRAYINITDATA|, |ARRAYINITELEM|

* New :ref:`reference instructions <syntax-instr-ref>` for converting :ref:`host types <syntax-externtype>`: |EXTERNINTERNALIZE|, |EXTERNEXTERNALIZE|

* Extended set of :ref:`constant instructions <valid-const>` with |I31NEW|, |STRUCTNEW|, |STRUCTNEWDEFAULT|, |ARRAYNEW|, |ARRAYNEWDEFAULT|, |ARRAYNEWFIXED|, |EXTERNINTERNALIZE|, |EXTERNEXTERNALIZE|, and |GLOBALGET| for any previously declared immutable :ref:`global <syntax-global>`
* Extended set of :ref:`constant instructions <valid-const>` with |REFI31|, |STRUCTNEW|, |STRUCTNEWDEFAULT|, |ARRAYNEW|, |ARRAYNEWDEFAULT|, |ARRAYNEWFIXED|, |EXTERNINTERNALIZE|, |EXTERNEXTERNALIZE|, and |GLOBALGET| for any previously declared immutable :ref:`global <syntax-global>`


.. [#proposal-signext]
Expand Down
34 changes: 34 additions & 0 deletions document/core/appendix/custom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Id Subsection
0 :ref:`module name <binary-modulenamesec>`
1 :ref:`function names <binary-funcnamesec>`
2 :ref:`local names <binary-localnamesec>`
4 :ref:`type names <binary-typenamesec>`
10 :ref:`field names <binary-fieldnamesec>`
== ===========================================

Each subsection may occur at most once, and in order of increasing id.
Expand Down Expand Up @@ -143,3 +145,35 @@ It consists of an :ref:`indirect name map <binary-indirectnamemap>` assigning lo
\production{local name subsection} & \Blocalnamesubsec &::=&
\Bnamesubsection_2(\Bindirectnamemap) \\
\end{array}
.. index:: type, type index
.. _binary-typenamesec:

Type Names
..............

The *type name subsection* has the id 4.
It consists of a :ref:`name map <binary-namemap>` assigning type names to :ref:`type indices <syntax-typeidx>`.

.. math::
\begin{array}{llclll}
\production{type name subsection} & \Btypenamesubsec &::=&
\Bnamesubsection_1(\Bnamemap) \\
\end{array}
.. index:: type, field, type index, field index
.. _binary-fieldnamesec:

Field Names
...........

The *field name subsection* has the id 10.
It consists of an :ref:`indirect name map <binary-indirectnamemap>` assigning field names to :ref:`field indices <syntax-fieldidx>` grouped by :ref:`type indices <syntax-typeidx>`.

.. math::
\begin{array}{llclll}
\production{field name subsection} & \Bfieldnamesubsec &::=&
\Bnamesubsection_2(\Bindirectnamemap) \\
\end{array}
91 changes: 57 additions & 34 deletions document/core/appendix/index-instructions.py

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions document/core/appendix/index-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,31 @@ Category Constructor
:ref:`Number type <syntax-numtype>` |F32| :math:`\hex{7D}` (-3 as |Bs7|)
:ref:`Number type <syntax-numtype>` |F64| :math:`\hex{7C}` (-4 as |Bs7|)
:ref:`Vector type <syntax-vectype>` |V128| :math:`\hex{7B}` (-5 as |Bs7|)
:ref:`Packed type <syntax-packedtype>` |I8| :math:`\hex{7A}` (-6 as |Bs7|)
:ref:`Packed type <syntax-packedtype>` |I16| :math:`\hex{79}` (-7 as |Bs7|)
(reserved) :math:`\hex{78}` .. :math:`\hex{71}`
(reserved) :math:`\hex{7a}` .. :math:`\hex{79}`
:ref:`Packed type <syntax-packedtype>` |I8| :math:`\hex{78}` (-8 as |Bs7|)
:ref:`Packed type <syntax-packedtype>` |I16| :math:`\hex{77}` (-9 as |Bs7|)
(reserved) :math:`\hex{78}` .. :math:`\hex{74}`
:ref:`Heap type <syntax-heaptype>` |NOFUNC| :math:`\hex{73}` (-13 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |NOEXTERN| :math:`\hex{72}` (-14 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |NONE| :math:`\hex{71}` (-15 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |FUNC| :math:`\hex{70}` (-16 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |EXTERN| :math:`\hex{6F}` (-17 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |ANY| :math:`\hex{6E}` (-18 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |EQT| :math:`\hex{6D}` (-19 as |Bs7|)
:ref:`Reference type <syntax-reftype>` |REF| |NULL| :math:`\hex{6C}` (-20 as |Bs7|)
:ref:`Reference type <syntax-reftype>` |REF| :math:`\hex{6B}` (-21 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |I31| :math:`\hex{6A}` (-22 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |NOFUNC| :math:`\hex{69}` (-23 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |NOEXTERN| :math:`\hex{68}` (-24 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |STRUCT| :math:`\hex{67}` (-25 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |ARRAY| :math:`\hex{66}` (-26 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |NONE| :math:`\hex{65}` (-27 as |Bs7|)
(reserved) :math:`\hex{64}` .. :math:`\hex{61}`
:ref:`Heap type <syntax-heaptype>` |I31| :math:`\hex{6C}` (-20 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |STRUCT| :math:`\hex{6B}` (-21 as |Bs7|)
:ref:`Heap type <syntax-heaptype>` |ARRAY| :math:`\hex{6A}` (-22 as |Bs7|)
(reserved) :math:`\hex{69}` .. :math:`\hex{65}`
:ref:`Reference type <syntax-reftype>` |REF| :math:`\hex{64}` (-28 as |Bs7|)
:ref:`Reference type <syntax-reftype>` |REF| |NULL| :math:`\hex{63}` (-29 as |Bs7|)
(reserved) :math:`\hex{62}` .. :math:`\hex{61}`
:ref:`Composite type <syntax-comptype>` :math:`\TFUNC~[\valtype^\ast] \toF[\valtype^\ast]` :math:`\hex{60}` (-32 as |Bs7|)
:ref:`Composite type <syntax-comptype>` :math:`\TSTRUCT~\fieldtype^\ast` :math:`\hex{5F}` (-33 as |Bs7|)
:ref:`Composite type <syntax-comptype>` :math:`\TARRAY~\fieldtype` :math:`\hex{5E}` (-34 as |Bs7|)
(reserved) :math:`\hex{5D}` .. :math:`\hex{51}`
:ref:`Sub type <syntax-subtype>` :math:`\TSUB~\typeidx^\ast~\comptype` :math:`\hex{50}` (-48 as |Bs7|)
:ref:`Recursive type <syntax-rectype>` :math:`\TREC~\subtype^\ast` :math:`\hex{4F}` (-49 as |Bs7|)
:ref:`Sub type <syntax-subtype>` :math:`\TSUB~\TFINAL~\typeidx^\ast~\comptype` :math:`\hex{4E}` (-50 as |Bs7|)
:ref:`Sub type <syntax-subtype>` :math:`\TSUB~\TFINAL~\typeidx^\ast~\comptype` :math:`\hex{4F}` (-49 as |Bs7|)
:ref:`Recursive type <syntax-rectype>` :math:`\TREC~\subtype^\ast` :math:`\hex{4E}` (-50 as |Bs7|)
(reserved) :math:`\hex{4D}` .. :math:`\hex{41}`
:ref:`Result type <syntax-resulttype>` :math:`[\epsilon]` :math:`\hex{40}` (-64 as |Bs7|)
:ref:`Table type <syntax-tabletype>` :math:`\limits~\reftype` (none)
Expand Down
68 changes: 34 additions & 34 deletions document/core/binary/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ Control Instructions
\hex{13}~~y{:}\Btypeidx~~x{:}\Btableidx &\Rightarrow& \RETURNCALLINDIRECT~x~y \\ &&|&
\hex{14}~~x{:}\Btypeidx &\Rightarrow& \CALLREF~x \\ &&|&
\hex{15}~~x{:}\Btypeidx &\Rightarrow& \RETURNCALLREF~x \\ &&|&
\hex{D4}~~l{:}\Blabelidx &\Rightarrow& \BRONNULL~l \\ &&|&
\hex{D5}~~l{:}\Blabelidx &\Rightarrow& \BRONNULL~l \\ &&|&
\hex{D6}~~l{:}\Blabelidx &\Rightarrow& \BRONNONNULL~l \\ &&|&
\hex{FB}~~78{:}\Bu32~~(\NULL_1^?,\NULL_2^?){:}\Bcastflags\\&&&~~~~l{:}\Blabelidx~~\X{ht}_1{:}\Bheaptype~~\X{ht}_2{:}\Bheaptype &\Rightarrow& \BRONCAST~l~(\REF~\NULL_1^?~\X{ht}_1)~(\REF~\NULL_2^?~\X{ht}_2) \\ &&|&
\hex{FB}~~79{:}\Bu32~~(\NULL_1^?,\NULL_2^?){:}\Bcastflags\\&&&~~~~l{:}\Blabelidx~~\X{ht}_1{:}\Bheaptype~~\X{ht}_2{:}\Bheaptype &\Rightarrow& \BRONCASTFAIL~l~(\REF~\NULL_1^?~\X{ht}_1)~(\REF~\NULL_2^?~\X{ht}_2) \\
\hex{FB}~~24{:}\Bu32~~(\NULL_1^?,\NULL_2^?){:}\Bcastflags\\&&&~~~~l{:}\Blabelidx~~\X{ht}_1{:}\Bheaptype~~\X{ht}_2{:}\Bheaptype &\Rightarrow& \BRONCAST~l~(\REF~\NULL_1^?~\X{ht}_1)~(\REF~\NULL_2^?~\X{ht}_2) \\ &&|&
\hex{FB}~~25{:}\Bu32~~(\NULL_1^?,\NULL_2^?){:}\Bcastflags\\&&&~~~~l{:}\Blabelidx~~\X{ht}_1{:}\Bheaptype~~\X{ht}_2{:}\Bheaptype &\Rightarrow& \BRONCASTFAIL~l~(\REF~\NULL_1^?~\X{ht}_1)~(\REF~\NULL_2^?~\X{ht}_2) \\
\production{cast flags} & \Bcastflags &::=&
0{:}\Bu8 &\Rightarrow& (\epsilon, \epsilon) \\ &&|&
1{:}\Bu8 &\Rightarrow& (\NULL, \epsilon) \\ &&|&
Expand Down Expand Up @@ -126,7 +126,7 @@ Generic :ref:`reference instructions <syntax-instr-ref>` are represented by sing
.. _binary-array.copy:
.. _binary-array.init_data:
.. _binary-array.init_elem:
.. _binary-i31.new:
.. _binary-ref.i31:
.. _binary-i31.get_s:
.. _binary-i31.get_u:
.. _binary-ref.test:
Expand All @@ -140,37 +140,37 @@ Generic :ref:`reference instructions <syntax-instr-ref>` are represented by sing
\hex{D0}~~t{:}\Bheaptype &\Rightarrow& \REFNULL~t \\ &&|&
\hex{D1} &\Rightarrow& \REFISNULL \\ &&|&
\hex{D2}~~x{:}\Bfuncidx &\Rightarrow& \REFFUNC~x \\ &&|&
\hex{D3} &\Rightarrow& \REFASNONNULL \\ &&|&
\hex{D5} &\Rightarrow& \REFEQ \\ &&|&
\hex{FB}~~1{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \STRUCTNEW~x \\ &&|&
\hex{FB}~~2{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \STRUCTNEWDEFAULT~x \\ &&|&
\hex{FB}~~3{:}\Bu32~~x{:}\Btypeidx~~i{:}\Bu32 &\Rightarrow& \STRUCTGET~x~i \\ &&|&
\hex{FB}~~4{:}\Bu32~~x{:}\Btypeidx~~i{:}\Bu32 &\Rightarrow& \STRUCTGETS~x~i \\ &&|&
\hex{FB}~~5{:}\Bu32~~x{:}\Btypeidx~~i{:}\Bu32 &\Rightarrow& \STRUCTGETU~x~i \\ &&|&
\hex{FB}~~6{:}\Bu32~~x{:}\Btypeidx~~i{:}\Bu32 &\Rightarrow& \STRUCTSET~x~i \\ &&|&
\hex{D3} &\Rightarrow& \REFEQ \\ &&|&
\hex{D4} &\Rightarrow& \REFASNONNULL \\ &&|&
\hex{FB}~~0{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \STRUCTNEW~x \\ &&|&
\hex{FB}~~1{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \STRUCTNEWDEFAULT~x \\ &&|&
\hex{FB}~~2{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bfieldidx &\Rightarrow& \STRUCTGET~x~y \\ &&|&
\hex{FB}~~3{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bfieldidx &\Rightarrow& \STRUCTGETS~x~y \\ &&|&
\hex{FB}~~4{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bfieldidx &\Rightarrow& \STRUCTGETU~x~y \\ &&|&
\hex{FB}~~5{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bfieldidx &\Rightarrow& \STRUCTSET~x~y \\ &&|&
\hex{FB}~~6{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYNEW~x \\ &&|&
\hex{FB}~~7{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYNEWDEFAULT~x \\ &&|&
\hex{FB}~~8{:}\Bu32~~x{:}\Btypeidx~~n{:}\Bu32 &\Rightarrow& \ARRAYNEWFIXED~x~n \\ &&|&
\hex{FB}~~9{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bdataidx &\Rightarrow& \ARRAYNEWDATA~x~y \\ &&|&
\hex{FB}~~10{:}\Bu32~~x{:}\Btypeidx~~y{:}\Belemidx &\Rightarrow& \ARRAYNEWELEM~x~y \\ &&|&
\hex{FB}~~11{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYGET~x \\ &&|&
\hex{FB}~~12{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYGETS~x \\ &&|&
\hex{FB}~~13{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYGETU~x \\ &&|&
\hex{FB}~~14{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYSET~x \\ &&|&
\hex{FB}~~15{:}\Bu32 &\Rightarrow& \ARRAYLEN \\ &&|&
\hex{FB}~~16{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYFILL~x \\ &&|&
\hex{FB}~~17{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYNEW~x \\ &&|&
\hex{FB}~~18{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYNEWDEFAULT~x \\ &&|&
\hex{FB}~~19{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYGET~x \\ &&|&
\hex{FB}~~20{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYGETS~x \\ &&|&
\hex{FB}~~21{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYGETU~x \\ &&|&
\hex{FB}~~22{:}\Bu32~~x{:}\Btypeidx &\Rightarrow& \ARRAYSET~x \\ &&|&
\hex{FB}~~23{:}\Bu32 &\Rightarrow& \ARRAYLEN \\ &&|&
\hex{FB}~~24{:}\Bu32~~x{:}\Btypeidx~~y{:}\Btypeidx &\Rightarrow& \ARRAYCOPY~x~y \\ &&|&
\hex{FB}~~25{:}\Bu32~~x{:}\Btypeidx~~n{:}\Bu32 &\Rightarrow& \ARRAYNEWFIXED~x~n \\ &&|&
\hex{FB}~~27{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bdataidx &\Rightarrow& \ARRAYNEWDATA~x~y \\ &&|&
\hex{FB}~~28{:}\Bu32~~x{:}\Btypeidx~~y{:}\Belemidx &\Rightarrow& \ARRAYNEWELEM~x~y \\ &&|&
\hex{FB}~~32{:}\Bu32 &\Rightarrow& \I31NEW \\ &&|&
\hex{FB}~~33{:}\Bu32 &\Rightarrow& \I31GETS \\ &&|&
\hex{FB}~~34{:}\Bu32 &\Rightarrow& \I31GETU \\ &&|&
\hex{FB}~~64{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFTEST~(\REF~\X{ht}) \\ &&|&
\hex{FB}~~65{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFCAST~(\REF~\X{ht}) \\ &&|&
\hex{FB}~~72{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFTEST~(\REF~\NULL~\X{ht}) \\ &&|&
\hex{FB}~~73{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFCAST~(\REF~\NULL~\X{ht}) \\ &&|&
\hex{FB}~~84{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bdataidx &\Rightarrow& \ARRAYINITDATA~x~y \\ &&|&
\hex{FB}~~85{:}\Bu32~~x{:}\Btypeidx~~y{:}\Belemidx &\Rightarrow& \ARRAYINITELEM~x~y \\ &&|&
\hex{FB}~~112{:}\Bu32 &\Rightarrow& \EXTERNINTERNALIZE \\ &&|&
\hex{FB}~~113{:}\Bu32 &\Rightarrow& \EXTERNEXTERNALIZE \\
\hex{FB}~~17{:}\Bu32~~x{:}\Btypeidx~~y{:}\Btypeidx &\Rightarrow& \ARRAYCOPY~x~y \\ &&|&
\hex{FB}~~18{:}\Bu32~~x{:}\Btypeidx~~y{:}\Bdataidx &\Rightarrow& \ARRAYINITDATA~x~y \\ &&|&
\hex{FB}~~19{:}\Bu32~~x{:}\Btypeidx~~y{:}\Belemidx &\Rightarrow& \ARRAYINITELEM~x~y \\ &&|&
\hex{FB}~~20{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFTEST~(\REF~\X{ht}) \\ &&|&
\hex{FB}~~21{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFTEST~(\REF~\NULL~\X{ht}) \\ &&|&
\hex{FB}~~22{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFCAST~(\REF~\X{ht}) \\ &&|&
\hex{FB}~~23{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFCAST~(\REF~\NULL~\X{ht}) \\ &&|&
\hex{FB}~~26{:}\Bu32 &\Rightarrow& \EXTERNINTERNALIZE \\ &&|&
\hex{FB}~~27{:}\Bu32 &\Rightarrow& \EXTERNEXTERNALIZE \\ &&|&
\hex{FB}~~28{:}\Bu32 &\Rightarrow& \REFI31 \\ &&|&
\hex{FB}~~29{:}\Bu32 &\Rightarrow& \I31GETS \\ &&|&
\hex{FB}~~30{:}\Bu32 &\Rightarrow& \I31GETU \\
\end{array}
Expand Down
5 changes: 4 additions & 1 deletion document/core/binary/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ except that :ref:`function definitions <syntax-func>` are split into two section
This separation enables *parallel* and *streaming* compilation of the functions in a module.


.. index:: index, type index, function index, table index, memory index, global index, element index, data index, local index, label index
.. index:: index, type index, function index, table index, memory index, global index, element index, data index, local index, label index, field index
pair: binary format; type index
pair: binary format; function index
pair: binary format; table index
Expand All @@ -19,6 +19,7 @@ except that :ref:`function definitions <syntax-func>` are split into two section
pair: binary format; data index
pair: binary format; local index
pair: binary format; label index
pair: binary format; field index
.. _binary-typeidx:
.. _binary-funcidx:
.. _binary-tableidx:
Expand All @@ -28,6 +29,7 @@ except that :ref:`function definitions <syntax-func>` are split into two section
.. _binary-dataidx:
.. _binary-localidx:
.. _binary-labelidx:
.. _binary-fieldidx:
.. _binary-index:

Indices
Expand All @@ -46,6 +48,7 @@ All :ref:`indices <syntax-index>` are encoded with their respective value.
\production{data index} & \Bdataidx &::=& x{:}\Bu32 &\Rightarrow& x \\
\production{local index} & \Blocalidx &::=& x{:}\Bu32 &\Rightarrow& x \\
\production{label index} & \Blabelidx &::=& l{:}\Bu32 &\Rightarrow& l \\
\production{field index} & \Bfieldidx &::=& x{:}\Bu32 &\Rightarrow& x \\
\end{array}
Expand Down
26 changes: 13 additions & 13 deletions document/core/binary/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ Heap Types
.. math::
\begin{array}{llclll@{\qquad\qquad}l}
\production{abstract heap type} & \Babsheaptype &::=&
\hex{65} &\Rightarrow& \NONE \\ &&|&
\hex{66} &\Rightarrow& \ARRAY \\ &&|&
\hex{67} &\Rightarrow& \STRUCT \\ &&|&
\hex{68} &\Rightarrow& \NOEXTERN \\ &&|&
\hex{69} &\Rightarrow& \NOFUNC \\ &&|&
\hex{6A} &\Rightarrow& \I31 \\ &&|&
\hex{6D} &\Rightarrow& \EQT \\ &&|&
\hex{6E} &\Rightarrow& \ANY \\ &&|&
\hex{73} &\Rightarrow& \NOFUNC \\ &&|&
\hex{72} &\Rightarrow& \NOEXTERN \\ &&|&
\hex{71} &\Rightarrow& \NONE \\ &&|&
\hex{70} &\Rightarrow& \FUNC \\ &&|&
\hex{6F} &\Rightarrow& \EXTERN \\ &&|&
\hex{70} &\Rightarrow& \FUNC \\
\hex{6E} &\Rightarrow& \ANY \\ &&|&
\hex{6D} &\Rightarrow& \EQT \\ &&|&
\hex{6C} &\Rightarrow& \I31 \\ &&|&
\hex{6B} &\Rightarrow& \STRUCT \\ &&|&
\hex{6A} &\Rightarrow& \ARRAY \\
\production{heap type} & \Bheaptype &::=&
\X{ht}{:}\Babsheaptype &\Rightarrow& \X{ht} \\ &&|&
x{:}\Bs33 &\Rightarrow& x & (\iff x \geq 0) \\
Expand All @@ -86,8 +86,8 @@ Reference Types
.. math::
\begin{array}{llclll@{\qquad\qquad}l}
\production{reference type} & \Breftype &::=&
\hex{6B}~~\X{ht}{:}\Bheaptype &\Rightarrow& \REF~\X{ht} \\ &&|&
\hex{6C}~~\X{ht}{:}\Bheaptype &\Rightarrow& \REF~\NULL~\X{ht} \\ &&|&
\hex{64}~~\X{ht}{:}\Bheaptype &\Rightarrow& \REF~\X{ht} \\ &&|&
\hex{63}~~\X{ht}{:}\Bheaptype &\Rightarrow& \REF~\NULL~\X{ht} \\ &&|&
\X{ht}{:}\Babsheaptype &\Rightarrow& \REF~\NULL~\X{ht} \\
\end{array}
Expand Down Expand Up @@ -185,9 +185,9 @@ Aggregate Types
t{:}\Bpackedtype
&\Rightarrow& t \\
\production{packed type} & \Bpackedtype &::=&
\hex{7A}
\hex{78}
&\Rightarrow& \I8 \\ &&|&
\hex{79}
\hex{77}
&\Rightarrow& \I16 \\
\end{array}
Expand Down
Loading

0 comments on commit 3823205

Please sign in to comment.