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

A.2.1 Codegen Notes

The x86_64 backend still follows udewy's logical value-stack model, but it does not map every save_value() directly to a machine push.

  • The current visible expression result stays in rax.
  • A small prefix of the logical saved-value stack is cached in callee-saved registers before falling back to spill slots on the real stack.
  • When a call has more than 6 arguments, the extra arguments are written into an outbound stack-argument area and the first 6 are placed in rdi, rsi, rdx, rcx, r8, and r9.
  • Call lowering also keeps the machine stack aligned to the ABI-required 16-byte boundary.