Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WasmFX reference interpreter and testsuite #47

Merged
merged 147 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
9ef4a9b
Merge pull request #2 from effect-handlers/merge-funcref
dhil Feb 15, 2021
41d0c6e
Minimal exception handling extension
dhil Feb 14, 2021
f81d04a
Update interpreter/syntax/free.ml
dhil Feb 16, 2021
1572421
Update interpreter/text/arrange.ml
dhil Feb 16, 2021
7fe3e89
Update interpreter/text/parser.mly
dhil Feb 16, 2021
f293c24
Update interpreter/exec/eval.ml
dhil Feb 16, 2021
ad622f3
Update interpreter/exec/eval.ml
dhil Feb 16, 2021
449e176
Update interpreter/binary/encode.ml
dhil Feb 16, 2021
8e0a378
Update interpreter/exec/eval.ml
dhil Feb 16, 2021
147024b
Declare DO as a token.
dhil Feb 16, 2021
bd8a611
Add lexical rules for try/catch/do/throw.
dhil Feb 16, 2021
b0fcf75
Add a few test cases.
dhil Feb 16, 2021
62fc2d9
Implement binary encoding and decoding.
dhil Feb 16, 2021
4d2b207
Update interpreter/script/run.ml
dhil Feb 16, 2021
bc83c41
Update interpreter/script/run.ml
dhil Feb 16, 2021
5d4602a
Address @rossberg's comments.
dhil Feb 16, 2021
1b59e24
Adds missing success reduction for `catch`.
dhil Feb 16, 2021
68e69ec
Update interpreter/script/js.ml
dhil Feb 16, 2021
ce612e8
Implement events
rossberg Feb 17, 2021
ac039db
Add cont type and instructions; validation, en/decoding
rossberg Feb 18, 2021
2d7252d
Merge pull request #1 from effect-handlers/tiny-exn
dhil Feb 18, 2021
3eebbfe
Merge pull request #4 from effect-handlers/mini-exn
dhil Feb 18, 2021
c1e7772
Merge branch 'master' of github.com:effect-handlers/wasm-spec into ti…
dhil Feb 18, 2021
a6ab02b
Merge pull request #5 from effect-handlers/cont
dhil Feb 18, 2021
fdb69cc
Merge branch 'mini-exn' of github.com:effect-handlers/wasm-spec into …
dhil Feb 18, 2021
fb297a0
Typos
rossberg Feb 18, 2021
7704c23
Merge branch 'master' into cont
rossberg Feb 18, 2021
c9f369b
First semantics
rossberg Feb 18, 2021
7f092d0
Simplify
rossberg Feb 18, 2021
5e510ee
Text, simple test
rossberg Feb 19, 2021
a44c070
Missing rule
rossberg Feb 19, 2021
e10edf6
Minor grammar tweak
rossberg Feb 19, 2021
e235dac
Test exns
rossberg Feb 19, 2021
1b478ef
Scheduler example
rossberg Feb 19, 2021
8349bee
Generator example; make threads more interesting
rossberg Feb 19, 2021
34ebc19
Avoid code duplication
rossberg Feb 19, 2021
3939828
Eps
rossberg Feb 19, 2021
92fd88f
Renames; fixes; add guard instruction
rossberg Feb 20, 2021
6f1aed8
Actually invoke test
rossberg Feb 20, 2021
c3a3a3d
Unify Guarded admin instr with Handle
rossberg Feb 22, 2021
be2c1c0
Test empty handler
rossberg Feb 22, 2021
dfb8dad
Comment
rossberg Feb 22, 2021
6b0b593
Implement reduction and text format (#6)
rossberg Feb 22, 2021
f775ff5
Implement single-shot semantics
rossberg Feb 22, 2021
707dec0
Implement single-shot semantics (#7)
rossberg Feb 25, 2021
a5cacd2
Merge remote-tracking branch 'funcref/master' into single-shot
rossberg Feb 25, 2021
13aa280
Merge remote-tracking branch 'funcref/master'
rossberg Feb 25, 2021
332f4f1
Merge remote-tracking branch 'origin/master'
rossberg Feb 25, 2021
8109132
Merge remote-tracking branch 'funcref/master'
rossberg Mar 11, 2021
261d1a8
Merge remote-tracking branch 'tailcall/master'
rossberg Mar 11, 2021
ee429ef
Add cont.bind; check handler types
rossberg Apr 8, 2021
03a1e4c
Nit
rossberg Apr 8, 2021
eef1931
Fix
rossberg Apr 8, 2021
650e0f0
Add cont.bind; check handler types (#10)
rossberg Apr 8, 2021
ed01787
Merge remote-tracking branch 'upstream/master'
rossberg Apr 8, 2021
c33e8bd
Merge remote-tracking branch 'funcref/master'
rossberg Apr 8, 2021
f3ce3d2
Merge remote-tracking branch 'tailcall/master'
rossberg Apr 8, 2021
3d81921
fix cont.bind to bind arguments in the correct order (fixes #12)
slindley Apr 11, 2021
611a37e
Fix composiiton order
rossberg Apr 12, 2021
43b741d
Merge branch 'cont.bind'
slindley Apr 12, 2021
60d2c28
Examples (#8)
slindley Apr 12, 2021
ce9860d
Add overview of formal rules (#11)
rossberg Apr 15, 2021
a6c90c8
Added mvar implementation
ani003 Sep 23, 2021
e991efe
Added comments
ani003 Sep 28, 2021
5cb386e
Merge pull request #15 from ani003/mvar
dhil Oct 7, 2021
6b6f0e3
Explainer document (#14)
dhil Dec 14, 2021
6a62ed1
Revert "MVar implementation" (#17)
slindley Feb 3, 2022
069848a
update README
slindley Feb 3, 2022
57c5955
Type-indexed tags. (#18)
dhil Oct 10, 2022
f317d0b
Refactor `cont.wast` to not use `let` & `func.bind` (#24)
dhil Mar 3, 2023
eb9932a
Merge
dhil Mar 10, 2023
f4a1f12
Fix compilation errors after merge.
dhil Mar 13, 2023
9f861ea
Merge pull request #25 from dhil/wasmfx-funcref-merge
dhil Mar 17, 2023
c9e60d8
Update `resume_throw` (#26)
dhil Mar 22, 2023
5331635
Fix all examples apart from delimited control (#27)
matijapretnar Apr 10, 2023
2877ce4
Change opcode for cont (#28)
dhil Apr 10, 2023
7ad4f4b
Add type annotations to continuation instructions (#29)
dhil Apr 10, 2023
d24a9bd
Update examples to conform with the recent changes to the syntax (con…
dhil Apr 11, 2023
b7e4ed5
Add a simple and more involved generator example (#31)
matijapretnar Apr 13, 2023
dd4e5a1
Merge with WebAssembly/spec
dhil Aug 31, 2023
08de56b
Disable JS testsuite
dhil Sep 1, 2023
74a3ed3
Merge pull request #1 from dhil/wasmfx-main-sync
dhil Sep 1, 2023
0cfa5a5
Merge branch 'main' of github.com:WebAssembly/spec into wasmfx
dhil Sep 19, 2023
42228fb
Merge pull request #6 from dhil/wasmfx
dhil Sep 19, 2023
af789d0
Merge with WebAssembly/function-references
dhil Sep 21, 2023
1b8e62a
Merge branch 'main' of github.com:WebAssembly/function-references int…
dhil Sep 21, 2023
fe51e7d
Fix CI interpreter
dhil Sep 21, 2023
7fb5764
Merge pull request #7 from dhil/funcref-merge
dhil Sep 21, 2023
aa62cdd
Merge with WebAssembly/spec
dhil Sep 21, 2023
ab3bf77
Merge pull request #8 from dhil/wasmfx-main
dhil Sep 21, 2023
2250826
Merge with upstream
dhil Oct 2, 2023
4f8d8c7
Merge pull request #9 from dhil/wasmfx-merge
dhil Oct 2, 2023
7188e24
Merge branch 'main' of github.com:WebAssembly/gc into wasmfx-merge
dhil Oct 3, 2023
d7aa1d1
Expand tag types
dhil Oct 5, 2023
5e0e3f8
Fix try-catch assertion error.
dhil Oct 5, 2023
8ce5b1f
Fix remaining bugs after merge with the GC proposal.
dhil Oct 18, 2023
697ac89
Fix nit
dhil Oct 18, 2023
52ec720
Address comments
dhil Oct 18, 2023
47367c9
More tests
dhil Oct 19, 2023
c81ef89
Test for resume_throw too
dhil Oct 19, 2023
4eb38ce
Add NoContHT
dhil Oct 19, 2023
92c223d
Add contref, nullcontref, etc to the wat/wast formats
dhil Oct 20, 2023
9072739
Update opcodes again
dhil Oct 20, 2023
d13dc88
Fix opcode
dhil Oct 20, 2023
a8ffd1f
Merge pull request #10 from dhil/wasmfx-merge
dhil Oct 20, 2023
4a46a40
Merge with WebAssembly/main
dhil Oct 20, 2023
5987142
Merge branch 'main' of github.com:WebAssembly/gc into wasmfx-merge
dhil Oct 20, 2023
aa87fc8
Merge pull request #11 from dhil/wasmfx-merge
dhil Oct 20, 2023
dbc1d73
Merge with upstream
dhil Nov 13, 2023
bb16de3
Merge branch 'main' of github.com:WebAssembly/function-references int…
dhil Nov 13, 2023
c27a005
Merge with GC
dhil Nov 13, 2023
4ce0657
Merge with spec, function-references, and gc
dhil Nov 13, 2023
ab570e6
Merge pull request #12 from dhil/wasmfx-merge
dhil Nov 13, 2023
c17b4a6
Merge with WebAssembly/spec
dhil Nov 15, 2023
72b3d35
Merge branch 'main' of github.com:WebAssembly/gc into wasmfx-merge
dhil Nov 15, 2023
d55bb61
Merge pull request #13 from dhil/wasmfx-merge
dhil Nov 15, 2023
41bf3b9
Update Overview.md (#15)
dhil Dec 6, 2023
2168ade
Merge branch 'main' of github.com:WebAssembly/function-references int…
dhil Dec 6, 2023
50b8d7d
Merge branch 'main' of github.com:WebAssembly/gc into wasmfx-merge
dhil Dec 6, 2023
b77ab8d
Merge with WebAssembly/spec, WebAssembly/function-references, and Web…
dhil Dec 6, 2023
4310c76
Merge pull request #16 from dhil/wasmfx-merge
dhil Dec 6, 2023
a9ec313
Resolve wasmfx/specfx#17 (#18)
dhil Jan 25, 2024
a9e6111
Merge branch 'main' of github.com:WebAssembly/spec into wasmfx-merge
dhil Jan 25, 2024
848ebad
Merge pull request #20 from dhil/wasmfx
dhil Jan 25, 2024
b585eb9
Merge pull request #21 from dhil/wasmfx-merge
dhil Jan 25, 2024
00b7aca
Merge with WebAssembly/function-references
dhil Jan 25, 2024
6c78ed3
Merge pull request #22 from dhil/wasmfx-fr-merge
dhil Jan 25, 2024
3e3abe7
Merge with WebAssembly/gc
dhil Jan 25, 2024
e746b32
Merge pull request #23 from dhil/wasmfx-gc-merge
dhil Jan 25, 2024
c8cbfd2
Merge with WebAssembly/main
dhil Feb 12, 2024
4663060
Merge pull request #24 from dhil/wasmfx-merge
dhil Feb 12, 2024
d534658
Merge with WebAssembly/function-references
dhil Feb 12, 2024
4fb7135
Merge with WebAssembly/gc
dhil Feb 12, 2024
25a78b9
Merge pull request #25 from dhil/wasmfx-merge
dhil Feb 12, 2024
ee9cbe7
Update the instruction set descriptions in the Explainer document (#27)
dhil Feb 13, 2024
88774bd
[spec] minor formatting adjustment
takikawa Feb 15, 2024
2361fee
Merge pull request #524 from takikawa/adjust-spacing-match
rossberg Feb 15, 2024
2992099
Merge branch 'main' of github.com:WebAssembly/spec into wasmfx-merge
dhil Feb 15, 2024
a33a6a0
Merge branch 'main' of github.com:WebAssembly/gc into wasmfx-merge
dhil Feb 15, 2024
0af205c
Merge pull request #28 from dhil/wasmfx-merge
dhil Feb 15, 2024
10286c8
Merge branch 'wasm-3.0+exn' of github.com:WebAssembly/spec into wasmf…
dhil Apr 12, 2024
e49a5b7
Maybe fix bikeshed error; at least silencing it for now.
dhil Apr 12, 2024
02de8d1
Disable W3C publish workflow
dhil Apr 12, 2024
b0a7c47
Merge pull request #29 from dhil/wasmfx-wasm3.0+exn
dhil Apr 12, 2024
a324dba
Fix control-lwt example (#30)
dhil Apr 12, 2024
902e33d
WasmFX documents&examples
dhil Apr 12, 2024
217ed1b
Merge with wasmfx/specfx
dhil Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' of github.com:WebAssembly/function-references int…
…o funcref-merge
  • Loading branch information
dhil committed Sep 21, 2023
commit 1b8e62a44f09e1ada3b621e7f435dc9fb7087d00
6 changes: 0 additions & 6 deletions interpreter/valid/match.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ and eq_val_type t1 t2 =
| BotT, BotT -> true
| _, _ -> false

(* and eq_var_type t1 t2 =
* t1 = t2 *)

and eq_result_type ts1 ts2 =
List.length ts1 = List.length ts2 &&
List.for_all2 eq_val_type ts1 ts2
Expand Down Expand Up @@ -148,9 +145,6 @@ and match_global_type (GlobalT (mut1, t1)) (GlobalT (mut2, t2)) =
and match_tag_type (TagT ht1) (TagT ht2) =
match_heap_type ht1 ht2

(* and match_var_type t1 t2 =
* eq_var_type t1 t2 *)

let match_extern_type et1 et2 =
match et1, et2 with
| ExternFuncT ft1, ExternFuncT ft2 -> match_func_type ft1 ft2
Expand Down
2 changes: 1 addition & 1 deletion interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ let check_tag (c : context) (tag : tag) : context =
{c with tags = c.tags @ [tag']}



(* Modules *)

let check_type (c : context) (ty : type_) : context =
Expand All @@ -919,7 +920,6 @@ let check_import (c : context) (im : import) : context =
let et = check_tag_type c (TagT (VarHT (StatX x.it))) idesc.at in
{c with tags = c.tags @ [et]}


module NameSet = Set.Make(struct type t = Ast.name let compare = compare end)

let check_export (c : context) (set : NameSet.t) (ex : export) : NameSet.t =
Expand Down
40 changes: 40 additions & 0 deletions test/core/table.wast
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,61 @@
;; Table initializer

(module
(global (export "g") (ref $f) (ref.func $f))
(type $f (func))
(func $f)
)
(register "M")

(module
(global $g (import "M" "g") (ref $dummy))

(type $dummy (func))
(func $dummy)

(table $t1 10 funcref)
(table $t2 10 funcref (ref.func $dummy))
(table $t3 10 (ref $dummy) (ref.func $dummy))
(table $t4 10 funcref (global.get $g))
(table $t5 10 (ref $dummy) (global.get $g))

(func (export "get1") (result funcref) (table.get $t1 (i32.const 1)))
(func (export "get2") (result funcref) (table.get $t2 (i32.const 4)))
(func (export "get3") (result funcref) (table.get $t3 (i32.const 7)))
(func (export "get4") (result funcref) (table.get $t4 (i32.const 8)))
(func (export "get5") (result funcref) (table.get $t5 (i32.const 9)))
)

(assert_return (invoke "get1") (ref.null))
(assert_return (invoke "get2") (ref.func))
(assert_return (invoke "get3") (ref.func))
(assert_return (invoke "get4") (ref.func))
(assert_return (invoke "get5") (ref.func))


(assert_invalid
(module
(type $f (func))
(table 10 (ref $f))
)
"type mismatch"
)

(assert_invalid
(module
(type $f (func))
(table 0 (ref $f))
)
"type mismatch"
)

(assert_invalid
(module
(type $f (func))
(table 0 0 (ref $f))
)
"type mismatch"
)


(assert_invalid
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.