Skip to content

Commit b0a7c47

Browse files
authored
Merge pull request #29 from dhil/wasmfx-wasm3.0+exn
Merge with wasm-3.0+exn
2 parents 0af205c + 02de8d1 commit b0a7c47

File tree

164 files changed

+14603
-1800
lines changed

Some content is hidden

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

164 files changed

+14603
-1800
lines changed

.github/workflows/ci-interpreter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: CI for interpreter & tests
33
on:
44
push:
55
branches: [ main ]
6-
paths: [ interpreter/**, test/** ]
6+
paths: [ .github/**, interpreter/**, test/** ]
77

88
pull_request:
99
branches: [ main ]
10-
paths: [ interpreter/**, test/** ]
10+
paths: [ .github/**, interpreter/**, test/** ]
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -31,6 +31,6 @@ jobs:
3131
- name: Build interpreter
3232
run: cd interpreter && opam exec make
3333
- name: Run tests
34-
# TODO: disable node.js run until it fully implements proposal
34+
# TODO: reactiate node once it supports all of Wasm 3.0
3535
# run: cd interpreter && opam exec make JS=node ci
3636
run: cd interpreter && opam exec make test

.github/workflows/ci-spec.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: CI for specs
33
on:
44
push:
55
branches: [ main ]
6-
paths: [ document/** ]
6+
paths: [ .github/**, document/** ]
77

88
pull_request:
99
branches: [ main ]
10-
paths: [ document/** ]
10+
paths: [ .github/**, document/** ]
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -40,6 +40,25 @@ jobs:
4040
name: core-rendered
4141
path: document/core/_build/html
4242

43+
build-legacy-exceptions-spec:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout repo
47+
uses: actions/checkout@v2
48+
with:
49+
submodules: "recursive"
50+
- name: Setup TexLive
51+
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
52+
- name: Setup Sphinx
53+
run: pip install six && pip install sphinx==5.1.0
54+
- name: Build main spec
55+
run: cd document/legacy/exceptions && make main
56+
- name: Upload artifact
57+
uses: actions/upload-artifact@v2
58+
with:
59+
name: legacy-exceptions-rendered
60+
path: document/legacy/exceptions/_build/html
61+
4362
build-js-api-spec:
4463
runs-on: ubuntu-latest
4564
steps:
@@ -72,7 +91,7 @@ jobs:
7291

7392
publish-spec:
7493
runs-on: ubuntu-latest
75-
needs: [build-core-spec, build-js-api-spec, build-web-api-spec]
94+
needs: [build-core-spec, build-legacy-exceptions-spec, build-js-api-spec, build-web-api-spec]
7695
steps:
7796
- name: Checkout repo
7897
uses: actions/checkout@v2
@@ -83,6 +102,11 @@ jobs:
83102
with:
84103
name: core-rendered
85104
path: _output/core
105+
- name: Download legacy exceptions spec artifact
106+
uses: actions/download-artifact@v2
107+
with:
108+
name: legacy-exceptions-rendered
109+
path: _output/legacy/exceptions
86110
- name: Download JS API spec artifact
87111
uses: actions/download-artifact@v2
88112
with:

.github/workflows/w3c-publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to W3C TR space
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths: [ .github/**, document/** ]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish-to-w3c-TR:
13+
runs-on: ubuntu-latest
14+
# TODO(dhil): The following effectively disables this workflow. It
15+
# should be removed before merging with upstream.
16+
if: false
17+
steps:
18+
- name: Checkout repo
19+
uses: actions/checkout@v2
20+
with:
21+
submodules: "recursive"
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: 16
26+
- name: Setup Bikeshed
27+
run: pip install bikeshed && bikeshed update
28+
- name: Setup TexLive
29+
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
30+
- name: Setup Sphinx
31+
run: pip install six && pip install sphinx==5.1.0
32+
- name: Publish all specs to their https://www.w3.org/TR/ URLs
33+
run: cd document && make -e WD-echidna-CI
34+
env:
35+
STATUS: --md-status=WD
36+
W3C_ECHIDNA_TOKEN_CORE: ${{ secrets.W3C_ECHIDNA_TOKEN_CORE }}
37+
W3C_ECHIDNA_TOKEN_JSAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_JSAPI }}
38+
W3C_ECHIDNA_TOKEN_WEBAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_WEBAPI }}
39+
YARN_ENABLE_IMMUTABLE_INSTALLS: false

deploy_key

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
-----BEGIN OPENSSH PRIVATE KEY-----
2+
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn
3+
NhAAAAAwEAAQAAAgEAn9FUrQzWcgEOHsDJ+f7L0g7xIYrdBb3K1dQqFWFidZcL8KYMMR0/
4+
CEYRXfSn3EcvpYnRoIjWfGQgqOpA90FMaAwqdoK72ByW7q2C4ymjX5xR8XFyG5YJVvjaMe
5+
STXZlynQSOH9lXU5RooeEwRatgQizuwB/Bqahry/8FOfDhVlNO26IbEyJPd23qeyAd+42C
6+
OTE5oWHEJ3TKSWSfwTAhfrIlIg+dWiSx/IUcLc+7Ms5EpQh3ebX49oaW00SWRDnyqoM95m
7+
D+Uc3DuTFJyKdHlLouESdNrE9LeBms5N/bHSgedVyZ5fL9SHC6P1HmgDPFspmO6z1s15/a
8+
5y5hf9zHVoj1ha54LSaPlE5/L5hpY6PCH7fepRXhw84VIQV74IsJow1XUbkmfKkjW3PeBq
9+
CF5cTKF2LK65SraxEfNMLU0ThOH6B6yzePq7JF+05VGMh2G2Wkwy11pezeqW5tPU1M2qwS
10+
RN8jAFKIwuC7B73drz8yMhF8MfTW4iGM4RqhQRCK22xmVtzwYFwRKUM++p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T
40+
ATa8KR6okRAUxn7tqswebAFPmdpGS1YkQAyAQQoPr2NQpPSWN0cKXQZUYLn5r6HSZ7isAm
41+
K/6mrF+TqK80055A+duZggLIKyMAKDTdgtIu4D/wZIqZYcY8uiA2ZhGM3XEQutTjo4xemu
42+
V2X+WSwXhrXiSAWqbCBxCRcCLKktweihb1nOkXIOspKr7Adj/ctmlqO875GHuwlrGaNfe2
43+
DFo67i4udsdrc9AAABAQDKE5rUxfN6K51jWdgiBVx1XVH0YenLGHECYcxg5AHkDTJUOl9F
44+
SqiP4w128fFjHEO+GGltgkruQ94k+wINub/e7k1NYSpgj03BDs6swpRG7Y3uot1aBFAati
45+
ITJF6p1rmjmBxtDhaVX9nA6GyOmzXO4Tb6niBHO5u7B3dqZI/iXHUmsZOsa1ijuE8YL5P7
46+
SzxbkiGGsWv5gfs8RcYuOmGhTx2LxOTNh3kovj4xQSoJVH3IikpodQAuXTdL5utuAzgVEL
47+
Xpk1XVyVPkFGitmNqTr3D2gKnPnkQf8KYsRmzt4bPKDrKOBleqYbFSabyHUNJEaW7pmf8+
48+
fNbVF9dWMmyHAAAAAAEC
49+
-----END OPENSSH PRIVATE KEY-----

deploy_key.pub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCf0VStDNZyAQ4ewMn5/svSDvEhit0FvcrV1CoVYWJ1lwvwpgwxHT8IRhFd9KfcRy+lidGgiNZ8ZCCo6kD3QUxoDCp2grvYHJburYLjKaNfnFHxcXIblglW+Nox5JNdmXKdBI4f2VdTlGih4TBFq2BCLO7AH8GpqGvL/wU58OFWU07bohsTIk93bep7IB37jYI5MTmhYcQndMpJZJ/BMCF+siUiD51aJLH8hRwtz7syzkSlCHd5tfj2hpbTRJZEOfKqgz3mYP5RzcO5MUnIp0eUui4RJ02sT0t4Gazk39sdKB51XJnl8v1IcLo/UeaAM8WymY7rPWzXn9rnLmF/3MdWiPWFrngtJo+UTn8vmGljo8Ift96lFeHDzhUhBXvgiwmjDVdRuSZ8qSNbc94GoIXlxMoXYsrrlKtrER80wtTROE4foHrLN4+rskX7TlUYyHYbZaTDLXWl7N6pbm09TUzarBJE3yMAUojC4LsHvd2vPzIyEXwx9NbiIYzhGqFBEIrbbGZW3PBgXBEpQz76naI6CAaLjaOdWyS/v/JDpdxoSb7YnHcLbPL/k50uqX3PyCYqwfiOlBQAOZp7woF8kKodmu2+FFOof30Te2GkgpynNj6fm6E0LKtj6FN8Hjj8Qie1aRcNMvBVVGaY7IdK8QDv8PPW+0DuBj027bnFj9JdKw==

document/Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
DIRS = core js-api web-api
1+
DIRS = core js-api web-api legacy/exceptions
22
FILES = index.html
33
BUILDDIR = _build
4+
TAR = tar
45

56
# Global targets.
67

@@ -24,6 +25,25 @@ clean: $(DIRS:%=clean-%)
2425
.PHONY: diff
2526
diff: $(DIRS:%=diff-%)
2627

28+
# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-tar
29+
.PHONY: WD-tar
30+
WD-tar:
31+
for dir in $(DIRS); \
32+
do STATUS=--md-status=WD TAR=$(TAR) $(MAKE) -e -C $$dir $@;\
33+
done
34+
35+
# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-echidna
36+
.PHONY: WD-echidna
37+
WD-echidna:
38+
for dir in $(DIRS); \
39+
do $(MAKE) -e -C $$dir $@;\
40+
done
41+
42+
.PHONY: WD-echidna-CI
43+
WD-echidna-CI:
44+
for dir in $(DIRS); \
45+
do $(MAKE) -e -C $$dir $@;\
46+
done
2747

2848
# Directory-specific targets.
2949

document/core/Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ BUILDDIR = _build
99
STATICDIR = _static
1010
DOWNLOADDIR = _download
1111
NAME = WebAssembly
12+
DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md
13+
TAR = tar
1214

1315
# Internal variables.
1416
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -148,7 +150,7 @@ bikeshed: $(GENERATED)
148150
@echo
149151
@echo =========================================================================
150152
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
151-
bikeshed spec index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
153+
bikeshed spec $(STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
152154
mkdir -p $(BUILDDIR)/html/bikeshed/
153155
(cd util/katex/ && yarn && yarn build && npm install --only=prod)
154156
python3 util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \
@@ -163,9 +165,11 @@ bikeshed: $(GENERATED)
163165
@echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/."
164166

165167
.PHONY: WD-tar
168+
# macOS tar has no “--transform” option (only GNU tar does), so on macOS,
169+
# do “brew install tar” & run “make” like this: “TAR=gtar make -e WD-tar”
166170
WD-tar: bikeshed
167171
@echo "Building tar file..."
168-
tar cvf \
172+
$(TAR) cvf \
169173
$(BUILDDIR)/WD.tar \
170174
--transform='s|$(BUILDDIR)/html/bikeshed/||' \
171175
--transform='s|index.html|Overview.html|' \
@@ -190,6 +194,20 @@ WD-echidna: WD-tar
190194
@echo
191195
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
192196

197+
.PHONY: WD-echidna-CI
198+
WD-echidna-CI: WD-tar
199+
@if [ -z $(W3C_ECHIDNA_TOKEN_CORE) ] || \
200+
[ -z $(DECISION_URL) ] ; then \
201+
echo "Must provide W3C_ECHIDNA_TOKEN_CORE and DECISION_URL environment variables"; \
202+
exit 1; \
203+
fi
204+
curl 'https://labs.w3.org/echidna/api/request' \
205+
-F "tar=@$(BUILDDIR)/WD.tar" \
206+
-F "token=$(W3C_ECHIDNA_TOKEN_CORE)" \
207+
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
208+
@echo
209+
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
210+
193211
.PHONY: diff
194212
diff: bikeshed
195213
@echo "Downloading the old single-file html spec..."

document/core/appendix/algorithm.rst

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Value types are representable as sets of enumerations:
3232
type vec_type = V128
3333
type heap_type =
3434
Any | Eq | I31 | Struct | Array | None |
35-
Func | Nofunc | Extern | Noextern | Bot |
35+
Func | Nofunc | Exn | Noexn | Extern | Noextern | Bot |
3636
Def(def : def_type)
3737
type ref_type = Ref(heap : heap_type, null : bool)
3838
type val_type = num_type | vec_type | ref_type | Bot
@@ -445,6 +445,28 @@ Other instructions are checked in a similar manner.
445445
pop_val(Ref(Def(types[x])))
446446
pop_val(unpack_field(st.fields[n]))
447447
448+
case (throw x)
449+
pop_vals(tags[x].type.params)
450+
unreachable()
451+
452+
case (try_table t1*->t2* handler*)
453+
pop_vals([t1*])
454+
foreach (handler in handler*)
455+
error_if(ctrls.size() < handler.label)
456+
push_ctrl(catch, [], label_types(ctrls[handler.label]))
457+
switch (handler.clause)
458+
case (catch x)
459+
push_vals(tags[x].type.params)
460+
case (catch_ref x)
461+
push_vals(tags[x].type.params)
462+
push_val(Exnref)
463+
case (catch_all)
464+
skip
465+
case (catch_all_ref)
466+
push_val(Exnref)
467+
pop_ctrl()
468+
push_ctrl(try_table, [t1*], [t2*])
469+
448470
.. note::
449471
It is an invariant under the current WebAssembly instruction set that an operand of :code:`Bot` type is never duplicated on the stack.
450472
This would change if the language were extended with stack instructions like :code:`dup`.

0 commit comments

Comments
 (0)