Remove the concept of non-dense jump tables.
WebAssembly doesn't have non-dense jump tables, and higher-level users are better served by the facilities in lib/frontend/src/switch.rs for working with non-dense switches. This eliminates the concept of "absent" jump table entries, which were represented as "0" in the text format. Also, jump table contents are now enclosed in `[` and `]`, so that we can unambiguously display empty jump tables. Previously, empty jump tables were displayed as if they had a single absent entry.
This commit is contained in:
@@ -81,8 +81,8 @@ ebb1(v92: i32, v93: f32):
|
||||
; nextln: }
|
||||
|
||||
function %jumptable(i32) {
|
||||
jt200 = jump_table 0, 0
|
||||
jt2 = jump_table 0, 0, ebb10, ebb40, ebb20, ebb30
|
||||
jt200 = jump_table []
|
||||
jt2 = jump_table [ebb10, ebb40, ebb20, ebb30]
|
||||
|
||||
ebb10(v3: i32):
|
||||
br_table v3, ebb50, jt2
|
||||
@@ -97,8 +97,8 @@ ebb50:
|
||||
trap user1
|
||||
}
|
||||
; sameln: function %jumptable(i32) fast {
|
||||
; check: jt2 = jump_table 0, 0, ebb10, ebb40, ebb20, ebb30
|
||||
; check: jt200 = jump_table 0
|
||||
; check: jt2 = jump_table [ebb10, ebb40, ebb20, ebb30]
|
||||
; check: jt200 = jump_table []
|
||||
; check: ebb10(v3: i32):
|
||||
; nextln: br_table v3, ebb50, jt2
|
||||
; nextln:
|
||||
|
||||
Reference in New Issue
Block a user