200 likes | 492 Views
Common Intermediate Language (CIL). Introduction. Common Intermediate Language (formerly called Microsoft Intermediate Language or MSIL ) is the lowest-level human-readable programming language defined by the Common Language Infrastructure specification.
E N D
Introduction • Common Intermediate Language (formerly called Microsoft Intermediate Language or MSIL) is the lowest-level human-readable programming language defined by the Common Language Infrastructure specification. • Languages which target a CLR-compatible runtime environment compile to CIL, which is assembled into an object code that has a bytecode-style format. • CIL is an object-oriented assembly language, and is entirely stack-based. Its bytecode is translated inte native code or executed by a virtual machine.
Profile Class Library • Within the CLI class libraries lies a distinction between Microsoft's .NET and the ECMA CLI. • What was submitted for ECMA's standardization is a subset of the Microsoft .NET libraries, as depicted in the following diagram. • With that said, we can move on to describing only the ECMA CLI libraries.
Base Class Library • The BCL contains about 147 classes that deal with value types, exceptions, string manipulations, collections, threading, security, globalization, and IO. • A very small portion of the implementation must contain platform-specific code, while the vast majority can be generically developed for any platform.
Just-In-Time compiler • At run time, the CLR uses JIT compilation to compile MSIL to native machine code for the current platform • Compiles only methods that are called, the first time they are called • Compiled methods are cached for subsequent uses • Type Safety Verification verifies: • References to types are strictly compatible with each type being referenced • Only appropriately defined operations are invoked on each object • Identities are what they claim to be
Garbage Collection • The CLR manages a pool of memory called the managed heap • Once there are no references to an object, it becomes “garbage” and can no longer be reached • .NET continuously runs a Garbage Collector (GC) on a separate thread to look for this garbage • The GC works as a mark and sweep collector, only running when a certain amount of memory has been used, or when the system needs memory • The GC uses generation marking for each sweep • Objects marked higher than generation 2 are collected much less frequently
Namespace • The framework relies on Namespaces to organize classes. Much as a directory file structure is a physical container of files, namespaces are logical containers for classes and interfaces. • The root namespace in CLI is System. All classes within the framework are contained within the System namespace.
The End …… Thank You ……