F
F
Funtik_042022-01-13 23:19:49
.NET
Funtik_04, 2022-01-13 23:19:49

How does clr convert c# code into computer commands?

I'm reading the first chapter of Richter and I don't understand a bit. When compiling a c# file, we get il code, metadata, and headers. But what happens when the program is executed is not very clear to me. Clr creates a structure for storing links of class methods, ok, then (as I understand it) the jit compiler finds this link and sends us to the method data, which also contains il code? Or have I misunderstood something? And if there is no il code, then what? What happens next is clear to me, jit allocates memory into which it places the compiled jit code, and then places a link to its compiled code into the structure created by clr and transfers execution to it. And another question, if you describe the method in the file itself, then all the same, then jit will ask about the method from the method?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-01-14
@Funtik_04

Only machine code that IT generated by reading IL is executed.
That is, when your code is executed, all pointers in the vtable already lead to machine code.
The last thesis I could not decipher


if you describe the method in the file itself, then anyway, then jit will ask about the method from the method?

If you are very interested in how JIT works - look at the reports from Egor Bogatov.
Well, there are also articles on Habré.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question