Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / docs / mini-doc.txt
index 30d9b4442b7ad5cc8c24bb5c2f67e04f5ab88008..ba19c1031f112256c83295ebe53f2ecf6dfb8680 100644 (file)
@@ -4,7 +4,15 @@
           Miguel de Icaza (miguel@{ximian.com,gnome.org}),
           Paolo Molaro (lupus@{ximian.com,debian.org})
 
-  
+       This documents overall design of the Mono JIT up to version
+       2.0.   After Mono 2.0 the JIT engine was upgraded from
+       a tree-based intermediate representation to a linear
+       intermediate representation.
+
+       The Linear IL is documented here:
+
+           http://www.mono-project.com/Linear_IL
+
 * Abstract
 
        Mini is a new compilation engine for the Mono runtime.  The
        CIL code on the fly to marshal parameters, and then this
        code is in turned processed by the JIT engine.
 
+       Mono has now gone through three different JIT engines, these
+       are:
+
+       * Original JIT engine: 2002, hard to port, hard to
+         implement optimizations.
+
+       * Second JIT engine, used up until Mono 2.0, very
+          portable, many new optimizations.
+
+       * Third JIT engine, replaced the code generation layer from
+         being based on a tree representation to be based on a linear
+         representation.
+
+        For more information on the code generation changes, see our
+       web site for the details on the Linear IL:
+
+           http://www.mono-project.com/Linear_IL
+
 * Previous Experiences
 
        Mono has built a JIT engine, which has been used to bootstrap
        application domains, or generate code that will not be shared
        across application domains.
 
-* Objectives of the new JIT engine.
+* Second Generation JIT engine.
 
        We wanted to support a number of features that were missing:
 
             necessary that the JIT engine works in most of today's
             commercial hardware platforms. 
 
-* Features of the new JIT engine.
+* Features of the Second JIT engine.
 
        The new JIT engine was architected by Dietmar Maurer and Paolo
        Molaro, based on the new objectives.
        variables to registers.  The linear scan pass uses the
        information that was previously gathered by the loop nesting
        and loop structure computation to favor variables in inner
-       loops. 
+       loops.   This process updates the basic block `nesting' field
+       which is later used during liveness analysis.
 
        Stack space is then reserved for the local variables and any
        temporary variables generated during the various
        optimizations.
 
-** Instruction selection 
+** Instruction selection: Only used up until Mono 2.0
 
        At this point, the BURS instruction selector is invoked to
        transform the tree-based representation into a list of
        operations if possible.
 
        The rest of the code generation is fairly simple: a switch
-       statement is used to generate code for each of the MonoInsts
+       statement is used to generate code for each of the MonoInsts,
+       in the mono/mini/mini-ARCH.c files, the method is called
+       "mono_arch_output_basic_block".
 
        We always try to allocate code in sequence, instead of just using
        malloc. This way we increase spatial locality which gives a massive
        registers, fixed registers and clobbered registers by each
        operation.
 
-* BURG Code Generator Generator
+* BURG Code Generator Generator: Only used up to Mono 2.0
 
        monoburg was written by Dietmar Maurer. It is based on the
        papers from Christopher W. Fraser, Robert R. Henry and Todd
        processors, and some of the framework exists today in our
        register allocator and the instruction selector to cope with
        this, but has not been finished.  The instruction selection
-       would happen at the same time as local register allocation. <
\ No newline at end of file
+       would happen at the same time as local register allocation. <