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

Method frame_setup

winch/codegen/src/isa/aarch64/masm.rs:145–167  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

143 type ABI = Aarch64ABI;
144
145 fn frame_setup(&mut self) -> Result<()> {
146 let lr = regs::lr();
147 let fp = regs::fp();
148 let sp = regs::sp();
149
150 let offset = SImm7Scaled::maybe_from_i64(-16, types::I64)
151 .expect("Frame pointer offset of -16 is valid for pair addressing");
152 let addr = Address::pre_indexed_from_sp_for_pair(offset);
153 self.asm.stp(fp, lr, addr.to_pair_addressing_mode());
154 self.asm.mov_rr(sp, writable!(fp), OperandSize::S64);
155
156 let offset = SImm9::maybe_from_i64(-(SHADOW_STACK_POINTER_SLOT_SIZE as i64))
157 .expect("Shadow stack pointer slot size is valid for single addressing");
158 let addr = Address::pre_indexed_from_sp(offset);
159 addr.to_addressing_mode(self, OperandSize::S64, |masm, mem| {
160 masm.asm
161 .str(regs::shadow_sp(), mem, OperandSize::S64, TRUSTED_FLAGS);
162 Ok(())
163 })?;
164
165 self.move_sp_to_shadow_sp();
166 Ok(())
167 }
168
169 fn check_stack(&mut self, vmctx: Reg) -> Result<()> {
170 let ptr_size_u8: u8 = self.ptr_size.bytes().try_into().unwrap();

Callers

nothing calls this directly

Calls 12

lrFunction · 0.85
fpFunction · 0.85
spFunction · 0.85
shadow_spFunction · 0.85
OkFunction · 0.85
stpMethod · 0.80
to_addressing_modeMethod · 0.80
strMethod · 0.80
move_sp_to_shadow_spMethod · 0.80
expectMethod · 0.45
mov_rrMethod · 0.45

Tested by

no test coverage detected