BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Mono JIT Enhancements: Trampolines and Code Sharing

Mono JIT Enhancements: Trampolines and Code Sharing

Bookmarks

Mono is an open version of the .NET platform based primarily on the ECMA standards. Condemned by both traditional open source and .NET developers, it never the less preserved through those early years to become a viable platform. It can be now seen in several Gnome applications as well as the MP3 player, Sansa Connect.

Paolo Molaro talks about trampolines and how they affect the memory footprint of JIT-based runtimes. In short, a trampoline is a function stub that, when called, triggers the JIT. Once the JIT has compiled the function to machine code, the pointer to the trampoline is replaced with a pointer to the real function.

By finding a way to share trampolines used by virtual methods, Paolo was about to reduce the number needed to roughly a third of what the released version of Mono needs. The savings can vary greatly from application to application:

> In the cases above, the number of generated trampolines goes from 21000 to 7700 for MonoDevelop (saving 160 KB of memory), from 17000 to 5400 for the IronPython case and from 800 to 150 for the hello world case.

Meanwhile Mark Probst talks about the problems with sharing code across generics and the progress they are making.

> Now let’s see how far I’ve come implementing generics sharing. First off, we can only share non-generic non-static methods at this point. Also, we only share for generic instantiations where all type arguments are reference types. That is, the classes Dictionary and Dictionary will share methods, but the classes Dictionary and Dictionary will not share methods. All of that will be implemented later on, of course.

Rate this Article

Adoption
Style

BT