1 Mono Ahead Of Time Compiler
2 ===========================
4 The new mono JIT has sophisticated optimization features. It uses SSA and has a
5 pluggable architecture for further optimizations. This makes it possible and
6 efficient to use the JIT also for AOT compilation.
9 * file format: We use the native object format of the platform. That way it is
10 possible to reuse existing tools like objdump and the dynamic loader. All we
11 need is a working assembler, i.e. we write out a text file which is then
12 passed to gas (the gnu assembler) to generate the object file.
14 * file names: we simply add ".so" to the generated file. For example:
15 basic.exe -> basic.exe.so
16 corlib.dll -> corlib.dll.so
18 * staring the AOT compiler: mini --aot assembly_name
20 The following things are saved in the object file:
24 * native code: this is labeled with method_XXXXXXXX: where XXXXXXXX is the
25 hexadecimal token number of the method.
27 * additional informations needed by the runtime: For example we need to store
28 the code length and the exception tables. We also need a way to patch
29 constants only available at runtime (for example vtable and class
30 addresses). This is stored i a binary blob labeled method_info_XXXXXXXX:
34 - all precompiled methods must be domain independent, or we add patch infos to
35 patch the target doamin.
37 - the main problem is how to patch runtime related addresses, for example:
39 - current application domain
40 - string objects loaded with LDSTR
41 - address of MonoClass data
42 - static field offsets
44 - virtual function and interface slots