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