[Mono-dev] Where is the JIT compiler?

Massimiliano Mantione massi at ximian.com
Tue Apr 11 04:51:23 EDT 2006


On Mon, 2006-04-10 at 13:07 -0700, Alan Cyment wrote:
> Is "mini.c" the heart of the JIT compiler?

Well, "heart" is an ambiguous word here, but yes, it is the
main entry point and contains most of the "core" code :-)

> I'm trying
> to understand the way the JIT works, but I'm not
> having an easy time finding my way around the source
> code tree.

Be sure to read the relevant files in mono/docs, most of all
"mini-doc.txt", but also "jit-trampolines".
The JIT is in the process of being reworked (see the branch
"vargaz/mini-linear-il" in svn, and also the
"http://www.mono-project.com/Linear_IL" file), but most of what
is interesting for your AOP project will be the same IMHO.
Just keep in mind that the "new jit" in "mini-doc.txt" is now
the current one and will be the "old one" sooner than later :-)

That said, "mono_method_to_ir" is the function that transforms
the CIL stream into the internal representation (IR), and
"mini_method_compile" drives the whole compilation process.

If you want to see examples of "code that inserts hooks", have
a look at the CAS related things.

Ciao,
  Massi





More information about the Mono-devel-list mailing list