Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // =============== CLASS MEMBERS DECLARATION ===================
- .class private auto ansi beforefieldinit cs6await.Program
- extends [mscorlib]System.Object
- {
- .class auto ansi sealed nested private beforefieldinit '<CallerMethod>d__1'
- extends [mscorlib]System.Object
- implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .field public int32 '<>1__state'
- .field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
- .field private object '<>s__1'
- .field private int32 '<>s__2'
- .field private object '<>s__3'
- .field private int32 '<>s__4'
- .field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__1'
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 8 (0x8)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: nop
- IL_0007: ret
- } // end of method '<CallerMethod>d__1'::.ctor
- .method private hidebysig newslot virtual final
- instance void MoveNext() cil managed
- {
- .override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext
- // Code size 481 (0x1e1)
- .maxstack 3
- .locals init ([0] int32 V_0,
- [1] class [mscorlib]System.Exception V_1,
- [2] int32 V_2,
- [3] valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter V_3,
- [4] class cs6await.Program/'<CallerMethod>d__1' V_4,
- [5] object V_5,
- [6] valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter V_6,
- [7] class [mscorlib]System.Exception V_7)
- IL_0000: ldarg.0
- IL_0001: ldfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_0006: stloc.0
- .try
- {
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
- IL_000a: br.s IL_000c
- IL_000c: ldloc.0
- IL_000d: ldc.i4.1
- IL_000e: beq.s IL_0014
- IL_0010: br.s IL_0019
- IL_0012: br.s IL_0028
- IL_0014: br IL_0140
- IL_0019: nop
- IL_001a: ldarg.0
- IL_001b: ldnull
- IL_001c: stfld object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
- IL_0021: ldarg.0
- IL_0022: ldc.i4.0
- IL_0023: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__2'
- IL_0028: nop
- .try
- {
- IL_0029: ldloc.0
- IL_002a: brfalse.s IL_002e
- IL_002c: br.s IL_0030
- IL_002e: br.s IL_00a7
- IL_0030: ldarg.0
- IL_0031: ldc.i4.0
- IL_0032: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__4'
- .try
- {
- IL_0037: nop
- IL_0038: newobj instance void [mscorlib]System.Exception::.ctor()
- IL_003d: throw
- } // end .try
- catch [mscorlib]System.Exception
- {
- IL_003e: stloc.1
- IL_003f: ldarg.0
- IL_0040: ldloc.1
- IL_0041: stfld object cs6await.Program/'<CallerMethod>d__1'::'<>s__3'
- IL_0046: ldarg.0
- IL_0047: ldc.i4.1
- IL_0048: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__4'
- IL_004d: leave.s IL_004f
- } // end handler
- IL_004f: ldarg.0
- IL_0050: ldfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__4'
- IL_0055: stloc.2
- IL_0056: ldloc.2
- IL_0057: ldc.i4.1
- IL_0058: beq.s IL_005f
- IL_005a: br IL_00e1
- IL_005f: nop
- IL_0060: ldstr "Before catch await"
- IL_0065: call void [mscorlib]System.Console::WriteLine(string)
- IL_006a: nop
- IL_006b: call class [mscorlib]System.Threading.Tasks.Task cs6await.Program::TestAsync()
- IL_0070: callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
- IL_0075: stloc.3
- IL_0076: ldloca.s V_3
- IL_0078: call instance bool [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
- IL_007d: brtrue.s IL_00c3
- IL_007f: ldarg.0
- IL_0080: ldc.i4.0
- IL_0081: dup
- IL_0082: stloc.0
- IL_0083: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_0088: ldarg.0
- IL_0089: ldloc.3
- IL_008a: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
- IL_008f: ldarg.0
- IL_0090: stloc.s V_4
- IL_0092: ldarg.0
- IL_0093: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
- IL_0098: ldloca.s V_3
- IL_009a: ldloca.s V_4
- IL_009c: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,class cs6await.Program/'<CallerMethod>d__1'>(!!0&,
- !!1&)
- IL_00a1: nop
- IL_00a2: leave IL_01e0
- IL_00a7: ldarg.0
- IL_00a8: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
- IL_00ad: stloc.3
- IL_00ae: ldarg.0
- IL_00af: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
- IL_00b4: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
- IL_00ba: ldarg.0
- IL_00bb: ldc.i4.m1
- IL_00bc: dup
- IL_00bd: stloc.0
- IL_00be: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_00c3: ldloca.s V_3
- IL_00c5: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
- IL_00ca: nop
- IL_00cb: ldloca.s V_3
- IL_00cd: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
- IL_00d3: ldstr "After catch await"
- IL_00d8: call void [mscorlib]System.Console::WriteLine(string)
- IL_00dd: nop
- IL_00de: nop
- IL_00df: br.s IL_00e1
- IL_00e1: ldarg.0
- IL_00e2: ldnull
- IL_00e3: stfld object cs6await.Program/'<CallerMethod>d__1'::'<>s__3'
- IL_00e8: leave.s IL_00f6
- } // end .try
- catch [mscorlib]System.Object
- {
- IL_00ea: stloc.s V_5
- IL_00ec: ldarg.0
- IL_00ed: ldloc.s V_5
- IL_00ef: stfld object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
- IL_00f4: leave.s IL_00f6
- } // end handler
- IL_00f6: nop
- IL_00f7: ldstr "Before finally await"
- IL_00fc: call void [mscorlib]System.Console::WriteLine(string)
- IL_0101: nop
- IL_0102: call class [mscorlib]System.Threading.Tasks.Task cs6await.Program::TestAsync()
- IL_0107: callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
- IL_010c: stloc.s V_6
- IL_010e: ldloca.s V_6
- IL_0110: call instance bool [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
- IL_0115: brtrue.s IL_015d
- IL_0117: ldarg.0
- IL_0118: ldc.i4.1
- IL_0119: dup
- IL_011a: stloc.0
- IL_011b: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_0120: ldarg.0
- IL_0121: ldloc.s V_6
- IL_0123: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
- IL_0128: ldarg.0
- IL_0129: stloc.s V_4
- IL_012b: ldarg.0
- IL_012c: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
- IL_0131: ldloca.s V_6
- IL_0133: ldloca.s V_4
- IL_0135: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,class cs6await.Program/'<CallerMethod>d__1'>(!!0&,
- !!1&)
- IL_013a: nop
- IL_013b: leave IL_01e0
- IL_0140: ldarg.0
- IL_0141: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
- IL_0146: stloc.s V_6
- IL_0148: ldarg.0
- IL_0149: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
- IL_014e: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
- IL_0154: ldarg.0
- IL_0155: ldc.i4.m1
- IL_0156: dup
- IL_0157: stloc.0
- IL_0158: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_015d: ldloca.s V_6
- IL_015f: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
- IL_0164: nop
- IL_0165: ldloca.s V_6
- IL_0167: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
- IL_016d: ldstr "After finally await"
- IL_0172: call void [mscorlib]System.Console::WriteLine(string)
- IL_0177: nop
- IL_0178: nop
- IL_0179: ldarg.0
- IL_017a: ldfld object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
- IL_017f: stloc.s V_5
- IL_0181: ldloc.s V_5
- IL_0183: brfalse.s IL_01a2
- IL_0185: ldloc.s V_5
- IL_0187: isinst [mscorlib]System.Exception
- IL_018c: stloc.s V_7
- IL_018e: ldloc.s V_7
- IL_0190: brtrue.s IL_0195
- IL_0192: ldloc.s V_5
- IL_0194: throw
- IL_0195: ldloc.s V_7
- IL_0197: call class [mscorlib]System.Runtime.ExceptionServices.ExceptionDispatchInfo [mscorlib]System.Runtime.ExceptionServices.ExceptionDispatchInfo::Capture(class [mscorlib]System.Exception)
- IL_019c: callvirt instance void [mscorlib]System.Runtime.ExceptionServices.ExceptionDispatchInfo::Throw()
- IL_01a1: nop
- IL_01a2: ldarg.0
- IL_01a3: ldfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__2'
- IL_01a8: pop
- IL_01a9: ldarg.0
- IL_01aa: ldnull
- IL_01ab: stfld object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
- IL_01b0: leave.s IL_01cc
- } // end .try
- catch [mscorlib]System.Exception
- {
- IL_01b2: stloc.s V_7
- IL_01b4: ldarg.0
- IL_01b5: ldc.i4.s -2
- IL_01b7: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_01bc: ldarg.0
- IL_01bd: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
- IL_01c2: ldloc.s V_7
- IL_01c4: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
- IL_01c9: nop
- IL_01ca: leave.s IL_01e0
- } // end handler
- IL_01cc: ldarg.0
- IL_01cd: ldc.i4.s -2
- IL_01cf: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_01d4: ldarg.0
- IL_01d5: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
- IL_01da: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
- IL_01df: nop
- IL_01e0: ret
- } // end of method '<CallerMethod>d__1'::MoveNext
- .method private hidebysig newslot virtual final
- instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) cil managed
- {
- .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 )
- .override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::SetStateMachine
- // Code size 1 (0x1)
- .maxstack 8
- IL_0000: ret
- } // end of method '<CallerMethod>d__1'::SetStateMachine
- } // end of class '<CallerMethod>d__1'
- .class auto ansi serializable sealed nested private beforefieldinit '<>c'
- extends [mscorlib]System.Object
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .field public static initonly class cs6await.Program/'<>c' '<>9'
- .field public static class [mscorlib]System.Action '<>9__2_0'
- .method private hidebysig specialname rtspecialname static
- void .cctor() cil managed
- {
- // Code size 11 (0xb)
- .maxstack 8
- IL_0000: newobj instance void cs6await.Program/'<>c'::.ctor()
- IL_0005: stsfld class cs6await.Program/'<>c' cs6await.Program/'<>c'::'<>9'
- IL_000a: ret
- } // end of method '<>c'::.cctor
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 8 (0x8)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: nop
- IL_0007: ret
- } // end of method '<>c'::.ctor
- .method assembly hidebysig instance void
- '<TestAsync>b__2_0'() cil managed
- {
- // Code size 37 (0x25)
- .maxstack 8
- IL_0000: nop
- IL_0001: ldstr "Async method before sleep"
- IL_0006: call void [mscorlib]System.Console::WriteLine(string)
- IL_000b: nop
- IL_000c: ldc.i4 0x3e8
- IL_0011: call void [mscorlib]System.Threading.Thread::Sleep(int32)
- IL_0016: nop
- IL_0017: ldstr "Async method after sleep"
- IL_001c: call void [mscorlib]System.Console::WriteLine(string)
- IL_0021: nop
- IL_0022: br.s IL_0024
- IL_0024: ret
- } // end of method '<>c'::'<TestAsync>b__2_0'
- } // end of class '<>c'
- .method private hidebysig static void Main(string[] args) cil managed
- {
- .entrypoint
- // Code size 56 (0x38)
- .maxstack 2
- .locals init ([0] bool V_0,
- [1] valuetype [mscorlib]System.ConsoleKeyInfo V_1)
- IL_0000: nop
- IL_0001: nop
- IL_0002: ldstr "Before caller"
- IL_0007: call void [mscorlib]System.Console::WriteLine(string)
- IL_000c: nop
- IL_000d: call void cs6await.Program::CallerMethod()
- IL_0012: nop
- IL_0013: ldstr "After caller"
- IL_0018: call void [mscorlib]System.Console::WriteLine(string)
- IL_001d: nop
- IL_001e: nop
- IL_001f: call valuetype [mscorlib]System.ConsoleKeyInfo [mscorlib]System.Console::ReadKey()
- IL_0024: stloc.1
- IL_0025: ldloca.s V_1
- IL_0027: call instance valuetype [mscorlib]System.ConsoleKey [mscorlib]System.ConsoleKeyInfo::get_Key()
- IL_002c: ldc.i4.s 81
- IL_002e: ceq
- IL_0030: ldc.i4.0
- IL_0031: ceq
- IL_0033: stloc.0
- IL_0034: ldloc.0
- IL_0035: brtrue.s IL_0001
- IL_0037: ret
- } // end of method Program::Main
- .method public hidebysig static void CallerMethod() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 23 63 73 36 61 77 61 69 74 2E 50 72 6F 67 // ..#cs6await.Prog
- 72 61 6D 2B 3C 43 61 6C 6C 65 72 4D 65 74 68 6F // ram+<CallerMetho
- 64 3E 64 5F 5F 31 00 00 ) // d>d__1..
- // Code size 41 (0x29)
- .maxstack 2
- .locals init ([0] class cs6await.Program/'<CallerMethod>d__1' V_0,
- [1] valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
- IL_0000: newobj instance void cs6await.Program/'<CallerMethod>d__1'::.ctor()
- IL_0005: stloc.0
- IL_0006: ldloc.0
- IL_0007: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
- IL_000c: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
- IL_0011: ldloc.0
- IL_0012: ldc.i4.m1
- IL_0013: stfld int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
- IL_0018: ldloc.0
- IL_0019: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
- IL_001e: stloc.1
- IL_001f: ldloca.s V_1
- IL_0021: ldloca.s V_0
- IL_0023: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<class cs6await.Program/'<CallerMethod>d__1'>(!!0&)
- IL_0028: ret
- } // end of method Program::CallerMethod
- .method public hidebysig static class [mscorlib]System.Threading.Tasks.Task
- TestAsync() cil managed
- {
- // Code size 47 (0x2f)
- .maxstack 3
- .locals init ([0] class [mscorlib]System.Threading.Tasks.Task V_0)
- IL_0000: nop
- IL_0001: call class [mscorlib]System.Threading.Tasks.TaskFactory [mscorlib]System.Threading.Tasks.Task::get_Factory()
- IL_0006: ldsfld class [mscorlib]System.Action cs6await.Program/'<>c'::'<>9__2_0'
- IL_000b: dup
- IL_000c: brtrue.s IL_0025
- IL_000e: pop
- IL_000f: ldsfld class cs6await.Program/'<>c' cs6await.Program/'<>c'::'<>9'
- IL_0014: ldftn instance void cs6await.Program/'<>c'::'<TestAsync>b__2_0'()
- IL_001a: newobj instance void [mscorlib]System.Action::.ctor(object,
- native int)
- IL_001f: dup
- IL_0020: stsfld class [mscorlib]System.Action cs6await.Program/'<>c'::'<>9__2_0'
- IL_0025: callvirt instance class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Threading.Tasks.TaskFactory::StartNew(class [mscorlib]System.Action)
- IL_002a: stloc.0
- IL_002b: br.s IL_002d
- IL_002d: ldloc.0
- IL_002e: ret
- } // end of method Program::TestAsync
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 8 (0x8)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: nop
- IL_0007: ret
- } // end of method Program::.ctor
- } // end of class cs6await.Program
- // =============================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement