This shows you the differences between the selected revision and the current version of the page.
| aot_compiler 2009/04/01 16:21 | aot_compiler 2009/04/01 16:23 current | ||
|---|---|---|---|
| Line 46: | Line 46: | ||
| ===== Step by Step ===== | ===== Step by Step ===== | ||
| - | 1. Loads the IL using Mono.Cecil (AOT/Core/IR/Engine.cs:448) | + | 1. Loads the IL using Mono.Cecil (AOT/Core/IR/Engine.cs:448) |
| - | 2. Creates intermediate representation (IR) objects to represent types/methods. (AOT/Core/IR/Engine.cs:521) | + | |
| - | 3. Converts the IL bytecode into the intermediate code representation (fills the methods) (AOT/Core/IR/Engine.cs:587) | + | 2. Creates intermediate representation (IR) objects to represent types/methods. (AOT/Core/IR/Engine.cs:521) |
| - | 4. Performs a number of IR optimizations on each method (AOT/Core/IR/Method.cs:2712) | + | |
| - | 5. Calls an IAssembly implementation to handle encoding to native code (AOT/Core/IR/Engine.cs:622) | + | 3. Converts the IL bytecode into the intermediate code representation (fills the methods) (AOT/Core/IR/Engine.cs:587) |
| - | 6. IAssembly prepares the IR for encoding as native code. | + | |
| + | 4. Performs a number of IR optimizations on each method (AOT/Core/IR/Method.cs:2712) | ||
| + | |||
| + | 5. Calls an IAssembly implementation to handle encoding to native code (AOT/Core/IR/Engine.cs:622) | ||
| + | |||
| + | 6. IAssembly prepares the IR for encoding as native code. | ||
| The rest of the sequence is dependent on the IAssembly (aka, the architecture) being compiled for. | The rest of the sequence is dependent on the IAssembly (aka, the architecture) being compiled for. | ||
| For X86, the encoding is like this: | For X86, the encoding is like this: | ||
| - | 1. PE/COFF header: provides method names when debugging | + | 1. PE/COFF header: provides method names when debugging |
| - | 2. Multiboot header: hints for the boot loader, including entry point address | + | |
| - | 3. Methods | + | 2. Multiboot header: hints for the boot loader, including entry point address |
| - | 4. Helper functions | + | |
| - | 5. Data | + | 3. Methods |
| - | 6. Symbols | + | |
| + | 4. Helper functions | ||
| + | |||
| + | 5. Data | ||
| + | |||
| + | 6. Symbols | ||
| Then it saves all this encoded data to the file. This process happens in X86.Assembly.Encode() | Then it saves all this encoded data to the file. This process happens in X86.Assembly.Encode() | ||
| (AOT/Core/X86/Assembly.cs:1271). | (AOT/Core/X86/Assembly.cs:1271). | ||