X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=doc%2Fruntime;h=f828bb132219915a68d02743af7e12a0c54b7b8e;hb=9d93ddc5daf9a96e7fcd5d9ef7fac0ddba68feb9;hp=01f3dcf71b2594a1da183806524737cc67a478f9;hpb=f127a45f781b1801f807343a29d2427bc1169abb;p=mono.git
diff --git a/doc/runtime b/doc/runtime
index 01f3dcf71b2..f828bb13221 100644
--- a/doc/runtime
+++ b/doc/runtime
@@ -9,9 +9,8 @@
We currently have two runtimes:
- * mono: The Just In Time compiler implemented
- using a BURS instruction selector. We only support
- x86 machines in the JIT engine at this point.
+ * mono: Our Just-in-Time and Ahead-of-Time code
+ generator for maximum performance.
* mint: The Mono interpreter. This is an
easy-to-port runtime engine.
@@ -31,12 +30,52 @@
href="http://primates.ximian.com/~lupus/slides/jit/">slides
here
-** Current JIT Engine: technical details (updated, July 8th, 2002)
+** Current JIT Engine: technical details (updated, June 28th, 2003)
- The JIT engine uses a code-generator generator approach for
- compilation. Given the properties of CIL byte codes, we can
- take full advantage of a real instruction selector for our
- code generator.
+ We have re-written our JIT compiler. We wanted to support a
+ number of features that were missing:
+
+
+ * Ahead-of-time compilation.
+
+ The idea is to allow developers to pre-compile their code
+ to native code to reduce startup time, and the working
+ set that is used at runtime in the just-in-time compiler.
+
+ Although in Mono this has not been a visible problem, we
+ wanted to pro-actively address this problem.
+
+ When an assembly (a Mono/.NET executable) is installed in
+ the system, it would then be possible to pre-compile the
+ code, and have the JIT compiler tune the generated code
+ to the particular CPU on which the software is
+ installed.
+
+ This is done in the Microsoft.NET world with a tool
+ called ngen.exe
+
+ * Have a good platform for doing code optimizations.
+
+ The design called for a good architecture that would
+ enable various levels of optimizations: some
+ optimizations are better performed on high-level
+ intermediate representations, some on medium-level and
+ some at low-level representations.
+
+ Also it should be possible to conditionally turn these on
+ or off. Some optimizations are too expensive to be used
+ in just-in-time compilation scenarios, but these
+ expensive optimizations can be turned on for
+ ahead-of-time compilations or when using profile-guided
+ optimizations on a subset of the executed methods.
+
+ * Reduce the effort required to port the Mono code
+ generator to new architectures.
+
+ For Mono to gain wide adoption in the Unix world, it is
+ necessary that the JIT engine works in most of today's
+ commercial hardware platforms.
+
The JIT engine implements a number of optimizations:
@@ -47,7 +86,7 @@
* Inlining.
- * Constant folding.
+ * Constant folding, copy propagation, dead code elimination.
Although compilers typically do
constant folding, the combination of inlining with
@@ -56,6 +95,9 @@
* Linear scan register allocation. In the past,
register allocation was our achilles heel, but now
we have left this problem behind.
+
+ * SSA-based framework. Various optimizations are
+ implemented on top of this framework
There are a couple of books that deal with this technique: "A
@@ -64,7 +106,13 @@
technical description of lbrug.
- A few papers that describe the instruction selector:
+ The new JIT engines uses three intermediate representations:
+ the source is the CIL which is transformed into a forest of
+ trees; This is fed into a BURS instruction selector that
+ generates the final low-level intermediate representation.
+
+ The instruction selector is documented in the following
+ papers:
-** New JIT engine.
-
- We are working on a new JIT engine. The new JIT engine
- focuses on portability and in two intermediate representations
- that simplify the development of optimizations. This together
- with the Ahead-of-Time compilation will allow developers to
- deploy applications that match the speed of natively compiled code.
-
** Garbage Collection
We are using the Boehm conservative GC. We might consider