Inline jump tables in parsed br_table instructions (#5755)

As jump tables are used by at most one br_table instruction, inline their definition in those instructions instead of requiring them to be declared as function-level metadata.
This commit is contained in:
Trevor Elliott
2023-02-09 14:24:04 -08:00
committed by GitHub
parent 202d3af16a
commit 15fe9c7c93
23 changed files with 54 additions and 200 deletions

View File

@@ -11,7 +11,6 @@ function u0:0(i64 vmctx, i64) fast {
gv2 = load.i64 notrap aligned gv1
sig0 = (i64 vmctx, i64) fast
fn0 = colocated u0:2 sig0
jt0 = jump_table [block1]
stack_limit = gv2
block0(v0: i64, v1: i64):
@@ -33,7 +32,7 @@ function u0:0(i64 vmctx, i64) fast {
block4:
@002e call fn0(v0, v0)
@0030 br_table v8, block1, jt0
@0030 br_table v8, block1, [block1]
block1:
@0036 return

View File

@@ -17,7 +17,6 @@ function u0:33() system_v {
ss0 = explicit_slot 32
sig0 = (i64, i64, i64, i64, i64) -> i64, i64 system_v
fn0 = colocated u0:0 sig0
jt0 = jump_table [block36, block38]
block0:
v80 = iconst.i32 0
v91 = iconst.i64 0
@@ -28,7 +27,7 @@ block0:
v237 = iconst.i64 0
v238, v239 = call fn0(v236, v237, v91, v92, v235) ; v236 = 0, v237 = 0, v91 = 0, v92 = 0, v235 = 0
v97 = iadd v238, v96 ; v96 = 0
br_table v80, block37, jt0 ; v80 = 0
br_table v80, block37, [block36, block38] ; v80 = 0
block36:
trap user0
block37: