Skip to content

Commit

Permalink
Change element segment encoding (WebAssembly#108)
Browse files Browse the repository at this point in the history
* Change element segment encoding

* Change table index letter
  • Loading branch information
gahaas authored and binji committed Aug 1, 2019
1 parent 820bd12 commit aadc467
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions document/core/binary/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,18 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
\production{element section} & \Belemsec &::=&
\X{seg}^\ast{:}\Bsection_9(\Bvec(\Belem)) &\Rightarrow& \X{seg} \\
\production{element segment} & \Belem &::=&
\hex{00}~~e{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
&\Rightarrow& \{ \ETABLE~0, \EOFFSET~e, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\ &&|&
\hex{01}~~\X{et}:\Belemtype~e^\ast{:}\Bvec(\Belemexpr)
\hex{00}~~o{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
&\Rightarrow& \{ \ETABLE~0, \EOFFSET~o, \ETYPE~\FUNCREF, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\ &&|&
\hex{01}~~\hex{00}~~y^\ast{:}\Bvec(\Bfuncidx)
&\Rightarrow& \{ \ETYPE~\FUNCREF, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\ &&|&
\hex{02}~~x{:}\Btableidx~~o{:}\Bexpr~~\hex{00}~~y^\ast{:}\Bvec(\Bfuncidx)
&\Rightarrow& \{ \ETABLE~x, \EOFFSET~o, \ETYPE~\FUNCREF, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\ &&|&
\hex{04}~~o{:}\Bexpr~e^\ast{:}\Bvec(\Belemexpr)
&\Rightarrow& \{ \ETABLE~0, \EOFFSET~o, \ETYPE~\FUNCREF, \EINIT~e^\ast \} \\ &&|&
\hex{05}~~\X{et}:\Belemtype~~e^\ast{:}\Bvec(\Belemexpr)
&\Rightarrow& \{ \ETYPE~et, \EINIT~e^\ast \} \\ &&|&
\hex{02}~~x{:}\Btableidx~~e{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
&\Rightarrow& \{ \ETABLE~x, \EOFFSET~e, \EINIT~((\REFFUNC~y)~\END)^\ast \} \\
\hex{06}~~x{:}\Btableidx~~o{:}\Bexpr~~\X{et}:\Belemtype~~e^\ast{:}\Bvec(\Belemexpr)
&\Rightarrow& \{ \ETABLE~x, \EOFFSET~o, \ETYPE~et, \EINIT~e^\ast \} \\
\production{elemexpr} & \Belemexpr &::=&
\hex{D0}~\hex{0B} &\Rightarrow& \REFNULL~\END \\ &&|&
\hex{D2}~x{:}\Bfuncidx~\hex{0B} &\Rightarrow& (\REFFUNC~x)~\END \\
Expand Down

0 comments on commit aadc467

Please sign in to comment.