Skip to content

Commit 56acc5a

Browse files
authored
[wast] Rename extern.internalize and extern.externalize (#1298)
* [wast] Rename extern.internalize and extern.externalize. Due to a recent change in wasm-gc, extern.internalize was renamed to any.convert_extern and extern.externalize to extern.convert_any. * Update submodule testsuite * Update wast files to align with new tests.
1 parent 4293723 commit 56acc5a

File tree

49 files changed

+109
-132
lines changed

Some content is hidden

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

49 files changed

+109
-132
lines changed

crates/wast/src/core/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ instructions! {
649649
BrOnCastFail(Box<BrOnCastFail<'a>>) : [] : "br_on_cast_fail",
650650

651651
// gc proposal extern/any coercion operations
652-
ExternInternalize : [0xfb, 0x1a] : "extern.internalize",
653-
ExternExternalize : [0xfb, 0x1b] : "extern.externalize",
652+
AnyConvertExtern : [0xfb, 0x1a] : "any.convert_extern",
653+
ExternConvertAny : [0xfb, 0x1b] : "extern.convert_any",
654654

655655
I32Const(i32) : [0x41] : "i32.const",
656656
I64Const(i64) : [0x42] : "i64.const",

tests/roundtrip.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,13 @@ fn skip_validation(test: &Path) -> bool {
186186
"/proposals/gc/ref_test.wast",
187187
"/proposals/gc/struct.wast",
188188
"/proposals/gc/type-subtyping.wast",
189+
"/proposals/exception-handling/try_table.wast",
190+
"/proposals/exception-handling/throw_ref.wast",
191+
"/proposals/exception-handling/ref_null.wast",
189192
"/exnref/exnref.wast",
190193
"/exnref/throw_ref.wast",
191194
"/exnref/try_table.wast",
195+
"obsolete-keywords.wast",
192196
];
193197
let test_path = test.to_str().unwrap().replace("\\", "/"); // for windows paths
194198
if broken.iter().any(|x| test_path.contains(x)) {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(module
2+
(type (;0;) (func (result i32)))
3+
(func (;0;) (type 0) (result i32)
4+
i32.const 1
5+
i32.const 2
6+
return
7+
)
8+
(func (;1;) (type 0) (result i32)
9+
i32.const 1
10+
)
11+
(func (;2;) (type 0) (result i32)
12+
i32.const 1
13+
i32.const 2
14+
return
15+
)
16+
(export "f1" (func 0))
17+
(export "f2" (func 1))
18+
(export "f3" (func 2))
19+
)

tests/snapshots/testsuite/if.wast/0.print

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,17 @@
862862
drop
863863
drop
864864
)
865+
(func (;52;) (type $block-sig-1)
866+
i32.const 0
867+
if ;; label = @1
868+
else
869+
end
870+
i32.const 1
871+
i32.eqz
872+
if ;; label = @1
873+
else
874+
end
875+
)
865876
(table (;0;) 1 1 funcref)
866877
(memory (;0;) 1)
867878
(global $a (;0;) (mut i32) i32.const 10)
@@ -914,5 +925,6 @@
914925
(export "add64_u_with_carry" (func $add64_u_with_carry))
915926
(export "add64_u_saturated" (func $add64_u_saturated))
916927
(export "type-use" (func 51))
928+
(export "atypical-condition" (func 52))
917929
(elem (;0;) (i32.const 0) func $func)
918930
)

tests/snapshots/testsuite/proposals/exception-handling/rethrow.wast/0.print

Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(module
2+
(type (;0;) (func))
3+
(func (;0;) (type 0)
4+
throw 0
5+
)
6+
(tag (;0;) (type 0))
7+
(export "e0" (tag 0))
8+
(export "throw" (func 0))
9+
)

tests/snapshots/testsuite/proposals/gc/if.wast/0.print

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,17 @@
862862
drop
863863
drop
864864
)
865+
(func (;52;) (type $block-sig-1)
866+
i32.const 0
867+
if ;; label = @1
868+
else
869+
end
870+
i32.const 1
871+
i32.eqz
872+
if ;; label = @1
873+
else
874+
end
875+
)
865876
(table (;0;) 1 1 funcref)
866877
(memory (;0;) 1)
867878
(global $a (;0;) (mut i32) i32.const 10)
@@ -914,5 +925,6 @@
914925
(export "add64_u_with_carry" (func $add64_u_with_carry))
915926
(export "add64_u_saturated" (func $add64_u_saturated))
916927
(export "type-use" (func 51))
928+
(export "atypical-condition" (func 52))
917929
(elem (;0;) (i32.const 0) func $func)
918930
)
Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
(module
2-
(type $dummy (;0;) (func))
3-
(type (;1;) (func (result funcref)))
4-
(func $dummy (;0;) (type $dummy))
5-
(func (;1;) (type 1) (result funcref)
6-
i32.const 1
7-
table.get $t1
8-
)
9-
(func (;2;) (type 1) (result funcref)
10-
i32.const 4
11-
table.get $t2
12-
)
13-
(func (;3;) (type 1) (result funcref)
14-
i32.const 7
15-
table.get $t3
16-
)
17-
(table $t1 (;0;) 10 funcref)
18-
(table $t2 (;1;) 10 funcref ref.func $dummy)
19-
(table $t3 (;2;) 10 (ref 0) ref.func $dummy)
20-
(export "get1" (func 1))
21-
(export "get2" (func 2))
22-
(export "get3" (func 3))
2+
(type $f (;0;) (func))
3+
(func $f (;0;) (type $f))
4+
(global (;0;) (ref 0) ref.func $f)
5+
(export "g" (global 0))
236
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
(module
2+
(type $dummy (;0;) (func))
3+
(type (;1;) (func (result funcref)))
4+
(import "M" "g" (global $g (;0;) (ref 0)))
5+
(func $dummy (;0;) (type $dummy))
6+
(func (;1;) (type 1) (result funcref)
7+
i32.const 1
8+
table.get $t1
9+
)
10+
(func (;2;) (type 1) (result funcref)
11+
i32.const 4
12+
table.get $t2
13+
)
14+
(func (;3;) (type 1) (result funcref)
15+
i32.const 7
16+
table.get $t3
17+
)
18+
(func (;4;) (type 1) (result funcref)
19+
i32.const 8
20+
table.get $t4
21+
)
22+
(func (;5;) (type 1) (result funcref)
23+
i32.const 9
24+
table.get $t5
25+
)
26+
(table $t1 (;0;) 10 funcref)
27+
(table $t2 (;1;) 10 funcref ref.func $dummy)
28+
(table $t3 (;2;) 10 (ref 0) ref.func $dummy)
29+
(table $t4 (;3;) 10 funcref global.get $g)
30+
(table $t5 (;4;) 10 (ref 0) global.get $g)
31+
(export "get1" (func 1))
32+
(export "get2" (func 2))
33+
(export "get3" (func 3))
34+
(export "get4" (func 4))
35+
(export "get5" (func 5))
36+
)

tests/snapshots/testsuite/proposals/gc/type-equivalence.wast/22.print

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
(type $t2 (;0;) (func (param i32 (ref 0))))
44
)
55
(type (;1;) (func (param (ref 0))))
6-
(import "M" "f" (func (;0;) (type 1)))
6+
(import "Mr1" "f" (func (;0;) (type 1)))
77
)

0 commit comments

Comments
 (0)