Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 2. C# and the CLR > The JIT Compiler in the CLR

2.1. The JIT Compiler in the CLR

C# is compiled into IL, and IL is what the CLR processes. The IL specification is contained in the CLI standard. You can see what IL looks like by loading the "Hello World!" application (from Chapter 1) into the Intermediate Language Disassembler (ILDASM) provided with the .NET SDK.[] ILDASM shows you a tree view of the type data from the assembly, and you can open up individual methods and see the IL code that the C# compiler generated for them. As shown in Listing 2-1, IL looks similar to assembly language. In essence, it's the assembly language of the CLR. It's called IL because it acts as an intermediate step between a specific language and a specific platform.

[] If you have Visual Studio 2010 installed, you can easily launch ILDASM.exe from a Visual Studio 2010 command prompt.

Listing 2-1. HelloWorld.exe Main Method IL

.method private hidebysig static void Main() cil managed
{
  .entrypoint
  // Code size       13 (0xd)
  .maxstack  8
  IL_0000:  nop
  IL_0001:  ldstr      "Hello World! "
  IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
  IL_000b:  nop
  IL_000c:  ret
} // end of method EntryPoint::Main


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial