Ads 468x60px

.

JIT (Just–in-Time Compiler) & Debugging

The .NET Runtime ships with a Just-In-Time (JIT or JITter) compiler, which will convert the MSIL code in to the native code (CPU Specific executable code). So whatever code we write will be complied in to MSIL format and the JIT takes over when you run it. 

The .NET runtime/Common Language Runtime (CLR) ships three different classes of JITters. The Main JIT compiler converts the MSIL code it to native code with out any optimizations. The JIT compiler takes the MSIL code and optimizes it. So this compiler requires lot of resources like, time to compile, larger memory footprint, etc. The PreJIT is based on the Main JIT and it works like the traditional compilers (compiles MSIL to native code during compilation time rather than runtime). This compiler is usually used at the time of installation.

No matter whatever language we used to develop the HelloWorld program, it’s a known fact that compiler’s are going to generate a MSIL format, once our code has been converted in to MSIL format, from MSIL format all the code that we write will be converted to native code in the same way whether if it is a VB.NET source or C# source.

Intermediate Language (IL)
To support our discussion let us examine the IL code of HelloWorld program written using VB.NET and C#. To visualize the IL code Microsoft provides a disassembler tool through which you can easily see the IL code To use the tool, choose command prompt and type ILDASM->ILDASM dialog is shown- > choose file open dialog and select the assembly (make sure you set your path variable to point to the place where your ILDASM is available)

The manifest information shows the dependent assemblies like mscorlib, Microsoft.VisualBasic and their versions and it self describes the HelloWorld assembly. Since we have a simple program, which does not contain any embedded resource, the manifest does not include any information on those.

Figure showing disassembled HelloWorld program

The above window showing a tree displays the path of the assembly as the root node, manifest information and namespace information as the child node (if you do not specify the namespace for the class then class name will be shown instead of namespace).

The above figure shows the list of information present within the namespace. In general the namespace contains the list of classes, structures, delegates, enums etc., In this case it shows the HelloWorld class which in turn contains the methods present in the class. It also shows the following information.

�� .class public auto ansi



The above figure shows that HelloWorld is derived from System.Object, System.Object is the base class in the .NET framework

�� .ctor : void()


The above figure shows the IL code of the constructor of HelloWorld Class, you can see that it in turn calls System.Object::.ctor(), which is the base class’s constructor