Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 5ef6f0d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into merge-upstream
2 parents a3e4b05 + ee4a6c4 commit 5ef6f0d

File tree

20 files changed

+102
-51
lines changed

20 files changed

+102
-51
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ main ]
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
@@ -78,7 +78,7 @@ jobs:
7878
name: core-api-rendered
7979
path: _output/core
8080
- name: Publish HTML to GitHub Pages
81-
if: github.ref == 'refs/heads/master'
81+
if: github.ref == 'refs/heads/main'
8282
uses: peaceiris/actions-gh-pages@v3
8383
with:
8484
publish_dir: ./_output

.github/workflows/mirror.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
push:
3+
branches:
4+
- 'main'
5+
6+
jobs:
7+
mirror_job:
8+
runs-on: ubuntu-latest
9+
name: Mirror main branch to master branch
10+
steps:
11+
- name: Mirror action step
12+
id: mirror
13+
uses: google/mirror-branch-action@v1.0
14+
with:
15+
github-token: ${{ secrets.GITHUB_TOKEN }}
16+
source: 'main'
17+
dest: 'master'

Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Interested in participating? Please follow
44
[the same contributing guidelines as the design repository][].
55

6-
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/master/Contributing.md
6+
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/main/Contributing.md
77

88
Also, please be sure to read [the README.md](README.md) for this repository.

document/core/appendix/algorithm.rst

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,13 @@ However, these variables are not manipulated directly by the main checking funct
7575
7676
func pop_val(expect : val_type | Unknown) : val_type | Unknown =
7777
let actual = pop_val()
78-
if (actual = Unknown) return expect
79-
if (expect = Unknown) return actual
80-
error_if(actual =/= expect)
78+
error_if(actual =/= expect && actual =/= Unknown && expect =/= Unknown)
8179
return actual
8280
8381
func push_vals(types : list(val_type)) = foreach (t in types) push_val(t)
8482
func pop_vals(types : list(val_type)) : list(val_type) =
8583
var popped := []
86-
foreach (t in reverse(types)) popped.append(pop_val(t))
84+
foreach (t in reverse(types)) popped.prepend(pop_val(t))
8785
return popped
8886
8987
Pushing an operand value simply pushes the respective type to the value stack.
@@ -109,24 +107,24 @@ The control stack is likewise manipulated through auxiliary functions:
109107
.. code-block:: pseudo
110108
111109
func push_ctrl(opcode : opcode, in : list(val_type), out : list(val_type)) =
112-
 let frame = ctrl_frame(opcode, in, out, vals.size(), false)
113-
  ctrls.push(frame)
110+
let frame = ctrl_frame(opcode, in, out, vals.size(), false)
111+
ctrls.push(frame)
114112
push_vals(in)
115113
116114
func pop_ctrl() : ctrl_frame =
117-
 error_if(ctrls.is_empty())
118-
 let frame = ctrls[0]
119-
  pop_vals(frame.end_types)
120-
  error_if(vals.size() =/= frame.height)
115+
error_if(ctrls.is_empty())
116+
let frame = ctrls[0]
117+
pop_vals(frame.end_types)
118+
error_if(vals.size() =/= frame.height)
121119
ctrls.pop()
122-
  return frame
120+
return frame
123121
124122
func label_types(frame : ctrl_frame) : list(val_types) =
125123
return (if frame.opcode == loop then frame.start_types else frame.end_types)
126124
127125
func unreachable() =
128-
  vals.resize(ctrls[0].height)
129-
  ctrls[0].unreachable := true
126+
vals.resize(ctrls[0].height)
127+
ctrls[0].unreachable := true
130128
131129
Pushing a control frame takes the types of the label and result values.
132130
It allocates a new frame record recording them along with the current height of the operand stack and marks the block as reachable.
@@ -184,8 +182,8 @@ Other instructions are checked in a similar manner.
184182
pop_val(t)
185183
push_val(t)
186184
187-
   case (unreachable)
188-
      unreachable()
185+
case (unreachable)
186+
unreachable()
189187
190188
case (block t1*->t2*)
191189
pop_vals([t1*])
@@ -210,26 +208,26 @@ Other instructions are checked in a similar manner.
210208
push_ctrl(else, frame.start_types, frame.end_types)
211209
212210
case (br n)
213-
     error_if(ctrls.size() < n)
214-
      pop_vals(label_types(ctrls[n]))
215-
      unreachable()
211+
error_if(ctrls.size() < n)
212+
pop_vals(label_types(ctrls[n]))
213+
unreachable()
216214
217215
case (br_if n)
218-
     error_if(ctrls.size() < n)
216+
error_if(ctrls.size() < n)
219217
pop_val(I32)
220-
      pop_vals(label_types(ctrls[n]))
221-
      push_vals(label_types(ctrls[n]))
218+
pop_vals(label_types(ctrls[n]))
219+
push_vals(label_types(ctrls[n]))
222220
223-
   case (br_table n* m)
221+
case (br_table n* m)
224222
pop_val(I32)
225-
      error_if(ctrls.size() < m)
223+
error_if(ctrls.size() < m)
226224
let arity = label_types(ctrls[m]).size()
227-
      foreach (n in n*)
228-
        error_if(ctrls.size() < n)
229-
        error_if(label_types(ctrls[n]).size() =/= arity)
225+
foreach (n in n*)
226+
error_if(ctrls.size() < n)
227+
error_if(label_types(ctrls[n]).size() =/= arity)
230228
push_vals(pop_vals(label_types(ctrls[n])))
231229
pop_vals(label_types(ctrls[m]))
232-
      unreachable()
230+
unreachable()
233231
234232
235233
.. note::

document/core/valid/instructions.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,8 +1414,6 @@ Control Instructions
14141414

14151415
* The label :math:`C.\CLABELS[l_N]` must be defined in the context.
14161416

1417-
* Let :math:`[t^\ast]` be the :ref:`result type <syntax-resulttype>` :math:`C.\CLABELS[l_N]`.
1418-
14191417
* For all :math:`l_i` in :math:`l^\ast`,
14201418
the label :math:`C.\CLABELS[l_i]` must be defined in the context.
14211419

document/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ incremental_deploy() {
177177
0) echo No changes to files in $deploy_directory. Skipping commit.;;
178178
1) commit_and_push;;
179179
*)
180-
echo git diff exited with code $diff. Aborting. Staying on branch $deploy_branch so you can debug. To switch back to master, use: git symbolic-ref HEAD refs/heads/master && git reset --mixed >&2
180+
echo git diff exited with code $diff. Aborting. Staying on branch $deploy_branch so you can debug. To switch back to main, use: git symbolic-ref HEAD refs/heads/main && git reset --mixed >&2
181181
return $diff
182182
;;
183183
esac

interpreter/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ WebAssemblyText.decode(binary)
163163

164164
## S-Expression Syntax
165165

166-
The implementation consumes a WebAssembly AST given in S-expression syntax. Here is an overview of the grammar of types, expressions, functions, and modules, mirroring what's described in the [design doc](https://github.com/WebAssembly/design/blob/master/Semantics.md).
166+
The implementation consumes a WebAssembly AST given in S-expression syntax. Here is an overview of the grammar of types, expressions, functions, and modules, mirroring what's described in the [design doc](https://github.com/WebAssembly/design/blob/main/Semantics.md).
167167

168168
Note: The grammar is shown here for convenience, the definite source is the [specification of the text format](https://webassembly.github.io/spec/core/text/).
169169
```
@@ -509,7 +509,7 @@ Moreover, float values are required to be precise, that is, they may not contain
509509

510510
## Abstract Syntax
511511

512-
The abstract WebAssembly syntax, as described above and in the [design doc](https://github.com/WebAssembly/design/blob/master/Semantics.md), is defined in [ast.ml](syntax/ast.ml).
512+
The abstract WebAssembly syntax, as described above and in the [design doc](https://github.com/WebAssembly/design/blob/main/Semantics.md), is defined in [ast.ml](syntax/ast.ml).
513513

514514
However, to simplify the implementation, this AST representation represents some of the inner structure of the operators more explicitly. The mapping from the operators as given in the design doc to their structured form is defined in [operators.ml](syntax/operators.ml).
515515

interpreter/binary/decode.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ let module_ s =
10801080
iterate custom_section s;
10811081
let datas = data_section s in
10821082
iterate custom_section s;
1083-
require (pos s = len s) s (len s) "junk after last section";
1083+
require (pos s = len s) s (len s) "unexpected content after last section";
10841084
require (List.length func_types = List.length func_bodies)
10851085
s (len s) "function and code section have inconsistent lengths";
10861086
require (data_count = None || data_count = Some (Lib.List32.length datas))

proposals/multi-value/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- can easily be lifted by generalising to value* -> value*
1515

1616
* Generalised semantics is well-understood
17-
- https://github.com/WebAssembly/spec/tree/master/papers/pldi2017.pdf
17+
- https://github.com/WebAssembly/spec/tree/main/papers/pldi2017.pdf
1818

1919
* Semi-complete implementation of multiple results in V8
2020

proposals/nontrapping-float-to-int-conversion/Overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ https://github.com/WebAssembly/meetings/pull/3
3232

3333
and
3434

35-
https://github.com/WebAssembly/meetings/blob/master/2017/CG-05.md#non-trapping-float-to-int
35+
https://github.com/WebAssembly/meetings/blob/main/2017/CG-05.md#non-trapping-float-to-int
3636

3737
which made decisions about which semantics to choose, and which encoding strategy.
3838

@@ -43,7 +43,7 @@ https://github.com/WebAssembly/design/pull/1089
4343
At the CG-07-06 meeting it was decided that a full spec repo fork should be
4444
created to follow the new process for new features:
4545

46-
https://github.com/WebAssembly/meetings/blob/master/2017/CG-07-06.md#float-to-int-conversion
46+
https://github.com/WebAssembly/meetings/blob/main/2017/CG-07-06.md#float-to-int-conversion
4747

4848
This led to the creation of the present repo:
4949

0 commit comments

Comments
 (0)