Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Frame layout » ?

Definition 7.6 University Computer Science — Year 3 · Chapitre 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.
Lire dans le chapitre →