# Blocs d'activation ## Memory Hierarchy | Type | Desc | | ------------ | ----------------------------------- | | Registers | Small memory units built on the CPU | | L1 | Last main memory access results | | L2 | MB | | Memory (RAM) | RAM | | Storage | Disks | ## Register overflow **Memory allocation must be dynamic** ### Dynamic memory allocation - *Global* - *Automatic* - *Heap*: - User controlled - Garbage collected ## `spim` Memory model ![[Pasted image 20250513142247.png]] ## Stack management Function calls: stack process Or: Call Tree dfs ## Activation blocks contents - arguments : incoming - local variables : user automatic variables - return address : where to return - saved registers : caller's environment to restore - temp : compiler automatic variables, spills - static links : when needed Layout suggested by the constructor ## Frame & stack pointer Frame : debut de bloc Stack : fin de bloc # Static links A mechanism : - Computed at compile time - that produces code - that will be used at runtime $\rightarrow$ Sert à remonter au premier lien avant les appels recursifs pour chopper des variables # Translating expressions How to translate the expression $\alpha < \beta$ in HIR?