At run time, the common language runtime compiles IL code into machine code (binary) that is specific to the hardware and operating system the code is currently running on. The common language runtime compiler is known as the Just-In-Time (JIT) compiler because it doesn't go through and compile all the code in the assembly at one time but rather compiles code only as it is being called. If the same method is called again while the solution is running, the common language runtime runs the binary that is already in memory rather than rerun it through JIT compilation. One benefit of this arrangement is that only the code that needs to be run is compiled, saving time and memory compared with compiling it all at once.

Additionally, the common language runtime can read the metadata of the IL stored in the assembly and can verify that the code is type safe before attempting to access memory locations. Note also that the verification process can be skipped if security policy is set to do so.

0 0

Post a comment