Microsoft Intermediate Language
From Free net encyclopedia
Microsoft Intermediate Language (MSIL) is a byte-code that Microsoft .NET technology uses to accomplish platform independence and runtime safety.
Contents |
General information
During compilation of .NET programming languages, the source code is translated into MSIL code rather than machine-specific object code. MSIL is a CPU- and platform-independent instruction set that can be executed in any environment supporting the .NET framework. MSIL code is verified for safety during runtime, providing better security and reliability than natively compiled binaries.
Just-In-Time (JIT) Compilation
This technique involves the byte-code being turned into code immediately executable by the CPU. The conversion is performed gradually during the program's execution. JIT compilation provides environment-specific optimization, runtime type safety, and assembly verification. To accomplish this, the JIT compiler examines the assembly metadata for any illegal accesses and handles violations appropriately.
NGEN (Native Image Generator) Compilation
NGEN allows to produce a native binary image for the current environment. The byte-code is either skipped entirely or converted into native CPU instructions completly before runtime. This eliminates the JIT overhead at the expense of portability; whenever an NGEN-generated image is run in an incompatible environment, .NET framework automatically reverts to using JIT.
Once NGEN is run against an assembly, the resulting native image is placed into the Global Assembly Cache for use by all other .NET assemblies. It is advised that NGEN is run during applications' deployment.
Metadata
Metadata is information about the compiled classes. It serves the same purpose as a type library in COM. Metadata enables applications to support and discover the interfaces of classes in the assembly. The process of reading metadata is called reflection.