提交 8c1207ec 编写于 作者: A acasey

DevDiv #1024137 - Part 2: "Me" in VB iterators and async

Port of changeset #1357667 to VB.

Bonus: Update the VB IL visualizer to match C# in a case where it was using ToString instead of ToDisplayString.

TODO: Part 3 - "this" in anonymous functions.

CR: chucks (changeset 1358824)
上级 bf0e2f33
......@@ -89,7 +89,7 @@ private TypeMap WithAlphaRename(ImmutableArray<TypeParameterSymbol> oldTypeParam
// Note: the below assertion doesn't hold while rewriting async lambdas defined inside generic methods.
// The async rewriter adds a synthesized struct inside the lambda frame and construct a typemap from
// the lambda frame's substitued type parameters.
// the lambda frame's substituted type parameters.
// Debug.Assert(!oldTypeParameters.Any(tp => tp is SubstitutedTypeParameterSymbol));
// warning: we expose result to the SubstitutedTypeParameterSymbol constructor, below, even before it's all filled in.
......
......@@ -21,7 +21,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Emit
End Property
Public Overrides Function ToString() As String
Return UnderlyingSymbol.ToString()
Return UnderlyingSymbol.ToDisplayString(SymbolDisplayFormat.ILVisualizationFormat)
End Function
Private Function IReferenceAttributes(context As EmitContext) As IEnumerable(Of Cci.ICustomAttribute) Implements Cci.IReference.GetAttributes
......
......@@ -26,6 +26,25 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return String.Format(StringConstants.StateMachineTypeNameMask, index, topMethodMetadataName)
End Function
Public Shared Function TryParseStateMachineTypeName(stateMachineTypeName As String, <Out> ByRef index As Integer, <Out> ByRef methodName As String) As Boolean
If Not stateMachineTypeName.StartsWith(StringConstants.StateMachineTypeNamePrefix, StringComparison.Ordinal) Then
Return False
End If
Dim prefixLength As Integer = StringConstants.StateMachineTypeNamePrefix.Length
Dim separatorPos = stateMachineTypeName.IndexOf("_"c, prefixLength)
If separatorPos < 0 OrElse separatorPos = stateMachineTypeName.Length - 1 Then
Return False
End If
If Not Integer.TryParse(stateMachineTypeName.Substring(prefixLength, separatorPos - prefixLength), NumberStyles.None, CultureInfo.InvariantCulture, index) Then
Return False
End If
methodName = stateMachineTypeName.Substring(separatorPos + 1)
Return True
End Function
Public Shared Function EnsureNoDotsInTypeName(Name As String) As String
' CLR generally allows names with dots, however some APIs like IMetaDataImport
' can only return full type names combined with namespaces.
......
......@@ -38,7 +38,7 @@ expectedOutput:=<![CDATA[
// Code size 7 (0x7)
.maxstack 1
IL_0000: ldarg.0
IL_0001: ldfld "Private $a As T0"
IL_0001: ldfld "VB$AnonymousType_0(Of T0, T1).$a As T0"
IL_0006: ret
}
]]>).
......@@ -49,7 +49,7 @@ expectedOutput:=<![CDATA[
.maxstack 2
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld "Private $a As T0"
IL_0002: stfld "VB$AnonymousType_0(Of T0, T1).$a As T0"
IL_0007: ret
}
]]>).
......@@ -59,7 +59,7 @@ expectedOutput:=<![CDATA[
// Code size 7 (0x7)
.maxstack 1
IL_0000: ldarg.0
IL_0001: ldfld "Private $b As T1"
IL_0001: ldfld "VB$AnonymousType_0(Of T0, T1).$b As T1"
IL_0006: ret
}
]]>).
......@@ -70,7 +70,7 @@ expectedOutput:=<![CDATA[
.maxstack 2
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld "Private $b As T1"
IL_0002: stfld "VB$AnonymousType_0(Of T0, T1).$b As T1"
IL_0007: ret
}
]]>).
......@@ -83,10 +83,10 @@ expectedOutput:=<![CDATA[
IL_0001: call "Sub Object..ctor()"
IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld "Private $a As T0"
IL_0008: stfld "VB$AnonymousType_0(Of T0, T1).$a As T0"
IL_000d: ldarg.0
IL_000e: ldarg.2
IL_000f: stfld "Private $b As T1"
IL_000f: stfld "VB$AnonymousType_0(Of T0, T1).$b As T1"
IL_0014: ret
}
]]>)
......@@ -396,19 +396,19 @@ expectedOutput:=<![CDATA[
IL_000b: dup
IL_000c: ldc.i4.0
IL_000d: ldarg.0
IL_000e: ldfld "Private ReadOnly $a As T0"
IL_000e: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$a As T0"
IL_0013: box "T0"
IL_0018: stelem.ref
IL_0019: dup
IL_001a: ldc.i4.1
IL_001b: ldarg.0
IL_001c: ldfld "Private $b As T1"
IL_001c: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$b As T1"
IL_0021: box "T1"
IL_0026: stelem.ref
IL_0027: dup
IL_0028: ldc.i4.2
IL_0029: ldarg.0
IL_002a: ldfld "Private ReadOnly $c As T2"
IL_002a: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$c As T2"
IL_002f: box "T2"
IL_0034: stelem.ref
IL_0035: call "Function String.Format(String, ParamArray Object()) As String"
......@@ -462,15 +462,15 @@ False
// Code size 105 (0x69)
.maxstack 2
.locals init (Object V_0,
Object V_1)
Object V_1)
IL_0000: ldarg.1
IL_0001: brfalse.s IL_0067
IL_0003: ldarg.0
IL_0004: ldfld "Private ReadOnly $a As T0"
IL_0004: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$a As T0"
IL_0009: box "T0"
IL_000e: stloc.0
IL_000f: ldarg.1
IL_0010: ldfld "Private ReadOnly $a As T0"
IL_0010: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$a As T0"
IL_0015: box "T0"
IL_001a: stloc.1
IL_001b: ldloc.0
......@@ -487,11 +487,11 @@ False
IL_002e: callvirt "Function Object.Equals(Object) As Boolean"
IL_0033: brfalse.s IL_0065
IL_0035: ldarg.0
IL_0036: ldfld "Private ReadOnly $c As T2"
IL_0036: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$c As T2"
IL_003b: box "T2"
IL_0040: stloc.0
IL_0041: ldarg.1
IL_0042: ldfld "Private ReadOnly $c As T2"
IL_0042: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$c As T2"
IL_0047: box "T2"
IL_004c: stloc.1
IL_004d: ldloc.0
......@@ -590,7 +590,7 @@ True
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: isinst "VB$AnonymousType_0(Of T0, T1, T2)"
IL_0007: call "Public Overloads Function Equals(val As VB$AnonymousType_0(Of T0, T1, T2)) As Boolean"
IL_0007: call "Function VB$AnonymousType_0(Of T0, T1, T2).Equals(VB$AnonymousType_0(Of T0, T1, T2)) As Boolean"
IL_000c: ret
}
]]>)
......@@ -615,16 +615,16 @@ New XCData(<![CDATA[
// Code size 92 (0x5c)
.maxstack 2
.locals init (T0 V_0,
T2 V_1)
T2 V_1)
IL_0000: ldc.i4 0x526a854f
IL_0005: ldc.i4 0xa5555529
IL_000a: mul
IL_000b: ldarg.0
IL_000c: ldfld "Private ReadOnly $a As T0"
IL_000c: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$a As T0"
IL_0011: box "T0"
IL_0016: brfalse.s IL_002e
IL_0018: ldarg.0
IL_0019: ldfld "Private ReadOnly $a As T0"
IL_0019: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$a As T0"
IL_001e: stloc.0
IL_001f: ldloca.s V_0
IL_0021: constrained. "T0"
......@@ -635,11 +635,11 @@ New XCData(<![CDATA[
IL_0030: ldc.i4 0xa5555529
IL_0035: mul
IL_0036: ldarg.0
IL_0037: ldfld "Private ReadOnly $C As T2"
IL_0037: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$C As T2"
IL_003c: box "T2"
IL_0041: brfalse.s IL_0059
IL_0043: ldarg.0
IL_0044: ldfld "Private ReadOnly $C As T2"
IL_0044: ldfld "VB$AnonymousType_0(Of T0, T1, T2).$C As T2"
IL_0049: stloc.1
IL_004a: ldloca.s V_1
IL_004c: constrained. "T2"
......
......@@ -1812,7 +1812,7 @@ End Class
System.Runtime.CompilerServices.TaskAwaiter(Of String) V_2,
System.Exception V_3)
IL_0000: ldarg.0
IL_0001: ldfld "Friend $State As Integer"
IL_0001: ldfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$State As Integer"
IL_0006: stloc.1
.try
{
......@@ -1821,11 +1821,11 @@ End Class
IL_000a: newobj "Sub BASE(Of T).CLAZZ(Of U)._Closure$__1(Of SM$V)..ctor()"
IL_000f: dup
IL_0010: ldarg.0
IL_0011: ldfld "Friend $VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_0011: ldfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_0016: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of SM$V).$VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_001b: dup
IL_001c: ldarg.0
IL_001d: ldfld "Friend $VB$Local_p As SM$V"
IL_001d: ldfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$VB$Local_p As SM$V"
IL_0022: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of SM$V).$VB$Local_p As SM$V"
IL_0027: dup
IL_0028: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of SM$V).$VB$Local_outer As U"
......@@ -1846,12 +1846,12 @@ End Class
IL_0067: ldc.i4.0
IL_0068: dup
IL_0069: stloc.1
IL_006a: stfld "Friend $State As Integer"
IL_006a: stfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$State As Integer"
IL_006f: ldarg.0
IL_0070: ldloc.2
IL_0071: stfld "Friend $awaiter_4 As System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_0071: stfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$awaiter_4 As System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_0076: ldarg.0
IL_0077: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"
IL_0077: ldflda "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"
IL_007c: ldloca.s V_2
IL_007e: ldarg.0
IL_007f: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of String), BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V))(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of String), ByRef BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V))"
......@@ -1860,12 +1860,12 @@ End Class
IL_0087: ldc.i4.m1
IL_0088: dup
IL_0089: stloc.1
IL_008a: stfld "Friend $State As Integer"
IL_008a: stfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$State As Integer"
IL_008f: ldarg.0
IL_0090: ldfld "Friend $awaiter_4 As System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_0090: ldfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$awaiter_4 As System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_0095: stloc.2
IL_0096: ldarg.0
IL_0097: ldflda "Friend $awaiter_4 As System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_0097: ldflda "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$awaiter_4 As System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_009c: initobj "System.Runtime.CompilerServices.TaskAwaiter(Of String)"
IL_00a2: ldloca.s V_2
IL_00a4: call "Function System.Runtime.CompilerServices.TaskAwaiter(Of String).GetResult() As String"
......@@ -1882,9 +1882,9 @@ End Class
IL_00bf: stloc.3
IL_00c0: ldarg.0
IL_00c1: ldc.i4.s -2
IL_00c3: stfld "Friend $State As Integer"
IL_00c3: stfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$State As Integer"
IL_00c8: ldarg.0
IL_00c9: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"
IL_00c9: ldflda "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"
IL_00ce: ldloc.3
IL_00cf: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetException(System.Exception)"
IL_00d4: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"
......@@ -1894,9 +1894,9 @@ End Class
IL_00dc: ldc.i4.s -2
IL_00de: dup
IL_00df: stloc.1
IL_00e0: stfld "Friend $State As Integer"
IL_00e0: stfld "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$State As Integer"
IL_00e5: ldarg.0
IL_00e6: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"
IL_00e6: ldflda "BASE(Of T).CLAZZ(Of U).VB$StateMachine_0_F(Of SM$V).$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer)"
IL_00eb: ldloc.0
IL_00ec: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Integer).SetResult(Integer)"
IL_00f1: ret
......@@ -1912,7 +1912,7 @@ End Class
System.Runtime.CompilerServices.TaskAwaiter(Of Integer) V_2,
System.Exception V_3)
IL_0000: ldarg.0
IL_0001: ldfld "Friend $State As Integer"
IL_0001: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$State As Integer"
IL_0006: stloc.1
.try
{
......@@ -1920,22 +1920,22 @@ End Class
IL_0008: brfalse.s IL_0088
IL_000a: ldarg.0
IL_000b: ldarg.0
IL_000c: ldfld "Friend $VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_0011: ldflda "Public $VB$Local_outer As U"
IL_000c: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_0011: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).$VB$Local_outer As U"
IL_0016: constrained. "U"
IL_001c: callvirt "Function Object.ToString() As String"
IL_0021: ldarg.0
IL_0022: ldfld "Friend $VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_0027: ldfld "Public $VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_002c: ldflda "Public FX As T"
IL_0022: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_0027: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).$VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_002c: ldflda "BASE(Of T).CLAZZ(Of U).FX As T"
IL_0031: constrained. "T"
IL_0037: callvirt "Function Object.ToString() As String"
IL_003c: call "Function String.Concat(String, String) As String"
IL_0041: stfld "Friend $VB$ResumableLocal_result$1 As String"
IL_0041: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$VB$ResumableLocal_result$1 As String"
IL_0046: ldarg.0
IL_0047: ldfld "Friend $VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_004c: ldfld "Public $VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_0051: call "Public Function f2() As System.Threading.Tasks.Task(Of Integer)"
IL_0047: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_004c: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).$VB$Me As BASE(Of T).CLAZZ(Of U)"
IL_0051: call "Function BASE(Of T).CLAZZ(Of U).f2() As System.Threading.Tasks.Task(Of Integer)"
IL_0056: callvirt "Function System.Threading.Tasks.Task(Of Integer).GetAwaiter() As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_005b: stloc.2
IL_005c: ldloca.s V_2
......@@ -1945,12 +1945,12 @@ End Class
IL_0066: ldc.i4.0
IL_0067: dup
IL_0068: stloc.1
IL_0069: stfld "Friend $State As Integer"
IL_0069: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$State As Integer"
IL_006e: ldarg.0
IL_006f: ldloc.2
IL_0070: stfld "Friend $awaiter_3 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_0070: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$awaiter_3 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_0075: ldarg.0
IL_0076: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String)"
IL_0076: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String)"
IL_007b: ldloca.s V_2
IL_007d: ldarg.0
IL_007e: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String).AwaitUnsafeOnCompleted(Of System.Runtime.CompilerServices.TaskAwaiter(Of Integer), BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2)(ByRef System.Runtime.CompilerServices.TaskAwaiter(Of Integer), ByRef BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2)"
......@@ -1959,12 +1959,12 @@ End Class
IL_0089: ldc.i4.m1
IL_008a: dup
IL_008b: stloc.1
IL_008c: stfld "Friend $State As Integer"
IL_008c: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$State As Integer"
IL_0091: ldarg.0
IL_0092: ldfld "Friend $awaiter_3 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_0092: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$awaiter_3 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_0097: stloc.2
IL_0098: ldarg.0
IL_0099: ldflda "Friend $awaiter_3 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_0099: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$awaiter_3 As System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_009e: initobj "System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_00a4: ldloca.s V_2
IL_00a6: call "Function System.Runtime.CompilerServices.TaskAwaiter(Of Integer).GetResult() As Integer"
......@@ -1972,10 +1972,10 @@ End Class
IL_00ad: initobj "System.Runtime.CompilerServices.TaskAwaiter(Of Integer)"
IL_00b3: pop
IL_00b4: ldarg.0
IL_00b5: ldfld "Friend $VB$ResumableLocal_result$1 As String"
IL_00b5: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$VB$ResumableLocal_result$1 As String"
IL_00ba: ldarg.0
IL_00bb: ldfld "Friend $VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_00c0: ldflda "Public $VB$Local_p As $CLS0"
IL_00bb: ldfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$VB$NonLocal__Closure$__1 As BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0)"
IL_00c0: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).$VB$Local_p As $CLS0"
IL_00c5: constrained. "$CLS0"
IL_00cb: callvirt "Function System.ValueType.ToString() As String"
IL_00d0: call "Function String.Concat(String, String) As String"
......@@ -1989,9 +1989,9 @@ End Class
IL_00de: stloc.3
IL_00df: ldarg.0
IL_00e0: ldc.i4.s -2
IL_00e2: stfld "Friend $State As Integer"
IL_00e2: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$State As Integer"
IL_00e7: ldarg.0
IL_00e8: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String)"
IL_00e8: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String)"
IL_00ed: ldloc.3
IL_00ee: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String).SetException(System.Exception)"
IL_00f3: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"
......@@ -2001,9 +2001,9 @@ End Class
IL_00fb: ldc.i4.s -2
IL_00fd: dup
IL_00fe: stloc.1
IL_00ff: stfld "Friend $State As Integer"
IL_00ff: stfld "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$State As Integer"
IL_0104: ldarg.0
IL_0105: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String)"
IL_0105: ldflda "BASE(Of T).CLAZZ(Of U)._Closure$__1(Of $CLS0).VB$StateMachine_0__Lambda$__2.$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String)"
IL_010a: ldloc.0
IL_010b: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of String).SetResult(String)"
IL_0110: ret
......
......@@ -1272,7 +1272,7 @@ End Module
.maxstack 2
.locals init ($CLS0() V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Public $VB$Local_p As $CLS0()"
IL_0001: ldfld "M1.C1._Closure$__1(Of $CLS0).$VB$Local_p As $CLS0()"
IL_0006: dup
IL_0007: call "Function M1.C1.C2(Of $CLS0).get_M($CLS0()) As $CLS0()"
IL_000c: stloc.0
......@@ -1331,7 +1331,7 @@ End Module
IL_0000: newobj "Sub M1.C1._Closure$__2(Of $CLS0)..ctor()"
IL_0005: dup
IL_0006: ldarg.0
IL_0007: ldfld "Public $VB$Local_p As $CLS0"
IL_0007: ldfld "M1.C1._Closure$__1(Of $CLS0).$VB$Local_p As $CLS0"
IL_000c: stfld "M1.C1._Closure$__2(Of $CLS0).$VB$Local_X As $CLS0"
IL_0011: dup
IL_0012: ldftn "Sub M1.C1._Closure$__2(Of $CLS0)._Lambda$__4()"
......@@ -1458,28 +1458,28 @@ End Module
.maxstack 3
.locals init (System.Action(Of $CLS0) V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Public _ClosureCache$__4 As System.Action(Of $CLS0)"
IL_0001: ldfld "M1.C1._Closure$__1(Of $CLS0, $CLS1)._ClosureCache$__4 As System.Action(Of $CLS0)"
IL_0006: brfalse.s IL_0010
IL_0008: ldarg.0
IL_0009: ldfld "Public _ClosureCache$__4 As System.Action(Of $CLS0)"
IL_0009: ldfld "M1.C1._Closure$__1(Of $CLS0, $CLS1)._ClosureCache$__4 As System.Action(Of $CLS0)"
IL_000e: br.s IL_0025
IL_0010: ldarg.0
IL_0011: ldarg.0
IL_0012: ldftn "Friend Sub _Lambda$__3(X As $CLS0)"
IL_0012: ldftn "Sub M1.C1._Closure$__1(Of $CLS0, $CLS1)._Lambda$__3($CLS0)"
IL_0018: newobj "Sub System.Action(Of $CLS0)..ctor(Object, System.IntPtr)"
IL_001d: dup
IL_001e: stloc.0
IL_001f: stfld "Public _ClosureCache$__4 As System.Action(Of $CLS0)"
IL_001f: stfld "M1.C1._Closure$__1(Of $CLS0, $CLS1)._ClosureCache$__4 As System.Action(Of $CLS0)"
IL_0024: ldloc.0
IL_0025: dup
IL_0026: ldarg.0
IL_0027: ldfld "Public $VB$Local_p As $CLS0"
IL_0027: ldfld "M1.C1._Closure$__1(Of $CLS0, $CLS1).$VB$Local_p As $CLS0"
IL_002c: callvirt "Sub System.Action(Of $CLS0).Invoke($CLS0)"
IL_0031: ldarg.0
IL_0032: ldflda "Public $VB$Local_p1 As $CLS1"
IL_0032: ldflda "M1.C1._Closure$__1(Of $CLS0, $CLS1).$VB$Local_p1 As $CLS1"
IL_0037: initobj "$CLS1"
IL_003d: ldarg.0
IL_003e: ldfld "Public $VB$Local_p As $CLS0"
IL_003e: ldfld "M1.C1._Closure$__1(Of $CLS0, $CLS1).$VB$Local_p As $CLS0"
IL_0043: callvirt "Sub System.Action(Of $CLS0).Invoke($CLS0)"
IL_0048: ret
}
......@@ -1539,12 +1539,12 @@ End Module
// Code size 25 (0x19)
.maxstack 2
IL_0000: ldarg.0
IL_0001: ldfld "Public $VB$Me As M1.C1(Of G)"
IL_0001: ldfld "M1.C1(Of G)._Closure$__1(Of $CLS0, $CLS1).$VB$Me As M1.C1(Of G)"
IL_0006: ldarg.1
IL_0007: call "Sub M1.C1(Of G).Print(Of $CLS0)($CLS0)"
IL_000c: ldarg.1
IL_000d: ldarg.0
IL_000e: ldfld "Public $VB$Local_p1 As $CLS1"
IL_000e: ldfld "M1.C1(Of G)._Closure$__1(Of $CLS0, $CLS1).$VB$Local_p1 As $CLS1"
IL_0013: call "Sub M1.C1(Of $CLS1).PrintShared(Of $CLS0)($CLS0, $CLS1)"
IL_0018: ret
}
......
......@@ -1379,7 +1379,7 @@ End Module
.maxstack 3
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Friend $State As Integer"
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo(Of SM$T).$State As Integer"
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: brfalse.s IL_0010
......@@ -1392,23 +1392,23 @@ End Module
IL_0011: ldc.i4.m1
IL_0012: dup
IL_0013: stloc.0
IL_0014: stfld "Friend $State As Integer"
IL_0014: stfld "Module1.VB$StateMachine_1_Foo(Of SM$T).$State As Integer"
IL_0019: ldarg.0
IL_001a: ldarg.0
IL_001b: ldfld "Friend $VB$Local_x As SM$T"
IL_0020: stfld "Friend $Current As SM$T"
IL_001b: ldfld "Module1.VB$StateMachine_1_Foo(Of SM$T).$VB$Local_x As SM$T"
IL_0020: stfld "Module1.VB$StateMachine_1_Foo(Of SM$T).$Current As SM$T"
IL_0025: ldarg.0
IL_0026: ldc.i4.1
IL_0027: dup
IL_0028: stloc.0
IL_0029: stfld "Friend $State As Integer"
IL_0029: stfld "Module1.VB$StateMachine_1_Foo(Of SM$T).$State As Integer"
IL_002e: ldc.i4.1
IL_002f: ret
IL_0030: ldarg.0
IL_0031: ldc.i4.m1
IL_0032: dup
IL_0033: stloc.0
IL_0034: stfld "Friend $State As Integer"
IL_0034: stfld "Module1.VB$StateMachine_1_Foo(Of SM$T).$State As Integer"
IL_0039: ldc.i4.0
IL_003a: ret
}
......
......@@ -1229,7 +1229,7 @@ expectedOutput:="System.DateTime").
// Code size 38 (0x26)
.maxstack 1
.locals init (T V_0) //VB$With_0
IL_0000: call "Public Shared Property Get TProp() As T"
IL_0000: call "Function C(Of T).get_TProp() As T"
IL_0005: stloc.0
IL_0006: ldloca.s V_0
IL_0008: constrained. "T"
......
......@@ -965,13 +965,13 @@ End Interface
// Code size 75 (0x4b)
.maxstack 2
.locals init (iTest.Event2EventHandler V_0,
T V_1)
T V_1)
IL_0000: ldarg.0
IL_0001: ldftn "Public Sub EventHandler2()"
IL_0001: ldftn "Sub C1(Of T).EventHandler2()"
IL_0007: newobj "Sub iTest.Event2EventHandler..ctor(Object, System.IntPtr)"
IL_000c: stloc.0
IL_000d: ldarg.0
IL_000e: ldfld "Private _o As T"
IL_000e: ldfld "C1(Of T)._o As T"
IL_0013: stloc.1
IL_0014: ldloc.1
IL_0015: box "T"
......@@ -982,9 +982,9 @@ End Interface
IL_0023: callvirt "Sub iTest.remove_Event2(iTest.Event2EventHandler)"
IL_0028: ldarg.0
IL_0029: ldarg.1
IL_002a: stfld "Private _o As T"
IL_002a: stfld "C1(Of T)._o As T"
IL_002f: ldarg.0
IL_0030: ldfld "Private _o As T"
IL_0030: ldfld "C1(Of T)._o As T"
IL_0035: stloc.1
IL_0036: ldloc.1
IL_0037: box "T"
......@@ -1054,11 +1054,11 @@ End Interface
.locals init (iTest.Event2EventHandler V_0,
T V_1)
IL_0000: ldarg.0
IL_0001: ldftn "Public Sub EventHandler2()"
IL_0001: ldftn "Sub C1(Of T).EventHandler2()"
IL_0007: newobj "Sub iTest.Event2EventHandler..ctor(Object, System.IntPtr)"
IL_000c: stloc.0
IL_000d: ldarg.0
IL_000e: ldfld "Private _o As T"
IL_000e: ldfld "C1(Of T)._o As T"
IL_0013: stloc.1
IL_0014: ldloc.1
IL_0015: box "T"
......@@ -1069,9 +1069,9 @@ End Interface
IL_0023: callvirt "Sub iTest.remove_Event2(iTest.Event2EventHandler)"
IL_0028: ldarg.0
IL_0029: ldarg.1
IL_002a: stfld "Private _o As T"
IL_002a: stfld "C1(Of T)._o As T"
IL_002f: ldarg.0
IL_0030: ldfld "Private _o As T"
IL_0030: ldfld "C1(Of T)._o As T"
IL_0035: stloc.1
IL_0036: ldloc.1
IL_0037: box "T"
......
......@@ -897,7 +897,7 @@ BC37230: Cannot continue since the edit includes a reference to an embedded type
[unchanged] V_1)
IL_0000: nop
IL_0001: ldnull
IL_0002: call "Public Shared Sub M2(o As Object)"
IL_0002: call "Sub C(Of T).M2(Object)"
IL_0007: nop
IL_0008: ret
}
......@@ -968,11 +968,11 @@ BC37230: Cannot continue since the edit includes a reference to an embedded type
IL_0000: nop
IL_0001: ldc.i4.0
IL_0002: box "C(Of N.IA).E"
IL_0007: call "Public Shared Sub M(o As Object)"
IL_0007: call "Sub C(Of T).M(Object)"
IL_000c: nop
IL_000d: ldc.i4.0
IL_000e: box "C(Of IB).E"
IL_0013: call "Public Shared Sub M(o As Object)"
IL_0013: call "Sub C(Of T).M(Object)"
IL_0018: nop
IL_0019: ret
}
......
......@@ -4158,12 +4158,12 @@ End Interface
Short? V_3,
System.Exception V_4)
IL_0000: ldarg.0
IL_0001: ldfld "Friend $State As Integer"
IL_0001: ldfld "Module1.VB$StateMachine_0_Test1(Of SM$T).$State As Integer"
IL_0006: stloc.1
.try
{
IL_0007: ldarg.0
IL_0008: ldfld "Friend $VB$Local_x As SM$T()"
IL_0008: ldfld "Module1.VB$StateMachine_0_Test1(Of SM$T).$VB$Local_x As SM$T()"
IL_000d: ldc.i4.0
IL_000e: readonly.
IL_0010: ldelema "SM$T"
......@@ -4196,9 +4196,9 @@ End Interface
IL_005a: stloc.s V_4
IL_005c: ldarg.0
IL_005d: ldc.i4.s -2
IL_005f: stfld "Friend $State As Integer"
IL_005f: stfld "Module1.VB$StateMachine_0_Test1(Of SM$T).$State As Integer"
IL_0064: ldarg.0
IL_0065: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Short?)"
IL_0065: ldflda "Module1.VB$StateMachine_0_Test1(Of SM$T).$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Short?)"
IL_006a: ldloc.s V_4
IL_006c: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Short?).SetException(System.Exception)"
IL_0071: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"
......@@ -4208,9 +4208,9 @@ End Interface
IL_0079: ldc.i4.s -2
IL_007b: dup
IL_007c: stloc.1
IL_007d: stfld "Friend $State As Integer"
IL_007d: stfld "Module1.VB$StateMachine_0_Test1(Of SM$T).$State As Integer"
IL_0082: ldarg.0
IL_0083: ldflda "Friend $Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Short?)"
IL_0083: ldflda "Module1.VB$StateMachine_0_Test1(Of SM$T).$Builder As System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Short?)"
IL_0088: ldloc.0
IL_0089: call "Sub System.Runtime.CompilerServices.AsyncTaskMethodBuilder(Of Short?).SetResult(Short?)"
IL_008e: ret
......
......@@ -3530,14 +3530,14 @@ B1::F
// Code size 36 (0x24)
.maxstack 3
IL_0000: ldarg.0
IL_0001: ldfld "Public $VB$Me As M1.OuterClass(Of V).B2"
IL_0001: ldfld "M1.OuterClass(Of V).B2._Closure$__1.$VB$Me As M1.OuterClass(Of V).B2"
IL_0006: dup
IL_0007: ldvirtftn "Function M1.OuterClass(Of V).B2.F(Of V)(V, V) As String"
IL_000d: newobj "Sub System.Func(Of V, V, String)..ctor(Object, System.IntPtr)"
IL_0012: ldarg.0
IL_0013: ldfld "Public $VB$Local_p As V"
IL_0013: ldfld "M1.OuterClass(Of V).B2._Closure$__1.$VB$Local_p As V"
IL_0018: ldarg.0
IL_0019: ldfld "Public $VB$Local_p As V"
IL_0019: ldfld "M1.OuterClass(Of V).B2._Closure$__1.$VB$Local_p As V"
IL_001e: callvirt "Function System.Func(Of V, V, String).Invoke(V, V) As String"
IL_0023: ret
}
......@@ -3547,13 +3547,13 @@ B1::F
// Code size 35 (0x23)
.maxstack 3
IL_0000: ldarg.0
IL_0001: ldfld "Public $VB$Me As M1.OuterClass(Of V).B2"
IL_0001: ldfld "M1.OuterClass(Of V).B2._Closure$__3.$VB$Me As M1.OuterClass(Of V).B2"
IL_0006: ldftn "Function M1.OuterClass(Of V).B2.$VB$ClosureStub_F_MyClass(Of V)(V, V) As String"
IL_000c: newobj "Sub System.Func(Of V, V, String)..ctor(Object, System.IntPtr)"
IL_0011: ldarg.0
IL_0012: ldfld "Public $VB$Local_p As V"
IL_0012: ldfld "M1.OuterClass(Of V).B2._Closure$__3.$VB$Local_p As V"
IL_0017: ldarg.0
IL_0018: ldfld "Public $VB$Local_p As V"
IL_0018: ldfld "M1.OuterClass(Of V).B2._Closure$__3.$VB$Local_p As V"
IL_001d: callvirt "Function System.Func(Of V, V, String).Invoke(V, V) As String"
IL_0022: ret
}
......@@ -3574,13 +3574,13 @@ B1::F
// Code size 35 (0x23)
.maxstack 3
IL_0000: ldarg.0
IL_0001: ldfld "Public $VB$Me As M1.OuterClass(Of V).B2"
IL_0001: ldfld "M1.OuterClass(Of V).B2._Closure$__5.$VB$Me As M1.OuterClass(Of V).B2"
IL_0006: ldftn "Function M1.OuterClass(Of V).B2.$VB$ClosureStub_F_MyBase(Of V)(V, V) As String"
IL_000c: newobj "Sub System.Func(Of V, V, String)..ctor(Object, System.IntPtr)"
IL_0011: ldarg.0
IL_0012: ldfld "Public $VB$Local_p As V"
IL_0012: ldfld "M1.OuterClass(Of V).B2._Closure$__5.$VB$Local_p As V"
IL_0017: ldarg.0
IL_0018: ldfld "Public $VB$Local_p As V"
IL_0018: ldfld "M1.OuterClass(Of V).B2._Closure$__5.$VB$Local_p As V"
IL_001d: callvirt "Function System.Func(Of V, V, String).Invoke(V, V) As String"
IL_0022: ret
}
......
......@@ -1216,7 +1216,7 @@ End Class
// Code size 18 (0x12)
.maxstack 2
IL_0000: ldarg.0
IL_0001: ldftn "Private Sub _Lambda$__1()"
IL_0001: ldftn "Sub GenParent(Of t)._Lambda$__1()"
IL_0007: newobj "Sub VB$AnonymousDelegate_0..ctor(Object, System.IntPtr)"
IL_000c: callvirt "Sub VB$AnonymousDelegate_0.Invoke()"
IL_0011: ret
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册