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

Method finalize

cranelift/codegen/src/isa/x64/inst/args.rs:610–630  ·  view source on GitHub ↗
(&self, frame: &FrameLayout, buffer: &mut MachBuffer<Inst>)

Source from the content-addressed store, hash-verified

608 }
609
610 pub(crate) fn finalize(&self, frame: &FrameLayout, buffer: &mut MachBuffer<Inst>) -> Amode {
611 match self {
612 SyntheticAmode::Real(addr) => addr.clone(),
613 SyntheticAmode::IncomingArg { offset } => {
614 // NOTE: this could be made relative to RSP by adding additional
615 // offsets from the frame_layout.
616 let args_max_fp_offset = frame.tail_args_size + frame.setup_area_size;
617 Amode::imm_reg(
618 i32::try_from(args_max_fp_offset - offset).unwrap(),
619 regs::rbp(),
620 )
621 }
622 SyntheticAmode::SlotOffset { simm32 } => {
623 let off = *simm32 as i64 + i64::from(frame.outgoing_args_size);
624 Amode::imm_reg(off.try_into().expect("invalid sp offset"), regs::rsp())
625 }
626 SyntheticAmode::ConstantOffset(c) => {
627 Amode::rip_relative(buffer.get_label_for_constant(*c))
628 }
629 }
630 }
631
632 pub(crate) fn aligned(&self) -> bool {
633 match self {

Callers 2

compute_cache_keyFunction · 0.45
emitFunction · 0.45

Calls 8

fromFunction · 0.85
rbpFunction · 0.70
rspFunction · 0.70
cloneMethod · 0.45
unwrapMethod · 0.45
expectMethod · 0.45
try_intoMethod · 0.45

Tested by

no test coverage detected