more about MSIL code

T

Tony Johansson

Hi!

Will an assembly file(exe or dll) be the exact same MSIL code even after the
JIT have compiled the MSIL code to native machine code.
I mean if a compare the whole file(exe or dll) before I run the exe and
after I run the exe would the file be identical.

So when the CLR compile the MSIL into native machine language where is this
native machine language written

//Tony
 
A

Alberto Poblacion

Tony Johansson said:
Will an assembly file(exe or dll) be the exact same MSIL code even after
the JIT have compiled the MSIL code to native machine code.
I mean if a compare the whole file(exe or dll) before I run the exe and
after I run the exe would the file be identical.

So when the CLR compile the MSIL into native machine language where is
this native machine language written

The file is not affected. When the just-in-time compiler compiles the
MSIL into native code, the resulting code is written directly in RAM, and it
doesn't affect the original file. If you run the program again, it has to be
JIT-compiled again. If you want to elliminate the compilation step, you can
produce a "permanent" compiled file by means of NGEN.EXE.
 
A

Arne Vajhøj

Will an assembly file(exe or dll) be the exact same MSIL code even after the
JIT have compiled the MSIL code to native machine code.
I mean if a compare the whole file(exe or dll) before I run the exe and
after I run the exe would the file be identical.

Yes.

Otherwise it would be impossible to run assemblies at readonly
locations.
So when the CLR compile the MSIL into native machine language where is this
native machine language written

Just in memory. It is re-JIT'ed every time the program is run.

If you want to avoid that then use NGEN. But I will only recommend that
if your only major priority is startup speed.

Arne
 

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

Similar Threads


Top