CSC448: Code Generation: Code Generation [68/133] Previous pageContentsNext page

Corin did not show

Code generation produces an x86 assembly language file.

The output of the code generation phase is assembled, along with the x86 assembly language implementations of native methods, and then linked to produce an executable file.

The majority of the code generation can be described by the following pseudo-code:

for (every non-native method block and the entry block) {
  for (every statement in the block) {
    output one or more lines of assembly language to implement the statement;
  } 
}

There are some other details such as allocating storage for global variables and creating vtables for each clazz.

Previous pageContentsNext page