Skip to content

Commit

Permalink
Merge pull request #447 from WebAssembly/extern-cvt-rename
Browse files Browse the repository at this point in the history
Rename extern.in/externalize
  • Loading branch information
rossberg authored Oct 5, 2023
2 parents bdad982 + 5bca3f7 commit 0102418
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 73 deletions.
4 changes: 2 additions & 2 deletions document/core/appendix/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ Added managed reference types [#proposal-gc]_.

* New :ref:`reference instructions <syntax-instr-ref>` for :ref:`array types <syntax-structtype>`: |ARRAYNEW|, |ARRAYNEWDEFAULT|, |ARRAYNEWFIXED|, |ARRAYNEWDATA|, |ARRAYNEWELEM|, :math:`\ARRAYGET\K{\_}\sx^?`, |ARRAYSET|, |ARRAYLEN|, |ARRAYFILL|, |ARRAYCOPY|, |ARRAYINITDATA|, |ARRAYINITELEM|

* New :ref:`reference instructions <syntax-instr-ref>` for converting :ref:`host types <syntax-externtype>`: |EXTERNINTERNALIZE|, |EXTERNEXTERNALIZE|
* New :ref:`reference instructions <syntax-instr-ref>` for converting :ref:`host types <syntax-externtype>`: |ANYCONVERTEXTERN|, |EXTERNCONVERTANY|

* Extended set of :ref:`constant instructions <valid-const>` with |REFI31|, |STRUCTNEW|, |STRUCTNEWDEFAULT|, |ARRAYNEW|, |ARRAYNEWDEFAULT|, |ARRAYNEWFIXED|, |EXTERNINTERNALIZE|, |EXTERNEXTERNALIZE|, and |GLOBALGET| for any previously declared immutable :ref:`global <syntax-global>`
* Extended set of :ref:`constant instructions <valid-const>` with |REFI31|, |STRUCTNEW|, |STRUCTNEWDEFAULT|, |ARRAYNEW|, |ARRAYNEWDEFAULT|, |ARRAYNEWFIXED|, |ANYCONVERTEXTERN|, |EXTERNCONVERTANY|, and |GLOBALGET| for any previously declared immutable :ref:`global <syntax-global>`


.. [#proposal-signext]
Expand Down
4 changes: 2 additions & 2 deletions document/core/appendix/index-instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
Instruction(r'\REFCAST~(\REF~\NULL~t)', r'\hex{FB}~\hex{17}', r"[(\REF~\NULL~t')] \to [(\REF~\NULL~t)]", r'valid-ref.cast', r'exec-ref.cast'),
Instruction(r'\BRONCAST~t_1~t_2', r'\hex{FB}~\hex{18}', r'[t_1] \to [t_1\reftypediff t_2]', r'valid-br_on_cast', r'exec-br_on_cast'),
Instruction(r'\BRONCASTFAIL~t_1~t_2', r'\hex{FB}~\hex{19}', r'[t_1] \to [t_2]', r'valid-br_on_cast_fail', r'exec-br_on_cast_fail'),
Instruction(r'\EXTERNINTERNALIZE', r'\hex{FB}~\hex{1A}', r'[\EXTERNREF] \to [\ANYREF]', r'valid-extern.internalize', r'exec-extern.internalize'),
Instruction(r'\EXTERNEXTERNALIZE', r'\hex{FB}~\hex{1B}', r'[\ANYREF] \to [\EXTERNREF]', r'valid-extern.externalize', r'exec-extern.externalize'),
Instruction(r'\ANYCONVERTEXTERN', r'\hex{FB}~\hex{1A}', r'[\EXTERNREF] \to [\ANYREF]', r'valid-any.convert_extern', r'exec-any.convert_extern'),
Instruction(r'\EXTERNCONVERTANY', r'\hex{FB}~\hex{1B}', r'[\ANYREF] \to [\EXTERNREF]', r'valid-extern.convert_any', r'exec-extern.convert_any'),
Instruction(r'\REFI31', r'\hex{FB}~\hex{1C}', r'[\I32] \to [\I31REF]', r'valid-ref.i31', r'exec-ref.i31'),
Instruction(r'\I31GETS', r'\hex{FB}~\hex{1D}', r'[\I31REF] \to [\I32]', r'valid-i31.get_sx', r'exec-i31.get_sx'),
Instruction(r'\I31GETU', r'\hex{FB}~\hex{1E}', r'[\I31REF] \to [\I32]', r'valid-i31.get_sx', r'exec-i31.get_sx'),
Expand Down
8 changes: 4 additions & 4 deletions document/core/binary/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ Generic :ref:`reference instructions <syntax-instr-ref>` are represented by sing
.. _binary-i31.get_u:
.. _binary-ref.test:
.. _binary-ref.cast:
.. _binary-extern.internalize:
.. _binary-extern.externalize:
.. _binary-any.convert_extern:
.. _binary-extern.convert_any:

.. math::
\begin{array}{llclll}
Expand Down Expand Up @@ -166,8 +166,8 @@ Generic :ref:`reference instructions <syntax-instr-ref>` are represented by sing
\hex{FB}~~21{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFTEST~(\REF~\NULL~\X{ht}) \\ &&|&
\hex{FB}~~22{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFCAST~(\REF~\X{ht}) \\ &&|&
\hex{FB}~~23{:}\Bu32~~\X{ht}{:}\Bheaptype &\Rightarrow& \REFCAST~(\REF~\NULL~\X{ht}) \\ &&|&
\hex{FB}~~26{:}\Bu32 &\Rightarrow& \EXTERNINTERNALIZE \\ &&|&
\hex{FB}~~27{:}\Bu32 &\Rightarrow& \EXTERNEXTERNALIZE \\ &&|&
\hex{FB}~~26{:}\Bu32 &\Rightarrow& \ANYCONVERTEXTERN \\ &&|&
\hex{FB}~~27{:}\Bu32 &\Rightarrow& \EXTERNCONVERTANY \\ &&|&
\hex{FB}~~28{:}\Bu32 &\Rightarrow& \REFI31 \\ &&|&
\hex{FB}~~29{:}\Bu32 &\Rightarrow& \I31GETS \\ &&|&
\hex{FB}~~30{:}\Bu32 &\Rightarrow& \I31GETU \\
Expand Down
28 changes: 14 additions & 14 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1475,43 +1475,43 @@ Where:
\end{array}
.. _exec-extern.externalize:
.. _exec-any.convert_extern:

:math:`\EXTERNEXTERNALIZE`
..........................
:math:`\ANYCONVERTEXTERN`
.........................

1. Assert: due to :ref:`validation <valid-extern.externalize>`, a :ref:`reference value <syntax-ref>` is on the top of the stack.
1. Assert: due to :ref:`validation <valid-any.convert_extern>`, a :ref:`reference value <syntax-ref>` is on the top of the stack.

2. Pop the value :math:`\reff` from the stack.

3. Let :math:`\reff'` be the reference value :math:`(\REFEXTERN~\reff)`.
3. Assert: due to :ref:`validation <valid-any.convert_extern>`, a :math:`\reff` is an :ref:`external reference <syntax-ref.extern>`.

4. Let :math:`\REFEXTERN~\reff'` be the reference value :math:`\reff`.

5. Push the reference value :math:`\reff'` to the stack.

.. math::
\begin{array}{lcl@{\qquad}l}
\reff~\EXTERNEXTERNALIZE &\stepto& (\REFEXTERN~\reff)
(\REFEXTERN~\reff)~\ANYCONVERTEXTERN &\stepto& \reff
\end{array}
.. _exec-extern.internalize:
.. _exec-extern.convert_any:

:math:`\EXTERNINTERNALIZE`
..........................
:math:`\EXTERNCONVERTANY`
.........................

1. Assert: due to :ref:`validation <valid-extern.internalize>`, a :ref:`reference value <syntax-ref>` is on the top of the stack.
1. Assert: due to :ref:`validation <valid-extern.convert_any>`, a :ref:`reference value <syntax-ref>` is on the top of the stack.

2. Pop the value :math:`\reff` from the stack.

3. Assert: due to :ref:`validation <valid-extern.internalize>`, a :math:`\reff` is an :ref:`external reference <syntax-ref.extern>`.

4. Let :math:`\REFEXTERN~\reff'` be the reference value :math:`\reff`.
3. Let :math:`\reff'` be the reference value :math:`(\REFEXTERN~\reff)`.

5. Push the reference value :math:`\reff'` to the stack.

.. math::
\begin{array}{lcl@{\qquad}l}
(\REFEXTERN~\reff)~\EXTERNINTERNALIZE &\stepto& \reff
\reff~\EXTERNCONVERTANY &\stepto& (\REFEXTERN~\reff)
\end{array}
Expand Down
10 changes: 5 additions & 5 deletions document/core/syntax/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ while the latter performs a downcast and :ref:`traps <trap>` if the operand's ty
.. _syntax-ref.i31:
.. _syntax-i31.get_s:
.. _syntax-i31.get_u:
.. _syntax-extern.internalize:
.. _syntax-extern.externalize:
.. _syntax-any.convert_extern:
.. _syntax-extern.convert_any:
.. _syntax-instr-struct:
.. _syntax-instr-array:
.. _syntax-instr-i31:
Expand Down Expand Up @@ -521,8 +521,8 @@ Instructions in this group are concerned with creating and accessing :ref:`refer
\ARRAYINITELEM~\typeidx~\elemidx \\&&|&
\REFI31 \\&&|&
\I31GET\K{\_}\sx \\&&|&
\EXTERNINTERNALIZE \\&&|&
\EXTERNEXTERNALIZE \\
\ANYCONVERTEXTERN \\&&|&
\EXTERNCONVERTANY \\
\end{array}
The instructions |STRUCTNEW| and |STRUCTNEWDEFAULT| allocate a new :ref:`structure <syntax-structtype>`, initializing them either with operands or with default values.
Expand All @@ -539,7 +539,7 @@ again allowing for different sign extension modes in the case of a :ref:`packed

The instructions |REFI31| and :math:`\I31GET\K{\_}\sx` convert between type |I31| and an unboxed :ref:`scalar <syntax-i31>`.

The instructions |EXTERNINTERNALIZE| and |EXTERNEXTERNALIZE| allow lossless conversion between references represented as type :math:`(\REF~\NULL~\EXTERN)`| and as :math:`(\REF~\NULL~\ANY)`.
The instructions |ANYCONVERTEXTERN| and |EXTERNCONVERTANY| allow lossless conversion between references represented as type :math:`(\REF~\NULL~\EXTERN)`| and as :math:`(\REF~\NULL~\ANY)`.

.. index:: ! parametric instruction, value type
pair: abstract syntax; instruction
Expand Down
2 changes: 1 addition & 1 deletion document/core/syntax/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ There are three disjoint hierarchies of heap types:
- *aggregate types* classify dynamically allocated *managed* data, such as *structures*, *arrays*, or *unboxed scalars*,
- *external types* classify *external* references possibly owned by the :ref:`embedder <embedder>`.

The values from the latter two hierarchies are interconvertible by ways of the |EXTERNINTERNALIZE| and |EXTERNEXTERNALIZE| instructions.
The values from the latter two hierarchies are interconvertible by ways of the |EXTERNCONVERTANY| and |ANYCONVERTEXTERN| instructions.
That is, both type hierarchies are inhabited by an isomorphic set of values, but may have different, incompatible representations in practice.

.. math::
Expand Down
8 changes: 4 additions & 4 deletions document/core/text/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ Reference Instructions
.. _text-i31.get_u:
.. _text-ref.test:
.. _text-ref.cast:
.. _text-extern.internalize:
.. _text-extern.externalize:
.. _text-any.convert_extern:
.. _text-extern.convert_any:

.. math::
\begin{array}{llclll}
Expand Down Expand Up @@ -240,8 +240,8 @@ Reference Instructions
\text{ref.i31} &\Rightarrow& \REFI31 \\ &&|&
\text{i31.get\_u} &\Rightarrow& \I31GETU \\ &&|&
\text{i31.get\_s} &\Rightarrow& \I31GETS \\ &&|&
\text{extern.internalize} &\Rightarrow& \EXTERNINTERNALIZE \\ &&|&
\text{extern.externalize} &\Rightarrow& \EXTERNEXTERNALIZE \\
\text{any.convert_extern} &\Rightarrow& \ANYCONVERTEXTERN \\ &&|&
\text{extern.convert_any} &\Rightarrow& \EXTERNCONVERTANY \\
\end{array}
Expand Down
4 changes: 2 additions & 2 deletions document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@
.. |I31GETS| mathdef:: \xref{syntax/instructions}{syntax-instr-i31}{\K{i31.get\_s}}
.. |I31GETU| mathdef:: \xref{syntax/instructions}{syntax-instr-i31}{\K{i31.get\_u}}

.. |EXTERNINTERNALIZE| mathdef:: \xref{syntax/instructions}{syntax-instr-extern}{\K{extern.internalize}}
.. |EXTERNEXTERNALIZE| mathdef:: \xref{syntax/instructions}{syntax-instr-extern}{\K{extern.externalize}}
.. |ANYCONVERTEXTERN| mathdef:: \xref{syntax/instructions}{syntax-instr-extern}{\K{any.convert_extern}}
.. |EXTERNCONVERTANY| mathdef:: \xref{syntax/instructions}{syntax-instr-extern}{\K{extern.convert_any}}

.. |CONST| mathdef:: \xref{syntax/instructions}{syntax-instr-numeric}{\K{const}}
.. |EQZ| mathdef:: \xref{syntax/instructions}{syntax-instr-numeric}{\K{eqz}}
Expand Down
16 changes: 8 additions & 8 deletions document/core/valid/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -765,32 +765,32 @@ Scalar Reference Instructions
External Reference Instructions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. _valid-extern.internalize:
.. _valid-any.convert_extern:

:math:`\EXTERNINTERNALIZE`
..........................
:math:`\ANYCONVERTEXTERN`
.........................

* The instruction is valid with type :math:`[(\REF~\NULL_1^?~\EXTERN)] \to [(\REF~\NULL_2^?~\ANY)]` for any :math:`\NULL_1^?` that equals :math:`\NULL_2^?`.

.. math::
\frac{
\NULL_1^? = \NULL_2^?
}{
C \vdashinstr \EXTERNINTERNALIZE : [(\REF~\NULL_1^?~\EXTERN)] \to [(\REF~\NULL_2^?~\ANY)]
C \vdashinstr \ANYCONVERTEXTERN : [(\REF~\NULL_1^?~\EXTERN)] \to [(\REF~\NULL_2^?~\ANY)]
}
.. _valid-extern.externalize:
.. _valid-extern.convert_any:

:math:`\EXTERNEXTERNALIZE`
..........................
:math:`\EXTERNCONVERTANY`
.........................

* The instruction is valid with type :math:`[(\REF~\NULL_1^?~\ANY)] \to [(\REF~\NULL_2^?~\EXTERN)]` for any :math:`\NULL_1^?` that equals :math:`\NULL_2^?`.

.. math::
\frac{
\NULL_1^? = \NULL_2^?
}{
C \vdashinstr \EXTERNEXTERNALIZE : [(\REF~\NULL_1^?~\ANY)] \to [(\REF~\NULL_2^?~\EXTERN)]
C \vdashinstr \EXTERNCONVERTANY : [(\REF~\NULL_1^?~\ANY)] \to [(\REF~\NULL_2^?~\EXTERN)]
}
Expand Down
4 changes: 2 additions & 2 deletions interpreter/binary/decode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ let rec instr s =
let rt2 = ((if bit 1 flags then Null else NoNull), heap_type s) in
(if opcode = 0x18l then br_on_cast else br_on_cast_fail) x rt1 rt2

| 0x1al -> extern_internalize
| 0x1bl -> extern_externalize
| 0x1al -> any_convert_extern
| 0x1bl -> extern_convert_any

| 0x1cl -> ref_i31
| 0x1dl -> i31_get_s
Expand Down
4 changes: 2 additions & 2 deletions interpreter/syntax/operators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ let array_fill x = ArrayFill x
let array_init_data x y = ArrayInitData (x, y)
let array_init_elem x y = ArrayInitElem (x, y)

let extern_internalize = ExternConvert Internalize
let extern_externalize = ExternConvert Externalize
let any_convert_extern = ExternConvert Internalize
let extern_convert_any = ExternConvert Externalize

let i32_clz = Unary (I32 I32Op.Clz)
let i32_ctz = Unary (I32 I32Op.Ctz)
Expand Down
6 changes: 3 additions & 3 deletions interpreter/text/arrange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ let initop = function
| Implicit -> "_default"

let externop = function
| Internalize -> "internalize"
| Externalize -> "externalize"
| Internalize -> "any.convert_extern"
| Externalize -> "extern.convert_any"


(* Expressions *)
Expand Down Expand Up @@ -562,7 +562,7 @@ let rec instr e =
| ArrayFill x -> "array.fill " ^ var x, []
| ArrayInitData (x, y) -> "array.init_data " ^ var x ^ " " ^ var y, []
| ArrayInitElem (x, y) -> "array.init_elem " ^ var x ^ " " ^ var y, []
| ExternConvert op -> "extern." ^ externop op, []
| ExternConvert op -> externop op, []
| Const n -> constop n.it ^ " " ^ num n, []
| Test op -> testop op, []
| Compare op -> relop op, []
Expand Down
4 changes: 2 additions & 2 deletions interpreter/text/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ rule token = parse
| "array.init_data" -> ARRAY_INIT_DATA
| "array.init_elem" -> ARRAY_INIT_ELEM

| "extern.internalize" -> EXTERN_CONVERT extern_internalize
| "extern.externalize" -> EXTERN_CONVERT extern_externalize
| "any.convert_extern" -> EXTERN_CONVERT any_convert_extern
| "extern.convert_any" -> EXTERN_CONVERT extern_convert_any

| "i32.clz" -> UNARY i32_clz
| "i32.ctz" -> UNARY i32_ctz
Expand Down
18 changes: 9 additions & 9 deletions proposals/gc/MVP.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,17 +641,17 @@ In particular, `ref.null` is typed as before, despite the introduction of `none`

#### External conversion

* `extern.internalize` converts an external value into the internal representation
- `extern.internalize : [(ref null1? extern)] -> [(ref null2? any)]`
* `any.convert_extern` converts an external value into the internal representation
- `any.convert_extern : [(ref null1? extern)] -> [(ref null2? any)]`
- iff `null1? = null2?`
- this is a *constant instruction*
- note: this succeeds for all values, composing this with `extern.externalize` (in either order) yields the original value
- note: this succeeds for all values, composing this with `extern.convert_any` (in either order) yields the original value

* `extern.externalize` converts an internal value into the external representation
- `extern.externalize : [(ref null1? any)] -> [(ref null2? extern)]`
* `extern.convert_any` converts an internal value into the external representation
- `extern.convert_any : [(ref null1? any)] -> [(ref null2? extern)]`
- iff `null1? = null2?`
- this is a *constant instruction*
- note: this succeeds for all values; moreover, composing this with `extern.internalize` (in either order) yields the original value
- note: this succeeds for all values; moreover, composing this with `any.convert_extern` (in either order) yields the original value


#### Casts
Expand Down Expand Up @@ -707,7 +707,7 @@ In order to allow RTTs to be initialised as globals, the following extensions ar
* `struct.new` and `struct.new_default` are constant instructions
* `array.new`, `array.new_default`, and `array.new_fixed` are constant instructions
- Note: `array.new_data` and `array.new_elem` are not for the time being, see above
* `extern.internalize` and `extern.externalize` are constant instructions
* `any.convert_extern` and `extern.convert_any` are constant instructions
* `global.get` is a constant instruction and can access preceding (immutable) global definitions, not just imports as in the MVP


Expand Down Expand Up @@ -832,8 +832,8 @@ The opcode for heap types is encoded as an `s33`.
| 0xfb17 | `ref.cast (ref null ht)` | `ht : heaptype` |
| 0xfb18 | `br_on_cast $l (ref null1? ht1) (ref null2? ht2)` | `flags : u8`, `$l : labelidx`, `ht1 : heaptype`, `ht2 : heaptype` |
| 0xfb19 | `br_on_cast_fail $l (ref null1? ht1) (ref null2? ht2)` | `flags : u8`, `$l : labelidx`, `ht1 : heaptype`, `ht2 : heaptype` |
| 0xfb1a | `extern.internalize` |
| 0xfb1b | `extern.externalize` |
| 0xfb1a | `any.convert_extern` |
| 0xfb1b | `extern.convert_any` |
| 0xfb1c | `ref.i31` |
| 0xfb1d | `i31.get_s` |
| 0xfb1e | `i31.get_u` |
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/br_on_cast.wast
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(table.set (i32.const 1) (ref.i31 (i32.const 7)))
(table.set (i32.const 2) (struct.new $st (i32.const 6)))
(table.set (i32.const 3) (array.new $at (i32.const 5) (i32.const 3)))
(table.set (i32.const 4) (extern.internalize (local.get $x)))
(table.set (i32.const 4) (any.convert_extern (local.get $x)))
)

(func (export "br_on_null") (param $i i32) (result i32)
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/br_on_cast_fail.wast
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(table.set (i32.const 1) (ref.i31 (i32.const 7)))
(table.set (i32.const 2) (struct.new $st (i32.const 6)))
(table.set (i32.const 3) (array.new $at (i32.const 5) (i32.const 3)))
(table.set (i32.const 4) (extern.internalize (local.get $x)))
(table.set (i32.const 4) (any.convert_extern (local.get $x)))
)

(func (export "br_on_non_null") (param $i i32) (result i32)
Expand Down
10 changes: 5 additions & 5 deletions test/core/gc/extern.wast
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
(table.set (i32.const 1) (ref.i31 (i32.const 7)))
(table.set (i32.const 2) (struct.new_default $st))
(table.set (i32.const 3) (array.new_default $at (i32.const 0)))
(table.set (i32.const 4) (extern.internalize (local.get $x)))
(table.set (i32.const 4) (any.convert_extern (local.get $x)))
)

(func (export "internalize") (param externref) (result anyref)
(extern.internalize (local.get 0))
(any.convert_extern (local.get 0))
)
(func (export "externalize") (param anyref) (result externref)
(extern.externalize (local.get 0))
(extern.convert_any (local.get 0))
)

(func (export "externalize-i") (param i32) (result externref)
(extern.externalize (table.get (local.get 0)))
(extern.convert_any (table.get (local.get 0)))
)
(func (export "externalize-ii") (param i32) (result anyref)
(extern.internalize (extern.externalize (table.get (local.get 0))))
(any.convert_extern (extern.convert_any (table.get (local.get 0))))
)
)

Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/ref_cast.wast
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(table.set (i32.const 1) (ref.i31 (i32.const 7)))
(table.set (i32.const 2) (struct.new_default $st))
(table.set (i32.const 3) (array.new_default $at (i32.const 0)))
(table.set (i32.const 4) (extern.internalize (local.get $x)))
(table.set (i32.const 4) (any.convert_extern (local.get $x)))
(table.set (i32.const 5) (ref.null i31))
(table.set (i32.const 6) (ref.null struct))
(table.set (i32.const 7) (ref.null none))
Expand Down
10 changes: 5 additions & 5 deletions test/core/gc/ref_test.wast
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
(table.set $ta (i32.const 3) (ref.i31 (i32.const 7)))
(table.set $ta (i32.const 4) (struct.new_default $st))
(table.set $ta (i32.const 5) (array.new_default $at (i32.const 0)))
(table.set $ta (i32.const 6) (extern.internalize (local.get $x)))
(table.set $ta (i32.const 7) (extern.internalize (ref.null extern)))
(table.set $ta (i32.const 6) (any.convert_extern (local.get $x)))
(table.set $ta (i32.const 7) (any.convert_extern (ref.null extern)))

(table.set $tf (i32.const 0) (ref.null nofunc))
(table.set $tf (i32.const 1) (ref.null func))
Expand All @@ -29,9 +29,9 @@
(table.set $te (i32.const 0) (ref.null noextern))
(table.set $te (i32.const 1) (ref.null extern))
(table.set $te (i32.const 2) (local.get $x))
(table.set $te (i32.const 3) (extern.externalize (ref.i31 (i32.const 8))))
(table.set $te (i32.const 4) (extern.externalize (struct.new_default $st)))
(table.set $te (i32.const 5) (extern.externalize (ref.null any)))
(table.set $te (i32.const 3) (extern.convert_any (ref.i31 (i32.const 8))))
(table.set $te (i32.const 4) (extern.convert_any (struct.new_default $st)))
(table.set $te (i32.const 5) (extern.convert_any (ref.null any)))
)

(func (export "ref_test_null_data") (param $i i32) (result i32)
Expand Down

0 comments on commit 0102418

Please sign in to comment.