Skip to content

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

Emit plain `call`s for host intrinsics in FACT (#15224)

Nick Fitzgerald6de760e3c3f9
diff --git a/crates/cranelift/src/func_environ.rs b/crates/cranelift/src/func_environ.rs
index aed69be2d4..7e4916e3a7 100644
--- a/crates/cranelift/src/func_environ.rs
+++ b/crates/cranelift/src/func_environ.rs
@@ -2118,6 +2118,9 @@ struct Call<'a, 'func, 'module_env> {
env: &'a mut FuncEnvironment<'module_env>,
srcloc: ir::SourceLoc,
tail: bool,
+ /// Whether the callee may unwind a Wasm exception into this call, and so
+ /// needs the enclosing `try_table`'s handlers.
+ may_throw: bool,
}
enum CheckIndirectCallTypeSignature {
@@ -2144,6 +2147,7 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
env,
srcloc,
tail: false,
+ may_throw: true,
}
}
@@ -2158,46 +2162,97 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
env,
srcloc,
tail: true,
+ may_throw: true,
}
}
+ /// Configure whether this call may ever throw a Wasm exception or not.
+ ///
+ /// By default, it is conservatively assumed that calls may throw.
+ pub fn may_throw(mut self, may_throw: bool) -> Self {
+ self.may_throw = may_throw;
+ self
+ }
+
/// Do a Wasm-level direct call to the given callee function.
pub fn direct_call(
- mut self,
+ self,
callee_index: FuncIndex,
sig_ref: ir::SigRef,
wasm_call_args: &[ir::Value],
) -> WasmResult<Reachability<CallRets>> {
- let mut real_call_args = Vec::with_capacity(wasm_call_args.len() + 2);
+ let real_call_args = Vec::with_capacity(wasm_call_args.len() + 2);
let caller_vmctx = self
.builder
.func
.special_param(ArgumentPurpose::VMContext)
.unwrap();
- // Handle direct calls to locally-defined functions.
if let Some(def_func_index) = self.env.module.defined_func_index(callee_index) {
- // First append the callee vmctx address, which is the same as the caller vmctx in
- // this case.
- real_call_args.push(caller_vmctx);
+ self.direct_call_defined_function(
+ wasm_call_args,
+ real_call_args,
+ caller_vmctx,
+ def_func_index,
+ )
+ } else {
+ self.direct_call_imported_function(
+ callee_index,
+ sig_ref,
+ wasm_call_args,
+ real_call_args,
+ caller_vmctx,
+ )
+ }
+ }
- // Then append the caller vmctx address.
- real_call_args.push(caller_vmctx);
+ /// Emit code for direct calls to defined functions.
+ fn direct_call_defined_function(
+ mut self,
+ wasm_call_args: &[ir::Value],
+ mut real_call_args: Vec<ir::Value>,
+ caller_vmctx: ir::Value,
+ def_func_index: DefinedFuncIndex,
+ ) -> Result<Reachability<SmallVec<[ir::Value; 4]>>, wasmtime_environ::WasmError> {
+ // First append the callee vmctx address, which is the same as the caller vmctx in
+ // this case.
+ real_call_args.push(caller_vmctx);
- // Then append the regular call arguments.
- real_call_args.extend_from_slice(wasm_call_args);
+ // Then append the caller vmctx address.
+ real_call_args.push(caller_vmctx);
- // Finally, make the direct call!
- let callee = self
- .env
- .get_or_create_defined_func_ref(self.builder.func, def_func_index);
- return Ok(Reachability::Reachable(
- self.direct_call_inst(callee, &real_call_args),
- ));
- }
+ // Then append the regular call arguments.
+ real_call_args.extend_from_slice(wasm_call_args);
+
+ // Finally, make the direct call!
+ let callee = self
+ .env
+ .get_or_create_defined_func_ref(self.builder.func, def_func_index);
+ Ok(Reachability::Reachable(
+ self.direct_call_inst(callee, &real_call_args),
+ ))
+ }
- // Handle direct calls to imported functions. We use an indirect call
- // so that we don't have to patch the code at runtime.
+ /// Emit code for direct calls to imported functions.
+ fn direct_call_imported_function(
+ mut self,
+ callee_index: FuncIndex,
+ sig_ref: ir::SigRef,
+ wasm_call_args: &[ir::Value],
+ mut real_call_args: Vec<ir::Value>,
+ caller_vmctx: ir::Value,
+ ) -> Result<Reachability<SmallVec<[ir::Value; 4]>>, wasmtime_environ::WasmError> {
+ // Host intrinsics turn exceptions into traps rather than unwinding them
+ // into us, so a plain `call` suffices even inside a `try_table`, which
+ // avoids `try_call`'s clobber-everything ABI.
+ if self
+ .env
+ .translation
+ .imported_funcs_never_throw
+ .contains(callee_index)
+ {
+ self = self.may_throw(false);
+ }
// First append the callee vmctx address.
//
@@ -2314,17 +2369,9 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
FactInlineIntrinsic::EnterSyncCall | FactInlineIntrinsic::ExitSyncCall => {}
}
- let import_off = self.env.offsets.imported_functions().at(callee_index);
- let func_addr = self
- .env
- .alias_regions
- .vm_function_import()
- .wasm_call()
- .relative_to(import_off)
- .load(&mut self.builder.cursor(), vmctx);
- Ok(Reachability::Reachable(self.indirect_call_inst(
+ Ok(Reachability::Reachable(self.imported_call_inst(
+ callee_index,
sig_ref,
- func_addr,
&real_call_args,
)))
}
@@ -2334,21 +2381,11 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
// Unknown import function or this module is instantiated many times
// and with different functions. Either way, we have to do the
// indirect call.
- None => {
- let import_off = self.env.offsets.imported_functions().at(callee_index);
- let func_addr = self
- .env
- .alias_regions
- .vm_function_import()
- .wasm_call()
- .relative_to(import_off)
- .load(&mut self.builder.cursor(), vmctx);
- Ok(Reachability::Reachable(self.indirect_call_inst(
- sig_ref,
- func_addr,
- &real_call_args,
- )))
- }
+ None => Ok(Reachability::Reachable(self.imported_call_inst(
+ callee_index,
+ sig_ref,
+ &real_call_args,
+ ))),
}
}
@@ -2411,9 +2448,7 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
}
debug_assert!(!self.tail);
let rep = component_sync_call::transfer_borrow_to_owner(
- self.builder,
- self.env,
- self.srcloc,
+ self,
ty,
instance,
callee_index,
@@ -2444,15 +2479,7 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
let slow =
component_sync_call::exit(self.builder, &mut self.env.alias_regions, vmctx, slot);
- let import_off = self.env.offsets.imported_functions().at(callee_index);
- let func_addr = self
- .env
- .alias_regions
- .vm_function_import()
- .wasm_call()
- .relative_to(import_off)
- .load(&mut self.builder.cursor(), vmctx);
- self.indirect_call_inst(sig_ref, func_addr, real_call_args);
+ self.imported_call_inst(callee_index, sig_ref, real_call_args);
slow.finish(self.builder);
CallRets::new()
@@ -2732,7 +2759,7 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
&mut self,
sig: ir::SigRef,
) -> Option<(ir::ExceptionTable, Block, CallRets)> {
- if !self.tail && !self.env.stacks.handlers.is_empty() {
+ if !self.tail && self.may_throw && !self.env.stacks.handlers.is_empty() {
let continuation_block = self.builder.create_block();
let mut args = vec![];
let mut results = smallvec![];
@@ -2821,6 +2848,26 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
}
}
+ /// Call the imported function `callee_index` through its
+ /// `VMFunctionImport`, with the full `real_call_args`.
+ fn imported_call_inst(
+ &mut self,
+ callee_index: FuncIndex,
+ sig_ref: ir::SigRef,
+ real_call_args: &[ir::Value],
+ ) -> CallRets {
+ let vmctx = self.caller_vmctx();
+ let import_off = self.env.offsets.imported_functions().at(callee_index);
+ let func_addr = self
+ .env
+ .alias_regions
+ .vm_function_import()
+ .wasm_call()
+ .relative_to(import_off)
+ .load(&mut self.builder.cursor(), vmctx);
+ self.indirect_call_inst(sig_ref, func_addr, real_call_args)
+ }
+
fn indirect_call_inst(
&mut self,
sig_ref: ir::SigRef,
diff --git a/crates/cranelift/src/func_environ/component_sync_call.rs b/crates/cranelift/src/func_environ/component_sync_call.rs
index d015c2c506..2700a9a233 100644
--- a/crates/cranelift/src/func_environ/component_sync_call.rs
+++ b/crates/cranelift/src/func_environ/component_sync_call.rs
@@ -27,7 +27,7 @@
//! if it forces the deferred thread. Anything else, such as a promoted thread,
//! a full lazy lenders array, or an invalid handle, falls back to the libcall.
-use super::{Call, FuncEnvironment};
+use super::Call;
use crate::alias_region::AliasRegions;
use crate::trap::TranslateTrap;
use cranelift_codegen::ir::condcodes::IntCC;
@@ -251,16 +251,16 @@ where
/// imported intrinsic `callee_index` with `real_call_args` when the fast path
/// does not apply. `real_call_args` is `[callee_vmctx, caller_vmctx,
/// handle_index]`.
-pub fn transfer_borrow_to_owner(
- builder: &mut FunctionBuilder<'_>,
- env: &mut FuncEnvironment<'_>,
- srcloc: ir::SourceLoc,
+pub(super) fn transfer_borrow_to_owner(
+ call: &mut Call<'_, '_, '_>,
ty: TypeResourceTableIndex,
instance: RuntimeComponentInstanceIndex,
callee_index: FuncIndex,
sig_ref: ir::SigRef,
real_call_args: &[ir::Value],
) -> ir::Value {
+ let builder = &mut *call.builder;
+ let env = &mut *call.env;
let slot = env
.fact_sync_call_slot
.expect("inline to-owner borrow without an enclosing enter-sync-call");
@@ -323,15 +323,8 @@ pub fn transfer_borrow_to_owner(
builder.switch_to_block(slow_block);
builder.set_cold_block(slow_block);
builder.seal_block(slow_block);
- let import_off = env.offsets.imported_functions().at(callee_index);
- let func_addr = env
- .alias_regions
- .vm_function_import()
- .wasm_call()
- .relative_to(import_off)
- .load(&mut builder.cursor(), vmctx);
- let rets =
- Call::new(builder, env, srcloc).indirect_call_inst(sig_ref, func_addr, real_call_args);
+ let rets = call.imported_call_inst(callee_index, sig_ref, real_call_args);
+ let builder = &mut *call.builder;
builder.ins().jump(join_block, &[rets[0].into()]);
builder.switch_to_block(join_block);
diff --git a/crates/environ/src/compile/module_environ.rs b/crates/environ/src/compile/module_environ.rs
index e343b4dd93..c8f1a4b97c 100644
--- a/crates/environ/src/compile/module_environ.rs
+++ b/crates/environ/src/compile/module_environ.rs
@@ -149,6 +149,12 @@ pub struct ModuleTranslation<'data> {
/// Only filled in for modules compiled as part of a component.
pub imported_func_vmctx_representative: SecondaryMap<FuncIndex, PackedOption<FuncIndex>>,
+ /// Imported functions that never unwind a Wasm exception into their
+ /// caller, such as the host intrinsics imported by FACT adapter modules.
+ ///
+ /// Calls to these need no exception handlers, even inside a `try_table`.
+ pub imported_funcs_never_throw: EntitySet<FuncIndex>,
+
/// For each imported global, memory, or table, the single statically-known
/// defined entity that always satisfies that import, if any.
///
@@ -334,6 +340,7 @@ impl<'data> ModuleTranslation<'data> {
function_body_inputs: PrimaryMap::default(),
known_imported_functions: SecondaryMap::default(),
imported_func_vmctx_representative: SecondaryMap::default(),
+ imported_funcs_never_throw: EntitySet::new(),
known_imported_globals: SecondaryMap::default(),
known_imported_memories: SecondaryMap::default(),
known_imported_tables: SecondaryMap::default(),
diff --git a/crates/environ/src/component/translate/adapt.rs b/crates/environ/src/component/translate/adapt.rs
index 5e3ed4ec70..2cf386bf4c 100644
--- a/crates/environ/src/component/translate/adapt.rs
+++ b/crates/environ/src/component/translate/adapt.rs
@@ -234,7 +234,7 @@ impl<'data> Translator<'_, 'data> {
// translation, validation, etc.
self.validator.reset();
let static_module_index = self.static_modules.next_key();
- let translation = ModuleEnvironment::new(
+ let mut translation = ModuleEnvironment::new(
self.tunables,
&mut self.validator,
self.types.module_types_builder(),
@@ -243,6 +243,18 @@ impl<'data> Translator<'_, 'data> {
.translate(Parser::new(0), wasm)
.context("failed to validate a fused adapter module")?;
+ // Only `CoreDef` imports can be guest code. Everything else is a
+ // host intrinsic, which turns any exception it sees into a trap
+ // rather than unwinding it into the adapter.
+ for (i, import) in imports.iter().enumerate() {
+ if let fact::Import::CoreDef(_) = import {
+ continue;
+ }
+ if let Some(EntityIndex::Function(func)) = translation.module.import_index(i) {
+ translation.imported_funcs_never_throw.insert(func);
+ }
+ }
+
// Record, for each adapter in this adapter module, the module that
// the adapter was placed within as well as the function index of
// the adapter in the wasm module generated. Note that adapters are
diff --git a/crates/environ/src/fact/trampoline.rs b/crates/environ/src/fact/trampoline.rs
index e98b809bfa..b589e64512 100644
--- a/crates/environ/src/fact/trampoline.rs
+++ b/crates/environ/src/fact/trampoline.rs
@@ -4006,7 +4006,9 @@ impl<'a, 'b> Compiler<'a, 'b> {
/// function is wrapped in a `try_table` whose `catch_all` clause
/// traps. This catches exceptions thrown not only by the callee
/// itself but also by any other guest functions the adapter
- /// invokes (e.g. `realloc`).
+ /// invokes (e.g. `realloc`). Calls to host intrinsics inside the
+ /// barrier are compiled as plain calls, since the host turns any
+ /// exception into a trap rather than unwinding it into the adapter.
///
/// The generated structure, completed by `exit_exception_barrier`,
/// is:
diff --git a/tests/disas/component-model/sync-adapter-lazy-lend-in-loop.wat b/tests/disas/component-model/sync-adapter-lazy-lend-in-loop.wat
new file mode 100644
index 0000000000..9ad3ae568e
--- /dev/null
+++ b/tests/disas/component-model/sync-adapter-lazy-lend-in-loop.wat
@@ -0,0 +1,205 @@
+;;! target = "x86_64"
+;;! test = "compile"
+;;! filter = "wasm[1]::function"
+;;! flags = "-Cinlining=y -Wconcurrency-support=y"
+
+;; Like `sync-adapter-lazy-lend.wat`, but does its work in a loop so we can
+;; check what gets LICM'd.
+
+(component
+ (component $A
+ (type $t' (resource (rep i32)))
+ (export $t "t" (type $t'))
+
+ (core func $ctor (canon resource.new $t))
+
+ (core module $M
+ (func (export "get'") (param i32) (result i32)
+ (local.get 0)
+ )
+ )
+ (core instance $m (instantiate $M))
+
+ (func (export "[constructor]t") (param "x" u32) (result (own $t))
+ (canon lift (core func $ctor))
+ )
+ (func (export "get") (param "self" (borrow $t)) (result u32)
+ (canon lift (core func $m "get'"))
+ )
+ )
+ (instance $a (instantiate $A))
+
+ (component $B
+ (import "a" (instance $i
+ (export "t" (type $t (sub resource)))
+ (export "get" (func (param "self" (borrow $t)) (result u32)))
+ ))
+ (alias export $i "t" (type $t))
+ (alias export $i "get" (func $get))
+
+ (core func $get' (canon lower (func $get)))
+
+ (core module $M
+ (import "" "get" (func $get (param i32) (result i32)))
+ (func (export "run") (param i32 i32) (result i32)
+ loop
+ (call $get (local.get 0))
+
+ local.get 1
+ i32.const 0
+ i32.ne
+ if
+ local.get 1
+ i32.const 1
+ i32.sub
+ local.set 1
+ br 1
+ end
+
+ return
+ end
+ unreachable
+ )
+ )
+ (core instance $m (instantiate $M
+ (with "" (instance (export "get" (func $get'))))))
+
+ (func (export "run") (param "x" u32) (param "n" u32) (result u32)
+ (canon lift (core func $m "run"))
+ )
+ )
+ (instance $b (instantiate $B (with "a" (instance $a))))
+ (export "run" (func $b "run"))
+)
+
+;; wasm[1]::function[1]:
+;; pushq %rbp
+;; movq %rsp, %rbp
+;; movq 8(%rdi), %r10
+;; movq 0x18(%r10), %r10
+;; addq $0xb0, %r10
+;; cmpq %rsp, %r10
+;; ja 0x2a9
+;; 3c: subq $0xa0, %rsp
+;; movq %rbx, 0x70(%rsp)
+;; movq %r12, 0x78(%rsp)
+;; movq %r13, 0x80(%rsp)
+;; movq %r14, 0x88(%rsp)
+;; movq %r15, 0x90(%rsp)
+;; movq %rcx, 0x30(%rsp)
+;; movq 0x48(%rdi), %rax
+;; movq 0x108(%rax), %r12
+;; movq %r12, 0x60(%rsp)
+;; movq 8(%rax), %r13
+;; movq %rax, 0x68(%rsp)
+;; leaq (%rsp), %r14
+;; movq 0x68(%rsp), %r8
+;; movq %r14, 0x58(%rsp)
+;; movq 0x68(%r8), %rbx
+;; leal -1(%rdx), %r14d
+;; movq %rdx, 0x20(%rsp)
+;; imulq $0x18, %r14, %r15
+;; movq %r15, %rsi
+;; movq %r14, 0x50(%rsp)
+;; movq 0x90(%r13), %r12
+;; movq 0x68(%rsp), %rax
+;; movq %r12, 0x48(%rsp)
+;; movq 0x98(%rax), %r14
+;; movq %r14, 0x40(%rsp)
+;; movq 0xb8(%rax), %r14
+;; movq %r14, 0x38(%rsp)
+;; movq 0x60(%rsp), %rax
+;; movl (%rax), %ecx
+;; testl %ecx, %ecx
+;; je 0x2ab
+;; e2: movq 0x88(%r13), %rax
+;; movq %rax, (%rsp)
+;; movl $0, 8(%rsp)
+;; movl $1, 0xc(%rsp)
+;; movl 0x80(%r13), %eax
+;; movl %eax, 0x10(%rsp)
+;; movl $0, 0x80(%r13)
+;; movl 0x84(%r13), %eax
+;; movl %eax, 0x14(%rsp)
+;; movl $0, 0x84(%r13)
+;; movq 0x98(%r13), %rcx
+;; movq %rcx, 0x18(%rsp)
+;; movq 0x58(%rsp), %r15
+;; movq %r15, 0x88(%r13)
+;; cmpq $8, %rcx
+;; jae 0x247
+;; 14b: movq 0x78(%rbx), %rax
+;; movq 0x50(%rsp), %rdx
+;; cmpq %rax, %rdx
+;; jae 0x254
+;; 15d: movq 0x70(%rbx), %rdx
+;; movl $0xffffffff, %eax
+;; movq %rsi, %r14
+;; addl (%rdx, %r14), %eax
+;; cmpl $1, %eax
+;; ja 0x261
+;; 176: movl 4(%rdx, %r14), %eax
+;; cmpl $2, %eax
+;; jne 0x26b
+;; 184: movl 8(%rdx, %r14), %eax
+;; movq 0x48(%rsp), %r12
+;; movq %rax, 0x28(%rsp)
+;; movl $2, (%r12, %rcx, 8)
+;; movq 0x20(%rsp), %rax
+;; movl %eax, 4(%r12, %rcx, 8)
+;; leaq 1(%rcx), %rsi
+;; movq %rsi, 0x98(%r13)
+;; movq 0x88(%r13), %r9
+;; cmpq %r15, %r9
+;; movq %r15, 0x58(%rsp)
+;; jne 0x294
+;; 1c5: movq (%rsp), %rax
+;; movq %rax, 0x88(%r13)
+;; movq 0x18(%rsp), %rax
+;; movq %rax, 0x98(%r13)
+;; movl 0x10(%rsp), %eax
+;; movl %eax, 0x80(%r13)
+;; movl 0x14(%rsp), %eax
+;; movl %eax, 0x84(%r13)
+;; movq 0x30(%rsp), %rcx
+;; testl %ecx, %ecx
+;; je 0x214
+;; 1ff: subl $1, %ecx
+;; movq %r14, %rsi
+;; movq %rcx, 0x30(%rsp)
+;; movq %r12, 0x48(%rsp)
+;; jmp 0xd3
+;; 214: movq 0x28(%rsp), %rax
+;; movq 0x70(%rsp), %rbx
+;; movq 0x78(%rsp), %r12
+;; movq 0x80(%rsp), %r13
+;; movq 0x88(%rsp), %r14
+;; movq 0x90(%rsp), %r15
+;; addq $0xa0, %rsp
+;; movq %rbp, %rsp
+;; popq %rbp
+;; retq
+;; 247: movq 0x40(%rsp), %r12
+;; 24c: movq %rsi, %r14
+;; 24f: jmp 0x270
+;; 254: movq 0x40(%rsp), %r12
+;; 259: movq %rsi, %r14
+;; 25c: jmp 0x270
+;; 261: movq 0x40(%rsp), %r12
+;; 266: jmp 0x270
+;; 26b: movq 0x40(%rsp), %r12
+;; 270: movq 0x20(%rsp), %rdx
+;; 275: movq 0x68(%rsp), %rsi
+;; 27a: movq %rbx, %rdi
+;; 27d: callq *%r12
+;; 280: movq %r12, 0x40(%rsp)
+;; 285: movq 0x48(%rsp), %r12
+;; 28a: movq %rax, 0x28(%rsp)
+;; 28f: jmp 0x1b0
+;; 294: movq 0x38(%rsp), %r15
+;; 299: movq 0x68(%rsp), %rsi
+;; 29e: movq %rbx, %rdi
+;; 2a1: callq *%r15
+;; 2a4: jmp 0x1f2
+;; 2a9: ud2
+;; 2ab: ud2
diff --git a/tests/disas/component-model/sync-adapter-lazy-lend.wat b/tests/disas/component-model/sync-adapter-lazy-lend.wat
index 2785ff461b..02456e51f2 100644
--- a/tests/disas/component-model/sync-adapter-lazy-lend.wat
+++ b/tests/disas/component-model/sync-adapter-lazy-lend.wat
@@ -171,21 +171,19 @@
;; block9 cold:
;; @0100 v54 = load.i64 notrap aligned readonly can_move region23 v0+152
;; @00f4 v79 = load.i64 notrap aligned readonly can_move region4 v0+104
-;; @0100 try_call_indirect v54(v79, v0, v2), sig2, block16(ret0), [ context v0, default: block6(exn0) ]
-;;
-;; block16(v55: i32):
+;; @0100 v55 = call_indirect sig2, v54(v79, v0, v2)
;; @0100 jump block10(v55)
;;
;; block10(v23: i32):
;; @0102 v56 = load.i64 notrap aligned readonly can_move region4 v0+72
-;; @0102 try_call fn0(v56, v0, v23), sig2, block17(ret0), [ context v0, default: block6(exn0) ]
+;; @0102 try_call fn0(v56, v0, v23), sig2, block16(ret0), [ context v0, default: block6(exn0) ]
;;
-;; block17(v57: i32):
+;; block16(v57: i32):
;; @0106 v61 = load.i64 notrap aligned region5 v13+136
;; @0106 v62 = icmp eq v61, v12
-;; @0106 brif v62, block18, block19
+;; @0106 brif v62, block17, block18
;;
-;; block18:
+;; block17:
;; @0106 v63 = load.i64 notrap aligned region6 v12
;; @0106 store notrap aligned region5 v63, v13+136
;; @0106 v64 = load.i64 notrap aligned region14 v12+24
@@ -194,17 +192,15 @@
;; @0106 store notrap aligned region9 v65, v13+128
;; @0106 v66 = load.i32 notrap aligned region12 v12+20
;; @0106 store notrap aligned region11 v66, v13+132
-;; @0106 jump block20
+;; @0106 jump block19
;;
-;; block19 cold:
+;; block18 cold:
;; @0106 v67 = load.i64 notrap aligned readonly can_move region23 v0+184
;; @00f4 v80 = load.i64 notrap aligned readonly can_move region4 v0+104
-;; @0106 try_call_indirect v67(v80, v0), sig0, block21, [ context v0, default: block6(exn0) ]
-;;
-;; block21:
-;; @0106 jump block20
+;; @0106 call_indirect sig0, v67(v80, v0)
+;; @0106 jump block19
;;
-;; block20:
+;; block19:
;; @010a jump block5
;;
;; block5:
diff --git a/tests/disas/component-model/thread-transparency/opaque.wat b/tests/disas/component-model/thread-transparency/opaque.wat
index 6be1f9ece3..b24e062560 100644
--- a/tests/disas/component-model/thread-transparency/opaque.wat
+++ b/tests/disas/component-model/thread-transparency/opaque.wat
@@ -129,15 +129,15 @@
;; v21 = load.i64 notrap aligned region13 v15+152
;; store notrap aligned region14 v21, v14+24
;; store notrap aligned region5 v14, v15+136
-;; jump block16
+;; jump block15
;;
-;; block16:
+;; block15:
;; v22 = load.i64 notrap aligned readonly can_move region2 v3+72
;; v24 = load.i64 notrap aligned readonly can_move region0 v22+8
;; v25 = load.i32 notrap aligned region9 v24+128
-;; jump block17
+;; jump block16
;;
-;; block17:
+;; block16:
;; jump block11
;;
;; block11:
@@ -159,13 +159,13 @@
;; jump block3
;;
;; block3:
-;; jump block18
+;; jump block17
;;
-;; block18:
+;; block17:
;; @0125 jump block1
;;
;; block1:
;; @0120 v2 = iconst.i32 1234
-;; v40 = iadd.i32 v25, v2 ; v2 = 1234
-;; @0125 return v40
+;; v38 = iadd.i32 v25, v2 ; v2 = 1234
+;; @0125 return v38
;; }