The book "clr.via.c# third Edition" has recently been studied. Reading a PDF document is really tiring. Suggest a qualified friend or buy a book to read it.
My notes are used to record my understanding of the book, to simplify the logic, and to summarize what I think is the main point of each part. The special basis of things will not do too much elaboration.
The first part is about the CLR Foundation.
Let's start with the concept of the CLR: "The CLR is a runtime that can be used by multiple programming languages." You can use any programming language to develop your code, as long as the compiler is oriented to the CLR. " This is to be re-interpreted as "as long as the compiler is for the CLR". Beginners generally disagree with the. NET platform across languages, or so-called "cross-language" languages that are within the scope of Microsoft's rollout. This understanding is in fact wrong. Any language can target the CLR to create its own compilers. We are familiar with iron Ruby, Perl, and PHP have CLR-oriented compilers. Figure 1-1 shows the process of compiling the source code files.
The more important perception is that the CLR actually does not work with the managed module, but rather works with the assembly. The assembly contains other files such as managed modules and resource files.
IL (intermediate language) can be written using assembly language. The JIT in the CLR (just in time) is also called an instant compiler, which has a function jitcomplier (), the function of which is to convert the Il of the method to be executed cost to the CPU instruction.
The calling procedure for a method in a class:
When a method executes, it is generally called two times. (The tentative method here is named Test ())
Jitcompiler () compiles the IL Code of the test () method to compile the cost of the CPU instruction (this instruction is saved in a dynamically allocated memory block), and the test () method executes through Jitcomplier in the memory block (including the Il of the lookup method ) , verify the Il of the method, compile, execute).
Skip Jitcompiler () completely, and the Test () method executes again in memory.
Two executions of the process 1-4, 1-5 as shown:
Note that the local CPU instructions are stored in dynamic memory, and once the program terminates, the local CPU instructions are discarded.
The difference between the debug version and release version is essentially whether the IL code quality and the JIT native code quality are optimized. From the performance considerations, the program deployment, release, preferably with release version.
This section also contains program packaging, deployment, assembly information, and so on. There is no elaboration here.
The first part of "clr.via.c# Third Edition" Reading notes (i)