importing messaging-2008 branch to trunk [continued]
[mono.git] / docs / call-sites.txt
1 Call Sites
2 Extracted from emails from Paolo Molaro
3
4
5 There are 3 basic different kinds of call sites:
6
7         1) normal calls:
8                 call relative_displacement
9         
10         2) virtual calls:
11                 call *positive_offset(%register)
12         
13         3) interface calls:
14                 mov constant, %imt_register
15                 call *negative_offset(%register)
16         
17 The above is what happens on x86 and amd64, with different values of
18 %imt_register for each arch (this register is a constant, but it could
19 change with different mono builds, it should be likely one of
20 constants the runtime comunicates to the debugger). %register can
21 change depending on the callsite based on the register allocator
22 choices.  Note that the constant for the interface calls won't
23 necessarily be a MonoMethod address: this could change in the future
24 to a simple number.
25
26 In all the 3 cases the JIT trampolines will need to inspect the call
27 site, but only in the first case the call site will be changed.