The JIT compiler compiles the IL into native code which is
then executed by the processor. This MSIL is a platform-independent
Intermediate Code that all programs written in languages targeting the .NET
Runtime are converted into. The platform independence stems from the fact that
all programs written in any .NET Runtime compliant language are compiled to
this intermediate code. This is the same for all flavors of the .NET compiler
as they target the .NET Runtime and not the host Operating System. However, it
should be noted that as with Java's JVM and JIT, we have to have different implementations
of the CLR or JIT depending on the platform on which our application would be
executed. The .NET Runtime (CLR) is responsible for compiling this intermediate
code (MSIL or IL in short) to native code using the Just in Time Compiler
(JIT). Note that each block of the MSIL code needs to be Jitted only once and
the portion of the source code that is never called is never Jitted. The JIT
handles the following:
·
Ensuring type safety and handling violations appropriately
·
Optimizations
·
Assembly Verification