Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Remove GC-specific Wasm-to-CLIF translations (#13578)

Nick Fitzgerald0f36a198d36d
diff --git a/crates/cranelift/src/func_environ.rs b/crates/cranelift/src/func_environ.rs
index e9b9a094f9..daa1007dd9 100644
--- a/crates/cranelift/src/func_environ.rs
+++ b/crates/cranelift/src/func_environ.rs
@@ -29,7 +29,7 @@ use smallvec::{SmallVec, smallvec};
use std::iter::Peekable;
use std::mem;
use wasmparser::{
- BranchHint, FuncValidator, Operator, SectionLimitedIntoIter, WasmFeatures, WasmModuleResources,
+ BranchHint, FuncValidator, Operator, SectionLimitedIntoIter, WasmModuleResources,
};
use wasmtime_core::math::f64_cvt_to_int_bounds;
use wasmtime_environ::{
@@ -2082,7 +2082,6 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
/// Do a Wasm-level indirect call through the given funcref table.
pub fn indirect_call(
mut self,
- features: &WasmFeatures,
table_index: TableIndex,
ty_index: TypeIndex,
sig_ref: ir::SigRef,
@@ -2090,7 +2089,6 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
call_args: &[ir::Value],
) -> WasmResult<Option<CallRets>> {
let (code_ptr, callee_vmctx) = match self.check_and_load_code_and_callee_vmctx(
- features,
table_index,
ty_index,
callee,
@@ -2106,7 +2104,6 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
fn check_and_load_code_and_callee_vmctx(
&mut self,
- features: &WasmFeatures,
table_index: TableIndex,
ty_index: TypeIndex,
callee: ir::Value,
@@ -2118,8 +2115,7 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
.table_get_funcref(self.builder, table_index, callee, cold_blocks);
// If necessary, check the signature.
- let check =
- self.check_indirect_call_type_signature(features, table_index, ty_index, funcref_ptr);
+ let check = self.check_indirect_call_type_signature(table_index, ty_index, funcref_ptr);
let trap_code = match check {
// `funcref_ptr` is checked at runtime that its type matches,
@@ -2153,14 +2149,11 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
fn check_indirect_call_type_signature(
&mut self,
- features: &WasmFeatures,
table_index: TableIndex,
ty_index: TypeIndex,
funcref_ptr: ir::Value,
) -> CheckIndirectCallTypeSignature {
let table = &self.env.module.tables[table_index];
- let sig_id_size = self.env.offsets.size_of_vmshared_type_index();
- let sig_id_type = Type::int(u16::from(sig_id_size) * 8).unwrap();
// Test if a type check is necessary for this table. If this table is a
// table of typed functions and that type matches `ty_index`, then
@@ -2184,42 +2177,6 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
may_be_null: table.ref_type.nullable,
};
}
-
- if features.gc() {
- // If we are in the Wasm GC world, then we need to perform
- // an actual subtype check at runtime. Fall through to below
- // to do that.
- } else {
- // Otherwise if the types don't match then either (a) this
- // is a null pointer or (b) it's a pointer with the wrong
- // type. Figure out which and trap here.
- //
- // If it's possible to have a null here then try to load the
- // type information. If that fails due to the function being
- // a null pointer, then this was a call to null. Otherwise
- // if it succeeds then we know it won't match, so trap
- // anyway.
- if table.ref_type.nullable {
- if self.env.clif_memory_traps_enabled() {
- self.builder.ins().load(
- sig_id_type,
- ir::MemFlagsData::trusted()
- .with_readonly()
- .with_trap_code(Some(crate::TRAP_INDIRECT_CALL_TO_NULL)),
- funcref_ptr,
- i32::from(self.env.offsets.ptr.vm_func_ref_type_index()),
- );
- } else {
- self.env.trapz(
- self.builder,
- funcref_ptr,
- crate::TRAP_INDIRECT_CALL_TO_NULL,
- );
- }
- }
- self.env.trap(self.builder, crate::TRAP_BAD_SIGNATURE);
- return CheckIndirectCallTypeSignature::StaticTrap;
- }
}
// Tables of `nofunc` can only be inhabited by null, so go ahead and
@@ -2279,14 +2236,9 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
// Check that they match: in the case of Wasm GC, this means doing a
// full subtype check. Otherwise, we do a simple equality check.
- let matches = if features.gc() {
- self.env
- .is_subtype(self.builder, callee_sig_id, caller_sig_id, interned_ty)
- } else {
- self.builder
- .ins()
- .icmp(IntCC::Equal, callee_sig_id, caller_sig_id)
- };
+ let matches = self
+ .env
+ .is_subtype(self.builder, callee_sig_id, caller_sig_id, interned_ty);
self.env
.trapz(self.builder, matches, crate::TRAP_BAD_SIGNATURE);
CheckIndirectCallTypeSignature::Runtime
@@ -3338,7 +3290,6 @@ impl FuncEnvironment<'_> {
&mut self,
builder: &'a mut FunctionBuilder,
srcloc: ir::SourceLoc,
- features: &WasmFeatures,
table_index: TableIndex,
ty_index: TypeIndex,
sig_ref: ir::SigRef,
@@ -3346,7 +3297,6 @@ impl FuncEnvironment<'_> {
call_args: &[ir::Value],
) -> WasmResult<Option<CallRets>> {
Call::new(builder, self, srcloc).indirect_call(
- features,
table_index,
ty_index,
sig_ref,
@@ -3393,7 +3343,6 @@ impl FuncEnvironment<'_> {
&mut self,
builder: &mut FunctionBuilder,
srcloc: ir::SourceLoc,
- features: &WasmFeatures,
table_index: TableIndex,
ty_index: TypeIndex,
sig_ref: ir::SigRef,
@@ -3401,7 +3350,6 @@ impl FuncEnvironment<'_> {
call_args: &[ir::Value],
) -> WasmResult<()> {
Call::new_tail(builder, self, srcloc).indirect_call(
- features,
table_index,
ty_index,
sig_ref,
diff --git a/crates/cranelift/src/translate/code_translator.rs b/crates/cranelift/src/translate/code_translator.rs
index e150263136..46fe1071cf 100644
--- a/crates/cranelift/src/translate/code_translator.rs
+++ b/crates/cranelift/src/translate/code_translator.rs
@@ -744,7 +744,6 @@ pub fn translate_operator(
let inst_results = environ.translate_call_indirect(
builder,
environ.next_srcloc,
- validator.features(),
TableIndex::from_u32(*table_index),
type_index,
sigref,
@@ -810,7 +809,6 @@ pub fn translate_operator(
environ.translate_return_call_indirect(
builder,
srcloc,
- validator.features(),
TableIndex::from_u32(*table_index),
type_index,
sigref,
diff --git a/tests/disas/alias-region-tables.wat b/tests/disas/alias-region-tables.wat
index b316277e5e..955e5c377f 100644
--- a/tests/disas/alias-region-tables.wat
+++ b/tests/disas/alias-region-tables.wat
@@ -33,9 +33,9 @@
;; stack_limit = gv2
;;
;; block0(v0: i64, v1: i64, v2: i32, v3: i64):
-;; @0043 v63 = load.i64 notrap aligned readonly can_move v0+48
-;; @0043 v5 = load.i64 notrap aligned v63+8
-;; @0043 v9 = load.i64 notrap aligned v63
+;; @0043 v64 = load.i64 notrap aligned readonly can_move v0+48
+;; @0043 v5 = load.i64 notrap aligned v64+8
+;; @0043 v9 = load.i64 notrap aligned v64
;; @0043 v15 = iconst.i64 1
;; @0043 v16 = bor v3, v15 ; v15 = 1
;; @0043 v6 = ireduce.i32 v5
@@ -69,11 +69,11 @@
;; @004d v49 = load.i32 notrap aligned readonly can_move v48
;; @004d v51 = icmp eq v50, v49
;; @004d trapz v51, user8
-;; @004d v52 = load.i64 notrap aligned readonly v42+8
-;; @004d v53 = load.i64 notrap aligned readonly v42+24
-;; @004d v54 = call_indirect sig0, v52(v53, v0)
+;; @004d v53 = load.i64 notrap aligned readonly v42+8
+;; @004d v54 = load.i64 notrap aligned readonly v42+24
+;; @004d v55 = call_indirect sig0, v53(v54, v0)
;; @0050 jump block1
;;
;; block1:
-;; @0050 return v54
+;; @0050 return v55
;; }
diff --git a/tests/disas/call-indirect-without-gc.wat b/tests/disas/call-indirect-without-gc.wat
index 8b00695647..8bc983a597 100644
--- a/tests/disas/call-indirect-without-gc.wat
+++ b/tests/disas/call-indirect-without-gc.wat
@@ -49,11 +49,11 @@
;; @0035 v25 = load.i32 notrap aligned readonly can_move v24+4
;; @0035 v27 = icmp eq v26, v25
;; @0035 trapz v27, user8
-;; @0035 v28 = load.i64 notrap aligned readonly v18+8
-;; @0035 v29 = load.i64 notrap aligned readonly v18+24
-;; @0035 v30 = call_indirect sig0, v28(v29, v0, v2)
+;; @0035 v29 = load.i64 notrap aligned readonly v18+8
+;; @0035 v30 = load.i64 notrap aligned readonly v18+24
+;; @0035 v31 = call_indirect sig0, v29(v30, v0, v2)
;; @0038 jump block1
;;
;; block1:
-;; @0038 return v30
+;; @0038 return v31
;; }
diff --git a/tests/disas/duplicate-function-types.wat b/tests/disas/duplicate-function-types.wat
index 928194204b..98027d4e5a 100644
--- a/tests/disas/duplicate-function-types.wat
+++ b/tests/disas/duplicate-function-types.wat
@@ -31,13 +31,13 @@
;; stack_limit = gv2
;;
;; block0(v0: i64, v1: i64, v2: i32):
-;; @002d v64 = load.i64 notrap aligned readonly can_move v0+48
-;; @002d v5 = load.i64 notrap aligned v64+8
+;; @002d v66 = load.i64 notrap aligned readonly can_move v0+48
+;; @002d v5 = load.i64 notrap aligned v66+8
;; @002d v6 = ireduce.i32 v5
;; @002d v7 = icmp uge v2, v6
;; @002d v8 = uextend.i64 v2
-;; @002d v62 = load.i64 notrap aligned readonly can_move v0+48
-;; @002d v9 = load.i64 notrap aligned v62
+;; @002d v64 = load.i64 notrap aligned readonly can_move v0+48
+;; @002d v9 = load.i64 notrap aligned v64
;; @002d v10 = iconst.i64 3
;; @002d v11 = ishl v8, v10 ; v10 = 3
;; @002d v12 = iadd v9, v11
@@ -59,44 +59,46 @@
;; @002d v25 = load.i32 notrap aligned readonly can_move v24
;; @002d v26 = load.i32 user7 aligned readonly v18+16
;; @002d v27 = icmp eq v26, v25
-;; @002d trapz v27, user8
-;; @002d v28 = load.i64 notrap aligned readonly v18+8
-;; @002d v29 = load.i64 notrap aligned readonly v18+24
-;; @002d v30 = call_indirect sig0, v28(v29, v0)
+;; @002d v28 = uextend.i32 v27
+;; @002d trapz v28, user8
+;; @002d v29 = load.i64 notrap aligned readonly v18+8
+;; @002d v30 = load.i64 notrap aligned readonly v18+24
+;; @002d v31 = call_indirect sig0, v29(v30, v0)
+;; @0032 v62 = load.i64 notrap aligned readonly can_move v0+48
+;; @0032 v33 = load.i64 notrap aligned v62+8
+;; @0032 v34 = ireduce.i32 v33
+;; @0032 v35 = icmp.i32 uge v2, v34
+;; @0032 v36 = uextend.i64 v2
;; @0032 v60 = load.i64 notrap aligned readonly can_move v0+48
-;; @0032 v32 = load.i64 notrap aligned v60+8
-;; @0032 v33 = ireduce.i32 v32
-;; @0032 v34 = icmp.i32 uge v2, v33
-;; @0032 v35 = uextend.i64 v2
-;; @0032 v58 = load.i64 notrap aligned readonly can_move v0+48
-;; @0032 v36 = load.i64 notrap aligned v58
-;; @0032 v37 = iconst.i64 3
-;; @0032 v38 = ishl v35, v37 ; v37 = 3
-;; @0032 v39 = iadd v36, v38
-;; @0032 v40 = iconst.i64 0
-;; @0032 v41 = select_spectre_guard v34, v40, v39 ; v40 = 0
-;; @0032 v42 = load.i64 user6 aligned region0 v41
-;; @0032 v43 = iconst.i64 -2
-;; @0032 v44 = band v42, v43 ; v43 = -2
-;; @0032 brif v42, block5(v44), block4
+;; @0032 v37 = load.i64 notrap aligned v60
+;; @0032 v38 = iconst.i64 3
+;; @0032 v39 = ishl v36, v38 ; v38 = 3
+;; @0032 v40 = iadd v37, v39
+;; @0032 v41 = iconst.i64 0
+;; @0032 v42 = select_spectre_guard v35, v41, v40 ; v41 = 0
+;; @0032 v43 = load.i64 user6 aligned region0 v42
+;; @0032 v44 = iconst.i64 -2
+;; @0032 v45 = band v43, v44 ; v44 = -2
+;; @0032 brif v43, block5(v45), block4
;;
;; block4 cold:
-;; @0032 v46 = iconst.i32 0
-;; @0032 v48 = uextend.i64 v2
-;; @0032 v49 = call fn0(v0, v46, v48) ; v46 = 0
-;; @0032 jump block5(v49)
+;; @0032 v47 = iconst.i32 0
+;; @0032 v49 = uextend.i64 v2
+;; @0032 v50 = call fn0(v0, v47, v49) ; v47 = 0
+;; @0032 jump block5(v50)
;;
-;; block5(v45: i64):
-;; @0032 v51 = load.i64 notrap aligned readonly can_move v0+40
-;; @0032 v52 = load.i32 notrap aligned readonly can_move v51
-;; @0032 v53 = load.i32 user7 aligned readonly v45+16
-;; @0032 v54 = icmp eq v53, v52
-;; @0032 trapz v54, user8
-;; @0032 v55 = load.i64 notrap aligned readonly v45+8
-;; @0032 v56 = load.i64 notrap aligned readonly v45+24
-;; @0032 v57 = call_indirect sig0, v55(v56, v0)
+;; block5(v46: i64):
+;; @0032 v52 = load.i64 notrap aligned readonly can_move v0+40
+;; @0032 v53 = load.i32 notrap aligned readonly can_move v52
+;; @0032 v54 = load.i32 user7 aligned readonly v46+16
+;; @0032 v55 = icmp eq v54, v53
+;; @0032 v56 = uextend.i32 v55
+;; @0032 trapz v56, user8
+;; @0032 v57 = load.i64 notrap aligned readonly v46+8
+;; @0032 v58 = load.i64 notrap aligned readonly v46+24
+;; @0032 v59 = call_indirect sig0, v57(v58, v0)
;; @0035 jump block1
;;
;; block1:
-;; @0035 return v30, v57
+;; @0035 return v31, v59
;; }
diff --git a/tests/disas/foo.wat b/tests/disas/foo.wat
index ec75f71189..627c4b5cab 100644
--- a/tests/disas/foo.wat
+++ b/tests/disas/foo.wat
@@ -36,9 +36,9 @@
;; @0040 v6 = uextend.i64 v3
;; @0040 v8 = iadd v7, v6
;; @0040 v9 = load.i32 little region0 v8
-;; @0043 v75 = load.i64 notrap aligned readonly can_move v0+72
-;; @0043 v10 = load.i64 notrap aligned v75+8
-;; @0043 v14 = load.i64 notrap aligned v75
+;; @0043 v77 = load.i64 notrap aligned readonly can_move v0+72
+;; @0043 v10 = load.i64 notrap aligned v77+8
+;; @0043 v14 = load.i64 notrap aligned v77
;; @0043 v11 = ireduce.i32 v10
;; @0043 v12 = icmp uge v9, v11
;; @0043 v18 = iconst.i64 0
@@ -63,39 +63,39 @@
;; @0043 v30 = load.i32 notrap aligned readonly can_move v29+4
;; @0043 v32 = icmp eq v31, v30
;; @0043 trapz v32, user8
-;; @0043 v33 = load.i64 notrap aligned readonly v23+8
-;; @0043 v34 = load.i64 notrap aligned readonly v23+24
-;; @0043 v35 = call_indirect sig0, v33(v34, v0, v2)
-;; @004a v41 = load.i32 little region0 v8
-;; @004d v42 = load.i64 notrap aligned v75+8
-;; @004d v46 = load.i64 notrap aligned v75
-;; @004d v43 = ireduce.i32 v42
-;; @004d v44 = icmp uge v41, v43
-;; @004d v45 = uextend.i64 v41
-;; v78 = iconst.i64 3
-;; v79 = ishl v45, v78 ; v78 = 3
-;; @004d v49 = iadd v46, v79
-;; v80 = iconst.i64 0
-;; v81 = select_spectre_guard v44, v80, v49 ; v80 = 0
-;; @004d v52 = load.i64 user6 aligned region1 v81
-;; v82 = iconst.i64 -2
-;; v83 = band v52, v82 ; v82 = -2
-;; @004d brif v52, block5(v83), block4
+;; @0043 v34 = load.i64 notrap aligned readonly v23+8
+;; @0043 v35 = load.i64 notrap aligned readonly v23+24
+;; @0043 v36 = call_indirect sig0, v34(v35, v0, v2)
+;; @004a v42 = load.i32 little region0 v8
+;; @004d v43 = load.i64 notrap aligned v77+8
+;; @004d v47 = load.i64 notrap aligned v77
+;; @004d v44 = ireduce.i32 v43
+;; @004d v45 = icmp uge v42, v44
+;; @004d v46 = uextend.i64 v42
+;; v80 = iconst.i64 3
+;; v81 = ishl v46, v80 ; v80 = 3
+;; @004d v50 = iadd v47, v81
+;; v82 = iconst.i64 0
+;; v83 = select_spectre_guard v45, v82, v50 ; v82 = 0
+;; @004d v53 = load.i64 user6 aligned region1 v83
+;; v84 = iconst.i64 -2
+;; v85 = band v53, v84 ; v84 = -2
+;; @004d brif v53, block5(v85), block4
;;
;; block4 cold:
-;; v84 = iconst.i32 0
-;; @004d v59 = call fn0(v0, v84, v45) ; v84 = 0
-;; @004d jump block5(v59)
+;; v86 = iconst.i32 0
+;; @004d v60 = call fn0(v0, v86, v46) ; v86 = 0
+;; @004d jump block5(v60)
;;
-;; block5(v55: i64):
-;; @004d v63 = load.i32 user7 aligned readonly v55+16
-;; @004d v64 = icmp eq v63, v30
-;; @004d trapz v64, user8
-;; @004d v65 = load.i64 notrap aligned readonly v55+8
-;; @004d v66 = load.i64 notrap aligned readonly v55+24
-;; @004d v67 = call_indirect sig0, v65(v66, v0, v2)
+;; block5(v56: i64):
+;; @004d v64 = load.i32 user7 aligned readonly v56+16
+;; @004d v65 = icmp eq v64, v30
+;; @004d trapz v65, user8
+;; @004d v67 = load.i64 notrap aligned readonly v56+8
+;; @004d v68 = load.i64 notrap aligned readonly v56+24
+;; @004d v69 = call_indirect sig0, v67(v68, v0, v2)
;; @0050 jump block1
;;
;; block1:
-;; @0050 return v35, v67
+;; @0050 return v36, v69
;; }
diff --git a/tests/disas/icall-loop.wat b/tests/disas/icall-loop.wat
index 4f9fb4f0bc..9487a0757a 100644
--- a/tests/disas/icall-loop.wat
+++ b/tests/disas/icall-loop.wat
@@ -52,22 +52,22 @@
;;
;; block2:
;; @002b v13 = load.i64 user6 aligned region0 v12
-;; v31 = iconst.i64 -2
-;; v32 = band v13, v31 ; v31 = -2
-;; @002b brif v13, block5(v32), block4
+;; v32 = iconst.i64 -2
+;; v33 = band v13, v32 ; v32 = -2
+;; @002b brif v13, block5(v33), block4
;;
;; block4 cold:
-;; v33 = iconst.i32 0
-;; @002b v20 = call fn0(v0, v33, v6) ; v33 = 0
+;; v34 = iconst.i32 0
+;; @002b v20 = call fn0(v0, v34, v6) ; v34 = 0
;; @002b jump block5(v20)
;;
;; block5(v16: i64):
;; @002b v24 = load.i32 user7 aligned readonly v16+16
;; @002b v25 = icmp eq v24, v23
;; @002b trapz v25, user8
-;; @002b v26 = load.i64 notrap aligned readonly v16+8
-;; @002b v27 = load.i64 notrap aligned readonly v16+24
-;; @002b v28 = call_indirect sig0, v26(v27, v0)
+;; @002b v27 = load.i64 notrap aligned readonly v16+8
+;; @002b v28 = load.i64 notrap aligned readonly v16+24
+;; @002b v29 = call_indirect sig0, v27(v28, v0)
;; @002e jump block2
;; }
;;
@@ -85,34 +85,34 @@
;;
;; block0(v0: i64, v1: i64):
;; @0038 v6 = load.i64 notrap aligned readonly can_move v0+48
-;; v36 = iconst.i64 8
-;; @0038 v9 = iadd v6, v36 ; v36 = 8
+;; v37 = iconst.i64 8
+;; @0038 v9 = iadd v6, v37 ; v37 = 8
;; @0038 v13 = iconst.i64 -2
;; @0038 v16 = iconst.i32 0
-;; v35 = iconst.i64 1
+;; v36 = iconst.i64 1
;; @0038 v21 = load.i64 notrap aligned readonly can_move v0+40
;; @0038 v22 = load.i32 notrap aligned readonly can_move v21
;; @0034 jump block2
;;
;; block2:
-;; v37 = iadd.i64 v6, v36 ; v36 = 8
-;; @0038 v12 = load.i64 user6 aligned region0 v37
-;; v38 = iconst.i64 -2
-;; v39 = band v12, v38 ; v38 = -2
-;; @0038 brif v12, block5(v39), block4
+;; v38 = iadd.i64 v6, v37 ; v37 = 8
+;; @0038 v12 = load.i64 user6 aligned region0 v38
+;; v39 = iconst.i64 -2
+;; v40 = band v12, v39 ; v39 = -2
+;; @0038 brif v12, block5(v40), block4
;;
;; block4 cold:
-;; v40 = iconst.i32 0
-;; v41 = iconst.i64 1
-;; @0038 v19 = call fn0(v0, v40, v41) ; v40 = 0, v41 = 1
+;; v41 = iconst.i32 0
+;; v42 = iconst.i64 1
+;; @0038 v19 = call fn0(v0, v41, v42) ; v41 = 0, v42 = 1
;; @0038 jump block5(v19)
;;
;; block5(v15: i64):
;; @0038 v23 = load.i32 user7 aligned readonly v15+16
;; @0038 v24 = icmp eq v23, v22
;; @0038 trapz v24, user8
-;; @0038 v25 = load.i64 notrap aligned readonly v15+8
-;; @0038 v26 = load.i64 notrap aligned readonly v15+24
-;; @0038 v27 = call_indirect sig0, v25(v26, v0)
+;; @0038 v26 = load.i64 notrap aligned readonly v15+8
+;; @0038 v27 = load.i64 notrap aligned readonly v15+24
+;; @0038 v28 = call_indirect sig0, v26(v27, v0)
;; @003b jump block2
;; }
diff --git a/tests/disas/icall-simd.wat b/tests/disas/icall-simd.wat
index e276a53fc4..65eb4f4e84 100644
--- a/tests/disas/icall-simd.wat
+++ b/tests/disas/icall-simd.wat
@@ -46,12 +46,13 @@
;; @0033 v24 = load.i32 notrap aligned readonly can_move v23
;; @0033 v25 = load.i32 user7 aligned readonly v17+16
;; @0033 v26 = icmp eq v25, v24
-;; @0033 trapz v26, user8
-;; @0033 v27 = load.i64 notrap aligned readonly v17+8
-;; @0033 v28 = load.i64 notrap aligned readonly v17+24
-;; @0033 v29 = call_indirect sig0, v27(v28, v0, v3)
+;; @0033 v27 = uextend.i32 v26
+;; @0033 trapz v27, user8
+;; @0033 v28 = load.i64 notrap aligned readonly v17+8
+;; @0033 v29 = load.i64 notrap aligned readonly v17+24
+;; @0033 v30 = call_indirect sig0, v28(v29, v0, v3)
;; @0036 jump block1
;;
;; block1:
-;; @0036 return v29
+;; @0036 return v30
;; }
diff --git a/tests/disas/icall.wat b/tests/disas/icall.wat
index c288b25a1c..a09ca5a843 100644
--- a/tests/disas/icall.wat
+++ b/tests/disas/icall.wat
@@ -46,12 +46,13 @@
;; @0033 v24 = load.i32 notrap aligned readonly can_move v23
;; @0033 v25 = load.i32 user7 aligned readonly v17+16
;; @0033 v26 = icmp eq v25, v24
-;; @0033 trapz v26, user8
-;; @0033 v27 = load.i64 notrap aligned readonly v17+8
-;; @0033 v28 = load.i64 notrap aligned readonly v17+24
-;; @0033 v29 = call_indirect sig0, v27(v28, v0, v3)
+;; @0033 v27 = uextend.i32 v26
+;; @0033 trapz v27, user8
+;; @0033 v28 = load.i64 notrap aligned readonly v17+8
+;; @0033 v29 = load.i64 notrap aligned readonly v17+24
+;; @0033 v30 = call_indirect sig0, v28(v29, v0, v3)
;; @0036 jump block1
;;
;; block1:
-;; @0036 return v29
+;; @0036 return v30
;; }
diff --git a/tests/disas/indirect-call-no-caching.wat b/tests/disas/indirect-call-no-caching.wat
index 32a58a3b19..815947353a 100644
--- a/tests/disas/indirect-call-no-caching.wat
+++ b/tests/disas/indirect-call-no-caching.wat
@@ -100,12 +100,13 @@
;; @0050 v23 = load.i32 notrap aligned readonly can_move v22
;; @0050 v24 = load.i32 user7 aligned readonly v16+16
;; @0050 v25 = icmp eq v24, v23
-;; @0050 trapz v25, user8
-;; @0050 v26 = load.i64 notrap aligned readonly v16+8
-;; @0050 v27 = load.i64 notrap aligned readonly v16+24
-;; @0050 v28 = call_indirect sig0, v26(v27, v0)
+;; @0050 v26 = uextend.i32 v25
+;; @0050 trapz v26, user8
+;; @0050 v27 = load.i64 notrap aligned readonly v16+8
+;; @0050 v28 = load.i64 notrap aligned readonly v16+24
+;; @0050 v29 = call_indirect sig0, v27(v28, v0)
;; @0053 jump block1
;;
;; block1:
-;; @0053 return v28
+;; @0053 return v29
;; }
diff --git a/tests/disas/readonly-funcrefs.wat b/tests/disas/readonly-funcrefs.wat
index 7f8c9be2ae..ca3a066f94 100644
--- a/tests/disas/readonly-funcrefs.wat
+++ b/tests/disas/readonly-funcrefs.wat
@@ -69,9 +69,9 @@
;; @0031 v22 = load.i32 notrap aligned readonly can_move v21
;; @0031 v24 = icmp eq v23, v22
;; @0031 trapz v24, user8
-;; @0031 v25 = load.i64 notrap aligned readonly v15+8
-;; @0031 v26 = load.i64 notrap aligned readonly v15+24
-;; @0031 call_indirect sig0, v25(v26, v0)
+;; @0031 v26 = load.i64 notrap aligned readonly v15+8
+;; @0031 v27 = load.i64 notrap aligned readonly v15+24
+;; @0031 call_indirect sig0, v26(v27, v0)
;; @0034 jump block1
;;
;; block1: