IUCompilerCourse / Essentials-of-Compilation

A book about compiling Racket and Python to x86-64 assembly
1.27k stars 137 forks source link

Fix typo: output of assign-homes is X86_Int (not X86_Var) #151

Closed jnear closed 1 year ago

jnear commented 1 year ago

Figure 2.10 (Python version) lists the output of assign_homes as X86_Var (and all the other diagrams in both versions are similar). But I think the output language of this pass is actually X86_Int, right?

jsiek commented 1 year ago

There's a subtle point there... as currently defined, the x86_Int language is a subset of real x86, with all the funny restrictions on the instruction arguments. So we're not in x86_Int until after patch instructions. The x86_Var language relaxes those restrictions and adds variables. I suppose there really ought to be a third language that relaxes the restrictions but does not include variables, which would better capture the state of things between assign homes and patch instructions.

jsiek commented 1 year ago

I'll create an issue for this.