I.6 Overview of the Common Language Infrastructure
I.7 Common Language Specification
- I.8.1 Relationship to object-oriented programming
- I.8.2 Values and types
- I.8.3 Locations
- I.8.4 Type members
- I.8.5 Naming
- I.8.6 Contracts
- I.8.7 Assignment compatibility
- I.8.8 Type safety and verification
- I.8.9 Type definers
- I.8.9.1 Array types
- I.8.9.2 Unmanaged pointer types
- I.8.9.3 Delegates
- I.8.9.4 Interface type definition
- I.8.9.5 Class type definition
- I.8.9.6 Object type definitions
- I.8.9.7 Value type definition
- I.8.9.8 Type inheritance
- I.8.9.9 Object type inheritance
- I.8.9.10 Value type inheritance
- I.8.9.11 Interface type derivation
- I.8.10 Member inheritance
- I.8.11 Member definitions
- I.9.1 Components and assemblies
- I.9.2 Accessing metadata
- I.9.3 Unmanaged code
- I.9.4 Method implementation metadata
- I.9.5 Class layout
- I.9.6 Assemblies: name scopes for types
- I.9.7 Metadata extensibility
- I.9.8 Globals, imports, and exports
- I.9.9 Scoped statics
I.10 Name and type rules for the Common Language Specification
- I.10.1 Identifiers
- I.10.2 Overloading
- I.10.3 Operator overloading
- I.10.5 Exceptions
- I.10.6 Custom attributes
- I.10.7 Generic types and methods
I.11 Collected Common Language Specification rules
- I.12.1 Supported data types
- I.12.2 Module information
- I.12.3 Machine state
- I.12.4 Control flow
- I.12.5 Proxies and remoting
- I.12.6 Memory model and optimizations
II.3 Validation and verification
- II.5.1 General syntax notation
- II.5.2 Basic syntax categories
- II.5.3 Identifiers
- II.5.4 Labels and lists of labels
- II.5.5 Lists of hex bytes
- II.5.6 Floating-point numbers
- II.5.7 Source line information
- II.5.8 File names
- II.5.9 Attributes and metadata
- II.5.10 ilasm source files
II.6 Assemblies, manifests and modules
- II.6.1 Overview of modules, assemblies, and files
- II.6.2 Defining an assembly
- II.6.3 Referencing assemblies
- II.6.4 Declaring modules
- II.6.5 Referencing modules
- II.6.6 Declarations inside a module or assembly
- II.6.7 Exported type definitions
- II.6.8 Type forwarders
- II.7.1 Types
- II.7.2 Built-in types
- II.7.3 References to user-defined types (TypeReference)
- II.7.4 Native data types
II.8 Visibility, accessibility and hiding
- II.8.1 Visibility of top-level types and accessibility of nested types
- II.8.2 Accessibility
- II.8.3 Hiding
- II.9.1 Generic type definitions
- II.9.2 Generics and recursive inheritance graphs
- II.9.3 Generic method definitions
- II.9.4 Instantiating generic types
- II.9.5 Generics variance
- II.9.6 Assignment compatibility of instantiated types
- II.9.7 Validity of member signatures
- II.9.8 Signatures and binding
- II.9.9 Inheritance and overriding
- II.9.10 Explicit method overrides
- II.9.11 Constraints on generic parameters
- II.9.12 References to members of generic types
- II.10.1 Type header (ClassHeader)
- II.10.2 Body of a type definition
- II.10.3 Introducing and overriding virtual methods
- II.10.4 Method implementation requirements
- II.10.5 Special members
- II.10.6 Nested types
- II.10.7 Controlling instance layout
- II.10.8 Global fields and methods
II.13 Semantics of value types
II.14 Semantics of special types
- II.14.1 Vectors
- II.14.2 Arrays
- II.14.3 Enums
- II.14.4 Pointer types
- II.14.5 Method pointers
- II.14.6 Delegates
II.15 Defining, referencing, and calling methods
- II.15.1 Method descriptors
- II.15.2 Static, instance, and virtual methods
- II.15.3 Calling convention
- II.15.4 Defining methods
- II.15.5 Unmanaged methods
II.16 Defining and referencing fields
- II.16.1 Attributes of fields
- II.16.2 Field init metadata
- II.16.3 Embedding data in a PE file
- II.16.4 Initialization of non-literal static data
- II.16.5 Data known at load time
- II.19.1 Protected blocks
- II.19.2 Handler blocks
- II.19.3 Catch blocks
- II.19.4 Filter blocks
- II.19.5 Finally blocks
- II.19.6 Fault handlers
II.22 Metadata logical format: tables
- II.22.1 Metadata validation rules
- II.22.2 Assembly: 0x20
- II.22.3 AssemblyOS: 0x22
- II.22.4 AssemblyProcessor: 0x21
- II.22.5 AssemblyRef: 0x23
- II.22.6 AssemblyRefOS: 0x25
- II.22.7 AssemblyRefProcessor: 0x24
- II.22.8 ClassLayout: 0x0F
- II.22.9 Constant: 0x0B
- II.22.10 CustomAttribute: 0x0C
- II.22.11 DeclSecurity: 0x0E
- II.22.12 EventMap: 0x12
- II.22.13 Event: 0x14
- II.22.14 ExportedType: 0x27
- II.22.15 Field: 0x04
- II.22.16 FieldLayout: 0x10
- II.22.17 FieldMarshal: 0x0D
- II.22.18 FieldRVA: 0x1D
- II.22.19 File: 0x26
- II.22.20 GenericParam: 0x2A
- II.22.21 GenericParamConstraint: 0x2C
- II.22.22 ImplMap: 0x1C
- II.22.23 InterfaceImpl: 0x09
- II.22.24 ManifestResource: 0x28
- II.22.25 MemberRef: 0x0A
- II.22.26 MethodDef: 0x06
- II.22.27 MethodImpl: 0x19
- II.22.28 MethodSemantics: 0x18
- II.22.29 MethodSpec: 0x2B
- II.22.30 Module: 0x00
- II.22.31 ModuleRef: 0x1A
- II.22.32 NestedClass: 0x29
- II.22.33 Param: 0x08
- II.22.34 Property: 0x17
- II.22.35 PropertyMap: 0x15
- II.22.36 StandAloneSig: 0x11
- II.22.37 TypeDef: 0x02
- II.22.38 TypeRef: 0x01
- II.22.39 TypeSpec: 0x1B
II.23 Metadata logical format: other structures
- II.23.1 Bitmasks and flags
- II.23.1.1 Values for AssemblyHashAlgorithm
- II.23.1.2 Values for AssemblyFlags
- II.23.1.3 Values for Culture
- II.23.1.4 Flags for events [EventAttributes]
- II.23.1.5 Flags for fields [FieldAttributes]
- II.23.1.6 Flags for files [FileAttributes]
- II.23.1.7 Flags for Generic Parameters [GenericParamAttributes]
- II.23.1.8 Flags for ImplMap [PInvokeAttributes]
- II.23.1.9 Flags for ManifestResource [ManifestResourceAttributes]
- II.23.1.10 Flags for methods [MethodAttributes]
- II.23.1.11 Flags for methods [MethodImplAttributes]
- II.23.1.12 Flags for MethodSemantics [MethodSemanticsAttributes]
- II.23.1.13 Flags for params [ParamAttributes]
- II.23.1.14 Flags for properties [PropertyAttributes]
- II.23.1.15 Flags for types [TypeAttributes]
- II.23.1.16 Element types used in signatures
- II.23.2 Blobs and signatures
- II.23.2.1 MethodDefSig
- II.23.2.2 MethodRefSig
- II.23.2.3 StandAloneMethodSig
- II.23.2.4 FieldSig
- II.23.2.5 PropertySig
- II.23.2.6 LocalVarSig
- II.23.2.7 CustomMod
- II.23.2.8 TypeDefOrRefOrSpecEncoded
- II.23.2.9 Constraint
- II.23.2.10 Param
- II.23.2.11 RetType
- II.23.2.12 Type
- II.23.2.13 ArrayShape
- II.23.2.14 TypeSpec
- II.23.2.15 MethodSpec
- II.23.2.16 Short form signatures
- II.23.3 Custom attributes
- II.23.4 Marshalling descriptors
II.24 Metadata physical layout
II.25 File format extensions to PE
- II.25.1 Structure of the runtime file format
- II.25.2 PE headers
- II.25.3 Section headers
- II.25.4 Common Intermediate Language physical layout
- III.1.1 Data types
- III.1.2 Instruction variant table
- III.1.3 Stack transition diagram
- III.1.4 English description
- III.1.5 Operand type table
- III.1.6 Implicit argument coercion
- III.1.7 Restrictions on CIL code sequences
- III.1.8 Verifiability and correctness
- III.1.9 Metadata tokens
- III.1.10 Exceptions thrown
III.2 Prefixes to instructions
- III.2.1 constrained. – (prefix) invoke a member on a value of a variable type
- III.2.2 no. – (prefix) possibly skip a fault check
- III.2.3 readonly. (prefix) – following instruction returns a controlled-mutability managed pointer
- III.2.4 tail. (prefix) – call terminates current method
- III.2.5 unaligned. (prefix) – pointer instruction might be unaligned
- III.2.6 volatile. (prefix) – pointer reference is volatile
- III.3.1 add – add numeric values
- III.3.2 add.ovf.<signed> – add integer values with overflow check
- III.3.3 and – bitwise AND
- III.3.4 arglist – get argument list
- III.3.5 beq.<length> – branch on equal
- III.3.6 bge.<length> – branch on greater than or equal to
- III.3.7 bge.un.<length> – branch on greater than or equal to, unsigned or unordered
- III.3.8 bgt.<length> – branch on greater than
- III.3.9 bgt.un.<length> – branch on greater than, unsigned or unordered
- III.3.10 ble.<length> – branch on less than or equal to
- III.3.11 ble.un.<length> – branch on less than or equal to, unsigned or unordered
- III.3.12 blt.<length> – branch on less than
- III.3.13 blt.un.<length> – branch on less than, unsigned or unordered
- III.3.14 bne.un.<length> – branch on not equal or unordered
- III.3.15 br.<length> – unconditional branch
- III.3.16 break – breakpoint instruction
- III.3.17 brfalse.<length> – branch on false, null, or zero
- III.3.18 brtrue.<length> – branch on non-false or non-null
- III.3.19 call – call a method
- III.3.20 calli – indirect method call
- III.3.21 ceq – compare equal
- III.3.22 cgt – compare greater than
- III.3.23 cgt.un – compare greater than, unsigned or unordered
- III.3.24 ckfinite – check for a finite real number
- III.3.25 clt – compare less than
- III.3.26 clt.un – compare less than, unsigned or unordered
- III.3.27 conv.<to type> – data conversion
- III.3.28 conv.ovf.<to type> – data conversion with overflow detection
- III.3.29 conv.ovf.<to type>.un – unsigned data conversion with overflow detection
- III.3.30 cpblk – copy data from memory to memory
- III.3.31 div – divide values
- III.3.32 div.un – divide integer values, unsigned
- III.3.33 dup – duplicate the top value of the stack
- III.3.34 endfilter – end exception handling filter clause
- III.3.35 endfinally – end the finally or fault clause of an exception block
- III.3.36 initblk – initialize a block of memory to a value
- III.3.37 jmp – jump to method
- III.3.38 ldarg.<length> – load argument onto the stack
- III.3.39 ldarga.<length> – load an argument address
- III.3.40 ldc.<type> – load numeric constant
- III.3.41 ldftn – load method pointer
- III.3.42 ldind.<type> – load value indirect onto the stack
- III.3.43 ldloc – load local variable onto the stack
- III.3.44 ldloca.<length> – load local variable address
- III.3.45 ldnull – load a null pointer
- III.3.46 leave.<length> – exit a protected region of code
- III.3.47 localloc – allocate space in the local dynamic memory pool
- III.3.48 mul – multiply values
- III.3.49 mul.ovf.<type> – multiply integer values with overflow check
- III.3.50 neg – negate
- III.3.51 nop – no operation
- III.3.52 not – bitwise complement
- III.3.53 or – bitwise OR
- III.3.54 pop – remove the top element of the stack
- III.3.55 rem – compute remainder
- III.3.56 rem.un – compute integer remainder, unsigned
- III.3.57 ret – return from method
- III.3.58 shl – shift integer left
- III.3.59 shr – shift integer right
- III.3.60 shr.un – shift integer right, unsigned
- III.3.61 starg.<length> – store a value in an argument slot
- III.3.62 stind.<type> – store value indirect from stack
- III.3.63 stloc – pop value from stack to local variable
- III.3.64 sub – subtract numeric values
- III.3.65 sub.ovf.<type> – subtract integer values, checking for overflow
- III.3.66 switch – table switch based on value
- III.3.67 xor – bitwise XOR
III.4 Object model instructions
- III.4.1 box – convert a boxable value to its boxed form
- III.4.2 callvirt – call a method associated, at runtime, with an object
- III.4.3 castclass – cast an object to a class
- III.4.4 cpobj – copy a value from one address to another
- III.4.5 initobj – initialize the value at an address
- III.4.6 isinst – test if an object is an instance of a class or interface
- III.4.7 ldelem – load element from array
- III.4.8 ldelem.<type> – load an element of an array
- III.4.9 ldelema – load address of an element of an array
- III.4.10 ldfld – load field of an object
- III.4.11 ldflda – load field address
- III.4.12 ldlen – load the length of an array
- III.4.13 ldobj – copy a value from an address to the stack
- III.4.14 ldsfld – load static field of a class
- III.4.15 ldsflda – load static field address
- III.4.16 ldstr – load a literal string
- III.4.17 ldtoken – load the runtime representation of a metadata token
- III.4.18 ldvirtftn – load a virtual method pointer
- III.4.19 mkrefany – push a typed reference on the stack
- III.4.20 newarr – create a zero-based, one-dimensional array
- III.4.21 newobj – create a new object
- III.4.22 refanytype – load the type out of a typed reference
- III.4.23 refanyval – load the address out of a typed reference
- III.4.24 rethrow – rethrow the current exception
- III.4.25 sizeof – load the size, in bytes, of a type
- III.4.26 stelem – store element to array
- III.4.27 stelem.<type> – store an element of an array
- III.4.28 stfld – store into a field of an object
- III.4.29 stobj – store a value at an address
- III.4.30 stsfld – store a static field of a class
- III.4.31 throw – throw an exception
- III.4.32 unbox – convert boxed value type to its raw form
- III.4.33 unbox.any – convert boxed type to value
IV.4 Kernel Profile feature requirements
- IV.5.1 General comments
- IV.5.2 Runtime infrastructure library
- IV.5.3 Base Class Library (BCL)
- IV.5.4 Network library
- IV.5.5 Reflection library
- IV.5.6 XML library
- IV.5.7 Extended numerics library
- IV.5.8 Extended array library
- IV.5.9 Vararg library
- IV.5.10 Parallel library
IV.6 Implementation-specific modifications to the system libraries
- VI.B.1 Mutually recursive program (with tail calls)
- VI.B.2 Using value types
- VI.B.3 Custom attributes
- VI.B.4 Generics code and metadata
VI.Annex C CIL assembler implementation
- VI.C.1 ILAsm keywords
- VI.C.2 CIL opcode descriptions
- VI.C.3 Complete grammar
- VI.C.4 Instruction syntax
- VI.C.4.1 Top-level instruction syntax
- VI.C.4.2 Instructions with no operand
- VI.C.4.3 Instructions that refer to parameters or local variables
- VI.C.4.4 Instructions that take a single 32-bit integer argument
- VI.C.4.5 Instructions that take a single 64-bit integer argument
- VI.C.4.6 Instructions that take a single floating-point argument
- VI.C.4.7 Branch instructions
- VI.C.4.8 Instructions that take a method as an argument
- VI.C.4.9 Instructions that take a field of a class as an argument
- VI.C.4.10 Instructions that take a type as an argument
- VI.C.4.11 Instructions that take a string as an argument
- VI.C.4.12 Instructions that take a signature as an argument
- VI.C.4.13 Instructions that take a metadata token as an argument
- VI.C.4.14 Switch instruction
VI.Annex D Class library design guidelines
VI.Annex E Portability considerations
- VI.E.1 Uncontrollable behavior
- VI.E.2 Language- and compiler-controllable behavior
- VI.E.3 Programmer-controllable behavior
- VI.F.1 Instruction reordering
- VI.F.2 Inlining
- VI.F.3 Finally handlers still guaranteed once a try block is entered
- VI.F.4 Interleaved calls
- VI.F.5 Examples
- VI.G.1 Considerations
- VI.G.2 ParallelFor
- VI.G.3 ParallelForEach
- VI.G.4 ParallelWhile
- VI.G.5 Debugging
Index