BT

Mono JIT Enhancements: Trampolines and Code Sharing

| by Jonathan Allen Follow 636 Followers on Oct 24, 2007. Estimated reading time: 1 minute |

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 Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Typo? by Christophe Vanfleteren

but the classes Dictionary and Dictionary will not share methods. All of that will be implemented later on, of course.


Guess some < and > got lost in the process?

Wrong sweeping generalizations by Dan Tines

Condemned by both traditional open source and .NET developers...

Who, what, when, where?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss
BT