Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 51c7216

Browse files
committed
Merge branch 'upstream' into merge-upstream
2 parents 4e16278 + e19508a commit 51c7216

File tree

8 files changed

+255
-847
lines changed

8 files changed

+255
-847
lines changed

document/core/appendix/embedding.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ Tables
323323

324324
.. _embed-table-alloc:
325325

326-
:math:`\F{table\_alloc}(\store, \tabletype) : (\store, \tableaddr, \reff)`
326+
:math:`\F{table\_alloc}(\store, \tabletype, \reff) : (\store, \tableaddr)`
327327
..........................................................................
328328

329329
1. Pre-condition: :math:`\tabletype` is :ref:`valid <valid-tabletype>`.

document/core/appendix/index-instructions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
441441
Instruction(r'\V128.\STORE\K{16\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{59}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
442442
Instruction(r'\V128.\STORE\K{32\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{5A}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
443443
Instruction(r'\V128.\STORE\K{64\_lane}~\memarg~\laneidx', r'\hex{FD}~~\hex{5B}', r'[\I32~\V128] \to []', r'valid-store-lane', r'exec-store-lane'),
444-
Instruction(r'\V128.\LOAD\K{32\_zero}~\memarg~\laneidx', r'\hex{FD}~~\hex{5C}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
445-
Instruction(r'\V128.\LOAD\K{64\_zero}~\memarg~\laneidx', r'\hex{FD}~~\hex{5D}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
444+
Instruction(r'\V128.\LOAD\K{32\_zero}~\memarg', r'\hex{FD}~~\hex{5C}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
445+
Instruction(r'\V128.\LOAD\K{64\_zero}~\memarg', r'\hex{FD}~~\hex{5D}', r'[\I32] \to [\V128]', r'valid-load-zero', r'exec-load-zero'),
446446
Instruction(r'\F32X4.\VDEMOTE\K{\_f64x2\_zero}', r'\hex{FD}~~\hex{5E}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-demote'),
447447
Instruction(r'\F64X2.\VPROMOTE\K{\_low\_f32x4}', r'\hex{FD}~~\hex{5F}', r'[\V128] \to [\V128]', r'valid-vcvtop', r'exec-vcvtop', r'op-promote'),
448448
Instruction(r'\I8X16.\VABS', r'\hex{FD}~~\hex{60}', r'[\V128] \to [\V128]', r'valid-vunop', r'exec-vunop', r'op-iabs'),

document/core/text/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ An :ref:`element segment <text-elem>` can be given inline with a table definitio
298298
\production{module field} &
299299
\text{(}~\text{table}~~\Tid^?~~\Treftype~~\text{(}~\text{elem}~~\expr^n{:}\Tvec(\Telemexpr)~\text{)}~\text{)} \quad\equiv \\ & \qquad
300300
\text{(}~\text{table}~~\Tid'~~n~~n~~\Treftype~\text{)} \\ & \qquad
301-
\text{(}~\text{elem}~~\text{(}~\text{table}~~\Tid'~\text{)}~~\text{(}~\text{i32.const}~~\text{0}~\text{)}~~\Tvec(\Telemexpr)~\text{)}
301+
\text{(}~\text{elem}~~\text{(}~\text{table}~~\Tid'~\text{)}~~\text{(}~\text{i32.const}~~\text{0}~\text{)}~~\Treftype~~\Tvec(\Telemexpr)~\text{)}
302302
\\ & \qquad\qquad
303303
(\iff \Tid^? \neq \epsilon \wedge \Tid' = \Tid^? \vee \Tid^? = \epsilon \wedge \Tid' \idfresh) \\
304304
\end{array}
@@ -308,7 +308,7 @@ An :ref:`element segment <text-elem>` can be given inline with a table definitio
308308
\production{module field} &
309309
\text{(}~\text{table}~~\Tid^?~~\Treftype~~\text{(}~\text{elem}~~x^n{:}\Tvec(\Tfuncidx)~\text{)}~\text{)} \quad\equiv \\ & \qquad
310310
\text{(}~\text{table}~~\Tid'~~n~~n~~\Treftype~\text{)} \\ & \qquad
311-
\text{(}~\text{elem}~~\text{(}~\text{table}~~\Tid'~\text{)}~~\text{(}~\text{i32.const}~~\text{0}~\text{)}~~\Tvec(\Tfuncidx)~\text{)}
311+
\text{(}~\text{elem}~~\text{(}~\text{table}~~\Tid'~\text{)}~~\text{(}~\text{i32.const}~~\text{0}~\text{)}~~\text{func}~~\Tvec(\Tfuncidx)~\text{)}
312312
\\ & \qquad\qquad
313313
(\iff \Tid^? \neq \epsilon \wedge \Tid' = \Tid^? \vee \Tid^? = \epsilon \wedge \Tid' \idfresh) \\
314314
\end{array}

document/js-api/index.bs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,32 +1415,32 @@ An implementation must reject a module that exceeds one of the following limits
14151415
In practice, an implementation may run out of resources for valid modules below these limits.
14161416

14171417
<ul>
1418-
<li>The maximum size of a module is 1073741824 bytes (1 GiB).</li>
1419-
<li>The maximum number of types defined in the types section is 1000000.</li>
1420-
<li>The maximum number of functions defined in a module is 1000000.</li>
1421-
<li>The maximum number of imports declared in a module is 100000.</li>
1422-
<li>The maximum number of exports declared in a module is 100000.</li>
1423-
<li>The maximum number of globals defined in a module is 1000000.</li>
1424-
<li>The maximum number of tags defined in a module is 1000000.</li>
1425-
<li>The maximum number of data segments defined in a module is 100000.</li>
1426-
1427-
<li>The maximum number of tables, including declared or imported tables, is 100000.</li>
1428-
<li>The maximum size of a table is 10000000.</li>
1429-
<li>The maximum number of table entries in any table initialization is 10000000.</li>
1418+
<li>The maximum size of a module is 1,073,741,824 bytes (1 GiB).</li>
1419+
<li>The maximum number of types defined in the types section is 1,000,000.</li>
1420+
<li>The maximum number of functions defined in a module is 1,000,000.</li>
1421+
<li>The maximum number of imports declared in a module is 100,000.</li>
1422+
<li>The maximum number of exports declared in a module is 100,000.</li>
1423+
<li>The maximum number of globals defined in a module is 1,000,000.</li>
1424+
<li>The maximum number of tags defined in a module is 1,000,000.</li>
1425+
<li>The maximum number of data segments defined in a module is 100,000.</li>
1426+
1427+
<li>The maximum number of tables, including declared or imported tables, is 100,000.</li>
1428+
<li>The maximum size of a table is 10,000,000.</li>
1429+
<li>The maximum number of table entries in any table initialization is 10,000,000.</li>
14301430
<li>The maximum number of memories, including declared or imported memories, is 1.</li>
14311431

1432-
<li>The maximum number of parameters to any function or block is 1000.</li>
1433-
<li>The maximum number of return values for any function or block is 1000.</li>
1434-
<li>The maximum size of a function body, including locals declarations, is 7654321 bytes.</li>
1435-
<li>The maximum number of locals declared in a function, including implicitly declared as parameters, is 50000.</li>
1432+
<li>The maximum number of parameters to any function or block is 1,000.</li>
1433+
<li>The maximum number of return values for any function or block is 1,000.</li>
1434+
<li>The maximum size of a function body, including locals declarations, is 7,654,321 bytes.</li>
1435+
<li>The maximum number of locals declared in a function, including implicitly declared as parameters, is 50,000.</li>
14361436
</ul>
14371437

14381438
An implementation must throw a {{RuntimeError}} if one of the following limits is exceeded during runtime:
14391439
In practice, an implementation may run out of resources for valid modules below these limits.
14401440

14411441
<ul>
1442-
<li>The maximum size of a table is 10000000.</li>
1443-
<li>The maximum number of pages of a memory is 65536.</li>
1442+
<li>The maximum size of a table is 10,000,000.</li>
1443+
<li>The maximum number of pages of a memory is 65,536.</li>
14441444
</ul>
14451445

14461446
<h2 id="security-considerations">Security and Privacy Considerations</h2>

interpreter/text/parser.mly

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,11 @@ elem_expr_list :
833833
elem_var_list :
834834
| var_list
835835
{ let f = function {at; _} as x -> [ref_func x @@ at] @@ at in
836-
fun c lookup -> List.map f ($1 c lookup) }
836+
fun c -> List.map f ($1 c func) }
837837

838838
elem_list :
839839
| elem_kind elem_var_list
840-
{ ($1, fun c -> $2 c func) }
840+
{ ($1, fun c -> $2 c) }
841841
| ref_type elem_expr_list
842842
{ ($1, fun c -> $2 c) }
843843

@@ -869,7 +869,7 @@ elem :
869869
{ let at = at () in
870870
fun c -> ignore ($3 c anon_elem bind_elem);
871871
fun () ->
872-
{ etype = FuncRefType; einit = $5 c func;
872+
{ etype = FuncRefType; einit = $5 c;
873873
emode = Active {index = 0l @@ at; offset = $4 c} @@ at } @@ at }
874874

875875
table :
@@ -889,19 +889,19 @@ table_fields :
889889
| inline_export table_fields /* Sugar */
890890
{ fun c x at -> let tabs, elems, ims, exs = $2 c x at in
891891
tabs, elems, ims, $1 (TableExport x) c :: exs }
892-
| ref_type LPAR ELEM elem_var_list RPAR /* Sugar */
892+
| ref_type LPAR ELEM elem_expr elem_expr_list RPAR /* Sugar */
893893
{ fun c x at ->
894894
let offset = [i32_const (0l @@ at) @@ at] @@ at in
895-
let einit = $4 c func in
895+
let einit = $4 c :: $5 c in
896896
let size = Lib.List32.length einit in
897897
let emode = Active {index = x; offset} @@ at in
898898
[{ttype = TableType ({min = size; max = Some size}, $1)} @@ at],
899-
[{etype = FuncRefType; einit; emode} @@ at],
899+
[{etype = $1; einit; emode} @@ at],
900900
[], [] }
901-
| ref_type LPAR ELEM elem_expr elem_expr_list RPAR /* Sugar */
901+
| ref_type LPAR ELEM elem_var_list RPAR /* Sugar */
902902
{ fun c x at ->
903903
let offset = [i32_const (0l @@ at) @@ at] @@ at in
904-
let einit = (fun c -> $4 c :: $5 c) c in
904+
let einit = $4 c in
905905
let size = Lib.List32.length einit in
906906
let emode = Active {index = x; offset} @@ at in
907907
[{ttype = TableType ({min = size; max = Some size}, $1)} @@ at],

0 commit comments

Comments
 (0)