Does the Just In Time Compiler(JIT)
really map each of the Common Intermediate Language(CIL)
instructions in a program to underlying processor's opcodes
?
And If so can we call CIL an assembly language and JIT an assembler
Note: Wikipedia doesn't list CIL as an assembly language in its list of assembly languages
CIL is an object-oriented assembly language and is CPU and platform-independent instructions that can be executed in any environment supporting the Common Language Infrastructure such as the . NET run time.
CIL is a CPU- and platform-independent instruction set that can be executed in any environment supporting the Common Language Infrastructure, such as the . NET runtime on Windows, or the cross-platform Mono runtime.
The Assembler is a Software that converts an assembly language code to machine code. It takes basic Computer commands and converts them into Binary Code that Computer's Processor can use to perform its Basic Operations. These instructions are assembler language or assembly language.
This question is all about definitions, so let's define the terms properly. First, assembly language:
Assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices in which each statement corresponds to a single machine language instruction. An assembly language is specific to a certain computer architecture, in contrast to most high-level programming languages, which generally are portable to multiple systems.
Now, CIL:
Common Intermediate Language is the lowest-level human-readable programming language defined by the Common Language Infrastructure (CLI) specification and is used by the .NET Framework and Mono. Languages which target a CLI-compatible runtime environment compile to CIL, which is assembled into an object code that has a bytecode-style format.
Okay, this part is technically not correct: for example C# compiler compiles directly to the bytecode, it doesn't go through CIL (the human-readable language), but theoretically, we can imagine that's what's happening.
With these two definitions, CIL is an assembly language, because each statement in it is compiled down to a single bytecode instruction. The fact that there is no physical computer that can execute that bytecode directly doesn't matter.
The definition says that each assembly language is “specific to a certain computer architecture”. In this case, the architecture is the CLR virtual machine.
About JIT: the JIT compiler can't be considered an assembler: it doesn't do the 1:1 translation from human-readable form to bytecode, ilasm
does that.
The JIT compiler is an optimizing compiler that compiles from bytecode to native machine code (for whatever ISA / CPU it's running on), while making optimizations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With