MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / call_indirect

Method call_indirect

pulley/src/interp.rs:1416–1426  ·  view source on GitHub ↗
(&mut self, dst: XReg)

Source from the content-addressed store, hash-verified

1414 }
1415
1416 fn call_indirect(&mut self, dst: XReg) -> ControlFlow<Done> {
1417 let return_addr = self.pc.as_ptr();
1418 self.state.lr = return_addr.as_ptr();
1419 // SAFETY: part of the unsafe contract of the interpreter is only valid
1420 // bytecode is interpreted, so the jump destination is part of the validity
1421 // of the bytecode itself.
1422 unsafe {
1423 self.pc = UnsafeBytecodeStream::new(NonNull::new_unchecked(self.state[dst].get_ptr()));
1424 }
1425 ControlFlow::Continue(())
1426 }
1427
1428 fn jump(&mut self, offset: PcRelOffset) -> ControlFlow<Done> {
1429 self.pc_rel_jump::<crate::Jump>(offset)

Callers 6

make_trampolineFunction · 0.80
insert_call_to_functionFunction · 0.80
cloningFunction · 0.80
call_indirect_hostMethod · 0.80
indirect_call_instMethod · 0.80

Calls 3

get_ptrMethod · 0.80
newFunction · 0.50
as_ptrMethod · 0.45

Tested by 1

cloningFunction · 0.64