Skip to content

Instantly share code, notes, and snippets.

@sunnyone
Last active August 29, 2015 14:01
Show Gist options
  • Save sunnyone/0d3ed8285b5d91495399 to your computer and use it in GitHub Desktop.
Save sunnyone/0d3ed8285b5d91495399 to your computer and use it in GitHub Desktop.
ConsoleApplicationLinq.il
(メタデータ定義は省略)
// =============== CLASS MEMBERS DECLARATION ===================
.class private auto ansi beforefieldinit ConsoleApplicationLinq.Program
extends [mscorlib]System.Object
{
.class auto ansi sealed nested private beforefieldinit '<>c__DisplayClass1'
extends [mscorlib]System.Object
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field public int32 val
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// コード サイズ 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method '<>c__DisplayClass1'::.ctor
.method public hidebysig instance bool
'<Main>b__0'(int32 x) cil managed
{
// コード サイズ 10 (0xa)
.maxstack 8
IL_0000: ldarg.1
IL_0001: ldarg.0
IL_0002: ldfld int32 ConsoleApplicationLinq.Program/'<>c__DisplayClass1'::val
IL_0007: ceq
IL_0009: ret
} // end of method '<>c__DisplayClass1'::'<Main>b__0'
} // end of class '<>c__DisplayClass1'
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// コード サイズ 70 (0x46)
.maxstack 3
.locals init ([0] string format,
[1] int32[] 'array',
[2] int32 count,
[3] class ConsoleApplicationLinq.Program/'<>c__DisplayClass1' 'CS$<>8__locals2')
IL_0000: newobj instance void ConsoleApplicationLinq.Program/'<>c__DisplayClass1'::.ctor()
IL_0005: stloc.3
IL_0006: ldloc.3
IL_0007: ldc.i4.s 100
IL_0009: stfld int32 ConsoleApplicationLinq.Program/'<>c__DisplayClass1'::val
IL_000e: ldstr "Count of {0}: {1}"
IL_0013: stloc.0
IL_0014: ldc.i4.0
IL_0015: newarr [mscorlib]System.Int32
IL_001a: stloc.1
IL_001b: ldloc.1
IL_001c: ldloc.3
IL_001d: ldftn instance bool ConsoleApplicationLinq.Program/'<>c__DisplayClass1'::'<Main>b__0'(int32)
IL_0023: newobj instance void class [mscorlib]System.Func`2<int32,bool>::.ctor(object,
native int)
IL_0028: call int32 [System.Core]System.Linq.Enumerable::Count<int32>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0>,
class [mscorlib]System.Func`2<!!0,bool>)
IL_002d: stloc.2
IL_002e: ldloc.0
IL_002f: ldloc.3
IL_0030: ldfld int32 ConsoleApplicationLinq.Program/'<>c__DisplayClass1'::val
IL_0035: box [mscorlib]System.Int32
IL_003a: ldloc.2
IL_003b: box [mscorlib]System.Int32
IL_0040: call void [mscorlib]System.Console::WriteLine(string,
object,
object)
IL_0045: ret
} // end of method Program::Main
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// コード サイズ 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method Program::.ctor
} // end of class ConsoleApplicationLinq.Program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment