Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion scripts/gen-s-parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@
("resume", "makeResume()"),
("suspend", "makeSuspend()"),
# GC
("i31.new", "makeRefI31(Unshared)"), # deprecated
("ref.i31", "makeRefI31(Unshared)"),
("ref.i31_shared", "makeRefI31(Shared)"),
("i31.get_s", "makeI31Get(true)"),
Expand Down
29 changes: 9 additions & 20 deletions src/gen-s-parser.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1811,27 +1811,16 @@ switch (buf[0]) {
case '3': {
switch (buf[2]) {
case '1': {
switch (buf[4]) {
case 'g': {
switch (buf[8]) {
case 's':
if (op == "i31.get_s"sv) {
CHECK_ERR(makeI31Get(ctx, pos, annotations, true));
return Ok{};
}
goto parse_error;
case 'u':
if (op == "i31.get_u"sv) {
CHECK_ERR(makeI31Get(ctx, pos, annotations, false));
return Ok{};
}
goto parse_error;
default: goto parse_error;
switch (buf[8]) {
case 's':
if (op == "i31.get_s"sv) {
CHECK_ERR(makeI31Get(ctx, pos, annotations, true));
return Ok{};
}
}
case 'n':
if (op == "i31.new"sv) {
CHECK_ERR(makeRefI31(ctx, pos, annotations, Unshared));
goto parse_error;
case 'u':
if (op == "i31.get_u"sv) {
CHECK_ERR(makeI31Get(ctx, pos, annotations, false));
return Ok{};
}
goto parse_error;
Expand Down
18 changes: 0 additions & 18 deletions test/lit/i31-new.wast

This file was deleted.

22 changes: 11 additions & 11 deletions test/lit/passes/simplify-globals-single_use.wast
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
))
Expand Down Expand Up @@ -59,7 +59,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
))
Expand All @@ -85,7 +85,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
))
Expand Down Expand Up @@ -131,7 +131,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
))
Expand Down Expand Up @@ -160,7 +160,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
))
Expand Down Expand Up @@ -188,7 +188,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use1 anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
))
Expand All @@ -199,7 +199,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use2 anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 1337)
)
))
Expand All @@ -217,7 +217,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
(global $single-use3 anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 99999)
)
))
Expand Down Expand Up @@ -250,7 +250,7 @@
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: ))
(global $single-use1 anyref (struct.new $A
(i31.new
(ref.i31
(i32.const 42)
)
(ref.null any)
Expand All @@ -264,7 +264,7 @@
;; CHECK-NEXT: ))
(global $single-use2 anyref (struct.new $A
(ref.null any)
(i31.new
(ref.i31
(i32.const 1337)
)
))
Expand Down Expand Up @@ -297,7 +297,7 @@
;; CHECK: (global $single-use1 anyref (ref.i31
;; CHECK-NEXT: (i32.const 42)
;; CHECK-NEXT: ))
(global $single-use1 anyref (i31.new
(global $single-use1 anyref (ref.i31
(i32.const 42)
))

Expand Down
56 changes: 28 additions & 28 deletions test/lit/passes/stack-ir-non-nullable.wast
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -86,20 +86,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -135,20 +135,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -191,20 +191,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -245,20 +245,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -296,20 +296,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -345,20 +345,20 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
(then
(local.set $temp
(i31.new
(ref.i31
(i32.const 1)
)
)
)
(else
(local.set $temp
(i31.new
(ref.i31
(i32.const 2)
)
)
Expand Down Expand Up @@ -410,15 +410,15 @@
(tuple.extract 2 1
(local.get $temp)
)
(i31.new
(ref.i31
(i32.const 1)
)
)
(then
(local.set $temp
(tuple.make 2
(i32.const 2)
(i31.new
(ref.i31
(i32.const 3)
)
)
Expand All @@ -428,7 +428,7 @@
(local.set $temp
(tuple.make 2
(i32.const 4)
(i31.new
(ref.i31
(i32.const 5)
)
)
Expand Down Expand Up @@ -482,15 +482,15 @@
(tuple.extract 2 1
(local.get $temp)
)
(i31.new
(ref.i31
(i32.const 1)
)
)
(then
(local.set $temp
(tuple.make 2
(i32.const 2)
(i31.new
(ref.i31
(i32.const 3)
)
)
Expand All @@ -500,7 +500,7 @@
(local.set $temp
(tuple.make 2
(i32.const 4)
(i31.new
(ref.i31
(i32.const 5)
)
)
Expand Down Expand Up @@ -1015,7 +1015,7 @@
(if
(ref.eq
(local.get $temp)
(i31.new
(ref.i31
(i32.const 0)
)
)
Expand Down
Loading