Implementation

The core interpreter

The interpreter currently works by JITting the CIL into an internal format. This JIT stage does a stack type analysis, explicitly stores stack types in opcodes, but keeps the stack structure that is in the CIL. This internal format is then interpreted using a direct-threaded interpreter (as of version 0.2.0).

Dynamic opcode combining (incomplete)

The interpreter does implement dynamic opcode combining at run-time, but it is switched off by default because there is currently no intellegence about which .NET methods are JITted using dynamic opcode combining; which caused excessive memory use and, in some cases, a performance decrease due to cache misses.

Note that this project will never JIT directly to native machine code. Other projects already do this.

Supported systems

Currently it is been used on x86 and MIPS hardware, and should work on any 32-bit little-endian hardware without any problems.

32-bit big-endian hardware should be fairly simple to get running, but various parts of the code do assume little-endian at the moment.

A working C compiler and libc are required. GCC (any version) and the Microsoft C compiler in VS2005/2008 are known to work. There are two non-standard uses of C:

  1. Quite a few structs contain zero-length arrays. Some compilers do not support this.
  2. The GCC computed goto is used. Non-GCC compilers (that don't support computed goto) must implement a very small amount of assembler to acheive the same effect. This is already implemented for x86, and will be simple to implement for other platforms.