Advertisement
Guest User

C# 6.0 await in catch and finally

a guest
Jun 9th, 2015
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // =============== CLASS MEMBERS DECLARATION ===================
  2.  
  3. .class private auto ansi beforefieldinit cs6await.Program
  4.        extends [mscorlib]System.Object
  5. {
  6.   .class auto ansi sealed nested private beforefieldinit '<CallerMethod>d__1'
  7.          extends [mscorlib]System.Object
  8.          implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
  9.   {
  10.     .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
  11.     .field public int32 '<>1__state'
  12.     .field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
  13.     .field private object '<>s__1'
  14.     .field private int32 '<>s__2'
  15.     .field private object '<>s__3'
  16.     .field private int32 '<>s__4'
  17.     .field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__1'
  18.     .method public hidebysig specialname rtspecialname
  19.             instance void  .ctor() cil managed
  20.     {
  21.       // Code size       8 (0x8)
  22.       .maxstack  8
  23.       IL_0000:  ldarg.0
  24.       IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
  25.       IL_0006:  nop
  26.       IL_0007:  ret
  27.     } // end of method '<CallerMethod>d__1'::.ctor
  28.  
  29.     .method private hidebysig newslot virtual final
  30.             instance void  MoveNext() cil managed
  31.     {
  32.       .override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext
  33.       // Code size       481 (0x1e1)
  34.       .maxstack  3
  35.       .locals init ([0] int32 V_0,
  36.                [1] class [mscorlib]System.Exception V_1,
  37.                [2] int32 V_2,
  38.                [3] valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter V_3,
  39.                [4] class cs6await.Program/'<CallerMethod>d__1' V_4,
  40.                [5] object V_5,
  41.                [6] valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter V_6,
  42.                [7] class [mscorlib]System.Exception V_7)
  43.       IL_0000:  ldarg.0
  44.       IL_0001:  ldfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  45.       IL_0006:  stloc.0
  46.       .try
  47.       {
  48.         IL_0007:  ldloc.0
  49.         IL_0008:  brfalse.s  IL_0012
  50.  
  51.         IL_000a:  br.s       IL_000c
  52.  
  53.         IL_000c:  ldloc.0
  54.         IL_000d:  ldc.i4.1
  55.         IL_000e:  beq.s      IL_0014
  56.  
  57.         IL_0010:  br.s       IL_0019
  58.  
  59.         IL_0012:  br.s       IL_0028
  60.  
  61.         IL_0014:  br         IL_0140
  62.  
  63.         IL_0019:  nop
  64.         IL_001a:  ldarg.0
  65.         IL_001b:  ldnull
  66.         IL_001c:  stfld      object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
  67.         IL_0021:  ldarg.0
  68.         IL_0022:  ldc.i4.0
  69.         IL_0023:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__2'
  70.         IL_0028:  nop
  71.         .try
  72.         {
  73.           IL_0029:  ldloc.0
  74.           IL_002a:  brfalse.s  IL_002e
  75.  
  76.           IL_002c:  br.s       IL_0030
  77.  
  78.           IL_002e:  br.s       IL_00a7
  79.  
  80.           IL_0030:  ldarg.0
  81.           IL_0031:  ldc.i4.0
  82.           IL_0032:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__4'
  83.           .try
  84.           {
  85.             IL_0037:  nop
  86.             IL_0038:  newobj     instance void [mscorlib]System.Exception::.ctor()
  87.             IL_003d:  throw
  88.  
  89.           }  // end .try
  90.           catch [mscorlib]System.Exception
  91.           {
  92.             IL_003e:  stloc.1
  93.             IL_003f:  ldarg.0
  94.             IL_0040:  ldloc.1
  95.             IL_0041:  stfld      object cs6await.Program/'<CallerMethod>d__1'::'<>s__3'
  96.             IL_0046:  ldarg.0
  97.             IL_0047:  ldc.i4.1
  98.             IL_0048:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__4'
  99.             IL_004d:  leave.s    IL_004f
  100.  
  101.           }  // end handler
  102.           IL_004f:  ldarg.0
  103.           IL_0050:  ldfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__4'
  104.           IL_0055:  stloc.2
  105.           IL_0056:  ldloc.2
  106.           IL_0057:  ldc.i4.1
  107.           IL_0058:  beq.s      IL_005f
  108.  
  109.           IL_005a:  br         IL_00e1
  110.  
  111.           IL_005f:  nop
  112.           IL_0060:  ldstr      "Before catch await"
  113.           IL_0065:  call       void [mscorlib]System.Console::WriteLine(string)
  114.           IL_006a:  nop
  115.           IL_006b:  call       class [mscorlib]System.Threading.Tasks.Task cs6await.Program::TestAsync()
  116.           IL_0070:  callvirt   instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
  117.           IL_0075:  stloc.3
  118.           IL_0076:  ldloca.s   V_3
  119.           IL_0078:  call       instance bool [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
  120.           IL_007d:  brtrue.s   IL_00c3
  121.  
  122.           IL_007f:  ldarg.0
  123.           IL_0080:  ldc.i4.0
  124.           IL_0081:  dup
  125.           IL_0082:  stloc.0
  126.           IL_0083:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  127.           IL_0088:  ldarg.0
  128.           IL_0089:  ldloc.3
  129.           IL_008a:  stfld      valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
  130.           IL_008f:  ldarg.0
  131.           IL_0090:  stloc.s    V_4
  132.           IL_0092:  ldarg.0
  133.           IL_0093:  ldflda     valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
  134.           IL_0098:  ldloca.s   V_3
  135.           IL_009a:  ldloca.s   V_4
  136.           IL_009c:  call       instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,class cs6await.Program/'<CallerMethod>d__1'>(!!0&,
  137.                                                                                                                                                                                                                                                    !!1&)
  138.           IL_00a1:  nop
  139.           IL_00a2:  leave      IL_01e0
  140.  
  141.           IL_00a7:  ldarg.0
  142.           IL_00a8:  ldfld      valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
  143.           IL_00ad:  stloc.3
  144.           IL_00ae:  ldarg.0
  145.           IL_00af:  ldflda     valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
  146.           IL_00b4:  initobj    [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
  147.           IL_00ba:  ldarg.0
  148.           IL_00bb:  ldc.i4.m1
  149.           IL_00bc:  dup
  150.           IL_00bd:  stloc.0
  151.           IL_00be:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  152.           IL_00c3:  ldloca.s   V_3
  153.           IL_00c5:  call       instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
  154.           IL_00ca:  nop
  155.           IL_00cb:  ldloca.s   V_3
  156.           IL_00cd:  initobj    [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
  157.           IL_00d3:  ldstr      "After catch await"
  158.           IL_00d8:  call       void [mscorlib]System.Console::WriteLine(string)
  159.           IL_00dd:  nop
  160.           IL_00de:  nop
  161.           IL_00df:  br.s       IL_00e1
  162.  
  163.           IL_00e1:  ldarg.0
  164.           IL_00e2:  ldnull
  165.           IL_00e3:  stfld      object cs6await.Program/'<CallerMethod>d__1'::'<>s__3'
  166.           IL_00e8:  leave.s    IL_00f6
  167.  
  168.         }  // end .try
  169.         catch [mscorlib]System.Object
  170.         {
  171.           IL_00ea:  stloc.s    V_5
  172.           IL_00ec:  ldarg.0
  173.           IL_00ed:  ldloc.s    V_5
  174.           IL_00ef:  stfld      object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
  175.           IL_00f4:  leave.s    IL_00f6
  176.  
  177.         }  // end handler
  178.         IL_00f6:  nop
  179.         IL_00f7:  ldstr      "Before finally await"
  180.         IL_00fc:  call       void [mscorlib]System.Console::WriteLine(string)
  181.         IL_0101:  nop
  182.         IL_0102:  call       class [mscorlib]System.Threading.Tasks.Task cs6await.Program::TestAsync()
  183.         IL_0107:  callvirt   instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter [mscorlib]System.Threading.Tasks.Task::GetAwaiter()
  184.         IL_010c:  stloc.s    V_6
  185.         IL_010e:  ldloca.s   V_6
  186.         IL_0110:  call       instance bool [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::get_IsCompleted()
  187.         IL_0115:  brtrue.s   IL_015d
  188.  
  189.         IL_0117:  ldarg.0
  190.         IL_0118:  ldc.i4.1
  191.         IL_0119:  dup
  192.         IL_011a:  stloc.0
  193.         IL_011b:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  194.         IL_0120:  ldarg.0
  195.         IL_0121:  ldloc.s    V_6
  196.         IL_0123:  stfld      valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
  197.         IL_0128:  ldarg.0
  198.         IL_0129:  stloc.s    V_4
  199.         IL_012b:  ldarg.0
  200.         IL_012c:  ldflda     valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
  201.         IL_0131:  ldloca.s   V_6
  202.         IL_0133:  ldloca.s   V_4
  203.         IL_0135:  call       instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,class cs6await.Program/'<CallerMethod>d__1'>(!!0&,
  204.                                                                                                                                                                                                                                                  !!1&)
  205.         IL_013a:  nop
  206.         IL_013b:  leave      IL_01e0
  207.  
  208.         IL_0140:  ldarg.0
  209.         IL_0141:  ldfld      valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
  210.         IL_0146:  stloc.s    V_6
  211.         IL_0148:  ldarg.0
  212.         IL_0149:  ldflda     valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter cs6await.Program/'<CallerMethod>d__1'::'<>u__1'
  213.         IL_014e:  initobj    [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
  214.         IL_0154:  ldarg.0
  215.         IL_0155:  ldc.i4.m1
  216.         IL_0156:  dup
  217.         IL_0157:  stloc.0
  218.         IL_0158:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  219.         IL_015d:  ldloca.s   V_6
  220.         IL_015f:  call       instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
  221.         IL_0164:  nop
  222.         IL_0165:  ldloca.s   V_6
  223.         IL_0167:  initobj    [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
  224.         IL_016d:  ldstr      "After finally await"
  225.         IL_0172:  call       void [mscorlib]System.Console::WriteLine(string)
  226.         IL_0177:  nop
  227.         IL_0178:  nop
  228.         IL_0179:  ldarg.0
  229.         IL_017a:  ldfld      object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
  230.         IL_017f:  stloc.s    V_5
  231.         IL_0181:  ldloc.s    V_5
  232.         IL_0183:  brfalse.s  IL_01a2
  233.  
  234.         IL_0185:  ldloc.s    V_5
  235.         IL_0187:  isinst     [mscorlib]System.Exception
  236.         IL_018c:  stloc.s    V_7
  237.         IL_018e:  ldloc.s    V_7
  238.         IL_0190:  brtrue.s   IL_0195
  239.  
  240.         IL_0192:  ldloc.s    V_5
  241.         IL_0194:  throw
  242.  
  243.         IL_0195:  ldloc.s    V_7
  244.         IL_0197:  call       class [mscorlib]System.Runtime.ExceptionServices.ExceptionDispatchInfo [mscorlib]System.Runtime.ExceptionServices.ExceptionDispatchInfo::Capture(class [mscorlib]System.Exception)
  245.         IL_019c:  callvirt   instance void [mscorlib]System.Runtime.ExceptionServices.ExceptionDispatchInfo::Throw()
  246.         IL_01a1:  nop
  247.         IL_01a2:  ldarg.0
  248.         IL_01a3:  ldfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>s__2'
  249.         IL_01a8:  pop
  250.         IL_01a9:  ldarg.0
  251.         IL_01aa:  ldnull
  252.         IL_01ab:  stfld      object cs6await.Program/'<CallerMethod>d__1'::'<>s__1'
  253.         IL_01b0:  leave.s    IL_01cc
  254.  
  255.       }  // end .try
  256.       catch [mscorlib]System.Exception
  257.       {
  258.         IL_01b2:  stloc.s    V_7
  259.         IL_01b4:  ldarg.0
  260.         IL_01b5:  ldc.i4.s   -2
  261.         IL_01b7:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  262.         IL_01bc:  ldarg.0
  263.         IL_01bd:  ldflda     valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
  264.         IL_01c2:  ldloc.s    V_7
  265.         IL_01c4:  call       instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
  266.         IL_01c9:  nop
  267.         IL_01ca:  leave.s    IL_01e0
  268.  
  269.       }  // end handler
  270.       IL_01cc:  ldarg.0
  271.       IL_01cd:  ldc.i4.s   -2
  272.       IL_01cf:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  273.       IL_01d4:  ldarg.0
  274.       IL_01d5:  ldflda     valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
  275.       IL_01da:  call       instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
  276.       IL_01df:  nop
  277.       IL_01e0:  ret
  278.     } // end of method '<CallerMethod>d__1'::MoveNext
  279.  
  280.     .method private hidebysig newslot virtual final
  281.             instance void  SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) cil managed
  282.     {
  283.       .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 )
  284.       .override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::SetStateMachine
  285.       // Code size       1 (0x1)
  286.       .maxstack  8
  287.       IL_0000:  ret
  288.     } // end of method '<CallerMethod>d__1'::SetStateMachine
  289.  
  290.   } // end of class '<CallerMethod>d__1'
  291.  
  292.   .class auto ansi serializable sealed nested private beforefieldinit '<>c'
  293.          extends [mscorlib]System.Object
  294.   {
  295.     .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
  296.     .field public static initonly class cs6await.Program/'<>c' '<>9'
  297.     .field public static class [mscorlib]System.Action '<>9__2_0'
  298.     .method private hidebysig specialname rtspecialname static
  299.             void  .cctor() cil managed
  300.     {
  301.       // Code size       11 (0xb)
  302.       .maxstack  8
  303.       IL_0000:  newobj     instance void cs6await.Program/'<>c'::.ctor()
  304.       IL_0005:  stsfld     class cs6await.Program/'<>c' cs6await.Program/'<>c'::'<>9'
  305.       IL_000a:  ret
  306.     } // end of method '<>c'::.cctor
  307.  
  308.     .method public hidebysig specialname rtspecialname
  309.             instance void  .ctor() cil managed
  310.     {
  311.       // Code size       8 (0x8)
  312.       .maxstack  8
  313.       IL_0000:  ldarg.0
  314.       IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
  315.       IL_0006:  nop
  316.       IL_0007:  ret
  317.     } // end of method '<>c'::.ctor
  318.  
  319.     .method assembly hidebysig instance void
  320.             '<TestAsync>b__2_0'() cil managed
  321.     {
  322.       // Code size       37 (0x25)
  323.       .maxstack  8
  324.       IL_0000:  nop
  325.       IL_0001:  ldstr      "Async method before sleep"
  326.       IL_0006:  call       void [mscorlib]System.Console::WriteLine(string)
  327.       IL_000b:  nop
  328.       IL_000c:  ldc.i4     0x3e8
  329.       IL_0011:  call       void [mscorlib]System.Threading.Thread::Sleep(int32)
  330.       IL_0016:  nop
  331.       IL_0017:  ldstr      "Async method after sleep"
  332.       IL_001c:  call       void [mscorlib]System.Console::WriteLine(string)
  333.       IL_0021:  nop
  334.       IL_0022:  br.s       IL_0024
  335.  
  336.       IL_0024:  ret
  337.     } // end of method '<>c'::'<TestAsync>b__2_0'
  338.  
  339.   } // end of class '<>c'
  340.  
  341.   .method private hidebysig static void  Main(string[] args) cil managed
  342.   {
  343.     .entrypoint
  344.     // Code size       56 (0x38)
  345.     .maxstack  2
  346.     .locals init ([0] bool V_0,
  347.              [1] valuetype [mscorlib]System.ConsoleKeyInfo V_1)
  348.     IL_0000:  nop
  349.     IL_0001:  nop
  350.     IL_0002:  ldstr      "Before caller"
  351.     IL_0007:  call       void [mscorlib]System.Console::WriteLine(string)
  352.     IL_000c:  nop
  353.     IL_000d:  call       void cs6await.Program::CallerMethod()
  354.     IL_0012:  nop
  355.     IL_0013:  ldstr      "After caller"
  356.     IL_0018:  call       void [mscorlib]System.Console::WriteLine(string)
  357.     IL_001d:  nop
  358.     IL_001e:  nop
  359.     IL_001f:  call       valuetype [mscorlib]System.ConsoleKeyInfo [mscorlib]System.Console::ReadKey()
  360.     IL_0024:  stloc.1
  361.     IL_0025:  ldloca.s   V_1
  362.     IL_0027:  call       instance valuetype [mscorlib]System.ConsoleKey [mscorlib]System.ConsoleKeyInfo::get_Key()
  363.     IL_002c:  ldc.i4.s   81
  364.     IL_002e:  ceq
  365.     IL_0030:  ldc.i4.0
  366.     IL_0031:  ceq
  367.     IL_0033:  stloc.0
  368.     IL_0034:  ldloc.0
  369.     IL_0035:  brtrue.s   IL_0001
  370.  
  371.     IL_0037:  ret
  372.   } // end of method Program::Main
  373.  
  374.   .method public hidebysig static void  CallerMethod() cil managed
  375.   {
  376.     .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
  377.                                                                                                                                        72 61 6D 2B 3C 43 61 6C 6C 65 72 4D 65 74 68 6F   // ram+<CallerMetho
  378.                                                                                                                                        64 3E 64 5F 5F 31 00 00 )                         // d>d__1..
  379.     // Code size       41 (0x29)
  380.     .maxstack  2
  381.     .locals init ([0] class cs6await.Program/'<CallerMethod>d__1' V_0,
  382.              [1] valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
  383.     IL_0000:  newobj     instance void cs6await.Program/'<CallerMethod>d__1'::.ctor()
  384.     IL_0005:  stloc.0
  385.     IL_0006:  ldloc.0
  386.     IL_0007:  call       valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
  387.     IL_000c:  stfld      valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
  388.     IL_0011:  ldloc.0
  389.     IL_0012:  ldc.i4.m1
  390.     IL_0013:  stfld      int32 cs6await.Program/'<CallerMethod>d__1'::'<>1__state'
  391.     IL_0018:  ldloc.0
  392.     IL_0019:  ldfld      valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder cs6await.Program/'<CallerMethod>d__1'::'<>t__builder'
  393.     IL_001e:  stloc.1
  394.     IL_001f:  ldloca.s   V_1
  395.     IL_0021:  ldloca.s   V_0
  396.     IL_0023:  call       instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<class cs6await.Program/'<CallerMethod>d__1'>(!!0&)
  397.     IL_0028:  ret
  398.   } // end of method Program::CallerMethod
  399.  
  400.   .method public hidebysig static class [mscorlib]System.Threading.Tasks.Task
  401.           TestAsync() cil managed
  402.   {
  403.     // Code size       47 (0x2f)
  404.     .maxstack  3
  405.     .locals init ([0] class [mscorlib]System.Threading.Tasks.Task V_0)
  406.     IL_0000:  nop
  407.     IL_0001:  call       class [mscorlib]System.Threading.Tasks.TaskFactory [mscorlib]System.Threading.Tasks.Task::get_Factory()
  408.     IL_0006:  ldsfld     class [mscorlib]System.Action cs6await.Program/'<>c'::'<>9__2_0'
  409.     IL_000b:  dup
  410.     IL_000c:  brtrue.s   IL_0025
  411.  
  412.     IL_000e:  pop
  413.     IL_000f:  ldsfld     class cs6await.Program/'<>c' cs6await.Program/'<>c'::'<>9'
  414.     IL_0014:  ldftn      instance void cs6await.Program/'<>c'::'<TestAsync>b__2_0'()
  415.     IL_001a:  newobj     instance void [mscorlib]System.Action::.ctor(object,
  416.                                                                       native int)
  417.     IL_001f:  dup
  418.     IL_0020:  stsfld     class [mscorlib]System.Action cs6await.Program/'<>c'::'<>9__2_0'
  419.     IL_0025:  callvirt   instance class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Threading.Tasks.TaskFactory::StartNew(class [mscorlib]System.Action)
  420.     IL_002a:  stloc.0
  421.     IL_002b:  br.s       IL_002d
  422.  
  423.     IL_002d:  ldloc.0
  424.     IL_002e:  ret
  425.   } // end of method Program::TestAsync
  426.  
  427.   .method public hidebysig specialname rtspecialname
  428.           instance void  .ctor() cil managed
  429.   {
  430.     // Code size       8 (0x8)
  431.     .maxstack  8
  432.     IL_0000:  ldarg.0
  433.     IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
  434.     IL_0006:  nop
  435.     IL_0007:  ret
  436.   } // end of method Program::.ctor
  437.  
  438. } // end of class cs6await.Program
  439.  
  440.  
  441. // =============================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement