Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

C.2.1 Codegen Notes

The AArch64 backend also keeps the parser-visible stack model, but uses registers for the shallow saved-value stack instead of immediately spilling everything.

  • The current visible expression result stays in x0.
  • A small prefix of saved values is cached in callee-saved registers, with deeper values spilling to stack slots.
  • Calls place the first 8 arguments in x0-x7 and place overflow arguments in the outbound call stack area.
  • Because AArch64 already requires 16-byte stack alignment and the backend spills in 16-byte slots, this path stays naturally aligned.