MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / finalize

Method finalize

crates/ir-to-asm/src/compiler/frame_context.rs:69–83  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

67 // Lay out the save area above the locals: callee-saved regs ascending,
68 // then ra at the top. This keeps it one contiguous block.
69 let mut regs = std::mem::take(&mut self.pending_regs);
70 regs.sort_unstable();
71 for reg in regs {
72 let offset = self.alloc_slot(8, 8);
73 self.saved_regs.push((reg, offset));
74 }
75 if self.needs_ra {
76 self.ra_offset = Some(self.alloc_slot(8, 8));
77 }
78 // Align frame size to 16 bytes.
79 self.frame_size = (self.next_offset + self.alignment - 1) & !(self.alignment - 1);
80 }
81
82 pub fn frame_size(&self) -> usize {
83 self.frame_size
84 }
85
86 /// Compute the size of a type after resolving aliases.

Callers 3

compile_functionMethod · 0.45
alloc_forFunction · 0.45

Calls 2

alloc_slotMethod · 0.80
pushMethod · 0.80