Skip to content

Commit 42e3201

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 0493e50 + 89353e0 commit 42e3201

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2593
-2033
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ jobs:
2121
- run: opam install --yes ocamlbuild.0.14.0
2222
- run: cd interpreter && opam exec make all
2323

24+
ref-interpreter-js-library:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Setup OCaml
29+
uses: ocaml/setup-ocaml@v2
30+
with:
31+
ocaml-compiler: 4.12.x
32+
- run: opam install --yes ocamlbuild.0.14.0 ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0
33+
- run: cd interpreter && opam exec make wast.js
34+
2435
build-js-api-spec:
2536
runs-on: ubuntu-latest
2637
steps:

document/core/appendix/algorithm.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ The type of the :ref:`label <syntax-label>` associated with a control frame is e
140140

141141
Finally, the current frame can be marked as unreachable.
142142
In that case, all existing operand types are purged from the value stack, in order to allow for the :ref:`stack-polymorphism <polymorphism>` logic in :code:`pop_val` to take effect.
143+
Because every function has an implicit outermost label that corresponds to an implicit block frame,
144+
it is an invariant of the validation algorithm that there always is at least one frame on the control stack when validating an instruction, and hence, `ctrls[0]` is always defined.
143145

144146
.. note::
145147
Even with the unreachable flag set, consecutive operands are still pushed to and popped from the operand stack.

document/core/appendix/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Change History
77
Since the original release 1.0 of the WebAssembly specification, a number of proposals for extensions have been integrated.
88
The following sections provide an overview of what has changed.
99

10-
Release 1.1
10+
Release 2.0
1111
~~~~~~~~~~~
1212

1313
.. index:: instruction, integer

document/core/appendix/custom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Each subsection consists of a
3636

3737
* a one-byte subsection *id*,
3838
* the |U32| *size* of the contents, in bytes,
39-
* the actual *contents*, whose structure is depended on the subsection id.
39+
* the actual *contents*, whose structure is dependent on the subsection id.
4040

4141
.. math::
4242
\begin{array}{llcll}

document/core/appendix/embedding.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Some operations state *pre-conditions* about their arguments or *post-conditions
5050
It is the embedder's responsibility to meet the pre-conditions.
5151
If it does, the post conditions are guaranteed by the semantics.
5252

53-
In addition to pre- and post-conditions explicitly stated with each operation, the specification adopts the following conventions for :ref:`runtime objects <syntax-runtime>` (:math:`store`, :math:`\moduleinst`, :math:`\externval`, :ref:`addresses <syntax-addr>`):
53+
In addition to pre- and post-conditions explicitly stated with each operation, the specification adopts the following conventions for :ref:`runtime objects <syntax-runtime>` (:math:`\store`, :math:`\moduleinst`, :math:`\externval`, :ref:`addresses <syntax-addr>`):
5454

5555
* Every runtime object passed as a parameter must be :ref:`valid <valid-store>` per an implicit pre-condition.
5656

@@ -258,7 +258,7 @@ Functions
258258
:math:`\F{func\_alloc}(\store, \functype, \hostfunc) : (\store, \funcaddr)`
259259
...........................................................................
260260

261-
1. Pre-condition: :math:`\functype` is :math:`valid <valid-functype>`.
261+
1. Pre-condition: :math:`\functype` is :ref:`valid <valid-functype>`.
262262

263263
2. Let :math:`\funcaddr` be the result of :ref:`allocating a host function <alloc-func>` in :math:`\store` with :ref:`function type <syntax-functype>` :math:`\functype` and host function code :math:`\hostfunc`.
264264

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

329-
1. Pre-condition: :math:`\tabletype` is :math:`valid <valid-tabletype>`.
329+
1. Pre-condition: :math:`\tabletype` is :ref:`valid <valid-tabletype>`.
330330

331331
2. Let :math:`\tableaddr` be the result of :ref:`allocating a table <alloc-table>` in :math:`\store` with :ref:`table type <syntax-tabletype>` :math:`\tabletype` and initialization value :math:`\reff`.
332332

@@ -345,7 +345,7 @@ Tables
345345

346346
1. Return :math:`S.\STABLES[a].\TITYPE`.
347347

348-
2. Post-condition: the returned :ref:`table type <syntax-tabletype>` is :math:`valid <valid-tabletype>`.
348+
2. Post-condition: the returned :ref:`table type <syntax-tabletype>` is :ref:`valid <valid-tabletype>`.
349349

350350
.. math::
351351
\begin{array}{lclll}
@@ -438,7 +438,7 @@ Memories
438438
:math:`\F{mem\_alloc}(\store, \memtype) : (\store, \memaddr)`
439439
................................................................
440440

441-
1. Pre-condition: :math:`\memtype` is :math:`valid <valid-memtype>`.
441+
1. Pre-condition: :math:`\memtype` is :ref:`valid <valid-memtype>`.
442442

443443
2. Let :math:`\memaddr` be the result of :ref:`allocating a memory <alloc-mem>` in :math:`\store` with :ref:`memory type <syntax-memtype>` :math:`\memtype`.
444444

@@ -457,7 +457,7 @@ Memories
457457

458458
1. Return :math:`S.\SMEMS[a].\MITYPE`.
459459

460-
2. Post-condition: the returned :ref:`memory type <syntax-memtype>` is :math:`valid <valid-memtype>`.
460+
2. Post-condition: the returned :ref:`memory type <syntax-memtype>` is :ref:`valid <valid-memtype>`.
461461

462462
.. math::
463463
\begin{array}{lclll}
@@ -551,7 +551,7 @@ Globals
551551
:math:`\F{global\_alloc}(\store, \globaltype, \val) : (\store, \globaladdr)`
552552
............................................................................
553553

554-
1. Pre-condition: :math:`\globaltype` is :math:`valid <valid-globaltype>`.
554+
1. Pre-condition: :math:`\globaltype` is :ref:`valid <valid-globaltype>`.
555555

556556
2. Let :math:`\globaladdr` be the result of :ref:`allocating a global <alloc-global>` in :math:`\store` with :ref:`global type <syntax-globaltype>` :math:`\globaltype` and initialization value :math:`\val`.
557557

@@ -570,7 +570,7 @@ Globals
570570

571571
1. Return :math:`S.\SGLOBALS[a].\GITYPE`.
572572

573-
2. Post-condition: the returned :ref:`global type <syntax-globaltype>` is :math:`valid <valid-globaltype>`.
573+
2. Post-condition: the returned :ref:`global type <syntax-globaltype>` is :ref:`valid <valid-globaltype>`.
574574

575575
.. math::
576576
\begin{array}{lclll}

0 commit comments

Comments
 (0)