.Net Framework Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 3035 Page Views: 

How Just in Time Compiler Works?



Posted By: Avi Date: 30 November 2009 02:53:38 PM
 Answer:

.Net Framework uses two step compilation process. We write code in C#, VB.Net, or in other supporting languages and when we compile the code, the respective language's compiler compiles the code into an intermediate code called the MSIL (Microsoft Intermediate Language).

When you execute the program, i.e. the intermediate code, the Just-In-Time (JIT) compiler comes into the picture. The job of the JIT compiler is to convert intermediate code in to the machine code or the native code for execution.

The advantage of converting the source code to the intermediate code is that it can run on any operating system provided you have the JIT for that operating system. This gives the portability to your code.

Another advantage of JIT compiler is that the code can be optimized to a particular operating system.


Posted By: eTechPlanet


Date: 30 November 2009 02:53:38 PM

When you execute the program, i.e. the intermediate code, the Just-In-Time (JIT) compiler comes into the picture. The job of the JIT compiler is to convert intermediate code in to the machine code or the native code for execution. With the JIT the code can be optimized to a particular operating system. This is one of the advantages of going for such code execution.

The advantage of converting the source code to the intermediate code is that it can run on any operating system provided you have the JIT for that operating system. This gives the portability to your code.

In .Net the CLR which also has the JIT is used to convert the CIL code into the native code to be processed by the machine. It is also possible to convert the source code to the native code directly by bypassing the tasks done by the JIT. This helps to reduce the load in the JIT. This is done in some cases.


Posted By: Johndecruse


Date: 31 January 2010 10:53:29 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image F5V8yg
Related Questions
.Net Framework : Describe use of named pipes:

Describe use of named pipes:

Named pipes provide interprocess communication between a pipe server and one or more pipe clients. N....
Category: .Net Framework Date: 10/15/2010 10:27:48 AM
.Net Framework : How do format double with only two decimal places after decimal separator?

How do format double with only two decimal places after decimal separator?

field.ToString(“F2”)
Category: .Net Framework Date: 10/15/2010 10:27:48 AM
.Net Framework : Can event be marked as abstract?

Can event be marked as abstract?

Yes
Category: .Net Framework Date: 10/15/2010 8:52:48 AM
.Net Framework : What is routed event?

What is routed event?

Routed event is a type of event that can invoke handlers on multiple listeners in an element tree. R....
Category: .Net Framework Date: 10/15/2010 8:00:49 AM
.Net Framework : What are generics?

What are generics?

Generics add support for type parameters in .NET Framework.
Category: .Net Framework Date: 10/15/2010 6:05:48 AM