Skip to content

Commit

Permalink
Merge branch 'funcref'
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg committed Sep 7, 2023
2 parents e80576e + eab6b36 commit a20d667
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 4 additions & 1 deletion document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@

.. |toF| mathdef:: \xref{syntax/types}{syntax-functype}{\rightarrow}
.. |to| mathdef:: \xref{syntax/types}{syntax-instrtype}{\rightarrow}
.. |toX#1| mathdef:: \xref{syntax/types}{syntax-instrtype}{\rightarrow_{#1}}
.. Unfortunately, MathJax somehow barfs on the use of xref in the expansion
of a macro with parameters, so we cannot hyperlink the arrow
.. |toX#1| mathdef:: \xref{syntax/types}{syntax-instrtype}{\rightarrow_{#1}}
.. |toX#1| mathdef:: \rightarrow_{#1}

.. |BOTH| mathdef:: \xref{valid/conventions}{syntax-heaptype-ext}{\K{bot}}
.. |BOT| mathdef:: \xref{valid/conventions}{syntax-valtype-ext}{\K{bot}}
Expand Down
10 changes: 5 additions & 5 deletions proposals/function-references/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Typing of instruction sequences is updated to account for initialization of loca
- `epsilon : [] -> [] epsilon`

Note: These typing rules do not try to eliminate duplicate indices, but an implementation could.

A subsumption rule allows to go to a supertype for any instruction:

* `instr`
Expand Down Expand Up @@ -302,8 +302,8 @@ Table definitions have an initialiser value:
| ------ | --------------- | ---------- |
| -0x10 | `funcref` | |
| -0x11 | `externref` | |
| -0x14 | `(ref null ht)` | `$t : heaptype` |
| -0x15 | `(ref ht)` | `$t : heaptype` |
| -0x1c | `(ref ht)` | `$t : heaptype` |
| -0x1d | `(ref null ht)` | `$t : heaptype` |

#### Heap Types

Expand All @@ -321,8 +321,8 @@ The opcode for heap types is encoded as an `s33`.
| ------ | ------------------------ | ---------- |
| 0x14 | `call_ref $t` | `$t : u32` |
| 0x15 | `return_call_ref $t` | `$t : u32` |
| 0xd3 | `ref.as_non_null` | |
| 0xd4 | `br_on_null $l` | `$l : u32` |
| 0xd4 | `ref.as_non_null` | |
| 0xd5 | `br_on_null $l` | `$l : u32` |
| 0xd6 | `br_on_non_null $l` | `$l : u32` |

### Tables
Expand Down
10 changes: 5 additions & 5 deletions test/core/type-equivalence.wast
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@
(func (export "f1") (param (ref $t1)))
(func (export "f2") (param (ref $t1)))
)
(register "M")
(register "N")
(module
(type $s0 (func (param i32) (result f32)))
(type $s1 (func (param i32 (ref $s0)) (result (ref $s0))))
(type $s2 (func (param i32 (ref $s0)) (result (ref $s0))))
(type $t1 (func (param (ref $s1)) (result (ref $s2))))
(type $t2 (func (param (ref $s2)) (result (ref $s1))))
(func (import "M" "f1") (param (ref $t1)))
(func (import "M" "f1") (param (ref $t2)))
(func (import "M" "f2") (param (ref $t1)))
(func (import "M" "f2") (param (ref $t1)))
(func (import "N" "f1") (param (ref $t1)))
(func (import "N" "f1") (param (ref $t2)))
(func (import "N" "f2") (param (ref $t1)))
(func (import "N" "f2") (param (ref $t1)))
)


Expand Down

0 comments on commit a20d667

Please sign in to comment.