全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Frame layout?

Definition 7.6 University Computer Science — Year 3 · 第 7 章 — Intermediate Code and Code Generation

The frame of a function is the block of stack it allocates on entry, by lowering sp, and frees on return. Its layout assigns each item that must outlive a call, such as temporaries, saved registers and outgoing arguments that do not fit in registers, a fixed offset from sp.

The frame of fib: six temporaries at offsets 4t, then the saved ra at the top. 4 × 6 + 4 = 28 bytes, rounded up to 32. The offsets are those of Frame::new(6), which the test frames_of_fib_and_main checks.
The frame of fib: six temporaries at offsets 4t4t, then the saved ra at the top. 4×6+4=284 \times 6 + 4 = 28 bytes, rounded up to 32. The offsets are those of Frame::new(6), which the test frames_of_fib_and_main checks.
在原文中阅读 →