Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.5
-
Fix Version/s: None
-
Component/s: Emitter
-
Labels:None
-
Number of attachments :
Description
Notice that the equivalent C# code does not use any boxing at all and does not need to create an array to access a position in the array:
//000009: int[,] a = new int[2, 3];
IL_0000: ldc.i4.2
IL_0001: ldc.i4.3
IL_0002: newobj instance void int32[0...,0...]::.ctor(int32,
int32)
IL_0007: stloc.0
//000010: Console.WriteLine(a[0,0].ToString());
IL_0008: ldloc.0
IL_0009: ldc.i4.0
IL_000a: ldc.i4.0
IL_000b: call instance int32& int32[0...,0...]::Address(int32,
int32)
IL_0010: call instance string [mscorlib]System.Int32::ToString()
IL_0015: call void [mscorlib]System.Console::WriteLine(string)