The book is answered:
24th Time: Understanding metadata and IL (upper), 25th back: Understanding Metadata and IL (medium)
Let's move on.
Finally, to say that the metadata and IL role in JIT compilation, although the two-round foreshadowing is extravagant, but it is not too much, because only sufficient knowledge to have enough experience, technology is the same. So, we begin to follow the path of the method call, following the power that metadata and il contribute in that mysterious moment.
5 Meta data and IL at JIT compile time
The CLR ultimately executes only the local machine code, so JIT compilation works by parsing the IL code into machine code execution at run time. For JIT compilation, we will have a dedicated space to fully understand, this article will focus only on the metadata and IL in the execution of the program and participate in the details of the role. First, the IL is executed based on the stack, when executing method calls, method parameters, local variables, and return values are allocated on the stack and execute their invocation process, and since it is concerned with JIT compilation, we naturally focus on the execution of the method, because JIT compilation is triggered by executing a method call.
First, add some new material to the code starting with this article:
// Release : code04, 2009/02/24
// Author : Anytao, http://www.anytao.com
// List : Base.cs
public class Base
{
public void M()
{
Console.WriteLine("M in Base");
}
public virtual void N()
{
Console.WriteLine("N in Base");
}
}
And also:
// Release : code05, 2009/02/24
// Author : Anytao, http://www.anytao.com
// List : Three.cs
public class Three : Base
{
private static int ID { get; set; }
public override void N()
{
//Something new in Three
Console.WriteLine("N in Three");
}
public void M()
{
Console.WriteLine("M in Three");
M1();
}
public void M1()
{
Console.WriteLine("M1 in Three");
}
}
There are also code execution:
static void Main(string[] args)
{
Base three = new Three();
three.M();
three.N();
}