MSIL code

  • Thread starter Thread starter Peter Morris
  • Start date Start date
P

Peter Morris

MSIL is compiled to native instructions by the just-in-time compiler and
then those are executed. Although the statement is incorrect I suspect the
author may have merely omitted some of the details of the process.


Pete
 
Hello!

I'm reading in a book and it says the following.

"MSIL(Microsoft Intermediate Language) generated by all the .NET language
compilers. This is a common
standard for the binary code generated by the compilers and is what is
executed by the CLR"

Now to my question about the text.
Is it really true that CRL is executing the MSIL code ?

I'm quite sure that the code that CRL will execute is the native code that
is output from the JIT
compilers.
The JIT take MSIL as input and generate OS native code that CLR can execute.

You may correct me if I'm wrong here ?

//Tony
 
Tony Johansson said:
Hello!

I'm reading in a book and it says the following.

"MSIL(Microsoft Intermediate Language) generated by all the .NET language
compilers. This is a common
standard for the binary code generated by the compilers and is what is
executed by the CLR"

Now to my question about the text.
Is it really true that CRL is executing the MSIL code ?

I'm quite sure that the code that CRL will execute is the native code that
is output from the JIT
compilers.
The JIT take MSIL as input and generate OS native code that CLR can execute.

You may correct me if I'm wrong here ?

I'm don't think the statement is incorrect.

The CLR represents a machine which executes IL. How it does this is doesn't
nullify the fact the IL does ultimately get executed and the thing
responsible for having it executed is the CLR.

If its not true to say "the CLR executes IL code" then the same could be
applied to "a CPU executes machine code". Internally a processor may break
down the execution of single machine instruction into several steps and its
those steps which 'execute'.
 
The clr is responsible for the execution of MSIL code. This does not mean
that it executes it as though it were in a virtual machine of the classic
type.

The code does run natively on the processor.

However, the process of verification and compilation that the code goes
through before it gets to actually execute on the registers of the processor
is so intense that we might consider the CLR to be a virtual machine.

The strategy has one clear advantage over the classic interpretational or
tokenised virtual machine, that is that once verified, checked and compiled,
the process doesn't have to happen again for the second time that a given
routine is called.


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top