diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs index b5514387b5c3f17519c66e935174a2a14ddcbcbc..12b87e422e61de942f8a9cfaece9d5920d18cab6 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs @@ -134,8 +134,54 @@ System.Collections.Generic.IEnumerable Foo() } "; - var c = CreateCompilationWithMscorlibAndSystemCore(text, options: TestOptions.DebugDll); - c.VerifyPdb(@" + var v = CompileAndVerify(text, options: TestOptions.DebugDll); + + v.VerifyIL("Program.d__0.System.Collections.IEnumerator.MoveNext", @" +{ + // Code size 63 (0x3f) + .maxstack 2 + .locals init (int V_0, + bool V_1) + ~IL_0000: ldarg.0 + IL_0001: ldfld ""int Program.d__0.<>1__state"" + IL_0006: stloc.0 + 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_0016 + IL_0012: br.s IL_001a + IL_0014: br.s IL_0034 + IL_0016: ldc.i4.0 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ret + IL_001a: ldarg.0 + IL_001b: ldc.i4.m1 + IL_001c: stfld ""int Program.d__0.<>1__state"" + -IL_0021: nop + -IL_0022: ldarg.0 + IL_0023: ldc.i4.1 + IL_0024: stfld ""int Program.d__0.<>2__current"" + IL_0029: ldarg.0 + IL_002a: ldc.i4.1 + IL_002b: stfld ""int Program.d__0.<>1__state"" + IL_0030: ldc.i4.1 + IL_0031: stloc.1 + IL_0032: br.s IL_0018 + ~IL_0034: ldarg.0 + IL_0035: ldc.i4.m1 + IL_0036: stfld ""int Program.d__0.<>1__state"" + -IL_003b: ldc.i4.0 + IL_003c: stloc.1 + IL_003d: br.s IL_0018 +} +", + sequencePoints: "Program+d__0.MoveNext"); + + v.VerifyPdb(@" diff --git a/src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb b/src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb index 58cb2d5540ff0ad5f95b5f0db08f40273fc8fab0..725039cbde78cfaf4a5c0d59e92bee0a7d344464 100644 --- a/src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb +++ b/src/Compilers/VisualBasic/Portable/CodeGen/EmitStatement.vb @@ -1162,19 +1162,21 @@ OtherExpressions: cur = cur + 1 ' Emit case statement sequence point - If _emitPdbSequencePoints Then - Dim caseStatement = caseBlock.CaseStatement - If Not caseStatement.WasCompilerGenerated Then - Debug.Assert(caseStatement.Syntax IsNot Nothing) + + Dim caseStatement = caseBlock.CaseStatement + If Not caseStatement.WasCompilerGenerated Then + Debug.Assert(caseStatement.Syntax IsNot Nothing) + + If _emitPdbSequencePoints Then EmitSequencePoint(caseStatement.Syntax) End If - End If - If _optimizations = OptimizationLevel.Debug Then - ' Emit nop for the case statement otherwise the above sequence point - ' will get associated with the first statement in subsequent case block. - ' This matches the native compiler codegen. - _builder.EmitOpCode(ILOpCode.Nop) + If _optimizations = OptimizationLevel.Debug Then + ' Emit nop for the case statement otherwise the above sequence point + ' will get associated with the first statement in subsequent case block. + ' This matches the native compiler codegen. + _builder.EmitOpCode(ILOpCode.Nop) + End If End If ' Emit case block body diff --git a/src/Compilers/VisualBasic/Portable/Lowering/IteratorRewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb b/src/Compilers/VisualBasic/Portable/Lowering/IteratorRewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb index 3413504d0ca1d96539d6025025abf5f05179acff..2040c5e44aa6aa0f7a008c0b8d588143e7758bd5 100644 --- a/src/Compilers/VisualBasic/Portable/Lowering/IteratorRewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb +++ b/src/Compilers/VisualBasic/Portable/Lowering/IteratorRewriter/IteratorRewriter.IteratorMethodToClassRewriter.vb @@ -75,7 +75,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic GenerateReturn(finished:=True), F.Label(initialLabel), F.Assignment(F.Field(F.Me, Me.StateField, True), Me.F.AssignmentExpression(Me.F.Local(Me.CachedState, True), Me.F.Literal(StateMachineStates.NotStartedStateMachine))), - F.SequencePoint(_originalMethodDeclaration), newBody, HandleReturn() )) diff --git a/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb b/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb index 351844274ae475459f9ca03307b625aab0446937..94cb6c59b23bb7305f0c8876ae91915130d2019f 100644 --- a/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb +++ b/src/Compilers/VisualBasic/Test/Emit/CodeGen/CodeGenAsyncTests.vb @@ -1499,7 +1499,7 @@ End Module c.VerifyIL("Program.VB$StateMachine_0_Test2.MoveNext", IL_00b2: ldarg.0 - IL_00b3: ldc.i4.m1 - IL_00b4: dup - IL_00b5: stloc.0 - IL_00b6: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" - IL_00bb: ldarg.0 - IL_00bc: ldfld "Program.VB$StateMachine_0_Test2.$A0 As Object" - IL_00c1: stloc.1 - IL_00c2: ldarg.0 - IL_00c3: ldnull - IL_00c4: stfld "Program.VB$StateMachine_0_Test2.$A0 As Object" - IL_00c9: ldarg.0 - IL_00ca: ldloc.1 - IL_00cb: ldnull - IL_00cc: ldstr "GetResult" - IL_00d1: ldc.i4.0 - IL_00d2: newarr "Object" + IL_0054: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" + IL_0059: call "Function Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(Object) As Boolean" + IL_005e: brfalse.s IL_0062 + IL_0060: br.s IL_00c7 + IL_0062: ldarg.0 + IL_0063: ldc.i4.0 + IL_0064: dup + IL_0065: stloc.0 + IL_0066: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" + IL_00b0: ldarg.0 + IL_00b1: ldc.i4.m1 + IL_00b2: dup + IL_00b3: stloc.0 + IL_00b4: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" + IL_00b9: ldarg.0 + IL_00ba: ldfld "Program.VB$StateMachine_0_Test2.$A0 As Object" + IL_00bf: stloc.1 + IL_00c0: ldarg.0 + IL_00c1: ldnull + IL_00c2: stfld "Program.VB$StateMachine_0_Test2.$A0 As Object" + IL_00c7: ldarg.0 + IL_00c8: ldloc.1 + IL_00c9: ldnull + IL_00ca: ldstr "GetResult" + IL_00cf: ldc.i4.0 + IL_00d0: newarr "Object" + IL_00d5: ldnull + IL_00d6: ldnull IL_00d7: ldnull - IL_00d8: ldnull - IL_00d9: ldnull - IL_00da: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" - IL_00df: stloc.s V_5 - IL_00e1: ldnull - IL_00e2: stloc.1 - IL_00e3: ldloc.s V_5 - IL_00e5: call "Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object" - IL_00ea: stfld "Program.VB$StateMachine_0_Test2.$VB$ResumableLocal_x$1 As Object" - -IL_00ef: nop - IL_00f0: ldarg.0 - IL_00f1: ldfld "Program.VB$StateMachine_0_Test2.$VB$ResumableLocal_o$0 As Object" - IL_00f6: ldnull - IL_00f7: ldstr "GetAwaiter" - IL_00fc: ldc.i4.0 - IL_00fd: newarr "Object" + IL_00d8: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" + IL_00dd: stloc.s V_5 + IL_00df: ldnull + IL_00e0: stloc.1 + IL_00e1: ldloc.s V_5 + IL_00e3: call "Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object" + IL_00e8: stfld "Program.VB$StateMachine_0_Test2.$VB$ResumableLocal_x$1 As Object" + -IL_00ed: nop + IL_00ee: ldarg.0 + IL_00ef: ldfld "Program.VB$StateMachine_0_Test2.$VB$ResumableLocal_o$0 As Object" + IL_00f4: ldnull + IL_00f5: ldstr "GetAwaiter" + IL_00fa: ldc.i4.0 + IL_00fb: newarr "Object" + IL_0100: ldnull + IL_0101: ldnull IL_0102: ldnull - IL_0103: ldnull - IL_0104: ldnull - IL_0105: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" - IL_010a: stloc.s V_6 - ~IL_010c: ldloc.s V_6 - IL_010e: ldnull - IL_010f: ldstr "IsCompleted" - IL_0114: ldc.i4.0 - IL_0115: newarr "Object" + IL_0103: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" + IL_0108: stloc.s V_6 + ~IL_010a: ldloc.s V_6 + IL_010c: ldnull + IL_010d: ldstr "IsCompleted" + IL_0112: ldc.i4.0 + IL_0113: newarr "Object" + IL_0118: ldnull + IL_0119: ldnull IL_011a: ldnull - IL_011b: ldnull - IL_011c: ldnull - IL_011d: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" - IL_0122: call "Function Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(Object) As Boolean" - IL_0127: brfalse.s IL_012b - IL_0129: br.s IL_0194 - IL_012b: ldarg.0 - IL_012c: ldc.i4.1 - IL_012d: dup - IL_012e: stloc.0 - IL_012f: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" - IL_017c: ldarg.0 - IL_017d: ldc.i4.m1 - IL_017e: dup - IL_017f: stloc.0 - IL_0180: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" - IL_0185: ldarg.0 - IL_0186: ldfld "Program.VB$StateMachine_0_Test2.$A0 As Object" - IL_018b: stloc.s V_6 - IL_018d: ldarg.0 - IL_018e: ldnull - IL_018f: stfld "Program.VB$StateMachine_0_Test2.$A0 As Object" - IL_0194: ldloc.s V_6 - IL_0196: ldnull - IL_0197: ldstr "GetResult" - IL_019c: ldc.i4.0 - IL_019d: newarr "Object" + IL_011b: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object, System.Type, String, Object(), String(), System.Type(), Boolean()) As Object" + IL_0120: call "Function Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(Object) As Boolean" + IL_0125: brfalse.s IL_0129 + IL_0127: br.s IL_0192 + IL_0129: ldarg.0 + IL_012a: ldc.i4.1 + IL_012b: dup + IL_012c: stloc.0 + IL_012d: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" + IL_017a: ldarg.0 + IL_017b: ldc.i4.m1 + IL_017c: dup + IL_017d: stloc.0 + IL_017e: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" + IL_0183: ldarg.0 + IL_0184: ldfld "Program.VB$StateMachine_0_Test2.$A0 As Object" + IL_0189: stloc.s V_6 + IL_018b: ldarg.0 + IL_018c: ldnull + IL_018d: stfld "Program.VB$StateMachine_0_Test2.$A0 As Object" + IL_0192: ldloc.s V_6 + IL_0194: ldnull + IL_0195: ldstr "GetResult" + IL_019a: ldc.i4.0 + IL_019b: newarr "Object" + IL_01a0: ldnull + IL_01a1: ldnull IL_01a2: ldnull - IL_01a3: ldnull - IL_01a4: ldnull - IL_01a5: ldc.i4.1 - IL_01a6: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object, System.Type, String, Object(), String(), System.Type(), Boolean(), Boolean) As Object" - IL_01ab: pop - IL_01ac: ldnull - IL_01ad: stloc.s V_6 - -IL_01af: leave.s IL_01d6 + IL_01a3: ldc.i4.1 + IL_01a4: call "Function Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object, System.Type, String, Object(), String(), System.Type(), Boolean(), Boolean) As Object" + IL_01a9: pop + IL_01aa: ldnull + IL_01ab: stloc.s V_6 + -IL_01ad: leave.s IL_01d4 } catch System.Exception { - ~$IL_01b1: dup - IL_01b2: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)" - IL_01b7: stloc.s V_9 - ~IL_01b9: ldarg.0 - IL_01ba: ldc.i4.s -2 - IL_01bc: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" - IL_01c1: ldarg.0 - IL_01c2: ldflda "Program.VB$StateMachine_0_Test2.$Builder As System.Runtime.CompilerServices.AsyncVoidMethodBuilder" - IL_01c7: ldloc.s V_9 - IL_01c9: call "Sub System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetException(System.Exception)" - IL_01ce: nop - IL_01cf: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()" - IL_01d4: leave.s IL_01ec + ~$IL_01af: dup + IL_01b0: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)" + IL_01b5: stloc.s V_9 + ~IL_01b7: ldarg.0 + IL_01b8: ldc.i4.s -2 + IL_01ba: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" + IL_01bf: ldarg.0 + IL_01c0: ldflda "Program.VB$StateMachine_0_Test2.$Builder As System.Runtime.CompilerServices.AsyncVoidMethodBuilder" + IL_01c5: ldloc.s V_9 + IL_01c7: call "Sub System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetException(System.Exception)" + IL_01cc: nop + IL_01cd: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()" + IL_01d2: leave.s IL_01ea } - -IL_01d6: ldarg.0 - IL_01d7: ldc.i4.s -2 - IL_01d9: dup - IL_01da: stloc.0 - IL_01db: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" - ~IL_01e0: ldarg.0 - IL_01e1: ldflda "Program.VB$StateMachine_0_Test2.$Builder As System.Runtime.CompilerServices.AsyncVoidMethodBuilder" - IL_01e6: call "Sub System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetResult()" - IL_01eb: nop - IL_01ec: ret + -IL_01d4: ldarg.0 + IL_01d5: ldc.i4.s -2 + IL_01d7: dup + IL_01d8: stloc.0 + IL_01d9: stfld "Program.VB$StateMachine_0_Test2.$State As Integer" + ~IL_01de: ldarg.0 + IL_01df: ldflda "Program.VB$StateMachine_0_Test2.$Builder As System.Runtime.CompilerServices.AsyncVoidMethodBuilder" + IL_01e4: call "Sub System.Runtime.CompilerServices.AsyncVoidMethodBuilder.SetResult()" + IL_01e9: nop + IL_01ea: ret } ]]>, sequencePoints:="Program+VB$StateMachine_0_Test2.MoveNext") @@ -1785,7 +1783,7 @@ End Module c.VerifyIL("Program.VB$StateMachine_0_Test2.MoveNext", ) End Sub diff --git a/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.vb b/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.vb index add3dfb20391cbc09bda1f2d6298a135bc5c02ed..20116cb398b8cbae218e2b8909d4275753f2a71c 100644 --- a/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.vb +++ b/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/EditAndContinueStateMachineTests.vb @@ -248,7 +248,7 @@ End Class IL_0000: ret } { - // Code size 66 (0x42) + // Code size 63 (0x3f) .maxstack 3 IL_0000: ldarg.0 IL_0001: ldfld 0x04000005 @@ -258,38 +258,35 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0037 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld 0x04000005 - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldc.i4.2 - IL_0027: stfld 0x04000006 - IL_002c: ldarg.0 - IL_002d: ldc.i4.1 - IL_002e: dup - IL_002f: stloc.1 - IL_0030: stfld 0x04000005 - IL_0035: ldc.i4.1 - IL_0036: ret - IL_0037: ldarg.0 - IL_0038: ldc.i4.m1 - IL_0039: dup - IL_003a: stloc.1 - IL_003b: stfld 0x04000005 - IL_0040: ldc.i4.0 - IL_0041: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0034 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld 0x04000005 + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldc.i4.2 + IL_0024: stfld 0x04000006 + IL_0029: ldarg.0 + IL_002a: ldc.i4.1 + IL_002b: dup + IL_002c: stloc.1 + IL_002d: stfld 0x04000005 + IL_0032: ldc.i4.1 + IL_0033: ret + IL_0034: ldarg.0 + IL_0035: ldc.i4.m1 + IL_0036: dup + IL_0037: stloc.1 + IL_0038: stfld 0x04000005 + IL_003d: ldc.i4.0 + IL_003e: ret } { // Code size 55 (0x37) @@ -357,12 +354,11 @@ End Class - + @@ -566,86 +562,85 @@ End Class IL_0006: ret } { - // Code size 186 (0xba) + // Code size 185 (0xb9) .maxstack 3 IL_0000: ldarg.0 IL_0001: ldfld 0x04000001 IL_0006: stloc.1 IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_004b + IL_000a: br.s IL_000e + IL_000c: br.s IL_004a + IL_000e: nop IL_000f: nop - IL_0010: nop - IL_0011: ldc.i4.1 - IL_0012: call 0x2B000002 - IL_0017: callvirt 0x0A00000F - IL_001c: stloc.3 - IL_001d: ldloca.s V_3 - IL_001f: call 0x0A000010 - IL_0024: brtrue.s IL_0069 - IL_0026: ldarg.0 - IL_0027: ldc.i4.0 - IL_0028: dup - IL_0029: stloc.1 - IL_002a: stfld 0x04000001 - IL_002f: ldarg.0 - IL_0030: ldloc.3 - IL_0031: stfld 0x04000004 - IL_0036: ldarg.0 - IL_0037: ldflda 0x04000002 - IL_003c: ldloca.s V_3 - IL_003e: ldarg.0 - IL_003f: stloc.s V_4 - IL_0041: ldloca.s V_4 - IL_0043: call 0x2B000003 - IL_0048: nop - IL_0049: leave.s IL_00b9 - IL_004b: ldarg.0 - IL_004c: ldc.i4.m1 - IL_004d: dup - IL_004e: stloc.1 - IL_004f: stfld 0x04000001 - IL_0054: ldarg.0 - IL_0055: ldfld 0x04000004 - IL_005a: stloc.3 - IL_005b: ldarg.0 - IL_005c: ldflda 0x04000004 - IL_0061: initobj 0x1B000003 - IL_0067: br.s IL_0069 - IL_0069: ldloca.s V_3 - IL_006b: call 0x0A000012 - IL_0070: pop - IL_0071: ldloca.s V_3 - IL_0073: initobj 0x1B000003 - IL_0079: ldc.i4.0 - IL_007a: stloc.0 - IL_007b: leave.s IL_00a2 - IL_007d: dup - IL_007e: call 0x0A000013 - IL_0083: stloc.s V_5 - IL_0085: ldarg.0 - IL_0086: ldc.i4.s -2 - IL_0088: stfld 0x04000001 - IL_008d: ldarg.0 - IL_008e: ldflda 0x04000002 - IL_0093: ldloc.s V_5 - IL_0095: call 0x0A000014 - IL_009a: nop - IL_009b: call 0x0A000015 - IL_00a0: leave.s IL_00b9 - IL_00a2: ldarg.0 - IL_00a3: ldc.i4.s -2 - IL_00a5: dup - IL_00a6: stloc.1 - IL_00a7: stfld 0x04000001 - IL_00ac: ldarg.0 - IL_00ad: ldflda 0x04000002 - IL_00b2: ldloc.0 - IL_00b3: call 0x0A000016 - IL_00b8: nop - IL_00b9: ret + IL_0010: ldc.i4.1 + IL_0011: call 0x2B000002 + IL_0016: callvirt 0x0A00000F + IL_001b: stloc.3 + IL_001c: ldloca.s V_3 + IL_001e: call 0x0A000010 + IL_0023: brtrue.s IL_0068 + IL_0025: ldarg.0 + IL_0026: ldc.i4.0 + IL_0027: dup + IL_0028: stloc.1 + IL_0029: stfld 0x04000001 + IL_002e: ldarg.0 + IL_002f: ldloc.3 + IL_0030: stfld 0x04000004 + IL_0035: ldarg.0 + IL_0036: ldflda 0x04000002 + IL_003b: ldloca.s V_3 + IL_003d: ldarg.0 + IL_003e: stloc.s V_4 + IL_0040: ldloca.s V_4 + IL_0042: call 0x2B000003 + IL_0047: nop + IL_0048: leave.s IL_00b8 + IL_004a: ldarg.0 + IL_004b: ldc.i4.m1 + IL_004c: dup + IL_004d: stloc.1 + IL_004e: stfld 0x04000001 + IL_0053: ldarg.0 + IL_0054: ldfld 0x04000004 + IL_0059: stloc.3 + IL_005a: ldarg.0 + IL_005b: ldflda 0x04000004 + IL_0060: initobj 0x1B000003 + IL_0066: br.s IL_0068 + IL_0068: ldloca.s V_3 + IL_006a: call 0x0A000012 + IL_006f: pop + IL_0070: ldloca.s V_3 + IL_0072: initobj 0x1B000003 + IL_0078: ldc.i4.0 + IL_0079: stloc.0 + IL_007a: leave.s IL_00a1 + IL_007c: dup + IL_007d: call 0x0A000013 + IL_0082: stloc.s V_5 + IL_0084: ldarg.0 + IL_0085: ldc.i4.s -2 + IL_0087: stfld 0x04000001 + IL_008c: ldarg.0 + IL_008d: ldflda 0x04000002 + IL_0092: ldloc.s V_5 + IL_0094: call 0x0A000014 + IL_0099: nop + IL_009a: call 0x0A000015 + IL_009f: leave.s IL_00b8 + IL_00a1: ldarg.0 + IL_00a2: ldc.i4.s -2 + IL_00a4: dup + IL_00a5: stloc.1 + IL_00a6: stfld 0x04000001 + IL_00ab: ldarg.0 + IL_00ac: ldflda 0x04000002 + IL_00b1: ldloc.0 + IL_00b2: call 0x0A000016 + IL_00b7: nop + IL_00b8: ret } { // Code size 1 (0x1) @@ -664,22 +659,22 @@ End Class - + - + @@ -1106,7 +1101,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 66 (0x42) + // Code size 63 (0x3f) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -1118,43 +1113,40 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0037 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldc.i4.2 - IL_0027: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_002c: ldarg.0 - IL_002d: ldc.i4.1 - IL_002e: dup - IL_002f: stloc.1 - IL_0030: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0035: ldc.i4.1 - IL_0036: ret - IL_0037: ldarg.0 - IL_0038: ldc.i4.m1 - IL_0039: dup - IL_003a: stloc.1 - IL_003b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0040: ldc.i4.0 - IL_0041: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0034 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldc.i4.2 + IL_0024: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0029: ldarg.0 + IL_002a: ldc.i4.1 + IL_002b: dup + IL_002c: stloc.1 + IL_002d: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0032: ldc.i4.1 + IL_0033: ret + IL_0034: ldarg.0 + IL_0035: ldc.i4.m1 + IL_0036: dup + IL_0037: stloc.1 + IL_0038: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003d: ldc.i4.0 + IL_003e: ret } ") v0.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 66 (0x42) + // Code size 63 (0x3f) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -1166,38 +1158,35 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0037 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldc.i4.1 - IL_0027: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_002c: ldarg.0 - IL_002d: ldc.i4.1 - IL_002e: dup - IL_002f: stloc.1 - IL_0030: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0035: ldc.i4.1 - IL_0036: ret - IL_0037: ldarg.0 - IL_0038: ldc.i4.m1 - IL_0039: dup - IL_003a: stloc.1 - IL_003b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0040: ldc.i4.0 - IL_0041: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0034 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldc.i4.1 + IL_0024: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0029: ldarg.0 + IL_002a: ldc.i4.1 + IL_002b: dup + IL_002c: stloc.1 + IL_002d: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0032: ldc.i4.1 + IL_0033: ret + IL_0034: ldarg.0 + IL_0035: ldc.i4.m1 + IL_0036: dup + IL_0037: stloc.1 + IL_0038: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003d: ldc.i4.0 + IL_003e: ret } ") End Using @@ -1260,7 +1249,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 188 (0xbc) + // Code size 187 (0xbb) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -1275,108 +1264,11 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_004c + IL_000a: br.s IL_000e + IL_000c: br.s IL_004b + IL_000e: nop IL_000f: nop - IL_0010: nop - IL_0011: ldc.i4.s 10 - IL_0013: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" - IL_0018: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_001d: stloc.3 - IL_001e: ldloca.s V_3 - IL_0020: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_0025: brtrue.s IL_006a - IL_0027: ldarg.0 - IL_0028: ldc.i4.0 - IL_0029: dup - IL_002a: stloc.1 - IL_002b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0030: ldarg.0 - IL_0031: ldloc.3 - IL_0032: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0037: ldarg.0 - IL_0038: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_003d: ldloca.s V_3 - IL_003f: ldarg.0 - IL_0040: stloc.s V_4 - IL_0042: ldloca.s V_4 - IL_0044: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" - IL_0049: nop - IL_004a: leave.s IL_00bb - IL_004c: ldarg.0 - IL_004d: ldc.i4.m1 - IL_004e: dup - IL_004f: stloc.1 - IL_0050: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0055: ldarg.0 - IL_0056: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_005b: stloc.3 - IL_005c: ldarg.0 - IL_005d: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0062: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0068: br.s IL_006a - IL_006a: ldloca.s V_3 - IL_006c: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_0071: pop - IL_0072: ldloca.s V_3 - IL_0074: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_007a: ldc.i4.s 20 - IL_007c: stloc.0 - IL_007d: leave.s IL_00a4 - } - catch System.Exception - { - IL_007f: dup - IL_0080: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0085: stloc.s V_5 - IL_0087: ldarg.0 - IL_0088: ldc.i4.s -2 - IL_008a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_008f: ldarg.0 - IL_0090: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0095: ldloc.s V_5 - IL_0097: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_009c: nop - IL_009d: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00a2: leave.s IL_00bb - } - IL_00a4: ldarg.0 - IL_00a5: ldc.i4.s -2 - IL_00a7: dup - IL_00a8: stloc.1 - IL_00a9: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00ae: ldarg.0 - IL_00af: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00b4: ldloc.0 - IL_00b5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00ba: nop - IL_00bb: ret -} -") - v0.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " -{ - // Code size 186 (0xba) - .maxstack 3 - .locals init (Integer V_0, - Integer V_1, - System.Threading.Tasks.Task(Of Integer) V_2, - System.Runtime.CompilerServices.TaskAwaiter(Of Integer) V_3, - C.VB$StateMachine_1_F V_4, - System.Exception V_5) - IL_0000: ldarg.0 - IL_0001: ldfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0006: stloc.1 - .try - { - IL_0007: ldloc.1 - IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_004b - IL_000f: nop - IL_0010: nop - IL_0011: ldc.i4.1 + IL_0010: ldc.i4.s 10 IL_0012: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" IL_0017: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" IL_001c: stloc.3 @@ -1399,7 +1291,7 @@ End Class IL_0041: ldloca.s V_4 IL_0043: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" IL_0048: nop - IL_0049: leave.s IL_00b9 + IL_0049: leave.s IL_00ba IL_004b: ldarg.0 IL_004c: ldc.i4.m1 IL_004d: dup @@ -1417,37 +1309,132 @@ End Class IL_0070: pop IL_0071: ldloca.s V_3 IL_0073: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0079: ldc.i4.2 - IL_007a: stloc.0 - IL_007b: leave.s IL_00a2 + IL_0079: ldc.i4.s 20 + IL_007b: stloc.0 + IL_007c: leave.s IL_00a3 } catch System.Exception { - IL_007d: dup - IL_007e: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0083: stloc.s V_5 - IL_0085: ldarg.0 - IL_0086: ldc.i4.s -2 - IL_0088: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_008d: ldarg.0 - IL_008e: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0093: ldloc.s V_5 - IL_0095: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_009a: nop - IL_009b: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00a0: leave.s IL_00b9 + IL_007e: dup + IL_007f: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0084: stloc.s V_5 + IL_0086: ldarg.0 + IL_0087: ldc.i4.s -2 + IL_0089: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_008e: ldarg.0 + IL_008f: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0094: ldloc.s V_5 + IL_0096: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_009b: nop + IL_009c: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00a1: leave.s IL_00ba } - IL_00a2: ldarg.0 - IL_00a3: ldc.i4.s -2 - IL_00a5: dup - IL_00a6: stloc.1 - IL_00a7: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00ac: ldarg.0 - IL_00ad: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00b2: ldloc.0 - IL_00b3: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00b8: nop - IL_00b9: ret + IL_00a3: ldarg.0 + IL_00a4: ldc.i4.s -2 + IL_00a6: dup + IL_00a7: stloc.1 + IL_00a8: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00ad: ldarg.0 + IL_00ae: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00b3: ldloc.0 + IL_00b4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00b9: nop + IL_00ba: ret +} +") + v0.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " +{ + // Code size 185 (0xb9) + .maxstack 3 + .locals init (Integer V_0, + Integer V_1, + System.Threading.Tasks.Task(Of Integer) V_2, + System.Runtime.CompilerServices.TaskAwaiter(Of Integer) V_3, + C.VB$StateMachine_1_F V_4, + System.Exception V_5) + IL_0000: ldarg.0 + IL_0001: ldfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0006: stloc.1 + .try + { + IL_0007: ldloc.1 + IL_0008: brfalse.s IL_000c + IL_000a: br.s IL_000e + IL_000c: br.s IL_004a + IL_000e: nop + IL_000f: nop + IL_0010: ldc.i4.1 + IL_0011: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" + IL_0016: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_001b: stloc.3 + IL_001c: ldloca.s V_3 + IL_001e: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_0023: brtrue.s IL_0068 + IL_0025: ldarg.0 + IL_0026: ldc.i4.0 + IL_0027: dup + IL_0028: stloc.1 + IL_0029: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_002e: ldarg.0 + IL_002f: ldloc.3 + IL_0030: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0035: ldarg.0 + IL_0036: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_003b: ldloca.s V_3 + IL_003d: ldarg.0 + IL_003e: stloc.s V_4 + IL_0040: ldloca.s V_4 + IL_0042: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" + IL_0047: nop + IL_0048: leave.s IL_00b8 + IL_004a: ldarg.0 + IL_004b: ldc.i4.m1 + IL_004c: dup + IL_004d: stloc.1 + IL_004e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0053: ldarg.0 + IL_0054: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0059: stloc.3 + IL_005a: ldarg.0 + IL_005b: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0060: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0066: br.s IL_0068 + IL_0068: ldloca.s V_3 + IL_006a: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_006f: pop + IL_0070: ldloca.s V_3 + IL_0072: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0078: ldc.i4.2 + IL_0079: stloc.0 + IL_007a: leave.s IL_00a1 + } + catch System.Exception + { + IL_007c: dup + IL_007d: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0082: stloc.s V_5 + IL_0084: ldarg.0 + IL_0085: ldc.i4.s -2 + IL_0087: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_008c: ldarg.0 + IL_008d: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0092: ldloc.s V_5 + IL_0094: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_0099: nop + IL_009a: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_009f: leave.s IL_00b8 + } + IL_00a1: ldarg.0 + IL_00a2: ldc.i4.s -2 + IL_00a4: dup + IL_00a5: stloc.1 + IL_00a6: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00ab: ldarg.0 + IL_00ac: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00b1: ldloc.0 + IL_00b2: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00b7: nop + IL_00b8: ret } ") End Using @@ -1518,7 +1505,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 78 (0x4e) + // Code size 75 (0x4b) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -1530,42 +1517,39 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0043 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldarg.0 - IL_0027: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" - IL_002c: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" - IL_0031: ldarg.0 - IL_0032: ldc.i4.2 - IL_0033: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_0038: ldarg.0 - IL_0039: ldc.i4.1 - IL_003a: dup - IL_003b: stloc.1 - IL_003c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0041: ldc.i4.1 - IL_0042: ret - IL_0043: ldarg.0 - IL_0044: ldc.i4.m1 - IL_0045: dup - IL_0046: stloc.1 - IL_0047: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_004c: ldc.i4.0 - IL_004d: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0040 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldarg.0 + IL_0024: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" + IL_0029: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" + IL_002e: ldarg.0 + IL_002f: ldc.i4.2 + IL_0030: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0035: ldarg.0 + IL_0036: ldc.i4.1 + IL_0037: dup + IL_0038: stloc.1 + IL_0039: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003e: ldc.i4.1 + IL_003f: ret + IL_0040: ldarg.0 + IL_0041: ldc.i4.m1 + IL_0042: dup + IL_0043: stloc.1 + IL_0044: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0049: ldc.i4.0 + IL_004a: ret } ") End Using @@ -1639,7 +1623,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 94 (0x5e) + // Code size 91 (0x5b) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -1651,46 +1635,43 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0053 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldarg.0 - IL_0027: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" - IL_002c: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" - IL_0031: ldarg.0 - IL_0032: ldc.i4 0x4d2 - IL_0037: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" - IL_003c: ldarg.0 - IL_003d: ldarg.0 - IL_003e: ldfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" - IL_0043: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_0048: ldarg.0 - IL_0049: ldc.i4.1 - IL_004a: dup - IL_004b: stloc.1 - IL_004c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0051: ldc.i4.1 - IL_0052: ret - IL_0053: ldarg.0 - IL_0054: ldc.i4.m1 - IL_0055: dup - IL_0056: stloc.1 - IL_0057: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_005c: ldc.i4.0 - IL_005d: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0050 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldarg.0 + IL_0024: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" + IL_0029: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" + IL_002e: ldarg.0 + IL_002f: ldc.i4 0x4d2 + IL_0034: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" + IL_0039: ldarg.0 + IL_003a: ldarg.0 + IL_003b: ldfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" + IL_0040: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0045: ldarg.0 + IL_0046: ldc.i4.1 + IL_0047: dup + IL_0048: stloc.1 + IL_0049: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_004e: ldc.i4.1 + IL_004f: ret + IL_0050: ldarg.0 + IL_0051: ldc.i4.m1 + IL_0052: dup + IL_0053: stloc.1 + IL_0054: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0059: ldc.i4.0 + IL_005a: ret } ") End Using @@ -1763,7 +1744,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 82 (0x52) + // Code size 79 (0x4f) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -1775,42 +1756,39 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0047 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldc.i4 0x4d2 - IL_002b: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" - IL_0030: ldarg.0 - IL_0031: ldarg.0 - IL_0032: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" - IL_0037: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_003c: ldarg.0 - IL_003d: ldc.i4.1 - IL_003e: dup - IL_003f: stloc.1 - IL_0040: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0045: ldc.i4.1 - IL_0046: ret - IL_0047: ldarg.0 - IL_0048: ldc.i4.m1 - IL_0049: dup - IL_004a: stloc.1 - IL_004b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0050: ldc.i4.0 - IL_0051: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0044 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldc.i4 0x4d2 + IL_0028: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" + IL_002d: ldarg.0 + IL_002e: ldarg.0 + IL_002f: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" + IL_0034: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0039: ldarg.0 + IL_003a: ldc.i4.1 + IL_003b: dup + IL_003c: stloc.1 + IL_003d: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0042: ldc.i4.1 + IL_0043: ret + IL_0044: ldarg.0 + IL_0045: ldc.i4.m1 + IL_0046: dup + IL_0047: stloc.1 + IL_0048: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_004d: ldc.i4.0 + IL_004e: ret } ") End Using @@ -1883,7 +1861,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 77 (0x4d) + // Code size 74 (0x4a) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -1895,41 +1873,38 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0042 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldc.i4 0x4d2 - IL_002b: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$1 As Integer"" - IL_0030: ldarg.0 - IL_0031: ldc.i4.0 - IL_0032: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_0037: ldarg.0 - IL_0038: ldc.i4.1 - IL_0039: dup - IL_003a: stloc.1 - IL_003b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0040: ldc.i4.1 - IL_0041: ret - IL_0042: ldarg.0 - IL_0043: ldc.i4.m1 - IL_0044: dup - IL_0045: stloc.1 - IL_0046: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_004b: ldc.i4.0 - IL_004c: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_003f + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldc.i4 0x4d2 + IL_0028: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$1 As Integer"" + IL_002d: ldarg.0 + IL_002e: ldc.i4.0 + IL_002f: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0034: ldarg.0 + IL_0035: ldc.i4.1 + IL_0036: dup + IL_0037: stloc.1 + IL_0038: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003d: ldc.i4.1 + IL_003e: ret + IL_003f: ldarg.0 + IL_0040: ldc.i4.m1 + IL_0041: dup + IL_0042: stloc.1 + IL_0043: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0048: ldc.i4.0 + IL_0049: ret } ") End Using @@ -2033,7 +2008,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 165 (0xa5) + // Code size 162 (0xa2) .maxstack 5 .locals init (Boolean V_0, Integer V_1, @@ -2046,78 +2021,75 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_0018 - IL_0012: nop - IL_0013: br.s IL_001a - IL_0015: nop - IL_0016: br.s IL_0077 - IL_0018: ldc.i4.0 - IL_0019: ret - IL_001a: ldarg.0 - IL_001b: ldc.i4.m1 - IL_001c: dup - IL_001d: stloc.1 - IL_001e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0023: nop - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldc.i4.2 - IL_0027: newarr ""Double"" - IL_002c: dup - IL_002d: ldc.i4.0 - IL_002e: ldc.r8 1 - IL_0037: stelem.r8 - IL_0038: dup - IL_0039: ldc.i4.1 - IL_003a: ldc.r8 2 - IL_0043: stelem.r8 - IL_0044: stfld ""C.VB$StateMachine_1_F.$S3 As Double()"" - IL_0049: ldarg.0 - IL_004a: ldc.i4.0 - IL_004b: stfld ""C.VB$StateMachine_1_F.$S1 As Integer"" - IL_0050: br.s IL_008f - IL_0052: ldarg.0 - IL_0053: ldarg.0 - IL_0054: ldfld ""C.VB$StateMachine_1_F.$S3 As Double()"" - IL_0059: ldarg.0 - IL_005a: ldfld ""C.VB$StateMachine_1_F.$S1 As Integer"" - IL_005f: ldelem.r8 - IL_0060: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$4 As Double"" - IL_0065: ldarg.0 - IL_0066: ldc.i4.1 - IL_0067: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" - IL_006c: ldarg.0 - IL_006d: ldc.i4.1 - IL_006e: dup - IL_006f: stloc.1 - IL_0070: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0075: ldc.i4.1 - IL_0076: ret - IL_0077: ldarg.0 - IL_0078: ldc.i4.m1 - IL_0079: dup - IL_007a: stloc.1 - IL_007b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0080: nop - IL_0081: ldarg.0 - IL_0082: ldarg.0 - IL_0083: ldfld ""C.VB$StateMachine_1_F.$S1 As Integer"" - IL_0088: ldc.i4.1 - IL_0089: add.ovf - IL_008a: stfld ""C.VB$StateMachine_1_F.$S1 As Integer"" - IL_008f: ldarg.0 - IL_0090: ldfld ""C.VB$StateMachine_1_F.$S1 As Integer"" - IL_0095: ldarg.0 - IL_0096: ldfld ""C.VB$StateMachine_1_F.$S3 As Double()"" - IL_009b: ldlen - IL_009c: conv.i4 - IL_009d: clt - IL_009f: stloc.2 - IL_00a0: ldloc.2 - IL_00a1: brtrue.s IL_0052 - IL_00a3: ldc.i4.0 - IL_00a4: ret + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0074 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldc.i4.2 + IL_0024: newarr ""Double"" + IL_0029: dup + IL_002a: ldc.i4.0 + IL_002b: ldc.r8 1 + IL_0034: stelem.r8 + IL_0035: dup + IL_0036: ldc.i4.1 + IL_0037: ldc.r8 2 + IL_0040: stelem.r8 + IL_0041: stfld ""C.VB$StateMachine_1_F.$S3 As Double()"" + IL_0046: ldarg.0 + IL_0047: ldc.i4.0 + IL_0048: stfld ""C.VB$StateMachine_1_F.$S1 As Integer"" + IL_004d: br.s IL_008c + IL_004f: ldarg.0 + IL_0050: ldarg.0 + IL_0051: ldfld ""C.VB$StateMachine_1_F.$S3 As Double()"" + IL_0056: ldarg.0 + IL_0057: ldfld ""C.VB$StateMachine_1_F.$S1 As Integer"" + IL_005c: ldelem.r8 + IL_005d: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$4 As Double"" + IL_0062: ldarg.0 + IL_0063: ldc.i4.1 + IL_0064: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0069: ldarg.0 + IL_006a: ldc.i4.1 + IL_006b: dup + IL_006c: stloc.1 + IL_006d: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0072: ldc.i4.1 + IL_0073: ret + IL_0074: ldarg.0 + IL_0075: ldc.i4.m1 + IL_0076: dup + IL_0077: stloc.1 + IL_0078: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_007d: nop + IL_007e: ldarg.0 + IL_007f: ldarg.0 + IL_0080: ldfld ""C.VB$StateMachine_1_F.$S1 As Integer"" + IL_0085: ldc.i4.1 + IL_0086: add.ovf + IL_0087: stfld ""C.VB$StateMachine_1_F.$S1 As Integer"" + IL_008c: ldarg.0 + IL_008d: ldfld ""C.VB$StateMachine_1_F.$S1 As Integer"" + IL_0092: ldarg.0 + IL_0093: ldfld ""C.VB$StateMachine_1_F.$S3 As Double()"" + IL_0098: ldlen + IL_0099: conv.i4 + IL_009a: clt + IL_009c: stloc.2 + IL_009d: ldloc.2 + IL_009e: brtrue.s IL_004f + IL_00a0: ldc.i4.0 + IL_00a1: ret } ") End Using @@ -2185,7 +2157,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 201 (0xc9) + // Code size 200 (0xc8) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -2201,87 +2173,86 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_0058 - IL_000f: nop + IL_000a: br.s IL_000e + IL_000c: br.s IL_0057 + IL_000e: nop + IL_000f: ldarg.0 IL_0010: ldarg.0 - IL_0011: ldarg.0 - IL_0012: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" - IL_0017: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" - IL_001c: nop - IL_001d: ldc.i4.s 20 - IL_001f: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" - IL_0024: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0029: stloc.3 - IL_002a: ldloca.s V_3 - IL_002c: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_0031: brtrue.s IL_0076 - IL_0033: ldarg.0 - IL_0034: ldc.i4.0 - IL_0035: dup - IL_0036: stloc.1 - IL_0037: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_003c: ldarg.0 - IL_003d: ldloc.3 - IL_003e: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0043: ldarg.0 - IL_0044: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0049: ldloca.s V_3 - IL_004b: ldarg.0 - IL_004c: stloc.s V_4 - IL_004e: ldloca.s V_4 - IL_0050: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" - IL_0055: nop - IL_0056: leave.s IL_00c8 - IL_0058: ldarg.0 - IL_0059: ldc.i4.m1 - IL_005a: dup - IL_005b: stloc.1 - IL_005c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0061: ldarg.0 - IL_0062: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0067: stloc.3 - IL_0068: ldarg.0 - IL_0069: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_006e: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0074: br.s IL_0076 - IL_0076: ldloca.s V_3 - IL_0078: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_007d: stloc.s V_5 - IL_007f: ldloca.s V_3 - IL_0081: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0087: ldloc.s V_5 - IL_0089: stloc.0 - IL_008a: leave.s IL_00b1 + IL_0011: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" + IL_0016: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" + IL_001b: nop + IL_001c: ldc.i4.s 20 + IL_001e: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" + IL_0023: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0028: stloc.3 + IL_0029: ldloca.s V_3 + IL_002b: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_0030: brtrue.s IL_0075 + IL_0032: ldarg.0 + IL_0033: ldc.i4.0 + IL_0034: dup + IL_0035: stloc.1 + IL_0036: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003b: ldarg.0 + IL_003c: ldloc.3 + IL_003d: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0042: ldarg.0 + IL_0043: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0048: ldloca.s V_3 + IL_004a: ldarg.0 + IL_004b: stloc.s V_4 + IL_004d: ldloca.s V_4 + IL_004f: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" + IL_0054: nop + IL_0055: leave.s IL_00c7 + IL_0057: ldarg.0 + IL_0058: ldc.i4.m1 + IL_0059: dup + IL_005a: stloc.1 + IL_005b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0060: ldarg.0 + IL_0061: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0066: stloc.3 + IL_0067: ldarg.0 + IL_0068: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_006d: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0073: br.s IL_0075 + IL_0075: ldloca.s V_3 + IL_0077: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_007c: stloc.s V_5 + IL_007e: ldloca.s V_3 + IL_0080: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0086: ldloc.s V_5 + IL_0088: stloc.0 + IL_0089: leave.s IL_00b0 } catch System.Exception { - IL_008c: dup - IL_008d: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0092: stloc.s V_6 - IL_0094: ldarg.0 - IL_0095: ldc.i4.s -2 - IL_0097: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_009c: ldarg.0 - IL_009d: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00a2: ldloc.s V_6 - IL_00a4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00a9: nop - IL_00aa: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00af: leave.s IL_00c8 + IL_008b: dup + IL_008c: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0091: stloc.s V_6 + IL_0093: ldarg.0 + IL_0094: ldc.i4.s -2 + IL_0096: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_009b: ldarg.0 + IL_009c: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00a1: ldloc.s V_6 + IL_00a3: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00a8: nop + IL_00a9: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00ae: leave.s IL_00c7 } - IL_00b1: ldarg.0 - IL_00b2: ldc.i4.s -2 - IL_00b4: dup - IL_00b5: stloc.1 - IL_00b6: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00bb: ldarg.0 - IL_00bc: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c1: ldloc.0 - IL_00c2: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00c7: nop - IL_00c8: ret + IL_00b0: ldarg.0 + IL_00b1: ldc.i4.s -2 + IL_00b3: dup + IL_00b4: stloc.1 + IL_00b5: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00ba: ldarg.0 + IL_00bb: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00c0: ldloc.0 + IL_00c1: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00c6: nop + IL_00c7: ret } ") End Using @@ -2352,7 +2323,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 213 (0xd5) + // Code size 212 (0xd4) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -2368,91 +2339,90 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_0064 - IL_000f: nop + IL_000a: br.s IL_000e + IL_000c: br.s IL_0063 + IL_000e: nop + IL_000f: ldarg.0 IL_0010: ldarg.0 - IL_0011: ldarg.0 - IL_0012: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" - IL_0017: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" - IL_001c: ldarg.0 - IL_001d: ldc.i4.s 10 - IL_001f: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" - IL_0024: nop - IL_0025: ldarg.0 - IL_0026: ldfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" - IL_002b: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" - IL_0030: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0035: stloc.3 - IL_0036: ldloca.s V_3 - IL_0038: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_003d: brtrue.s IL_0082 - IL_003f: ldarg.0 - IL_0040: ldc.i4.0 - IL_0041: dup - IL_0042: stloc.1 - IL_0043: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0048: ldarg.0 - IL_0049: ldloc.3 - IL_004a: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_004f: ldarg.0 - IL_0050: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0055: ldloca.s V_3 - IL_0057: ldarg.0 - IL_0058: stloc.s V_4 - IL_005a: ldloca.s V_4 - IL_005c: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" - IL_0061: nop - IL_0062: leave.s IL_00d4 - IL_0064: ldarg.0 - IL_0065: ldc.i4.m1 - IL_0066: dup - IL_0067: stloc.1 - IL_0068: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_006d: ldarg.0 - IL_006e: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0073: stloc.3 - IL_0074: ldarg.0 - IL_0075: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_007a: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0080: br.s IL_0082 - IL_0082: ldloca.s V_3 - IL_0084: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_0089: stloc.s V_5 - IL_008b: ldloca.s V_3 - IL_008d: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0093: ldloc.s V_5 - IL_0095: stloc.0 - IL_0096: leave.s IL_00bd + IL_0011: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" + IL_0016: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$0 As Integer"" + IL_001b: ldarg.0 + IL_001c: ldc.i4.s 10 + IL_001e: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" + IL_0023: nop + IL_0024: ldarg.0 + IL_0025: ldfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" + IL_002a: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" + IL_002f: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0034: stloc.3 + IL_0035: ldloca.s V_3 + IL_0037: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_003c: brtrue.s IL_0081 + IL_003e: ldarg.0 + IL_003f: ldc.i4.0 + IL_0040: dup + IL_0041: stloc.1 + IL_0042: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0047: ldarg.0 + IL_0048: ldloc.3 + IL_0049: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_004e: ldarg.0 + IL_004f: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0054: ldloca.s V_3 + IL_0056: ldarg.0 + IL_0057: stloc.s V_4 + IL_0059: ldloca.s V_4 + IL_005b: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" + IL_0060: nop + IL_0061: leave.s IL_00d3 + IL_0063: ldarg.0 + IL_0064: ldc.i4.m1 + IL_0065: dup + IL_0066: stloc.1 + IL_0067: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_006c: ldarg.0 + IL_006d: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0072: stloc.3 + IL_0073: ldarg.0 + IL_0074: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0079: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_007f: br.s IL_0081 + IL_0081: ldloca.s V_3 + IL_0083: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_0088: stloc.s V_5 + IL_008a: ldloca.s V_3 + IL_008c: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0092: ldloc.s V_5 + IL_0094: stloc.0 + IL_0095: leave.s IL_00bc } catch System.Exception { - IL_0098: dup - IL_0099: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_009e: stloc.s V_6 - IL_00a0: ldarg.0 - IL_00a1: ldc.i4.s -2 - IL_00a3: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00a8: ldarg.0 - IL_00a9: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00ae: ldloc.s V_6 - IL_00b0: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00b5: nop - IL_00b6: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00bb: leave.s IL_00d4 + IL_0097: dup + IL_0098: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_009d: stloc.s V_6 + IL_009f: ldarg.0 + IL_00a0: ldc.i4.s -2 + IL_00a2: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00a7: ldarg.0 + IL_00a8: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00ad: ldloc.s V_6 + IL_00af: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00b4: nop + IL_00b5: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00ba: leave.s IL_00d3 } - IL_00bd: ldarg.0 - IL_00be: ldc.i4.s -2 - IL_00c0: dup - IL_00c1: stloc.1 - IL_00c2: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00c7: ldarg.0 - IL_00c8: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00cd: ldloc.0 - IL_00ce: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00d3: nop - IL_00d4: ret + IL_00bc: ldarg.0 + IL_00bd: ldc.i4.s -2 + IL_00bf: dup + IL_00c0: stloc.1 + IL_00c1: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00c6: ldarg.0 + IL_00c7: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00cc: ldloc.0 + IL_00cd: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00d2: nop + IL_00d3: ret } ") End Using @@ -2522,7 +2492,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 204 (0xcc) + // Code size 203 (0xcb) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -2538,87 +2508,86 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_005b - IL_000f: nop - IL_0010: ldarg.0 - IL_0011: ldc.i4 0x4d2 - IL_0016: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" - IL_001b: nop - IL_001c: ldarg.0 - IL_001d: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" - IL_0022: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" - IL_0027: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_002c: stloc.3 - IL_002d: ldloca.s V_3 - IL_002f: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_0034: brtrue.s IL_0079 - IL_0036: ldarg.0 - IL_0037: ldc.i4.0 - IL_0038: dup - IL_0039: stloc.1 - IL_003a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_003f: ldarg.0 - IL_0040: ldloc.3 - IL_0041: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0046: ldarg.0 - IL_0047: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_004c: ldloca.s V_3 - IL_004e: ldarg.0 - IL_004f: stloc.s V_4 - IL_0051: ldloca.s V_4 - IL_0053: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" - IL_0058: nop - IL_0059: leave.s IL_00cb - IL_005b: ldarg.0 - IL_005c: ldc.i4.m1 - IL_005d: dup - IL_005e: stloc.1 - IL_005f: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0064: ldarg.0 - IL_0065: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_006a: stloc.3 - IL_006b: ldarg.0 - IL_006c: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0071: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0077: br.s IL_0079 - IL_0079: ldloca.s V_3 - IL_007b: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_0080: stloc.s V_5 - IL_0082: ldloca.s V_3 - IL_0084: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_008a: ldloc.s V_5 - IL_008c: stloc.0 - IL_008d: leave.s IL_00b4 + IL_000a: br.s IL_000e + IL_000c: br.s IL_005a + IL_000e: nop + IL_000f: ldarg.0 + IL_0010: ldc.i4 0x4d2 + IL_0015: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_y$1 As Integer"" + IL_001a: nop + IL_001b: ldarg.0 + IL_001c: ldfld ""C.VB$StateMachine_1_F.$VB$Local_p As Integer"" + IL_0021: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" + IL_0026: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_002b: stloc.3 + IL_002c: ldloca.s V_3 + IL_002e: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_0033: brtrue.s IL_0078 + IL_0035: ldarg.0 + IL_0036: ldc.i4.0 + IL_0037: dup + IL_0038: stloc.1 + IL_0039: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003e: ldarg.0 + IL_003f: ldloc.3 + IL_0040: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0045: ldarg.0 + IL_0046: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_004b: ldloca.s V_3 + IL_004d: ldarg.0 + IL_004e: stloc.s V_4 + IL_0050: ldloca.s V_4 + IL_0052: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" + IL_0057: nop + IL_0058: leave.s IL_00ca + IL_005a: ldarg.0 + IL_005b: ldc.i4.m1 + IL_005c: dup + IL_005d: stloc.1 + IL_005e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0063: ldarg.0 + IL_0064: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0069: stloc.3 + IL_006a: ldarg.0 + IL_006b: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0070: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0076: br.s IL_0078 + IL_0078: ldloca.s V_3 + IL_007a: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_007f: stloc.s V_5 + IL_0081: ldloca.s V_3 + IL_0083: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0089: ldloc.s V_5 + IL_008b: stloc.0 + IL_008c: leave.s IL_00b3 } catch System.Exception { - IL_008f: dup - IL_0090: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0095: stloc.s V_6 - IL_0097: ldarg.0 - IL_0098: ldc.i4.s -2 - IL_009a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_009f: ldarg.0 - IL_00a0: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00a5: ldloc.s V_6 - IL_00a7: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00ac: nop - IL_00ad: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00b2: leave.s IL_00cb + IL_008e: dup + IL_008f: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0094: stloc.s V_6 + IL_0096: ldarg.0 + IL_0097: ldc.i4.s -2 + IL_0099: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_009e: ldarg.0 + IL_009f: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00a4: ldloc.s V_6 + IL_00a6: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00ab: nop + IL_00ac: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00b1: leave.s IL_00ca } - IL_00b4: ldarg.0 - IL_00b5: ldc.i4.s -2 - IL_00b7: dup - IL_00b8: stloc.1 - IL_00b9: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00be: ldarg.0 - IL_00bf: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c4: ldloc.0 - IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00ca: nop - IL_00cb: ret + IL_00b3: ldarg.0 + IL_00b4: ldc.i4.s -2 + IL_00b6: dup + IL_00b7: stloc.1 + IL_00b8: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00bd: ldarg.0 + IL_00be: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00c3: ldloc.0 + IL_00c4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00c9: nop + IL_00ca: ret } ") End Using @@ -2688,7 +2657,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 204 (0xcc) + // Code size 203 (0xcb) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -2704,86 +2673,85 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_005b - IL_000f: nop - IL_0010: ldarg.0 - IL_0011: ldc.r8 10 - IL_001a: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$1 As Double"" - IL_001f: nop - IL_0020: ldc.i4.s 20 - IL_0022: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" - IL_0027: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_002c: stloc.3 - IL_002d: ldloca.s V_3 - IL_002f: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_0034: brtrue.s IL_0079 - IL_0036: ldarg.0 - IL_0037: ldc.i4.0 - IL_0038: dup - IL_0039: stloc.1 - IL_003a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_003f: ldarg.0 - IL_0040: ldloc.3 - IL_0041: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0046: ldarg.0 - IL_0047: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_004c: ldloca.s V_3 - IL_004e: ldarg.0 - IL_004f: stloc.s V_4 - IL_0051: ldloca.s V_4 - IL_0053: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" - IL_0058: nop - IL_0059: leave.s IL_00cb - IL_005b: ldarg.0 - IL_005c: ldc.i4.m1 - IL_005d: dup - IL_005e: stloc.1 - IL_005f: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0064: ldarg.0 - IL_0065: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_006a: stloc.3 - IL_006b: ldarg.0 - IL_006c: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0071: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0077: br.s IL_0079 - IL_0079: ldloca.s V_3 - IL_007b: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_0080: stloc.s V_5 - IL_0082: ldloca.s V_3 - IL_0084: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_008a: ldloc.s V_5 - IL_008c: stloc.0 - IL_008d: leave.s IL_00b4 + IL_000a: br.s IL_000e + IL_000c: br.s IL_005a + IL_000e: nop + IL_000f: ldarg.0 + IL_0010: ldc.r8 10 + IL_0019: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_x$1 As Double"" + IL_001e: nop + IL_001f: ldc.i4.s 20 + IL_0021: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" + IL_0026: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_002b: stloc.3 + IL_002c: ldloca.s V_3 + IL_002e: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_0033: brtrue.s IL_0078 + IL_0035: ldarg.0 + IL_0036: ldc.i4.0 + IL_0037: dup + IL_0038: stloc.1 + IL_0039: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_003e: ldarg.0 + IL_003f: ldloc.3 + IL_0040: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0045: ldarg.0 + IL_0046: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_004b: ldloca.s V_3 + IL_004d: ldarg.0 + IL_004e: stloc.s V_4 + IL_0050: ldloca.s V_4 + IL_0052: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_1_F)"" + IL_0057: nop + IL_0058: leave.s IL_00ca + IL_005a: ldarg.0 + IL_005b: ldc.i4.m1 + IL_005c: dup + IL_005d: stloc.1 + IL_005e: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0063: ldarg.0 + IL_0064: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0069: stloc.3 + IL_006a: ldarg.0 + IL_006b: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0070: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0076: br.s IL_0078 + IL_0078: ldloca.s V_3 + IL_007a: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_007f: stloc.s V_5 + IL_0081: ldloca.s V_3 + IL_0083: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0089: ldloc.s V_5 + IL_008b: stloc.0 + IL_008c: leave.s IL_00b3 } catch System.Exception { - IL_008f: dup - IL_0090: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0095: stloc.s V_6 - IL_0097: ldarg.0 - IL_0098: ldc.i4.s -2 - IL_009a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_009f: ldarg.0 - IL_00a0: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00a5: ldloc.s V_6 - IL_00a7: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00ac: nop - IL_00ad: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00b2: leave.s IL_00cb + IL_008e: dup + IL_008f: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0094: stloc.s V_6 + IL_0096: ldarg.0 + IL_0097: ldc.i4.s -2 + IL_0099: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_009e: ldarg.0 + IL_009f: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00a4: ldloc.s V_6 + IL_00a6: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00ab: nop + IL_00ac: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00b1: leave.s IL_00ca } - IL_00b4: ldarg.0 - IL_00b5: ldc.i4.s -2 - IL_00b7: dup - IL_00b8: stloc.1 - IL_00b9: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00be: ldarg.0 - IL_00bf: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c4: ldloc.0 - IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00ca: nop - IL_00cb: ret + IL_00b3: ldarg.0 + IL_00b4: ldc.i4.s -2 + IL_00b6: dup + IL_00b7: stloc.1 + IL_00b8: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00bd: ldarg.0 + IL_00be: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00c3: ldloc.0 + IL_00c4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00c9: nop + IL_00ca: ret } ") End Using @@ -3010,7 +2978,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 204 (0xcc) + // Code size 203 (0xcb) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -3025,89 +2993,88 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_005d - IL_000f: nop - IL_0010: ldarg.0 - IL_0011: newobj ""Sub C..ctor()"" - IL_0016: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a1$2 As C"" - IL_001b: ldarg.0 - IL_001c: ldc.i4.3 - IL_001d: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a2$1 As Integer"" - IL_0022: nop - IL_0023: ldc.i4.0 - IL_0024: call ""Function System.Threading.Tasks.Task.Delay(Integer) As System.Threading.Tasks.Task"" - IL_0029: callvirt ""Function System.Threading.Tasks.Task.GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter"" - IL_002e: stloc.3 - IL_002f: ldloca.s V_3 - IL_0031: call ""Function System.Runtime.CompilerServices.TaskAwaiter.get_IsCompleted() As Boolean"" - IL_0036: brtrue.s IL_007b - IL_0038: ldarg.0 - IL_0039: ldc.i4.0 - IL_003a: dup - IL_003b: stloc.1 - IL_003c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0041: ldarg.0 - IL_0042: ldloc.3 - IL_0043: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" - IL_0048: ldarg.0 - IL_0049: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_004e: ldloca.s V_3 - IL_0050: ldarg.0 - IL_0051: stloc.s V_4 - IL_0053: ldloca.s V_4 - IL_0055: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter, C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter, ByRef C.VB$StateMachine_1_F)"" - IL_005a: nop - IL_005b: leave.s IL_00cb - IL_005d: ldarg.0 - IL_005e: ldc.i4.m1 - IL_005f: dup - IL_0060: stloc.1 - IL_0061: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0066: ldarg.0 - IL_0067: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" - IL_006c: stloc.3 - IL_006d: ldarg.0 - IL_006e: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" - IL_0073: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_0079: br.s IL_007b - IL_007b: ldloca.s V_3 - IL_007d: call ""Sub System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" - IL_0082: nop - IL_0083: ldloca.s V_3 - IL_0085: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_008b: ldc.i4.1 - IL_008c: stloc.0 - IL_008d: leave.s IL_00b4 + IL_000a: br.s IL_000e + IL_000c: br.s IL_005c + IL_000e: nop + IL_000f: ldarg.0 + IL_0010: newobj ""Sub C..ctor()"" + IL_0015: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a1$2 As C"" + IL_001a: ldarg.0 + IL_001b: ldc.i4.3 + IL_001c: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a2$1 As Integer"" + IL_0021: nop + IL_0022: ldc.i4.0 + IL_0023: call ""Function System.Threading.Tasks.Task.Delay(Integer) As System.Threading.Tasks.Task"" + IL_0028: callvirt ""Function System.Threading.Tasks.Task.GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter"" + IL_002d: stloc.3 + IL_002e: ldloca.s V_3 + IL_0030: call ""Function System.Runtime.CompilerServices.TaskAwaiter.get_IsCompleted() As Boolean"" + IL_0035: brtrue.s IL_007a + IL_0037: ldarg.0 + IL_0038: ldc.i4.0 + IL_0039: dup + IL_003a: stloc.1 + IL_003b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0040: ldarg.0 + IL_0041: ldloc.3 + IL_0042: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_0047: ldarg.0 + IL_0048: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_004d: ldloca.s V_3 + IL_004f: ldarg.0 + IL_0050: stloc.s V_4 + IL_0052: ldloca.s V_4 + IL_0054: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter, C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter, ByRef C.VB$StateMachine_1_F)"" + IL_0059: nop + IL_005a: leave.s IL_00ca + IL_005c: ldarg.0 + IL_005d: ldc.i4.m1 + IL_005e: dup + IL_005f: stloc.1 + IL_0060: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0065: ldarg.0 + IL_0066: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_006b: stloc.3 + IL_006c: ldarg.0 + IL_006d: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_0072: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_0078: br.s IL_007a + IL_007a: ldloca.s V_3 + IL_007c: call ""Sub System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" + IL_0081: nop + IL_0082: ldloca.s V_3 + IL_0084: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_008a: ldc.i4.1 + IL_008b: stloc.0 + IL_008c: leave.s IL_00b3 } catch System.Exception { - IL_008f: dup - IL_0090: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0095: stloc.s V_5 - IL_0097: ldarg.0 - IL_0098: ldc.i4.s -2 - IL_009a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_009f: ldarg.0 - IL_00a0: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00a5: ldloc.s V_5 - IL_00a7: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00ac: nop - IL_00ad: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00b2: leave.s IL_00cb + IL_008e: dup + IL_008f: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0094: stloc.s V_5 + IL_0096: ldarg.0 + IL_0097: ldc.i4.s -2 + IL_0099: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_009e: ldarg.0 + IL_009f: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00a4: ldloc.s V_5 + IL_00a6: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00ab: nop + IL_00ac: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00b1: leave.s IL_00ca } - IL_00b4: ldarg.0 - IL_00b5: ldc.i4.s -2 - IL_00b7: dup - IL_00b8: stloc.1 - IL_00b9: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00be: ldarg.0 - IL_00bf: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c4: ldloc.0 - IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00ca: nop - IL_00cb: ret + IL_00b3: ldarg.0 + IL_00b4: ldc.i4.s -2 + IL_00b6: dup + IL_00b7: stloc.1 + IL_00b8: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00bd: ldarg.0 + IL_00be: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00c3: ldloc.0 + IL_00c4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00c9: nop + IL_00ca: ret } ") @@ -3126,7 +3093,7 @@ End Class diff2.VerifyIL("C.VB$StateMachine_1_F.MoveNext()", " { - // Code size 204 (0xcc) + // Code size 203 (0xcb) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -3141,89 +3108,88 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_005d - IL_000f: nop - IL_0010: ldarg.0 - IL_0011: ldc.i4.1 - IL_0012: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a1$3 As Boolean"" - IL_0017: ldarg.0 - IL_0018: newobj ""Sub C..ctor()"" - IL_001d: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a2$4 As C"" - IL_0022: nop - IL_0023: ldc.i4.0 - IL_0024: call ""Function System.Threading.Tasks.Task.Delay(Integer) As System.Threading.Tasks.Task"" - IL_0029: callvirt ""Function System.Threading.Tasks.Task.GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter"" - IL_002e: stloc.3 - IL_002f: ldloca.s V_3 - IL_0031: call ""Function System.Runtime.CompilerServices.TaskAwaiter.get_IsCompleted() As Boolean"" - IL_0036: brtrue.s IL_007b - IL_0038: ldarg.0 - IL_0039: ldc.i4.0 - IL_003a: dup - IL_003b: stloc.1 - IL_003c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0041: ldarg.0 - IL_0042: ldloc.3 - IL_0043: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" - IL_0048: ldarg.0 - IL_0049: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_004e: ldloca.s V_3 - IL_0050: ldarg.0 - IL_0051: stloc.s V_4 - IL_0053: ldloca.s V_4 - IL_0055: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter, C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter, ByRef C.VB$StateMachine_1_F)"" - IL_005a: nop - IL_005b: leave.s IL_00cb - IL_005d: ldarg.0 - IL_005e: ldc.i4.m1 - IL_005f: dup - IL_0060: stloc.1 - IL_0061: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_0066: ldarg.0 - IL_0067: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" - IL_006c: stloc.3 - IL_006d: ldarg.0 - IL_006e: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" - IL_0073: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_0079: br.s IL_007b - IL_007b: ldloca.s V_3 - IL_007d: call ""Sub System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" - IL_0082: nop - IL_0083: ldloca.s V_3 - IL_0085: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" - IL_008b: ldc.i4.1 - IL_008c: stloc.0 - IL_008d: leave.s IL_00b4 + IL_000a: br.s IL_000e + IL_000c: br.s IL_005c + IL_000e: nop + IL_000f: ldarg.0 + IL_0010: ldc.i4.1 + IL_0011: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a1$3 As Boolean"" + IL_0016: ldarg.0 + IL_0017: newobj ""Sub C..ctor()"" + IL_001c: stfld ""C.VB$StateMachine_1_F.$VB$ResumableLocal_a2$4 As C"" + IL_0021: nop + IL_0022: ldc.i4.0 + IL_0023: call ""Function System.Threading.Tasks.Task.Delay(Integer) As System.Threading.Tasks.Task"" + IL_0028: callvirt ""Function System.Threading.Tasks.Task.GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter"" + IL_002d: stloc.3 + IL_002e: ldloca.s V_3 + IL_0030: call ""Function System.Runtime.CompilerServices.TaskAwaiter.get_IsCompleted() As Boolean"" + IL_0035: brtrue.s IL_007a + IL_0037: ldarg.0 + IL_0038: ldc.i4.0 + IL_0039: dup + IL_003a: stloc.1 + IL_003b: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0040: ldarg.0 + IL_0041: ldloc.3 + IL_0042: stfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_0047: ldarg.0 + IL_0048: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_004d: ldloca.s V_3 + IL_004f: ldarg.0 + IL_0050: stloc.s V_4 + IL_0052: ldloca.s V_4 + IL_0054: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter, C.VB$StateMachine_1_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter, ByRef C.VB$StateMachine_1_F)"" + IL_0059: nop + IL_005a: leave.s IL_00ca + IL_005c: ldarg.0 + IL_005d: ldc.i4.m1 + IL_005e: dup + IL_005f: stloc.1 + IL_0060: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0065: ldarg.0 + IL_0066: ldfld ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_006b: stloc.3 + IL_006c: ldarg.0 + IL_006d: ldflda ""C.VB$StateMachine_1_F.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_0072: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_0078: br.s IL_007a + IL_007a: ldloca.s V_3 + IL_007c: call ""Sub System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" + IL_0081: nop + IL_0082: ldloca.s V_3 + IL_0084: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_008a: ldc.i4.1 + IL_008b: stloc.0 + IL_008c: leave.s IL_00b3 } catch System.Exception { - IL_008f: dup - IL_0090: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0095: stloc.s V_5 - IL_0097: ldarg.0 - IL_0098: ldc.i4.s -2 - IL_009a: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_009f: ldarg.0 - IL_00a0: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00a5: ldloc.s V_5 - IL_00a7: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00ac: nop - IL_00ad: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00b2: leave.s IL_00cb + IL_008e: dup + IL_008f: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0094: stloc.s V_5 + IL_0096: ldarg.0 + IL_0097: ldc.i4.s -2 + IL_0099: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_009e: ldarg.0 + IL_009f: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00a4: ldloc.s V_5 + IL_00a6: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00ab: nop + IL_00ac: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00b1: leave.s IL_00ca } - IL_00b4: ldarg.0 - IL_00b5: ldc.i4.s -2 - IL_00b7: dup - IL_00b8: stloc.1 - IL_00b9: stfld ""C.VB$StateMachine_1_F.$State As Integer"" - IL_00be: ldarg.0 - IL_00bf: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c4: ldloc.0 - IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00ca: nop - IL_00cb: ret + IL_00b3: ldarg.0 + IL_00b4: ldc.i4.s -2 + IL_00b6: dup + IL_00b7: stloc.1 + IL_00b8: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_00bd: ldarg.0 + IL_00be: ldflda ""C.VB$StateMachine_1_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00c3: ldloc.0 + IL_00c4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00c9: nop + IL_00ca: ret } ") @@ -3523,7 +3489,7 @@ End Class diff1.VerifyIL("C.VB$StateMachine_4_F.MoveNext()", " { - // Code size 319 (0x13f) + // Code size 317 (0x13d) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -3542,130 +3508,128 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_001b - IL_0012: nop - IL_0013: br.s IL_005f - IL_0015: nop - IL_0016: br IL_00cf - IL_001b: nop - IL_001c: nop - IL_001d: ldarg.0 - IL_001e: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" - IL_0023: callvirt ""Function C.A3() As System.Threading.Tasks.Task(Of C)"" - IL_0028: callvirt ""Function System.Threading.Tasks.Task(Of C).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_002d: stloc.3 - IL_002e: ldloca.s V_3 - IL_0030: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).get_IsCompleted() As Boolean"" - IL_0035: brtrue.s IL_007d - IL_0037: ldarg.0 - IL_0038: ldc.i4.0 - IL_0039: dup - IL_003a: stloc.1 - IL_003b: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0040: ldarg.0 - IL_0041: ldloc.3 - IL_0042: stfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_0047: ldarg.0 - IL_0048: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_004d: ldloca.s V_3 - IL_004f: ldarg.0 - IL_0050: stloc.s V_4 - IL_0052: ldloca.s V_4 - IL_0054: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of C), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of C), ByRef C.VB$StateMachine_4_F)"" - IL_0059: nop - IL_005a: leave IL_013e - IL_005f: ldarg.0 - IL_0060: ldc.i4.m1 - IL_0061: dup - IL_0062: stloc.1 - IL_0063: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0068: ldarg.0 - IL_0069: ldfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_006e: stloc.3 - IL_006f: ldarg.0 - IL_0070: ldflda ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_0075: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_007b: br.s IL_007d - IL_007d: ldloca.s V_3 - IL_007f: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).GetResult() As C"" - IL_0084: pop - IL_0085: ldloca.s V_3 - IL_0087: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_008d: nop - IL_008e: ldarg.0 - IL_008f: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" - IL_0094: callvirt ""Function C.A2() As System.Threading.Tasks.Task(Of Integer)"" - IL_0099: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_009e: stloc.s V_5 - IL_00a0: ldloca.s V_5 - IL_00a2: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_00a7: brtrue.s IL_00ee - IL_00a9: ldarg.0 - IL_00aa: ldc.i4.1 - IL_00ab: dup - IL_00ac: stloc.1 - IL_00ad: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_00b2: ldarg.0 - IL_00b3: ldloc.s V_5 - IL_00b5: stfld ""C.VB$StateMachine_4_F.$A1 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_00ba: ldarg.0 - IL_00bb: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c0: ldloca.s V_5 - IL_00c2: ldarg.0 - IL_00c3: stloc.s V_4 - IL_00c5: ldloca.s V_4 - IL_00c7: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_4_F)"" - IL_00cc: nop - IL_00cd: leave.s IL_013e - IL_00cf: ldarg.0 - IL_00d0: ldc.i4.m1 - IL_00d1: dup - IL_00d2: stloc.1 - IL_00d3: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_00d8: ldarg.0 - IL_00d9: ldfld ""C.VB$StateMachine_4_F.$A1 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_00de: stloc.s V_5 - IL_00e0: ldarg.0 - IL_00e1: ldflda ""C.VB$StateMachine_4_F.$A1 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_00e6: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_00ec: br.s IL_00ee - IL_00ee: ldloca.s V_5 - IL_00f0: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_00f5: pop - IL_00f6: ldloca.s V_5 - IL_00f8: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_00fe: ldc.i4.1 - IL_00ff: stloc.0 - IL_0100: leave.s IL_0127 + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0019 + IL_0012: br.s IL_005d + IL_0014: br IL_00cd + IL_0019: nop + IL_001a: nop + IL_001b: ldarg.0 + IL_001c: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" + IL_0021: callvirt ""Function C.A3() As System.Threading.Tasks.Task(Of C)"" + IL_0026: callvirt ""Function System.Threading.Tasks.Task(Of C).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_002b: stloc.3 + IL_002c: ldloca.s V_3 + IL_002e: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).get_IsCompleted() As Boolean"" + IL_0033: brtrue.s IL_007b + IL_0035: ldarg.0 + IL_0036: ldc.i4.0 + IL_0037: dup + IL_0038: stloc.1 + IL_0039: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_003e: ldarg.0 + IL_003f: ldloc.3 + IL_0040: stfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_0045: ldarg.0 + IL_0046: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_004b: ldloca.s V_3 + IL_004d: ldarg.0 + IL_004e: stloc.s V_4 + IL_0050: ldloca.s V_4 + IL_0052: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of C), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of C), ByRef C.VB$StateMachine_4_F)"" + IL_0057: nop + IL_0058: leave IL_013c + IL_005d: ldarg.0 + IL_005e: ldc.i4.m1 + IL_005f: dup + IL_0060: stloc.1 + IL_0061: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_0066: ldarg.0 + IL_0067: ldfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_006c: stloc.3 + IL_006d: ldarg.0 + IL_006e: ldflda ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_0073: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_0079: br.s IL_007b + IL_007b: ldloca.s V_3 + IL_007d: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).GetResult() As C"" + IL_0082: pop + IL_0083: ldloca.s V_3 + IL_0085: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_008b: nop + IL_008c: ldarg.0 + IL_008d: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" + IL_0092: callvirt ""Function C.A2() As System.Threading.Tasks.Task(Of Integer)"" + IL_0097: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_009c: stloc.s V_5 + IL_009e: ldloca.s V_5 + IL_00a0: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_00a5: brtrue.s IL_00ec + IL_00a7: ldarg.0 + IL_00a8: ldc.i4.1 + IL_00a9: dup + IL_00aa: stloc.1 + IL_00ab: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_00b0: ldarg.0 + IL_00b1: ldloc.s V_5 + IL_00b3: stfld ""C.VB$StateMachine_4_F.$A1 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_00b8: ldarg.0 + IL_00b9: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00be: ldloca.s V_5 + IL_00c0: ldarg.0 + IL_00c1: stloc.s V_4 + IL_00c3: ldloca.s V_4 + IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_4_F)"" + IL_00ca: nop + IL_00cb: leave.s IL_013c + IL_00cd: ldarg.0 + IL_00ce: ldc.i4.m1 + IL_00cf: dup + IL_00d0: stloc.1 + IL_00d1: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_00d6: ldarg.0 + IL_00d7: ldfld ""C.VB$StateMachine_4_F.$A1 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_00dc: stloc.s V_5 + IL_00de: ldarg.0 + IL_00df: ldflda ""C.VB$StateMachine_4_F.$A1 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_00e4: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_00ea: br.s IL_00ec + IL_00ec: ldloca.s V_5 + IL_00ee: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_00f3: pop + IL_00f4: ldloca.s V_5 + IL_00f6: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_00fc: ldc.i4.1 + IL_00fd: stloc.0 + IL_00fe: leave.s IL_0125 } catch System.Exception { - IL_0102: dup - IL_0103: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0108: stloc.s V_6 - IL_010a: ldarg.0 - IL_010b: ldc.i4.s -2 - IL_010d: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0112: ldarg.0 - IL_0113: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0118: ldloc.s V_6 - IL_011a: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_011f: nop - IL_0120: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_0125: leave.s IL_013e + IL_0100: dup + IL_0101: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0106: stloc.s V_6 + IL_0108: ldarg.0 + IL_0109: ldc.i4.s -2 + IL_010b: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_0110: ldarg.0 + IL_0111: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0116: ldloc.s V_6 + IL_0118: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_011d: nop + IL_011e: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_0123: leave.s IL_013c } - IL_0127: ldarg.0 - IL_0128: ldc.i4.s -2 - IL_012a: dup - IL_012b: stloc.1 - IL_012c: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0131: ldarg.0 - IL_0132: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0137: ldloc.0 - IL_0138: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_013d: nop - IL_013e: ret + IL_0125: ldarg.0 + IL_0126: ldc.i4.s -2 + IL_0128: dup + IL_0129: stloc.1 + IL_012a: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_012f: ldarg.0 + IL_0130: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0135: ldloc.0 + IL_0136: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_013b: nop + IL_013c: ret } ") @@ -3682,7 +3646,7 @@ End Class diff2.VerifyIL("C.VB$StateMachine_4_F.MoveNext()", " { - // Code size 319 (0x13f) + // Code size 317 (0x13d) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -3701,130 +3665,128 @@ End Class IL_000a: br.s IL_000c IL_000c: ldloc.1 IL_000d: ldc.i4.1 - IL_000e: beq.s IL_0015 - IL_0010: br.s IL_001b - IL_0012: nop - IL_0013: br.s IL_005f - IL_0015: nop - IL_0016: br IL_00cf - IL_001b: nop - IL_001c: nop - IL_001d: ldarg.0 - IL_001e: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" - IL_0023: callvirt ""Function C.A1() As System.Threading.Tasks.Task(Of Boolean)"" - IL_0028: callvirt ""Function System.Threading.Tasks.Task(Of Boolean).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" - IL_002d: stloc.3 - IL_002e: ldloca.s V_3 - IL_0030: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Boolean).get_IsCompleted() As Boolean"" - IL_0035: brtrue.s IL_007d - IL_0037: ldarg.0 - IL_0038: ldc.i4.0 - IL_0039: dup - IL_003a: stloc.1 - IL_003b: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0040: ldarg.0 - IL_0041: ldloc.3 - IL_0042: stfld ""C.VB$StateMachine_4_F.$A3 As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" - IL_0047: ldarg.0 - IL_0048: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_004d: ldloca.s V_3 - IL_004f: ldarg.0 - IL_0050: stloc.s V_4 - IL_0052: ldloca.s V_4 - IL_0054: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Boolean), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Boolean), ByRef C.VB$StateMachine_4_F)"" - IL_0059: nop - IL_005a: leave IL_013e - IL_005f: ldarg.0 - IL_0060: ldc.i4.m1 - IL_0061: dup - IL_0062: stloc.1 - IL_0063: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0068: ldarg.0 - IL_0069: ldfld ""C.VB$StateMachine_4_F.$A3 As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" - IL_006e: stloc.3 - IL_006f: ldarg.0 - IL_0070: ldflda ""C.VB$StateMachine_4_F.$A3 As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" - IL_0075: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" - IL_007b: br.s IL_007d - IL_007d: ldloca.s V_3 - IL_007f: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Boolean).GetResult() As Boolean"" - IL_0084: pop - IL_0085: ldloca.s V_3 - IL_0087: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" - IL_008d: nop - IL_008e: ldarg.0 - IL_008f: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" - IL_0094: callvirt ""Function C.A3() As System.Threading.Tasks.Task(Of C)"" - IL_0099: callvirt ""Function System.Threading.Tasks.Task(Of C).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_009e: stloc.s V_5 - IL_00a0: ldloca.s V_5 - IL_00a2: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).get_IsCompleted() As Boolean"" - IL_00a7: brtrue.s IL_00ee - IL_00a9: ldarg.0 - IL_00aa: ldc.i4.1 - IL_00ab: dup - IL_00ac: stloc.1 - IL_00ad: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_00b2: ldarg.0 - IL_00b3: ldloc.s V_5 - IL_00b5: stfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_00ba: ldarg.0 - IL_00bb: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c0: ldloca.s V_5 - IL_00c2: ldarg.0 - IL_00c3: stloc.s V_4 - IL_00c5: ldloca.s V_4 - IL_00c7: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of C), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of C), ByRef C.VB$StateMachine_4_F)"" - IL_00cc: nop - IL_00cd: leave.s IL_013e - IL_00cf: ldarg.0 - IL_00d0: ldc.i4.m1 - IL_00d1: dup - IL_00d2: stloc.1 - IL_00d3: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_00d8: ldarg.0 - IL_00d9: ldfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_00de: stloc.s V_5 - IL_00e0: ldarg.0 - IL_00e1: ldflda ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_00e6: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_00ec: br.s IL_00ee - IL_00ee: ldloca.s V_5 - IL_00f0: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).GetResult() As C"" - IL_00f5: pop - IL_00f6: ldloca.s V_5 - IL_00f8: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" - IL_00fe: ldc.i4.1 - IL_00ff: stloc.0 - IL_0100: leave.s IL_0127 + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0019 + IL_0012: br.s IL_005d + IL_0014: br IL_00cd + IL_0019: nop + IL_001a: nop + IL_001b: ldarg.0 + IL_001c: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" + IL_0021: callvirt ""Function C.A1() As System.Threading.Tasks.Task(Of Boolean)"" + IL_0026: callvirt ""Function System.Threading.Tasks.Task(Of Boolean).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" + IL_002b: stloc.3 + IL_002c: ldloca.s V_3 + IL_002e: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Boolean).get_IsCompleted() As Boolean"" + IL_0033: brtrue.s IL_007b + IL_0035: ldarg.0 + IL_0036: ldc.i4.0 + IL_0037: dup + IL_0038: stloc.1 + IL_0039: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_003e: ldarg.0 + IL_003f: ldloc.3 + IL_0040: stfld ""C.VB$StateMachine_4_F.$A3 As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" + IL_0045: ldarg.0 + IL_0046: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_004b: ldloca.s V_3 + IL_004d: ldarg.0 + IL_004e: stloc.s V_4 + IL_0050: ldloca.s V_4 + IL_0052: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Boolean), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Boolean), ByRef C.VB$StateMachine_4_F)"" + IL_0057: nop + IL_0058: leave IL_013c + IL_005d: ldarg.0 + IL_005e: ldc.i4.m1 + IL_005f: dup + IL_0060: stloc.1 + IL_0061: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_0066: ldarg.0 + IL_0067: ldfld ""C.VB$StateMachine_4_F.$A3 As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" + IL_006c: stloc.3 + IL_006d: ldarg.0 + IL_006e: ldflda ""C.VB$StateMachine_4_F.$A3 As System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" + IL_0073: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" + IL_0079: br.s IL_007b + IL_007b: ldloca.s V_3 + IL_007d: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Boolean).GetResult() As Boolean"" + IL_0082: pop + IL_0083: ldloca.s V_3 + IL_0085: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Boolean)"" + IL_008b: nop + IL_008c: ldarg.0 + IL_008d: ldfld ""C.VB$StateMachine_4_F.$VB$Me As C"" + IL_0092: callvirt ""Function C.A3() As System.Threading.Tasks.Task(Of C)"" + IL_0097: callvirt ""Function System.Threading.Tasks.Task(Of C).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_009c: stloc.s V_5 + IL_009e: ldloca.s V_5 + IL_00a0: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).get_IsCompleted() As Boolean"" + IL_00a5: brtrue.s IL_00ec + IL_00a7: ldarg.0 + IL_00a8: ldc.i4.1 + IL_00a9: dup + IL_00aa: stloc.1 + IL_00ab: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_00b0: ldarg.0 + IL_00b1: ldloc.s V_5 + IL_00b3: stfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_00b8: ldarg.0 + IL_00b9: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00be: ldloca.s V_5 + IL_00c0: ldarg.0 + IL_00c1: stloc.s V_4 + IL_00c3: ldloca.s V_4 + IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of C), C.VB$StateMachine_4_F)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of C), ByRef C.VB$StateMachine_4_F)"" + IL_00ca: nop + IL_00cb: leave.s IL_013c + IL_00cd: ldarg.0 + IL_00ce: ldc.i4.m1 + IL_00cf: dup + IL_00d0: stloc.1 + IL_00d1: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_00d6: ldarg.0 + IL_00d7: ldfld ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_00dc: stloc.s V_5 + IL_00de: ldarg.0 + IL_00df: ldflda ""C.VB$StateMachine_4_F.$A2 As System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_00e4: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_00ea: br.s IL_00ec + IL_00ec: ldloca.s V_5 + IL_00ee: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of C).GetResult() As C"" + IL_00f3: pop + IL_00f4: ldloca.s V_5 + IL_00f6: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of C)"" + IL_00fc: ldc.i4.1 + IL_00fd: stloc.0 + IL_00fe: leave.s IL_0125 } catch System.Exception { - IL_0102: dup - IL_0103: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_0108: stloc.s V_6 - IL_010a: ldarg.0 - IL_010b: ldc.i4.s -2 - IL_010d: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0112: ldarg.0 - IL_0113: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0118: ldloc.s V_6 - IL_011a: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_011f: nop - IL_0120: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_0125: leave.s IL_013e + IL_0100: dup + IL_0101: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0106: stloc.s V_6 + IL_0108: ldarg.0 + IL_0109: ldc.i4.s -2 + IL_010b: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_0110: ldarg.0 + IL_0111: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0116: ldloc.s V_6 + IL_0118: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_011d: nop + IL_011e: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_0123: leave.s IL_013c } - IL_0127: ldarg.0 - IL_0128: ldc.i4.s -2 - IL_012a: dup - IL_012b: stloc.1 - IL_012c: stfld ""C.VB$StateMachine_4_F.$State As Integer"" - IL_0131: ldarg.0 - IL_0132: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_0137: ldloc.0 - IL_0138: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_013d: nop - IL_013e: ret + IL_0125: ldarg.0 + IL_0126: ldc.i4.s -2 + IL_0128: dup + IL_0129: stloc.1 + IL_012a: stfld ""C.VB$StateMachine_4_F.$State As Integer"" + IL_012f: ldarg.0 + IL_0130: ldflda ""C.VB$StateMachine_4_F.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0135: ldloc.0 + IL_0136: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_013b: nop + IL_013c: ret } ") diff --git a/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb b/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb index 15d65e05a574e62d9c9c743e056f6d560a9c254a..6695ecb45796b197c845f44d2d8d97bbb755042a 100644 --- a/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb +++ b/src/Compilers/VisualBasic/Test/Emit/Emit/EditAndContinue/LocalSlotMappingTests.vb @@ -586,7 +586,7 @@ End Class Dim v0 = CompileAndVerify(compilation:=compilation0) v0.VerifyIL("C.VB$StateMachine_2_M.MoveNext()", " { - // Code size 198 (0xc6) + // Code size 192 (0xc0) .maxstack 3 .locals init (Boolean V_0, Integer V_1) @@ -596,108 +596,102 @@ End Class IL_0007: ldloc.1 IL_0008: switch ( IL_001f, - IL_0022, - IL_0022, - IL_0025) - IL_001d: br.s IL_002b - IL_001f: nop - IL_0020: br.s IL_002d - IL_0022: nop - IL_0023: br.s IL_004a - IL_0025: nop - IL_0026: br IL_00b9 - IL_002b: ldc.i4.0 - IL_002c: ret - IL_002d: ldarg.0 - IL_002e: ldc.i4.m1 - IL_002f: dup - IL_0030: stloc.1 - IL_0031: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_0036: nop - IL_0037: nop - IL_0038: nop - IL_0039: ldarg.0 - IL_003a: ldarg.0 - IL_003b: ldfld ""C.VB$StateMachine_2_M.$VB$Me As C"" - IL_0040: callvirt ""Function C.F() As System.IDisposable"" - IL_0045: stfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" - IL_004a: nop + IL_0021, + IL_0021, + IL_0023) + IL_001d: br.s IL_0028 + IL_001f: br.s IL_002a + IL_0021: br.s IL_0046 + IL_0023: br IL_00b3 + IL_0028: ldc.i4.0 + IL_0029: ret + IL_002a: ldarg.0 + IL_002b: ldc.i4.m1 + IL_002c: dup + IL_002d: stloc.1 + IL_002e: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_0033: nop + IL_0034: nop + IL_0035: ldarg.0 + IL_0036: ldarg.0 + IL_0037: ldfld ""C.VB$StateMachine_2_M.$VB$Me As C"" + IL_003c: callvirt ""Function C.F() As System.IDisposable"" + IL_0041: stfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" + IL_0046: nop .try { - IL_004b: ldloc.1 - IL_004c: ldc.i4.1 - IL_004d: beq.s IL_0057 - IL_004f: br.s IL_0051 - IL_0051: ldloc.1 - IL_0052: ldc.i4.2 - IL_0053: beq.s IL_005a - IL_0055: br.s IL_005d - IL_0057: nop - IL_0058: br.s IL_0080 - IL_005a: nop - IL_005b: br.s IL_005f - IL_005d: br.s IL_006c - IL_005f: ldarg.0 - IL_0060: ldc.i4.m1 - IL_0061: dup - IL_0062: stloc.1 - IL_0063: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_0068: ldc.i4.1 - IL_0069: stloc.0 - IL_006a: leave.s IL_00c4 - IL_006c: ldarg.0 - IL_006d: ldc.i4.1 - IL_006e: stfld ""C.VB$StateMachine_2_M.$Current As Integer"" - IL_0073: ldarg.0 - IL_0074: ldc.i4.1 - IL_0075: dup - IL_0076: stloc.1 - IL_0077: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_007c: ldc.i4.1 - IL_007d: stloc.0 - IL_007e: leave.s IL_00c4 - IL_0080: ldarg.0 - IL_0081: ldc.i4.m1 - IL_0082: dup - IL_0083: stloc.1 - IL_0084: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_0089: leave.s IL_00a7 + IL_0047: ldloc.1 + IL_0048: ldc.i4.1 + IL_0049: beq.s IL_0053 + IL_004b: br.s IL_004d + IL_004d: ldloc.1 + IL_004e: ldc.i4.2 + IL_004f: beq.s IL_0055 + IL_0051: br.s IL_0057 + IL_0053: br.s IL_007a + IL_0055: br.s IL_0059 + IL_0057: br.s IL_0066 + IL_0059: ldarg.0 + IL_005a: ldc.i4.m1 + IL_005b: dup + IL_005c: stloc.1 + IL_005d: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_0062: ldc.i4.1 + IL_0063: stloc.0 + IL_0064: leave.s IL_00be + IL_0066: ldarg.0 + IL_0067: ldc.i4.1 + IL_0068: stfld ""C.VB$StateMachine_2_M.$Current As Integer"" + IL_006d: ldarg.0 + IL_006e: ldc.i4.1 + IL_006f: dup + IL_0070: stloc.1 + IL_0071: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_0076: ldc.i4.1 + IL_0077: stloc.0 + IL_0078: leave.s IL_00be + IL_007a: ldarg.0 + IL_007b: ldc.i4.m1 + IL_007c: dup + IL_007d: stloc.1 + IL_007e: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_0083: leave.s IL_00a1 } finally { - IL_008b: ldloc.1 - IL_008c: ldc.i4.0 - IL_008d: bge.s IL_00a6 - IL_008f: nop - IL_0090: ldarg.0 - IL_0091: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" - IL_0096: brfalse.s IL_00a4 - IL_0098: ldarg.0 - IL_0099: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" - IL_009e: callvirt ""Sub System.IDisposable.Dispose()"" - IL_00a3: nop - IL_00a4: br.s IL_00a6 - IL_00a6: endfinally + IL_0085: ldloc.1 + IL_0086: ldc.i4.0 + IL_0087: bge.s IL_00a0 + IL_0089: nop + IL_008a: ldarg.0 + IL_008b: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" + IL_0090: brfalse.s IL_009e + IL_0092: ldarg.0 + IL_0093: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" + IL_0098: callvirt ""Sub System.IDisposable.Dispose()"" + IL_009d: nop + IL_009e: br.s IL_00a0 + IL_00a0: endfinally } - IL_00a7: ldarg.0 - IL_00a8: ldc.i4.2 - IL_00a9: stfld ""C.VB$StateMachine_2_M.$Current As Integer"" - IL_00ae: ldarg.0 - IL_00af: ldc.i4.3 - IL_00b0: dup - IL_00b1: stloc.1 - IL_00b2: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_00b7: ldc.i4.1 - IL_00b8: ret - IL_00b9: ldarg.0 - IL_00ba: ldc.i4.m1 - IL_00bb: dup - IL_00bc: stloc.1 - IL_00bd: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_00c2: ldc.i4.0 - IL_00c3: ret - IL_00c4: ldloc.0 - IL_00c5: ret + IL_00a1: ldarg.0 + IL_00a2: ldc.i4.2 + IL_00a3: stfld ""C.VB$StateMachine_2_M.$Current As Integer"" + IL_00a8: ldarg.0 + IL_00a9: ldc.i4.3 + IL_00aa: dup + IL_00ab: stloc.1 + IL_00ac: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_00b1: ldc.i4.1 + IL_00b2: ret + IL_00b3: ldarg.0 + IL_00b4: ldc.i4.m1 + IL_00b5: dup + IL_00b6: stloc.1 + IL_00b7: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_00bc: ldc.i4.0 + IL_00bd: ret + IL_00be: ldloc.0 + IL_00bf: ret } ") v0.VerifyPdb("C+VB$StateMachine_2_M.MoveNext", " @@ -715,20 +709,19 @@ End Class - + @@ -765,7 +758,7 @@ End Class Dim v0 = CompileAndVerify(compilation:=compilation0) v0.VerifyIL("C.VB$StateMachine_2_M.MoveNext()", " { - // Code size 235 (0xeb) + // Code size 234 (0xea) .maxstack 3 .locals init (Integer V_0, Integer V_1, @@ -780,109 +773,108 @@ End Class { IL_0007: ldloc.1 IL_0008: brfalse.s IL_000c - IL_000a: br.s IL_000f - IL_000c: nop - IL_000d: br.s IL_007c + IL_000a: br.s IL_000e + IL_000c: br.s IL_007b + IL_000e: nop IL_000f: nop - IL_0010: nop + IL_0010: ldarg.0 IL_0011: ldarg.0 - IL_0012: ldarg.0 - IL_0013: ldfld ""C.VB$StateMachine_2_M.$VB$Me As C"" - IL_0018: callvirt ""Function C.F() As System.IDisposable"" - IL_001d: stfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" + IL_0012: ldfld ""C.VB$StateMachine_2_M.$VB$Me As C"" + IL_0017: callvirt ""Function C.F() As System.IDisposable"" + IL_001c: stfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" .try { - IL_0022: leave.s IL_0040 + IL_0021: leave.s IL_003f } finally { - IL_0024: ldloc.1 - IL_0025: ldc.i4.0 - IL_0026: bge.s IL_003f - IL_0028: nop - IL_0029: ldarg.0 - IL_002a: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" - IL_002f: brfalse.s IL_003d - IL_0031: ldarg.0 - IL_0032: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" - IL_0037: callvirt ""Sub System.IDisposable.Dispose()"" - IL_003c: nop - IL_003d: br.s IL_003f - IL_003f: endfinally + IL_0023: ldloc.1 + IL_0024: ldc.i4.0 + IL_0025: bge.s IL_003e + IL_0027: nop + IL_0028: ldarg.0 + IL_0029: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" + IL_002e: brfalse.s IL_003c + IL_0030: ldarg.0 + IL_0031: ldfld ""C.VB$StateMachine_2_M.$S0 As System.IDisposable"" + IL_0036: callvirt ""Sub System.IDisposable.Dispose()"" + IL_003b: nop + IL_003c: br.s IL_003e + IL_003e: endfinally } - IL_0040: nop - IL_0041: ldc.i4.s 10 - IL_0043: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" - IL_0048: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_004d: stloc.3 - IL_004e: ldloca.s V_3 - IL_0050: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" - IL_0055: brtrue.s IL_009a - IL_0057: ldarg.0 - IL_0058: ldc.i4.0 - IL_0059: dup - IL_005a: stloc.1 - IL_005b: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_0060: ldarg.0 - IL_0061: ldloc.3 - IL_0062: stfld ""C.VB$StateMachine_2_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0067: ldarg.0 - IL_0068: ldflda ""C.VB$StateMachine_2_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_006d: ldloca.s V_3 - IL_006f: ldarg.0 - IL_0070: stloc.s V_4 - IL_0072: ldloca.s V_4 - IL_0074: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_2_M)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_2_M)"" - IL_0079: nop - IL_007a: leave.s IL_00ea - IL_007c: ldarg.0 - IL_007d: ldc.i4.m1 - IL_007e: dup - IL_007f: stloc.1 - IL_0080: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_0085: ldarg.0 - IL_0086: ldfld ""C.VB$StateMachine_2_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_008b: stloc.3 - IL_008c: ldarg.0 - IL_008d: ldflda ""C.VB$StateMachine_2_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0092: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_0098: br.s IL_009a - IL_009a: ldloca.s V_3 - IL_009c: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" - IL_00a1: pop - IL_00a2: ldloca.s V_3 - IL_00a4: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" - IL_00aa: ldc.i4.2 - IL_00ab: stloc.0 - IL_00ac: leave.s IL_00d3 + IL_003f: nop + IL_0040: ldc.i4.s 10 + IL_0042: call ""Function System.Threading.Tasks.Task.FromResult(Of Integer)(Integer) As System.Threading.Tasks.Task(Of Integer)"" + IL_0047: callvirt ""Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_004c: stloc.3 + IL_004d: ldloca.s V_3 + IL_004f: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).get_IsCompleted() As Boolean"" + IL_0054: brtrue.s IL_0099 + IL_0056: ldarg.0 + IL_0057: ldc.i4.0 + IL_0058: dup + IL_0059: stloc.1 + IL_005a: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_005f: ldarg.0 + IL_0060: ldloc.3 + IL_0061: stfld ""C.VB$StateMachine_2_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0066: ldarg.0 + IL_0067: ldflda ""C.VB$StateMachine_2_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_006c: ldloca.s V_3 + IL_006e: ldarg.0 + IL_006f: stloc.s V_4 + IL_0071: ldloca.s V_4 + IL_0073: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), C.VB$StateMachine_2_M)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef C.VB$StateMachine_2_M)"" + IL_0078: nop + IL_0079: leave.s IL_00e9 + IL_007b: ldarg.0 + IL_007c: ldc.i4.m1 + IL_007d: dup + IL_007e: stloc.1 + IL_007f: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_0084: ldarg.0 + IL_0085: ldfld ""C.VB$StateMachine_2_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_008a: stloc.3 + IL_008b: ldarg.0 + IL_008c: ldflda ""C.VB$StateMachine_2_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0091: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_0097: br.s IL_0099 + IL_0099: ldloca.s V_3 + IL_009b: call ""Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"" + IL_00a0: pop + IL_00a1: ldloca.s V_3 + IL_00a3: initobj ""System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"" + IL_00a9: ldc.i4.2 + IL_00aa: stloc.0 + IL_00ab: leave.s IL_00d2 } catch System.Exception { - IL_00ae: dup - IL_00af: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" - IL_00b4: stloc.s V_5 - IL_00b6: ldarg.0 - IL_00b7: ldc.i4.s -2 - IL_00b9: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_00be: ldarg.0 - IL_00bf: ldflda ""C.VB$StateMachine_2_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00c4: ldloc.s V_5 - IL_00c6: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" - IL_00cb: nop - IL_00cc: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" - IL_00d1: leave.s IL_00ea + IL_00ad: dup + IL_00ae: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_00b3: stloc.s V_5 + IL_00b5: ldarg.0 + IL_00b6: ldc.i4.s -2 + IL_00b8: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_00bd: ldarg.0 + IL_00be: ldflda ""C.VB$StateMachine_2_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00c3: ldloc.s V_5 + IL_00c5: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_00ca: nop + IL_00cb: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_00d0: leave.s IL_00e9 } - IL_00d3: ldarg.0 - IL_00d4: ldc.i4.s -2 - IL_00d6: dup - IL_00d7: stloc.1 - IL_00d8: stfld ""C.VB$StateMachine_2_M.$State As Integer"" - IL_00dd: ldarg.0 - IL_00de: ldflda ""C.VB$StateMachine_2_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" - IL_00e3: ldloc.0 - IL_00e4: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" - IL_00e9: nop - IL_00ea: ret + IL_00d2: ldarg.0 + IL_00d3: ldc.i4.s -2 + IL_00d5: dup + IL_00d6: stloc.1 + IL_00d7: stfld ""C.VB$StateMachine_2_M.$State As Integer"" + IL_00dc: ldarg.0 + IL_00dd: ldflda ""C.VB$StateMachine_2_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00e2: ldloc.0 + IL_00e3: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00e8: nop + IL_00e9: ret } ") @@ -906,26 +898,26 @@ End Class - + - + diff --git a/src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb b/src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb index 63959a79b1cc5550824aa908571957f8fd40e228..aa661eba6cf389ac62dc581e2263e5bc672984db 100644 --- a/src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb +++ b/src/Compilers/VisualBasic/Test/Emit/PDB/PDBAsyncTests.vb @@ -7,6 +7,162 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.PDB Public Class PDBAsyncTests Inherits BasicTestBase + + + Public Sub SimpleAsyncMethod() + Dim source = + + +Imports System +Imports System.Threading.Tasks + +Class C + Shared Async Function M() As Task(Of Integer) + Await Task.Delay(1) + Return 1 + End Function +End Class + + + + Dim v = CompileAndVerify(source, LatestReferences, options:=TestOptions.DebugDll) + + v.VerifyIL("C.VB$StateMachine_1_M.MoveNext", " +{ + // Code size 185 (0xb9) + .maxstack 3 + .locals init (Integer V_0, + Integer V_1, + System.Threading.Tasks.Task(Of Integer) V_2, + System.Runtime.CompilerServices.TaskAwaiter V_3, + C.VB$StateMachine_1_M V_4, + System.Exception V_5) + ~IL_0000: ldarg.0 + IL_0001: ldfld ""C.VB$StateMachine_1_M.$State As Integer"" + IL_0006: stloc.1 + .try + { + ~IL_0007: ldloc.1 + IL_0008: brfalse.s IL_000c + IL_000a: br.s IL_000e + IL_000c: br.s IL_004a + -IL_000e: nop + -IL_000f: nop + IL_0010: ldc.i4.1 + IL_0011: call ""Function System.Threading.Tasks.Task.Delay(Integer) As System.Threading.Tasks.Task"" + IL_0016: callvirt ""Function System.Threading.Tasks.Task.GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter"" + IL_001b: stloc.3 + ~IL_001c: ldloca.s V_3 + IL_001e: call ""Function System.Runtime.CompilerServices.TaskAwaiter.get_IsCompleted() As Boolean"" + IL_0023: brtrue.s IL_0068 + IL_0025: ldarg.0 + IL_0026: ldc.i4.0 + IL_0027: dup + IL_0028: stloc.1 + IL_0029: stfld ""C.VB$StateMachine_1_M.$State As Integer"" + IL_004a: ldarg.0 + IL_004b: ldc.i4.m1 + IL_004c: dup + IL_004d: stloc.1 + IL_004e: stfld ""C.VB$StateMachine_1_M.$State As Integer"" + IL_0053: ldarg.0 + IL_0054: ldfld ""C.VB$StateMachine_1_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_0059: stloc.3 + IL_005a: ldarg.0 + IL_005b: ldflda ""C.VB$StateMachine_1_M.$A0 As System.Runtime.CompilerServices.TaskAwaiter"" + IL_0060: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + IL_0066: br.s IL_0068 + IL_0068: ldloca.s V_3 + IL_006a: call ""Sub System.Runtime.CompilerServices.TaskAwaiter.GetResult()"" + IL_006f: nop + IL_0070: ldloca.s V_3 + IL_0072: initobj ""System.Runtime.CompilerServices.TaskAwaiter"" + -IL_0078: ldc.i4.1 + IL_0079: stloc.0 + IL_007a: leave.s IL_00a1 + } + catch System.Exception + { + ~IL_007c: dup + IL_007d: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"" + IL_0082: stloc.s V_5 + ~IL_0084: ldarg.0 + IL_0085: ldc.i4.s -2 + IL_0087: stfld ""C.VB$StateMachine_1_M.$State As Integer"" + IL_008c: ldarg.0 + IL_008d: ldflda ""C.VB$StateMachine_1_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_0092: ldloc.s V_5 + IL_0094: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"" + IL_0099: nop + IL_009a: call ""Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"" + IL_009f: leave.s IL_00b8 + } + -IL_00a1: ldarg.0 + IL_00a2: ldc.i4.s -2 + IL_00a4: dup + IL_00a5: stloc.1 + IL_00a6: stfld ""C.VB$StateMachine_1_M.$State As Integer"" + ~IL_00ab: ldarg.0 + IL_00ac: ldflda ""C.VB$StateMachine_1_M.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"" + IL_00b1: ldloc.0 + IL_00b2: call ""Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"" + IL_00b7: nop + IL_00b8: ret +}", sequencePoints:="C+VB$StateMachine_1_M.MoveNext") + + ' NOTE: No for the return variable "M". + v.VerifyPdb("C+VB$StateMachine_1_M.MoveNext", + + + + + + + + + + + + + + + + + + + + + + + + + + +) + End Sub + Public Sub TestAsync() Dim source = @@ -75,21 +231,21 @@ End Module - + - + @@ -130,45 +286,45 @@ End Module - + - - - - - - - - - + + + + + + + + + @@ -201,22 +357,22 @@ End Module - + - + - + @@ -268,31 +424,31 @@ End Class - + - - - + + + - + @@ -406,31 +562,31 @@ End Class - + - - - + + + - + @@ -501,60 +657,5 @@ End Class ) End Sub - - - Public Sub AsyncReturnVariable() - Dim source = - - -Imports System -Imports System.Threading.Tasks - -Class C - Shared Async Function M() As Task(Of Integer) - Return 1 - End Function -End Class - - - - Dim c = CreateCompilationWithReferences(source, references:=LatestReferences, options:=TestOptions.DebugDll) - c.AssertNoErrors() - - ' NOTE: No for the return variable "M". - c.VerifyPdb("C+VB$StateMachine_1_M.MoveNext", - - - - - - - - - - - - - - - - - - - - - - - -) - End Sub - End Class End Namespace \ No newline at end of file diff --git a/src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb b/src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb index dc7a9670154c483ef0391118159f2a3a869f070a..0905ba517e528cfe046950da26767d695c8e89ec 100644 --- a/src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb +++ b/src/Compilers/VisualBasic/Test/Emit/PDB/PDBIteratorTests.vb @@ -7,6 +7,70 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.PDB Public Class PDBIteratorTests Inherits BasicTestBase + + Public Sub SimpleIterator() + Dim source = + + +Imports System.Collections.Generic + +Class C + Public Iterator Function F() As IEnumerable(Of Integer) + Yield 1 + End Function +End Class + + + + Dim v = CompileAndVerify(source, options:=TestOptions.DebugDll) + + v.VerifyIL("C.VB$StateMachine_1_F.MoveNext", " +{ + // Code size 63 (0x3f) + .maxstack 3 + .locals init (Boolean V_0, + Integer V_1) + ~IL_0000: ldarg.0 + IL_0001: ldfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: brfalse.s IL_0012 + IL_000a: br.s IL_000c + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: beq.s IL_0014 + IL_0010: br.s IL_0016 + IL_0012: br.s IL_0018 + IL_0014: br.s IL_0034 + IL_0016: ldc.i4.0 + IL_0017: ret + IL_0018: ldarg.0 + IL_0019: ldc.i4.m1 + IL_001a: dup + IL_001b: stloc.1 + IL_001c: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + -IL_0021: nop + -IL_0022: ldarg.0 + IL_0023: ldc.i4.1 + IL_0024: stfld ""C.VB$StateMachine_1_F.$Current As Integer"" + IL_0029: ldarg.0 + IL_002a: ldc.i4.1 + IL_002b: dup + IL_002c: stloc.1 + IL_002d: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + IL_0032: ldc.i4.1 + IL_0033: ret + IL_0034: ldarg.0 + IL_0035: ldc.i4.m1 + IL_0036: dup + IL_0037: stloc.1 + IL_0038: stfld ""C.VB$StateMachine_1_F.$State As Integer"" + -IL_003d: ldc.i4.0 + IL_003e: ret +} +", sequencePoints:="C+VB$StateMachine_1_F.MoveNext") + End Sub + Public Sub IteratorLambdaWithForEach() Dim source = @@ -49,13 +113,12 @@ End Module - + @@ -118,37 +181,36 @@ End Module - + - - - - + + + + - - + + @@ -400,13 +462,12 @@ End Module - +