[Mono-dev] [PATCH]Optimization of the generated IMT code

Rodrigo Kumpera kumpera at gmail.com
Wed Oct 24 19:39:04 EDT 2007


Hi,

The attached patch optimize the imt thunk code. The optimization is to
exploit the fact that IP don't need to be preserved under a particular
situation.

The magic trampoline needs to retrieve the vtable pointer used by the call
site to patch it and this address might be stored in a scratch register,
that's why the IMT code cannot change then. But if the code store the vtable
address within the scratch registers, the magic trampoline code won't
notice. This change allow us to branch without the POP hack.

The optimization loads the vtable pointer into IP and uses r0 and r1 to
compare values. To call the virtual method, we use "ldr pc, [ip + #]". These
changes reduce the code by 3 words for each entry.


Cheers,
Rodrigo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071024/1cb6bd3d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm_imt_opt.diff
Type: text/x-patch
Size: 4875 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071024/1cb6bd3d/attachment.bin 


More information about the Mono-devel-list mailing list