提交 00beb1f7 编写于 作者: W wochae

Port C# synthesized symbol refactoring work to VB

This is a part of porting C# synthesized refactoring work where the names of long-lived variables follow a naming pattern that allows us to reverse-engineer the SynthesizedLocalKind value from the variable name. Especially in this change, we give a synthesized variable an explicit name based on its SynthesizedLocalKind at emit time, not at local symbol creation time. (changeset 1324862)
上级 da262b04
......@@ -457,8 +457,8 @@
<Compile Include="Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb" />
<Compile Include="Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_UnaryOperator.vb" />
<Compile Include="Lowering\IteratorRewriter\IteratorRewriter.IteratorMethodToClassRewriter.vb" />
<Compile Include="Lowering\IteratorRewriter\IteratorRewriter.IteratorStateMachineTypeSymbol.vb" />
<Compile Include="Lowering\IteratorRewriter\IteratorRewriter.vb" />
<Compile Include="Lowering\IteratorRewriter\IteratorStateMachine.vb" />
<Compile Include="Lowering\LambdaRewriter\LambdaCapturedVariable.vb" />
<Compile Include="Lowering\LambdaRewriter\LambdaFrame.vb" />
<Compile Include="Lowering\LambdaRewriter\LambdaFrameConstructor.vb" />
......
......@@ -25,6 +25,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGen
''' <summary> Current enclosing Catch block if there is any. </summary>
Private _currentCatchBlock As BoundCatchBlock = Nothing
' unique id for generated local names
Private _uniqueId As Integer
' label used when when return is emitted in a form of store/goto
Private Shared ReadOnly ReturnLabel As New Object
......
......@@ -1231,7 +1231,6 @@ OtherExpressions:
End Sub
Private Function DefineLocal(local As LocalSymbol, syntaxNode As VisualBasicSyntaxNode) As LocalDefinition
Dim name As String = local.Name
Dim specType = local.Type.SpecialType
' We're treating constants of type Decimal and DateTime as local here to not create a new instance for each time
......@@ -1246,13 +1245,9 @@ OtherExpressions:
If local.HasConstantValue Then
Dim compileTimeValue As MetadataConstant = _module.CreateConstant(local.Type, local.ConstantValue, syntaxNode, _diagnostics)
Dim localConstantDef = New LocalConstantDefinition(name, If(local.Locations.FirstOrDefault(), Location.None), compileTimeValue)
' If there is a name, add it to the scope.
If name IsNot Nothing Then
' Reference in the scope for debugging purpose
_builder.AddLocalConstantToScope(localConstantDef)
End If
Dim localConstantDef = New LocalConstantDefinition(local.Name, If(local.Locations.FirstOrDefault(), Location.None), compileTimeValue)
' Reference in the scope for debugging purpose
_builder.AddLocalConstantToScope(localConstantDef)
Return Nothing
ElseIf Me.IsStackLocal(local) Then
......@@ -1266,6 +1261,7 @@ OtherExpressions:
Dim constraints = If(local.IsByRef, LocalSlotConstraints.ByRef, LocalSlotConstraints.None) Or
If(local.IsPinned, LocalSlotConstraints.Pinned, LocalSlotConstraints.None)
Dim name As String = GetLocalDebugName(local)
Debug.Assert(Not local.SynthesizedLocalKind.IsNamed(_optimizations) OrElse Not String.IsNullOrEmpty(name), "compiler generated names must be nonempty")
Dim localDef = _builder.LocalSlotManager.DeclareLocal(
......@@ -1288,11 +1284,28 @@ OtherExpressions:
End Function
Private Function GetLocalDebugName(local As LocalSymbol) As String
If local.Name IsNot Nothing Then
Debug.Assert(local.SynthesizedLocalKind = SynthesizedLocalKind.None)
Return local.Name
End If
If HasDebugName(local) Then
Return GeneratedNames.MakeLocalName(local.SynthesizedLocalKind, local.Type, _uniqueId)
End If
Return Nothing
End Function
Private Function HasDebugName(local As LocalSymbol) As Boolean
Return local.Name IsNot Nothing OrElse local.SynthesizedLocalKind.IsNamed(Me._optimizations)
End Function
Private Sub FreeLocal(temp As LocalSymbol)
'TODO: releasing locals with name NYI.
'NOTE: VB considers named local's extent to be whole method
' so releasing them may just not be possible.
If temp.Name Is Nothing AndAlso Not Me.IsStackLocal(temp) Then
If Not HasDebugName(temp) AndAlso Not Me.IsStackLocal(temp) Then
_builder.LocalSlotManager.FreeLocal(temp)
End If
End Sub
......
......@@ -13,7 +13,7 @@ Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.VisualBasic
Partial Friend NotInheritable Class IteratorRewriter
Inherits StateMachineRewriter(Of IteratorStateMachineTypeSymbol, FieldSymbol)
Inherits StateMachineRewriter(Of IteratorStateMachine, FieldSymbol)
Private Class IteratorMethodToClassRewriter
Inherits StateMachineMethodToClassRewriter
......
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Generic
Imports System.Collections.Immutable
Imports System.Threading
Imports Microsoft.Cci
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.Collections
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.VisualBasic
Partial Friend NotInheritable Class IteratorRewriter
Inherits StateMachineRewriter(Of IteratorStateMachineTypeSymbol, FieldSymbol)
Friend NotInheritable Class IteratorStateMachineTypeSymbol
Inherits SynthesizedContainer
Implements ISynthesizedMethodBodyImplementationSymbol
Private ReadOnly _constructor As SynthesizedSimpleConstructorSymbol
Private ReadOnly _iteratorMethod As MethodSymbol
Protected Friend Sub New(topLevelMethod As MethodSymbol,
typeIndex As Integer,
valueTypeSymbol As TypeSymbol,
isEnumerable As Boolean)
MyBase.New(topLevelMethod,
GeneratedNames.MakeStateMachineTypeName(typeIndex, topLevelMethod.Name),
topLevelMethod.ContainingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Object),
GetIteratorInterfaces(valueTypeSymbol,
isEnumerable,
topLevelMethod.ContainingAssembly))
Dim intType = DeclaringCompilation.GetSpecialType(SpecialType.System_Int32)
Me._constructor = New SynthesizedSimpleConstructorSymbol(Me)
Dim parameters = ImmutableArray.Create(Of ParameterSymbol)(
New SynthesizedParameterSymbol(Me._constructor, intType, 0, False, GeneratedNames.MakeStateMachineStateFieldName()))
Me._constructor.SetParameters(parameters)
Me._iteratorMethod = topLevelMethod
End Sub
Private Shared Function GetIteratorInterfaces(elementType As TypeSymbol,
isEnumerable As Boolean,
containingAssembly As AssemblySymbol) As ImmutableArray(Of NamedTypeSymbol)
Dim interfaces = ArrayBuilder(Of NamedTypeSymbol).GetInstance()
If isEnumerable Then
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_Generic_IEnumerable_T).Construct(elementType))
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_IEnumerable))
End If
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_Generic_IEnumerator_T).Construct(elementType))
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_IDisposable))
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_IEnumerator))
Return interfaces.ToImmutableAndFree()
End Function
Public Overrides ReadOnly Property TypeKind As TypeKind
Get
Return TypeKind.Class
End Get
End Property
Friend Overrides ReadOnly Property IsInterface As Boolean
Get
Return False
End Get
End Property
Protected Friend Overrides ReadOnly Property Constructor As MethodSymbol
Get
Return Me._constructor
End Get
End Property
Public ReadOnly Property HasMethodBodyDependency As Boolean Implements ISynthesizedMethodBodyImplementationSymbol.HasMethodBodyDependency
Get
' This method contains user code from the iterator method
Return True
End Get
End Property
Public ReadOnly Property Method As IMethodSymbol Implements ISynthesizedMethodBodyImplementationSymbol.Method
Get
Return _iteratorMethod
End Get
End Property
End Class
End Class
End Namespace
......@@ -7,11 +7,11 @@ Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Namespace Microsoft.CodeAnalysis.VisualBasic
Partial Friend NotInheritable Class IteratorRewriter
Inherits StateMachineRewriter(Of IteratorStateMachineTypeSymbol, FieldSymbol)
Inherits StateMachineRewriter(Of IteratorStateMachine, FieldSymbol)
Private ReadOnly elementType As TypeSymbol
Private ReadOnly isEnumerable As Boolean
Private ReadOnly iteratorClass As IteratorStateMachineTypeSymbol
Private ReadOnly iteratorClass As IteratorStateMachine
Private currentField As FieldSymbol
Private initialThreadIdField As FieldSymbol
......@@ -19,7 +19,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Public Sub New(body As BoundStatement,
method As MethodSymbol,
isEnumerable As Boolean,
stateMachineType As IteratorStateMachineTypeSymbol,
stateMachineType As IteratorStateMachine,
slotAllocatorOpt As VariableSlotAllocator,
compilationState As TypeCompilationState,
diagnostics As DiagnosticBag)
......@@ -64,7 +64,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
elementType = DirectCast(methodReturnType, NamedTypeSymbol).TypeArgumentsNoUseSiteDiagnostics(0)
End If
Dim stateMachineType = New IteratorStateMachineTypeSymbol(method, compilationState.GenerateTempNumber(), elementType, isEnumerable)
Dim stateMachineType = New IteratorStateMachine(method, compilationState.GenerateTempNumber(), elementType, isEnumerable)
Dim rewriter As New IteratorRewriter(body, method, isEnumerable, stateMachineType, slotAllocatorOpt, compilationState, diagnostics)
......@@ -331,7 +331,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
Protected Overrides ReadOnly Property StateMachineClass As IteratorStateMachineTypeSymbol
Protected Overrides ReadOnly Property StateMachineClass As IteratorStateMachine
Get
Return iteratorClass
End Get
......
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Generic
Imports System.Collections.Immutable
Imports System.Threading
Imports Microsoft.Cci
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.Collections
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.VisualBasic
Friend NotInheritable Class IteratorStateMachine
Inherits SynthesizedContainer
Implements ISynthesizedMethodBodyImplementationSymbol
Private ReadOnly _constructor As SynthesizedSimpleConstructorSymbol
Private ReadOnly _iteratorMethod As MethodSymbol
Protected Friend Sub New(topLevelMethod As MethodSymbol,
typeIndex As Integer,
valueTypeSymbol As TypeSymbol,
isEnumerable As Boolean)
MyBase.New(topLevelMethod,
GeneratedNames.MakeStateMachineTypeName(typeIndex, topLevelMethod.Name),
topLevelMethod.ContainingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Object),
GetIteratorInterfaces(valueTypeSymbol,
isEnumerable,
topLevelMethod.ContainingAssembly))
Dim intType = DeclaringCompilation.GetSpecialType(SpecialType.System_Int32)
Me._constructor = New SynthesizedSimpleConstructorSymbol(Me)
Dim parameters = ImmutableArray.Create(Of ParameterSymbol)(
New SynthesizedParameterSymbol(Me._constructor, intType, 0, False, GeneratedNames.MakeStateMachineStateFieldName()))
Me._constructor.SetParameters(parameters)
Me._iteratorMethod = topLevelMethod
End Sub
Private Shared Function GetIteratorInterfaces(elementType As TypeSymbol,
isEnumerable As Boolean,
containingAssembly As AssemblySymbol) As ImmutableArray(Of NamedTypeSymbol)
Dim interfaces = ArrayBuilder(Of NamedTypeSymbol).GetInstance()
If isEnumerable Then
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_Generic_IEnumerable_T).Construct(elementType))
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_IEnumerable))
End If
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_Generic_IEnumerator_T).Construct(elementType))
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_IDisposable))
interfaces.Add(containingAssembly.GetSpecialType(Microsoft.CodeAnalysis.SpecialType.System_Collections_IEnumerator))
Return interfaces.ToImmutableAndFree()
End Function
Public Overrides ReadOnly Property TypeKind As TypeKind
Get
Return TypeKind.Class
End Get
End Property
Friend Overrides ReadOnly Property IsInterface As Boolean
Get
Return False
End Get
End Property
Protected Friend Overrides ReadOnly Property Constructor As MethodSymbol
Get
Return Me._constructor
End Get
End Property
Public ReadOnly Property HasMethodBodyDependency As Boolean Implements ISynthesizedMethodBodyImplementationSymbol.HasMethodBodyDependency
Get
' This method contains user code from the iterator method
Return True
End Get
End Property
Public ReadOnly Property Method As IMethodSymbol Implements ISynthesizedMethodBodyImplementationSymbol.Method
Get
Return _iteratorMethod
End Get
End Property
End Class
End Namespace
\ No newline at end of file
......@@ -25,35 +25,28 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Me.m_isMe = isMeParameter
End Sub
Public Shared Function Create(frame As LambdaFrame, captured As Symbol) As LambdaCapturedVariable
Public Shared Function Create(frame As LambdaFrame, captured As Symbol, ByRef uniqueId As Integer) As LambdaCapturedVariable
Debug.Assert(TypeOf captured Is LocalSymbol OrElse TypeOf captured Is ParameterSymbol)
Dim fieldName = GetCapturedVariableFieldName(captured)
Dim fieldName = GetCapturedVariableFieldName(captured, uniqueId)
Dim type = GetCapturedVariableFieldType(frame, captured)
Return New LambdaCapturedVariable(frame, captured, type, fieldName, IsMe(captured))
End Function
Public Shared Function GetCapturedVariableFieldName(captured As Symbol) As String
Dim name As String
Public Shared Function GetCapturedVariableFieldName(captured As Symbol, ByRef uniqueId As Integer) As String
' captured symbol is either a local or parameter.
Dim local = TryCast(captured, LocalSymbol)
If local IsNot Nothing AndAlso local.IsCompilerGenerated Then
Return StringConstants.LiftedNonLocalPrefix & If(local.SynthesizedLocalKind.IsLongLived(), GeneratedNames.MakeLocalName(local.SynthesizedLocalKind, local.Type, uniqueId), Nothing)
End If
If local IsNot Nothing Then
' it is a local variable
name = If(local.IsCompilerGenerated,
StringConstants.LiftedNonLocalPrefix & captured.Name,
StringConstants.LiftedLocalPrefix & captured.Name)
Else
' it must be a parameter
Dim parameter = DirectCast(captured, ParameterSymbol)
name = If(parameter.IsMe,
StringConstants.LiftedMeName,
StringConstants.LiftedLocalPrefix & captured.Name)
Dim parameter = TryCast(captured, ParameterSymbol)
If parameter IsNot Nothing AndAlso parameter.IsMe Then
Return StringConstants.LiftedMeName
End If
Return name
Return StringConstants.LiftedLocalPrefix & captured.Name
End Function
Public Shared Function GetCapturedVariableFieldType(frame As LambdaFrame, captured As Symbol) As TypeSymbol
......
......@@ -53,7 +53,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
copyConstructor As Boolean,
tempNumber As Integer
)
MyBase.New(enclosingMethod, StringConstants.ClosureClassPrefix & tempNumber, containingType, ImmutableArray(Of NamedTypeSymbol).Empty)
MyBase.New(enclosingMethod, GeneratedNames.MakeLambdaDisplayClassName(tempNumber), containingType, ImmutableArray(Of NamedTypeSymbol).Empty)
Me.m_containingSymbol = containingType
......
......@@ -65,6 +65,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
' "This" in the context of current method.
Private currentFrameThis As ParameterSymbol
' ID dispenser for field names of frame references.
Private synthesizedFieldNameIdDispenser As Integer
' The symbol (field or local) holding the innermost frame.
' Needed in case inner frame needs to reference outer frame.
Private innermostFramePointer As Symbol
......@@ -104,6 +107,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End If
Me.currentFrameThis = method.MeParameter
Me.synthesizedFieldNameIdDispenser = 1
End Sub
''' <summary>
......@@ -200,7 +204,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End If
End If
Dim proxy = LambdaCapturedVariable.Create(frame, captured)
Dim proxy = LambdaCapturedVariable.Create(frame, captured, synthesizedFieldNameIdDispenser)
Proxies.Add(captured, proxy)
If CompilationState.ModuleBuilderOpt IsNot Nothing Then
frame.m_captured_locals.Add(proxy)
......@@ -361,7 +365,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Optional origLambda As LambdaSymbol = Nothing) As BoundNode
Dim frameType As NamedTypeSymbol = ConstructFrameType(frame, currentTypeParameters)
Dim framePointer = New SynthesizedLocal(Me._topLevelMethod, frameType, SynthesizedLocalKind.LambdaDisplayClass, CompilationState.GenerateTempNumber())
Dim framePointer = New SynthesizedLocal(Me._topLevelMethod, frameType, SynthesizedLocalKind.LambdaDisplayClass)
CompilationState.AddSynthesizedMethod(frame.Constructor, MakeFrameCtor(frame, Diagnostics))
Dim prologue = ArrayBuilder(Of BoundExpression).GetInstance()
......@@ -390,7 +394,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Proxies.TryGetValue(innermostFramePointer, oldInnermostFrameProxy)
If _analysis.needsParentFrame.Contains(node) Then
Dim capturedFrame = LambdaCapturedVariable.Create(frame, innermostFramePointer)
Dim capturedFrame = LambdaCapturedVariable.Create(frame, innermostFramePointer, synthesizedFieldNameIdDispenser)
Dim frameParent = capturedFrame.AsMember(frameType)
Dim left As BoundExpression = New BoundFieldAccess(syntaxNode,
New BoundLocal(syntaxNode, framePointer, frameType),
......
......@@ -58,7 +58,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
tempNumber As Integer,
diagnostics As DiagnosticBag)
MyBase.New(lambdaNode.Syntax, containingType, StringConstants.LAMBDA_PREFIX & tempNumber, isShared)
MyBase.New(lambdaNode.Syntax, containingType, GeneratedNames.MakeLambdaMethodName(tempNumber), isShared)
Me.m_lambda = lambdaNode.LambdaSymbol
Me.m_isShared = isShared
Me.m_locations = ImmutableArray.Create(Of Location)(lambdaNode.Syntax.GetLocation())
......
......@@ -353,6 +353,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
) As BoundStatement
' Dim collectionCopy As C = c
Dim expressionType = initExpression.Type
Debug.Assert(kind.IsLongLived())
Dim collectionCopy = New SynthesizedLocal(Me.currentMethodOrLambda, expressionType, kind, syntaxNode)
locals.Add(collectionCopy)
boundLocal = New BoundLocal(syntaxNode, collectionCopy, expressionType)
......
......@@ -274,7 +274,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Function
Private Function CreateTempLocalInExpressionLambda(syntax As VisualBasicSyntaxNode, type As TypeSymbol, expr As BoundExpression) As BoundLocal
Dim local As New SynthesizedLocal(Me.topMethod, type, SynthesizedLocalKind.XmlInExpressionLambda, Me.compilationState.GenerateTempNumber)
Dim local As New SynthesizedLocal(Me.topMethod, type, SynthesizedLocalKind.XmlInExpressionLambda)
Dim boundLocal = New BoundLocal(syntax, local, type)
Me.xmlFixupData.AddLocal(local, New BoundAssignmentOperator(syntax, boundLocal, expr, suppressObjectClone:=True, type:=type))
Return boundLocal.MakeRValue()
......
......@@ -70,19 +70,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Next
End Sub
Friend Shared Function IsSynthetic(symbol As Symbol) As Boolean
' TODO: this matches C# implementation, but may need to be revised according to VB semantics
' Special Case: There's logic in the EE to recognize locals that have been captured by a lambda
' and would have been hoisted for the state machine. Basically, we just hoist the local containing
' the instance of the lambda closure class as if it were user-created, rather than a compiler temp.
' The upshot is that an entry is created for a pseudo-local with a double-mangled name (hoisting
' mangling wrapping closure mangling, e.g. $VB$ResumableLocal_$VB$Closure_4$1).
Dim name As String = symbol.Name
Return Not (SyntaxFacts.IsValidIdentifier(name) AndAlso symbol.Locations.Length > 0 AndAlso symbol.CanBeReferencedByName) AndAlso
Not (name IsNot Nothing AndAlso name.StartsWith(StringConstants.ClosureVariablePrefix))
End Function
''' <summary>
''' Implementation-specific name for labels to mark state machine resume points.
''' </summary>
......@@ -184,7 +171,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Dim proxyFields = ArrayBuilder(Of FieldSymbol).GetInstance()
For Each local In locals
If Not IsSynthetic(local) Then
If local.SynthesizedLocalKind = SynthesizedLocalKind.None OrElse local.SynthesizedLocalKind = SynthesizedLocalKind.LambdaDisplayClass Then
Dim proxy As TProxy = Nothing
If Proxies.TryGetValue(local, proxy) Then
Me.AddProxyFieldsForStateMachineScope(proxy, proxyFields)
......
......@@ -311,8 +311,16 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Protected Function MakeHoistedFieldForLocal(local As LocalSymbol, localType As TypeSymbol) As FieldSymbol
Dim proxyName As String
If StateMachineMethodToClassRewriter.IsSynthetic(local) Then
proxyName = GeneratedNames.MakeStateMachineLocalName(Me.nextTempNumber, local.Name)
If local.SynthesizedLocalKind = SynthesizedLocalKind.LambdaDisplayClass Then
' Special Case: There's logic in the EE to recognize locals that have been captured by a lambda
' and would have been hoisted for the state machine. Basically, we just hoist the local containing
' the instance of the lambda closure class as if it were user-created, rather than a compiler temp.
proxyName = GeneratedNames.MakeStateMachineLocalName(Me.nextLocalNumber, GeneratedNames.MakeLocalName(local.SynthesizedLocalKind, localType, Me.nextLocalNumber))
Me.nextLocalNumber += 1
ElseIf local.SynthesizedLocalKind <> SynthesizedLocalKind.None Then
proxyName = GeneratedNames.MakeStateMachineLocalName(Me.nextTempNumber,
If(local.SynthesizedLocalKind.IsLongLived(), GeneratedNames.MakeLocalName(local.SynthesizedLocalKind, localType, Me.nextTempNumber), Nothing))
Me.nextTempNumber += 1
Else
proxyName = GeneratedNames.MakeStateMachineLocalName(Me.nextLocalNumber, local.Name)
......
......@@ -175,12 +175,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return False
End Function
Friend Shared Function GenerateTempName(kind As SynthesizedLocalKind) As String
Select Case kind
Friend Shared Function MakeLocalName(kind As SynthesizedLocalKind, type As TypeSymbol, ByRef index As Integer) As String
Debug.Assert(kind.IsLongLived())
Case SynthesizedLocalKind.LoweringTemp,
SynthesizedLocalKind.None
Return Nothing
Select Case kind
Case SynthesizedLocalKind.XmlInExpressionLambda
index += 1
Return SynthesizedLocalNamePrefix & type.GetNativeCompilerVType() & "$L" & index
Case SynthesizedLocalKind.LambdaDisplayClass
'TODO: VB10 adds line/column numbers in hex here. Not sure if that is important or always meaningful.
index += 1
Return StringConstants.ClosureVariablePrefix & index
Case SynthesizedLocalKind.Lock
Return StringConstants.SynthesizedLocalKindLock
......@@ -221,7 +226,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return StringConstants.OnErrorCurrentStatement
Case SynthesizedLocalKind.OnErrorCurrentLine
Return StringConstants.OnErrorCurrentLine
End Select
Throw ExceptionUtilities.UnexpectedValue(kind)
......@@ -229,19 +233,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Private Const SynthesizedLocalNamePrefix As String = "VB$"
Friend Shared Function GenerateTempName(kind As SynthesizedLocalKind, type As TypeSymbol, index As Integer) As String
Select Case kind
Case SynthesizedLocalKind.XmlInExpressionLambda
Return SynthesizedLocalNamePrefix & type.GetNativeCompilerVType() & "$L" & index
Case SynthesizedLocalKind.LambdaDisplayClass
'TODO: VB10 adds line/column numbers in hex here. Not sure if that is important or always meaningful.
Return StringConstants.ClosureVariablePrefix & index
End Select
Throw ExceptionUtilities.UnexpectedValue(kind)
End Function
Friend Shared Function TryParseLocalName(name As String, ByRef kind As SynthesizedLocalKind, ByRef uniqueId As Integer) As Boolean
'TODO: are we using this for anything?
......@@ -300,6 +291,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Select
Return True
End Function
Friend Shared Function MakeLambdaMethodName(index As Integer) As String
Return StringConstants.LAMBDA_PREFIX & index
End Function
Friend Shared Function MakeLambdaDisplayClassName(index As Integer) As String
Return StringConstants.ClosureClassPrefix & index
End Function
End Class
End Namespace
\ No newline at end of file
' Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Text
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
<DebuggerDisplay("{GetDebuggerDisplay(), nq}")>
Friend Class SynthesizedLocal
Inherits LocalSymbol
Private ReadOnly m_kind As SynthesizedLocalKind
Private ReadOnly m_isByRef As Boolean
Private ReadOnly m_Name As String
Private ReadOnly m_syntax As StatementSyntax
Friend Sub New(container As Symbol, type As TypeSymbol, kind As SynthesizedLocalKind, Optional syntax As StatementSyntax = Nothing, Optional isByRef As Boolean = False)
......@@ -21,16 +22,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Me.m_kind = kind
Me.m_syntax = syntax
Me.m_isByRef = isByRef
Me.m_Name = GeneratedNames.GenerateTempName(kind)
End Sub
Friend Sub New(container As Symbol, type As TypeSymbol, kind As SynthesizedLocalKind, index As Integer)
MyBase.New(container, LocalDeclarationKind.None, type)
Me.m_kind = kind
Me.m_syntax = Nothing
Me.m_isByRef = False
Me.m_Name = GeneratedNames.GenerateTempName(kind, type, index)
End Sub
Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
......@@ -59,7 +50,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Public Overrides ReadOnly Property Name As String
Get
Return m_Name
Return Nothing
End Get
End Property
......@@ -74,6 +65,16 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Return m_kind
End Get
End Property
Private Function GetDebuggerDisplay() As String
Dim builder As New StringBuilder()
builder.Append(If(m_kind = SynthesizedLocalKind.None, "<temp>", m_kind.ToString()))
builder.Append(" ")
builder.Append(Me.Type.ToDisplayString(SymbolDisplayFormat.TestFormat))
Return builder.ToString()
End Function
End Class
End Namespace
\ No newline at end of file
......@@ -447,7 +447,7 @@ Hello World!
.maxstack 2
.locals init (T V_0, //a
T V_1,
System.Collections.IEnumerator V_2) //VB$ForEachEnumerator
System.Collections.IEnumerator V_2)
IL_0000: call "Function System.Activator.CreateInstance(Of T)() As T"
IL_0005: stloc.1
IL_0006: ldloca.s V_1
......@@ -597,7 +597,7 @@ Hello World!
{
// Code size 102 (0x66)
.maxstack 4
.locals init (C1._Closure$__1 V_0) //$VB$Closure_2
.locals init (C1._Closure$__1 V_0) //$VB$Closure_1
IL_0000: newobj "Sub C1._Closure$__1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -606,19 +606,19 @@ Hello World!
IL_0011: newobj "Sub System.Collections.Generic.List(Of System.Action)..ctor()"
IL_0016: dup
IL_0017: ldloc.0
IL_0018: ldftn "Sub C1._Closure$__1._Lambda$__3()"
IL_0018: ldftn "Sub C1._Closure$__1._Lambda$__2()"
IL_001e: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0023: callvirt "Sub System.Collections.Generic.List(Of System.Action).Add(System.Action)"
IL_0028: dup
IL_0029: ldsfld "C1._ClosureCache$__5 As System.Action"
IL_0029: ldsfld "C1._ClosureCache$__4 As System.Action"
IL_002e: brfalse.s IL_0037
IL_0030: ldsfld "C1._ClosureCache$__5 As System.Action"
IL_0030: ldsfld "C1._ClosureCache$__4 As System.Action"
IL_0035: br.s IL_0049
IL_0037: ldnull
IL_0038: ldftn "Sub C1._Lambda$__4(Object)"
IL_0038: ldftn "Sub C1._Lambda$__3(Object)"
IL_003e: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0043: dup
IL_0044: stsfld "C1._ClosureCache$__5 As System.Action"
IL_0044: stsfld "C1._ClosureCache$__4 As System.Action"
IL_0049: callvirt "Sub System.Collections.Generic.List(Of System.Action).Add(System.Action)"
IL_004e: dup
IL_004f: ldc.i4.0
......@@ -664,14 +664,14 @@ End Class
{
// Code size 53 (0x35)
.maxstack 5
.locals init (C1._Closure$__1 V_0) //$VB$Closure_2
.locals init (C1._Closure$__1 V_0) //$VB$Closure_1
IL_0000: newobj "Sub C1._Closure$__1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
IL_0007: newobj "Sub System.Collections.Generic.List(Of System.Action)..ctor()"
IL_000c: dup
IL_000d: ldloc.0
IL_000e: ldftn "Sub C1._Closure$__1._Lambda$__3()"
IL_000e: ldftn "Sub C1._Closure$__1._Lambda$__2()"
IL_0014: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0019: callvirt "Sub System.Collections.Generic.List(Of System.Action).Add(System.Action)"
IL_001e: stfld "C1._Closure$__1.$VB$Local_x As System.Collections.Generic.List(Of System.Action)"
......
......@@ -57,8 +57,8 @@ End Class
// Code size 73 (0x49)
.maxstack 3
.locals init (Integer() V_0, //myarray
Integer V_1, //VB$ForLimit
Integer V_2, //VB$ForStep
Integer V_1,
Integer V_2,
Integer V_3) //i
IL_0000: ldc.i4.2
IL_0001: newarr "Integer"
......@@ -130,8 +130,8 @@ End Class
{
// Code size 97 (0x61)
.maxstack 2
.locals init (Double V_0, //VB$ForStep
Boolean V_1, //VB$LoopDirection
.locals init (Double V_0,
Boolean V_1,
Double V_2) //i
IL_0000: ldc.r8 1.1
IL_0009: stloc.0
......@@ -197,8 +197,8 @@ End Class
// Code size 92 (0x5c)
.maxstack 2
.locals init (Byte V_0, //s
Decimal V_1, //VB$ForStep
Boolean V_2, //VB$LoopDirection
Decimal V_1,
Boolean V_2,
Decimal V_3) //i
IL_0000: ldc.i4.1
IL_0001: stloc.0
......@@ -272,9 +272,9 @@ End Class
// Code size 99 (0x63)
.maxstack 2
.locals init (Byte V_0, //s
Decimal V_1, //VB$ForLimit
Decimal V_2, //VB$ForStep
Boolean V_3, //VB$LoopDirection
Decimal V_1,
Decimal V_2,
Boolean V_3,
Decimal V_4) //i
IL_0000: ldc.i4.1
IL_0001: stloc.0
......@@ -350,8 +350,8 @@ End Class
{
// Code size 97 (0x61)
.maxstack 2
.locals init (Double V_0, //VB$ForStep
Boolean V_1, //VB$LoopDirection
.locals init (Double V_0,
Boolean V_1,
Double V_2) //i
IL_0000: ldc.r8 -1.1
IL_0009: stloc.0
......@@ -425,7 +425,7 @@ End Class
Object V_1, //initValue
Object V_2, //limit
Object V_3, //stp
Object V_4) //VB$LoopObject
Object V_4)
IL_0000: ldc.i4.0
IL_0001: box "Integer"
IL_0006: stloc.1
......@@ -919,7 +919,7 @@ End Class
// Code size 52 (0x34)
.maxstack 6
.locals init (Integer V_0, //x
Object V_1, //VB$LoopObject
Object V_1,
Object V_2) //J
IL_0000: ldc.i4.1
IL_0001: stloc.0
......@@ -972,7 +972,7 @@ End Class
// Code size 50 (0x32)
.maxstack 6
.locals init (Integer V_0, //x
Object V_1, //VB$LoopObject
Object V_1,
Object V_2) //J
IL_0000: ldc.i4.1
IL_0001: stloc.0
......@@ -1021,7 +1021,7 @@ End Class
{
// Code size 48 (0x30)
.maxstack 6
.locals init (Object V_0, //VB$LoopObject
.locals init (Object V_0,
Object V_1) //J
IL_0000: ldloc.1
IL_0001: ldc.i4.0
......@@ -1070,7 +1070,7 @@ End Class
{
// Code size 67 (0x43)
.maxstack 6
.locals init (Object V_0, //VB$LoopObject
.locals init (Object V_0,
Object V_1, //IntCounter
Object V_2)
IL_0000: ldloc.1
......@@ -1164,7 +1164,7 @@ End Class
.locals init (Object V_0, //ObjStart
Object V_1, //ObjEndProp
Object V_2, //ObjStep
Object V_3, //VB$LoopObject
Object V_3,
Object V_4) //Idx
IL_0000: ldc.i4.1
IL_0001: box "Integer"
......@@ -1436,8 +1436,8 @@ End Class
{
// Code size 39 (0x27)
.maxstack 3
.locals init (Integer V_0, //VB$ForLimit
Integer V_1, //VB$ForStep
.locals init (Integer V_0,
Integer V_1,
Integer V_2) //x
IL_0000: ldloc.2
IL_0001: ldc.i4.s 20
......@@ -1536,7 +1536,7 @@ End Class
// Code size 28 (0x1c)
.maxstack 2
.locals init (Integer V_0, //x
Integer V_1, //VB$ForLimit
Integer V_1,
Integer V_2) //J
IL_0000: ldc.i4.5
IL_0001: stloc.0
......@@ -1778,9 +1778,9 @@ c
{
// Code size 175 (0xaf)
.maxstack 3
.locals init (Program.e1? V_0, //VB$ForLimit
Program.e1? V_1, //VB$ForStep
Boolean V_2, //VB$LoopDirection
.locals init (Program.e1? V_0,
Program.e1? V_1,
Boolean V_2,
Program.e1? V_3, //i
Program.e1? V_4)
IL_0000: ldc.i4.0
......@@ -1890,7 +1890,7 @@ End Module
{
// Code size 35 (0x23)
.maxstack 3
.locals init (Program.e1 V_0, //VB$ForStep
.locals init (Program.e1 V_0,
Program.e1 V_1) //i
IL_0000: call "Function Program.foo() As Program.e1"
IL_0005: stloc.0
......@@ -1955,7 +1955,7 @@ End Module
{
// Code size 23 (0x17)
.maxstack 2
.locals init (Program.e1 V_0, //VB$ForStep
.locals init (Program.e1 V_0,
Program.e1 V_1) //i
IL_0000: call "Function Program.foo() As Program.e1"
IL_0005: stloc.0
......
......@@ -38,8 +38,8 @@ two
{
// Code size 46 (0x2e)
.maxstack 4
.locals init (String() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (String() V_0,
Integer V_1)
IL_0000: ldc.i4.2
IL_0001: newarr "String"
IL_0006: dup
......@@ -93,8 +93,8 @@ End Class
{
// Code size 37 (0x25)
.maxstack 3
.locals init (Integer() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (Integer() V_0,
Integer V_1)
IL_0000: ldc.i4.3
IL_0001: newarr "Integer"
IL_0006: dup
......@@ -145,8 +145,8 @@ End Class
{
// Code size 42 (0x2a)
.maxstack 4
.locals init (Long() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (Long() V_0,
Integer V_1)
IL_0000: ldc.i4.2
IL_0001: newarr "Long"
IL_0006: dup
......@@ -202,8 +202,8 @@ End Class
{
// Code size 43 (0x2b)
.maxstack 4
.locals init (Long() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (Long() V_0,
Integer V_1)
IL_0000: ldc.i4.1
IL_0001: newarr "Long"
IL_0006: dup
......@@ -252,8 +252,8 @@ End Class
{
// Code size 34 (0x22)
.maxstack 4
.locals init (Integer() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (Integer() V_0,
Integer V_1)
IL_0000: ldc.i4.1
IL_0001: newarr "Integer"
IL_0006: dup
......@@ -309,8 +309,8 @@ End Class
{
// Code size 30 (0x1e)
.maxstack 4
.locals init (Integer() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (Integer() V_0,
Integer V_1)
IL_0000: ldc.i4.1
IL_0001: newarr "Integer"
IL_0006: dup
......@@ -359,7 +359,7 @@ End Structure
// Code size 77 (0x4d)
.maxstack 2
.locals init (S V_0,
System.Collections.IEnumerator V_1, //VB$ForEachEnumerator
System.Collections.IEnumerator V_1,
S V_2)
.try
{
......@@ -438,7 +438,7 @@ End Class
{
// Code size 52 (0x34)
.maxstack 1
.locals init (System.Collections.IEnumerator V_0) //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0)
.try
{
IL_0000: ldnull
......@@ -629,7 +629,7 @@ End Class
{
// Code size 98 (0x62)
.maxstack 5
.locals init (System.Collections.IEnumerator V_0) //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0)
IL_0000: ldc.i4.3
IL_0001: ldc.i4.2
IL_0002: newobj "Integer(*,*)..ctor"
......@@ -770,9 +770,9 @@ End Class
// Code size 141 (0x8d)
.maxstack 3
.locals init (System.Collections.Generic.Dictionary(Of Integer, Integer) V_0, //s
System.Collections.Generic.Dictionary(Of Integer, Integer).Enumerator V_1, //VB$ForEachEnumerator
System.Collections.Generic.Dictionary(Of Integer, Integer).Enumerator V_1,
System.Collections.Generic.KeyValuePair(Of Integer, Integer) V_2, //pair
System.Collections.Generic.Dictionary(Of Integer, Integer).Enumerator V_3, //VB$ForEachEnumerator
System.Collections.Generic.Dictionary(Of Integer, Integer).Enumerator V_3,
System.Collections.Generic.KeyValuePair(Of Integer, Integer) V_4) //pair
IL_0000: newobj "Sub System.Collections.Generic.Dictionary(Of Integer, Integer)..ctor()"
IL_0005: stloc.0
......@@ -928,7 +928,7 @@ End Class
{
// Code size 99 (0x63)
.maxstack 3
.locals init (System.Collections.Generic.IEnumerator(Of String) V_0) //VB$ForEachEnumerator
.locals init (System.Collections.Generic.IEnumerator(Of String) V_0)
.try
{
IL_0000: ldc.i4.3
......@@ -1026,7 +1026,7 @@ End Class
{
// Code size 41 (0x29)
.maxstack 1
.locals init (System.Collections.Generic.IEnumerator(Of Integer) V_0) //VB$ForEachEnumerator
.locals init (System.Collections.Generic.IEnumerator(Of Integer) V_0)
.try
{
IL_0000: newobj "Sub Gen(Of Integer)..ctor()"
......@@ -1107,7 +1107,7 @@ End Class
{
// Code size 33 (0x21)
.maxstack 1
.locals init (MyCollection.MyEnumerator V_0) //VB$ForEachEnumerator
.locals init (MyCollection.MyEnumerator V_0)
IL_0000: newobj "Sub MyCollection..ctor()"
IL_0005: callvirt "Function MyCollection.GetEnumerator() As MyCollection.MyEnumerator"
IL_000a: stloc.0
......@@ -1163,7 +1163,7 @@ End Class
{
// Code size 33 (0x21)
.maxstack 1
.locals init (Enumerator V_0) //VB$ForEachEnumerator
.locals init (Enumerator V_0)
IL_0000: newobj "Sub Enumerable..ctor()"
IL_0005: call "Function Enumerable.GetEnumerator() As Enumerator"
IL_000a: stloc.0
......@@ -1214,7 +1214,7 @@ End Class
{
// Code size 65 (0x41)
.maxstack 1
.locals init (System.Collections.IEnumerator V_0) //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0)
.try
{
IL_0000: newobj "Sub Enumerable..ctor()"
......@@ -1290,7 +1290,7 @@ End Structure
{
// Code size 51 (0x33)
.maxstack 1
.locals init (Enumerator V_0) //VB$ForEachEnumerator
.locals init (Enumerator V_0)
.try
{
IL_0000: newobj "Sub Enumerable..ctor()"
......@@ -1359,7 +1359,7 @@ End Structure
{
// Code size 35 (0x23)
.maxstack 1
.locals init (Enumerator V_0) //VB$ForEachEnumerator
.locals init (Enumerator V_0)
IL_0000: newobj "Sub Enumerable..ctor()"
IL_0005: call "Function Enumerable.GetEnumerator() As Enumerator"
IL_000a: stloc.0
......@@ -1416,7 +1416,7 @@ End Structure
{
// Code size 35 (0x23)
.maxstack 1
.locals init (Enumerator V_0) //VB$ForEachEnumerator
.locals init (Enumerator V_0)
IL_0000: newobj "Sub Enumerable..ctor()"
IL_0005: call "Function Enumerable.GetEnumerator() As Enumerator"
IL_000a: stloc.0
......@@ -1464,7 +1464,7 @@ End Structure
{
// Code size 79 (0x4f)
.maxstack 1
.locals init (System.Collections.IEnumerator V_0, //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0,
Enumerable V_1)
.try
{
......@@ -1532,7 +1532,7 @@ End Structure
{
// Code size 72 (0x48)
.maxstack 1
.locals init (System.Collections.IEnumerator V_0, //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0,
Enumerable V_1)
.try
{
......@@ -1615,7 +1615,7 @@ End Class
{
// Code size 45 (0x2d)
.maxstack 1
.locals init (Enumerator V_0) //VB$ForEachEnumerator
.locals init (Enumerator V_0)
.try
{
IL_0000: newobj "Sub Enumerable..ctor()"
......@@ -1684,7 +1684,7 @@ End Class
{
// Code size 33 (0x21)
.maxstack 1
.locals init (Enumerator V_0) //VB$ForEachEnumerator
.locals init (Enumerator V_0)
IL_0000: newobj "Sub Enumerable..ctor()"
IL_0005: call "Function Enumerable.GetEnumerator() As Enumerator"
IL_000a: stloc.0
......@@ -1778,8 +1778,8 @@ End Class
{
// Code size 65 (0x41)
.maxstack 1
.locals init (AbstractEnumerator V_0, //VB$ForEachEnumerator
AbstractEnumerator V_1) //VB$ForEachEnumerator
.locals init (AbstractEnumerator V_0,
AbstractEnumerator V_1)
IL_0000: newobj "Sub Enumerable1..ctor()"
IL_0005: call "Function Enumerable1.GetEnumerator() As AbstractEnumerator"
IL_000a: stloc.0
......@@ -1854,9 +1854,9 @@ End Class
{
// Code size 79 (0x4f)
.maxstack 3
.locals init (Enumerator V_0, //VB$ForEachEnumerator
.locals init (Enumerator V_0,
Integer V_1, //x
Enumerator V_2, //VB$ForEachEnumerator
Enumerator V_2,
Integer V_3) //y
IL_0000: newobj "Sub Enumerable..ctor()"
IL_0005: call "Function Enumerable.GetEnumerator() As Enumerator"
......@@ -1932,7 +1932,7 @@ c
{
// Code size 56 (0x38)
.maxstack 1
.locals init (System.Collections.Generic.List(Of String).Enumerator V_0) //VB$ForEachEnumerator
.locals init (System.Collections.Generic.List(Of String).Enumerator V_0)
.try
{
IL_0000: newobj "Sub B..ctor()"
......@@ -2061,7 +2061,7 @@ End Structure
{
// Code size 79 (0x4f)
.maxstack 1
.locals init (System.Collections.IEnumerator V_0, //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0,
Enumerable V_1)
.try
{
......@@ -2142,7 +2142,7 @@ End Structure
// Code size 58 (0x3a)
.maxstack 1
.locals init (Enumerable V_0, //e
Enumerator V_1) //VB$ForEachEnumerator
Enumerator V_1)
IL_0000: ldloca.s V_0
IL_0002: initobj "Enumerable"
IL_0008: ldloc.0
......@@ -2218,7 +2218,7 @@ End Structure
// Code size 92 (0x5c)
.maxstack 1
.locals init (Enumerable V_0, //e
System.Collections.IEnumerator V_1) //VB$ForEachEnumerator
System.Collections.IEnumerator V_1)
IL_0000: ldloca.s V_0
IL_0002: initobj "Enumerable"
IL_0008: ldloc.0
......@@ -2295,7 +2295,7 @@ End Class
// Code size 80 (0x50)
.maxstack 1
.locals init (Custom(Of S) V_0, //myCustomCollection
S V_1) //VB$ForEachEnumerator
S V_1)
IL_0000: ldnull
IL_0001: stloc.0
.try
......@@ -2368,7 +2368,7 @@ End Class
// Code size 72 (0x48)
.maxstack 1
.locals init (Custom(Of S) V_0, //myCustomCollection
S V_1) //VB$ForEachEnumerator
S V_1)
IL_0000: ldnull
IL_0001: stloc.0
.try
......@@ -2444,7 +2444,7 @@ End Class
{
// Code size 66 (0x42)
.maxstack 1
.locals init (System.Collections.IEnumerator V_0) //VB$ForEachEnumerator
.locals init (System.Collections.IEnumerator V_0)
.try
{
IL_0000: ldarg.0
......@@ -2598,9 +2598,9 @@ End Module
.maxstack 3
.locals init (System.Collections.Generic.List(Of System.Action) V_0, //actions
System.Collections.Generic.List(Of Integer) V_1, //values
System.Collections.Generic.List(Of Integer).Enumerator V_2, //VB$ForEachEnumerator
m1._Closure$__1 V_3, //$VB$Closure_2
System.Collections.Generic.List(Of System.Action).Enumerator V_4) //VB$ForEachEnumerator
System.Collections.Generic.List(Of Integer).Enumerator V_2,
m1._Closure$__1 V_3, //$VB$Closure_1
System.Collections.Generic.List(Of System.Action).Enumerator V_4)
IL_0000: newobj "Sub System.Collections.Generic.List(Of System.Action)..ctor()"
IL_0005: stloc.0
IL_0006: newobj "Sub System.Collections.Generic.List(Of Integer)..ctor()"
......@@ -2629,7 +2629,7 @@ End Module
IL_0039: stfld "m1._Closure$__1.$VB$Local_i As Integer"
IL_003e: ldloc.0
IL_003f: ldloc.3
IL_0040: ldftn "Sub m1._Closure$__1._Lambda$__3()"
IL_0040: ldftn "Sub m1._Closure$__1._Lambda$__2()"
IL_0046: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_004b: callvirt "Sub System.Collections.Generic.List(Of System.Action).Add(System.Action)"
IL_0050: ldloca.s V_2
......@@ -2706,15 +2706,15 @@ End Module
// Code size 93 (0x5d)
.maxstack 4
.locals init (System.Action() V_0, //x
Integer() V_1, //VB$ForEachArray
Integer V_2, //VB$ForEachArrayIndex
m1._Closure$__2 V_3, //$VB$Closure_5
Integer() V_1,
Integer V_2,
m1._Closure$__2 V_3, //$VB$Closure_1
Integer V_4) //i
IL_0000: ldc.i4.s 11
IL_0002: newarr "System.Action"
IL_0007: stloc.0
IL_0008: newobj "Sub m1._Closure$__1..ctor()"
IL_000d: callvirt "Function m1._Closure$__1._Lambda$__4() As Integer()"
IL_000d: callvirt "Function m1._Closure$__1._Lambda$__3() As Integer()"
IL_0012: stloc.1
IL_0013: ldc.i4.0
IL_0014: stloc.2
......@@ -2731,7 +2731,7 @@ End Module
IL_0028: ldloc.3
IL_0029: ldfld "m1._Closure$__2.$VB$Local_i As Integer"
IL_002e: ldloc.3
IL_002f: ldftn "Sub m1._Closure$__2._Lambda$__6()"
IL_002f: ldftn "Sub m1._Closure$__2._Lambda$__4()"
IL_0035: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_003a: stelem.ref
IL_003b: ldloc.2
......@@ -2806,11 +2806,11 @@ End Module
// Code size 166 (0xa6)
.maxstack 4
.locals init (System.Action() V_0, //x
Integer V_1, //j
Integer V_2,
System.Collections.Generic.IEnumerator(Of Integer) V_3, //VB$ForEachEnumerator
m1._Closure$__1 V_4, //$VB$Closure_4
Integer V_5) //i
Integer V_1, //j
Integer V_2,
System.Collections.Generic.IEnumerator(Of Integer) V_3,
m1._Closure$__1 V_4, //$VB$Closure_1
Integer V_5) //i
IL_0000: ldc.i4.s 11
IL_0002: newarr "System.Action"
IL_0007: stloc.0
......@@ -2818,49 +2818,49 @@ End Module
IL_0009: stloc.1
IL_000a: nop
.try
{
IL_000b: ldsfld "m1._ClosureCache$__3 As <generated method>"
IL_0010: brfalse.s IL_0019
IL_0012: ldsfld "m1._ClosureCache$__3 As <generated method>"
IL_0017: br.s IL_002b
IL_0019: ldnull
IL_001a: ldftn "Function m1._Lambda$__2(Object, Object) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0020: newobj "Sub VB$AnonymousDelegate_0(Of Object, System.Collections.Generic.IEnumerable(Of Integer))..ctor(Object, System.IntPtr)"
IL_0025: dup
IL_0026: stsfld "m1._ClosureCache$__3 As <generated method>"
IL_002b: ldloc.2
IL_002c: box "Integer"
IL_0031: callvirt "Function VB$AnonymousDelegate_0(Of Object, System.Collections.Generic.IEnumerable(Of Integer)).Invoke(Object) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0036: callvirt "Function System.Collections.Generic.IEnumerable(Of Integer).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Integer)"
IL_003b: stloc.3
IL_003c: br.s IL_006a
IL_003e: ldloc.s V_4
IL_0040: newobj "Sub m1._Closure$__1..ctor(m1._Closure$__1)"
IL_0045: stloc.s V_4
IL_0047: ldloc.s V_4
IL_0049: ldloc.3
IL_004a: callvirt "Function System.Collections.Generic.IEnumerator(Of Integer).get_Current() As Integer"
IL_004f: stfld "m1._Closure$__1.$VB$Local_i As Integer"
IL_0054: ldloc.0
IL_0055: ldloc.s V_4
IL_0057: ldfld "m1._Closure$__1.$VB$Local_i As Integer"
IL_005c: ldloc.s V_4
IL_005e: ldftn "Sub m1._Closure$__1._Lambda$__5()"
IL_0064: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0069: stelem.ref
IL_006a: ldloc.3
IL_006b: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_0070: brtrue.s IL_003e
IL_0072: leave.s IL_007e
}
{
IL_000b: ldsfld "m1._ClosureCache$__3 As <generated method>"
IL_0010: brfalse.s IL_0019
IL_0012: ldsfld "m1._ClosureCache$__3 As <generated method>"
IL_0017: br.s IL_002b
IL_0019: ldnull
IL_001a: ldftn "Function m1._Lambda$__2(Object, Object) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0020: newobj "Sub VB$AnonymousDelegate_0(Of Object, System.Collections.Generic.IEnumerable(Of Integer))..ctor(Object, System.IntPtr)"
IL_0025: dup
IL_0026: stsfld "m1._ClosureCache$__3 As <generated method>"
IL_002b: ldloc.2
IL_002c: box "Integer"
IL_0031: callvirt "Function VB$AnonymousDelegate_0(Of Object, System.Collections.Generic.IEnumerable(Of Integer)).Invoke(Object) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0036: callvirt "Function System.Collections.Generic.IEnumerable(Of Integer).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Integer)"
IL_003b: stloc.3
IL_003c: br.s IL_006a
IL_003e: ldloc.s V_4
IL_0040: newobj "Sub m1._Closure$__1..ctor(m1._Closure$__1)"
IL_0045: stloc.s V_4
IL_0047: ldloc.s V_4
IL_0049: ldloc.3
IL_004a: callvirt "Function System.Collections.Generic.IEnumerator(Of Integer).get_Current() As Integer"
IL_004f: stfld "m1._Closure$__1.$VB$Local_i As Integer"
IL_0054: ldloc.0
IL_0055: ldloc.s V_4
IL_0057: ldfld "m1._Closure$__1.$VB$Local_i As Integer"
IL_005c: ldloc.s V_4
IL_005e: ldftn "Sub m1._Closure$__1._Lambda$__4()"
IL_0064: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0069: stelem.ref
IL_006a: ldloc.3
IL_006b: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_0070: brtrue.s IL_003e
IL_0072: leave.s IL_007e
}
finally
{
IL_0074: ldloc.3
IL_0075: brfalse.s IL_007d
IL_0077: ldloc.3
IL_0078: callvirt "Sub System.IDisposable.Dispose()"
IL_007d: endfinally
}
{
IL_0074: ldloc.3
IL_0075: brfalse.s IL_007d
IL_0077: ldloc.3
IL_0078: callvirt "Sub System.IDisposable.Dispose()"
IL_007d: endfinally
}
IL_007e: ldc.i4.1
IL_007f: stloc.s V_5
IL_0081: ldloc.0
......@@ -2932,10 +2932,10 @@ End Module
.maxstack 3
.locals init (System.Collections.Generic.List(Of System.Action) V_0, //lambdas
Integer V_1, //y
Object() V_2, //VB$ForEachArray
Integer V_3, //VB$ForEachArrayIndex
m1._Closure$__2 V_4, //$VB$Closure_5
System.Collections.Generic.List(Of System.Action).Enumerator V_5) //VB$ForEachEnumerator
Object() V_2,
Integer V_3,
m1._Closure$__2 V_4, //$VB$Closure_1
System.Collections.Generic.List(Of System.Action).Enumerator V_5)
IL_0000: newobj "Sub System.Collections.Generic.List(Of System.Action)..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -2946,7 +2946,7 @@ End Module
IL_0013: dup
IL_0014: ldfld "m1._Closure$__1.$VB$NonLocal_ As Integer"
IL_0019: box "Integer"
IL_001e: callvirt "Function m1._Closure$__1._Lambda$__4(Object) As Object()"
IL_001e: callvirt "Function m1._Closure$__1._Lambda$__3(Object) As Object()"
IL_0023: stloc.2
IL_0024: ldc.i4.0
IL_0025: stloc.3
......@@ -2962,7 +2962,7 @@ End Module
IL_003b: stfld "m1._Closure$__2.$VB$Local_x As Integer"
IL_0040: ldloc.0
IL_0041: ldloc.s V_4
IL_0043: ldftn "Sub m1._Closure$__2._Lambda$__6()"
IL_0043: ldftn "Sub m1._Closure$__2._Lambda$__4()"
IL_0049: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_004e: callvirt "Sub System.Collections.Generic.List(Of System.Action).Add(System.Action)"
IL_0053: ldloc.3
......@@ -2975,15 +2975,15 @@ End Module
IL_005a: conv.i4
IL_005b: blt.s IL_0028
IL_005d: ldloc.0
IL_005e: ldsfld "m1._ClosureCache$__8 As System.Action"
IL_005e: ldsfld "m1._ClosureCache$__6 As System.Action"
IL_0063: brfalse.s IL_006c
IL_0065: ldsfld "m1._ClosureCache$__8 As System.Action"
IL_0065: ldsfld "m1._ClosureCache$__6 As System.Action"
IL_006a: br.s IL_007e
IL_006c: ldnull
IL_006d: ldftn "Sub m1._Lambda$__7(Object)"
IL_006d: ldftn "Sub m1._Lambda$__5(Object)"
IL_0073: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0078: dup
IL_0079: stsfld "m1._ClosureCache$__8 As System.Action"
IL_0079: stsfld "m1._ClosureCache$__6 As System.Action"
IL_007e: callvirt "Sub System.Collections.Generic.List(Of System.Action).Add(System.Action)"
IL_0083: ldloc.1
IL_0084: ldc.i4.1
......@@ -3044,7 +3044,7 @@ End Class
// Code size 84 (0x54)
.maxstack 3
.locals init (Object V_0, //o
System.Collections.IEnumerator V_1) //VB$ForEachEnumerator
System.Collections.IEnumerator V_1)
IL_0000: ldc.i4.3
IL_0001: newarr "Integer"
IL_0006: dup
......
......@@ -786,13 +786,13 @@ End Class
{
// Code size 26 (0x1a)
.maxstack 3
.locals init (c1._Closure$__1 V_0) //$VB$Closure_2
.locals init (c1._Closure$__1 V_0) //$VB$Closure_1
IL_0000: ldloc.0
IL_0001: newobj "Sub c1._Closure$__1..ctor(c1._Closure$__1)"
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: dup
IL_0009: ldftn "Function c1._Closure$__1._Lambda$__3(Integer) As Integer"
IL_0009: ldftn "Function c1._Closure$__1._Lambda$__2(Integer) As Integer"
IL_000f: newobj "Sub del..ctor(Object, System.IntPtr)"
IL_0014: stfld "c1._Closure$__1.$VB$Local_q As del"
IL_0019: ret
......
......@@ -40,7 +40,7 @@ End Module
{
// Code size 55 (0x37)
.maxstack 3
.locals init (Integer V_0) //VB$cachedState
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0006: stloc.0
......@@ -127,18 +127,18 @@ End Module
{
// Code size 340 (0x154)
.maxstack 3
.locals init (Integer V_0, //VB$cachedState
Integer() V_1) //arr
.locals init (Integer V_0,
Integer() V_1) //arr
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0006: stloc.0
IL_0007: ldloc.0
IL_0008: switch (
IL_0023,
IL_0072,
IL_0092,
IL_0100,
IL_0125)
IL_0023,
IL_0072,
IL_0092,
IL_0100,
IL_0125)
IL_0021: ldc.i4.0
IL_0022: ret
IL_0023: ldarg.0
......@@ -158,13 +158,13 @@ End Module
IL_003a: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$1 As Integer()"
IL_003f: ldarg.0
IL_0040: ldc.i4.0
IL_0041: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$3 As Integer"
IL_0041: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$2 As Integer"
IL_0046: br.s IL_00a9
IL_0048: ldarg.0
IL_0049: ldarg.0
IL_004a: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$1 As Integer()"
IL_004f: ldarg.0
IL_0050: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$3 As Integer"
IL_0050: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$2 As Integer"
IL_0055: ldelem.i4
IL_0056: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_x$1 As Integer"
IL_005b: ldarg.0
......@@ -201,12 +201,12 @@ End Module
IL_0096: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_009b: ldarg.0
IL_009c: ldarg.0
IL_009d: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$3 As Integer"
IL_009d: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$2 As Integer"
IL_00a2: ldc.i4.1
IL_00a3: add.ovf
IL_00a4: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$3 As Integer"
IL_00a4: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$2 As Integer"
IL_00a9: ldarg.0
IL_00aa: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$3 As Integer"
IL_00aa: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$2 As Integer"
IL_00af: ldarg.0
IL_00b0: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$1 As Integer()"
IL_00b5: ldlen
......@@ -214,14 +214,14 @@ End Module
IL_00b7: blt.s IL_0048
IL_00b9: ldarg.0
IL_00ba: ldstr "abc"
IL_00bf: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$2 As String"
IL_00bf: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$3 As String"
IL_00c4: ldarg.0
IL_00c5: ldc.i4.0
IL_00c6: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$4 As Integer"
IL_00cb: br.s IL_013c
IL_00cd: ldarg.0
IL_00ce: ldarg.0
IL_00cf: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$2 As String"
IL_00cf: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$3 As String"
IL_00d4: ldarg.0
IL_00d5: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$4 As Integer"
IL_00da: callvirt "Function String.get_Chars(Integer) As Char"
......@@ -259,6 +259,7 @@ End Module
IL_0126: ldc.i4.m1
IL_0127: dup
IL_0128: stloc.0
IL_0129: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_012e: ldarg.0
IL_012f: ldarg.0
......@@ -269,7 +270,7 @@ End Module
IL_013c: ldarg.0
IL_013d: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArrayIndex$4 As Integer"
IL_0142: ldarg.0
IL_0143: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$2 As String"
IL_0143: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachArray$3 As String"
IL_0148: callvirt "Function String.get_Length() As Integer"
IL_014d: blt IL_00cd
IL_0152: ldc.i4.0
......@@ -318,7 +319,7 @@ End Module
{
// Code size 55 (0x37)
.maxstack 3
.locals init (Integer V_0) //VB$cachedState
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_get_p1.$State As Integer"
IL_0006: stloc.0
......@@ -424,7 +425,7 @@ End Module
{
// Code size 59 (0x3b)
.maxstack 3
.locals init (Integer V_0) //VB$cachedState
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0006: stloc.0
......@@ -495,17 +496,17 @@ End Module
{
// Code size 161 (0xa1)
.maxstack 3
.locals init (Boolean V_0, //VB$returnTemp
Integer V_1, //VB$cachedState
Integer V_2) //i
.locals init (Boolean V_0,
Integer V_1,
Integer V_2) //i
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0006: stloc.1
IL_0007: ldloc.1
IL_0008: switch (
IL_001b,
IL_0024,
IL_0024)
IL_001b,
IL_0024,
IL_0024)
IL_0019: ldc.i4.0
IL_001a: ret
IL_001b: ldarg.0
......@@ -515,70 +516,71 @@ End Module
IL_001f: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0024: nop
.try
{
IL_0025: ldloc.1
IL_0026: ldc.i4.1
IL_0027: beq.s IL_006d
IL_0029: ldloc.1
IL_002a: ldc.i4.2
IL_002b: bne.un.s IL_003a
IL_002d: ldarg.0
IL_002e: ldc.i4.m1
IL_002f: dup
IL_0030: stloc.1
IL_0031: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0036: ldc.i4.1
IL_0037: stloc.0
IL_0038: leave.s IL_009f
IL_003a: ldarg.0
IL_003b: ldarg.0
IL_003c: ldfld "Module1.VB$StateMachine_1_Foo.$VB$Local_x As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0041: callvirt "Function System.Collections.Generic.IEnumerable(Of Integer).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Integer)"
IL_0046: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_004b: br.s IL_0076
IL_004d: ldarg.0
IL_004e: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_0053: callvirt "Function System.Collections.Generic.IEnumerator(Of Integer).get_Current() As Integer"
IL_0058: stloc.2
IL_0059: ldarg.0
IL_005a: ldloc.2
IL_005b: stfld "Module1.VB$StateMachine_1_Foo.$Current As Integer"
IL_0060: ldarg.0
IL_0061: ldc.i4.1
IL_0062: dup
IL_0063: stloc.1
IL_0064: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0069: ldc.i4.1
IL_006a: stloc.0
IL_006b: leave.s IL_009f
IL_006d: ldarg.0
IL_006e: ldc.i4.m1
IL_006f: dup
IL_0070: stloc.1
IL_0071: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0076: ldarg.0
IL_0077: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_007c: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_0081: brtrue.s IL_004d
IL_0083: leave.s IL_009d
}
{
IL_0025: ldloc.1
IL_0026: ldc.i4.1
IL_0027: beq.s IL_006d
IL_0029: ldloc.1
IL_002a: ldc.i4.2
IL_002b: bne.un.s IL_003a
IL_002d: ldarg.0
IL_002e: ldc.i4.m1
IL_002f: dup
IL_0030: stloc.1
IL_0031: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0036: ldc.i4.1
IL_0037: stloc.0
IL_0038: leave.s IL_009f
IL_003a: ldarg.0
IL_003b: ldarg.0
IL_003c: ldfld "Module1.VB$StateMachine_1_Foo.$VB$Local_x As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0041: callvirt "Function System.Collections.Generic.IEnumerable(Of Integer).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Integer)"
IL_0046: stfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_004b: br.s IL_0076
IL_004d: ldarg.0
IL_004e: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_0053: callvirt "Function System.Collections.Generic.IEnumerator(Of Integer).get_Current() As Integer"
IL_0058: stloc.2
IL_0059: ldarg.0
IL_005a: ldloc.2
IL_005b: stfld "Module1.VB$StateMachine_1_Foo.$Current As Integer"
IL_0060: ldarg.0
IL_0061: ldc.i4.1
IL_0062: dup
IL_0063: stloc.1
IL_0064: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0069: ldc.i4.1
IL_006a: stloc.0
IL_006b: leave.s IL_009f
IL_006d: ldarg.0
IL_006e: ldc.i4.m1
IL_006f: dup
IL_0070: stloc.1
IL_0071: stfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0076: ldarg.0
IL_0077: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_007c: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_0081: brtrue.s IL_004d
IL_0083: leave.s IL_009d
}
finally
{
IL_0085: ldloc.1
IL_0086: ldc.i4.0
IL_0087: bge.s IL_009c
IL_0089: ldarg.0
IL_008a: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_008f: brfalse.s IL_009c
IL_0091: ldarg.0
IL_0092: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_0097: callvirt "Sub System.IDisposable.Dispose()"
IL_009c: endfinally
}
{
IL_0085: ldloc.1
IL_0086: ldc.i4.0
IL_0087: bge.s IL_009c
IL_0089: ldarg.0
IL_008a: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_008f: brfalse.s IL_009c
IL_0091: ldarg.0
IL_0092: ldfld "Module1.VB$StateMachine_1_Foo.$VB$ResumableLocal_VB$ForEachEnumerator$1 As System.Collections.Generic.IEnumerator(Of Integer)"
IL_0097: callvirt "Sub System.IDisposable.Dispose()"
IL_009c: endfinally
}
IL_009d: ldc.i4.0
IL_009e: ret
IL_009f: ldloc.0
IL_00a0: ret
}
]]>).VerifyIL("Module1.VB$StateMachine_1_Foo.IEnumerable.GetEnumerator", <![CDATA[
{
......@@ -624,7 +626,7 @@ End Module
{
// Code size 89 (0x59)
.maxstack 3
.locals init (Integer V_0) //VB$cachedState
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0006: stloc.0
......@@ -724,8 +726,8 @@ End Module
{
// Code size 168 (0xa8)
.maxstack 3
.locals init (Boolean V_0, //VB$returnTemp
Integer V_1, //VB$cachedState
.locals init (Boolean V_0,
Integer V_1,
Integer V_2) //y
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
......@@ -866,8 +868,8 @@ End Module
{
// Code size 175 (0xaf)
.maxstack 3
.locals init (Boolean V_0, //VB$returnTemp
Integer V_1, //VB$cachedState
.locals init (Boolean V_0,
Integer V_1,
System.Exception V_2)
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
......@@ -1294,7 +1296,7 @@ End Module
{
// Code size 59 (0x3b)
.maxstack 3
.locals init (Integer V_0) //VB$cachedState
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Module1.VB$StateMachine_1_Foo.$State As Integer"
IL_0006: stloc.0
......@@ -1375,7 +1377,7 @@ End Module
{
// Code size 59 (0x3b)
.maxstack 3
.locals init (Integer V_0) //VB$cachedState
.locals init (Integer V_0)
IL_0000: ldarg.0
IL_0001: ldfld "Friend $State As Integer"
IL_0006: stloc.0
......
......@@ -2373,7 +2373,7 @@ End Module
</file>
</compilation>,
expectedOutput:=<![CDATA[3]]>).
VerifyIL("Program._Closure$__1._Lambda$__3",
VerifyIL("Program._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 134 (0x86)
......
......@@ -3945,9 +3945,9 @@ End Class
// Code size 289 (0x121)
.maxstack 3
.locals init (UInteger? V_0, //l
UInteger? V_1, //VB$ForLimit
UInteger? V_2, //VB$ForStep
Boolean V_3, //VB$LoopDirection
UInteger? V_1,
UInteger? V_2,
Boolean V_3,
UInteger? V_4, //x
Long? V_5,
Long V_6,
......@@ -4093,9 +4093,9 @@ End Class
// Code size 248 (0xf8)
.maxstack 3
.locals init (Integer? V_0, //x
Integer? V_1, //VB$ForLimit
Integer? V_2, //VB$ForStep
Boolean V_3, //VB$LoopDirection
Integer? V_1,
Integer? V_2,
Boolean V_3,
Integer? V_4,
Boolean? V_5)
IL_0000: ldloca.s V_0
......@@ -4237,9 +4237,9 @@ step
{
// Code size 220 (0xdc)
.maxstack 3
.locals init (Decimal? V_0, //VB$ForLimit
Decimal? V_1, //VB$ForStep
Boolean V_2, //VB$LoopDirection
.locals init (Decimal? V_0,
Decimal? V_1,
Boolean V_2,
Decimal? V_3, //x
Decimal? V_4)
IL_0000: call "Function MyClass1.Init() As Integer"
......
......@@ -195,7 +195,7 @@ expectedOutput:="abcdefbye")
IL_0005: dup
IL_0006: ldstr "bye"
IL_000b: stfld "Module1._Closure$__1.$VB$Local_expr2 As String"
IL_0010: ldftn "Function Module1._Closure$__1._Lambda$__3() As String"
IL_0010: ldftn "Function Module1._Closure$__1._Lambda$__2() As String"
IL_0016: newobj "Sub System.Func(Of String)..ctor(Object, System.IntPtr)"
IL_001b: callvirt "Function System.Func(Of String).Invoke() As String"
IL_0020: call "Sub System.Console.WriteLine(String)"
......
......@@ -36,8 +36,8 @@ Inside SyncLock.
{
// Code size 44 (0x2c)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldtoken "C1"
IL_0005: call "Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type"
IL_000a: stloc.0
......@@ -94,7 +94,7 @@ End Class
{
// Code size 37 (0x25)
.maxstack 1
.locals init (Object V_0) //VB$Lock
.locals init (Object V_0)
IL_0000: ldtoken "C1"
IL_0005: call "Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type"
IL_000a: stloc.0
......@@ -149,8 +149,8 @@ Inside SyncLock.
{
// Code size 54 (0x36)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: newobj "Sub C1..ctor()"
IL_0005: isinst "T"
IL_000a: unbox.any "T"
......@@ -207,8 +207,8 @@ Inside SyncLock.
{
// Code size 50 (0x32)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: newobj "Sub Object..ctor()"
IL_0005: call "Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object"
IL_000a: stloc.0
......@@ -290,8 +290,8 @@ End Class
{
// Code size 31 (0x1f)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldnull
IL_0001: stloc.0
IL_0002: ldloc.0
......@@ -342,8 +342,8 @@ End Interface
{
// Code size 29 (0x1d)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: call "Function M1.Foo() As I1"
IL_0005: stloc.0
IL_0006: ldc.i4.0
......@@ -387,8 +387,8 @@ End Class
{
// Code size 35 (0x23)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldsfld "Program.Key As Object"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -436,8 +436,8 @@ End Class
{
// Code size 36 (0x24)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldnull
IL_0001: ldftn "Sub Program.PM(Integer)"
IL_0007: newobj "Sub D..ctor(Object, System.IntPtr)"
......@@ -483,8 +483,8 @@ End Class
{
// Code size 31 (0x1f)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldarg.0
IL_0001: stloc.0
IL_0002: ldc.i4.0
......@@ -532,8 +532,8 @@ End Class
{
// Code size 42 (0x2a)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldarg.1
IL_0001: stloc.0
IL_0002: ldloc.0
......@@ -581,8 +581,8 @@ End Class
{
// Code size 25 (0x19)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldarg.0
IL_0001: stloc.0
IL_0002: ldc.i4.0
......@@ -625,8 +625,8 @@ End Class
{
// Code size 29 (0x1d)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldstr "abc"
IL_0005: stloc.0
IL_0006: ldc.i4.0
......@@ -673,10 +673,10 @@ End Class
// Code size 71 (0x47)
.maxstack 2
.locals init (Object V_0, //syncroot
Object V_1, //VB$Lock
Boolean V_2, //VB$LockTaken
Object V_3, //VB$Lock
Boolean V_4) //VB$LockTaken
Object V_1,
Boolean V_2,
Object V_3,
Boolean V_4)
IL_0000: newobj "Sub Object..ctor()"
IL_0005: call "Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object"
IL_000a: stloc.0
......@@ -747,10 +747,10 @@ End Class
// Code size 72 (0x48)
.maxstack 2
.locals init (Object V_0, //syncroot
Object V_1, //VB$Lock
Boolean V_2, //VB$LockTaken
Object V_3, //VB$Lock
Boolean V_4) //VB$LockTaken
Object V_1,
Boolean V_2,
Object V_3,
Boolean V_4)
IL_0000: newobj "Sub Object..ctor()"
IL_0005: call "Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object"
IL_000a: stloc.0
......@@ -824,8 +824,8 @@ End Module
{
// Code size 51 (0x33)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1, //VB$LockTaken
.locals init (Object V_0,
Boolean V_1,
System.Exception V_2) //ex
.try
{
......@@ -890,8 +890,8 @@ End Module
{
// Code size 44 (0x2c)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
.try
{
.try
......@@ -959,8 +959,8 @@ End Class
// Code size 65 (0x41)
.maxstack 3
.locals init (String V_0,
Object V_1, //VB$Lock
Boolean V_2) //VB$LockTaken
Object V_1,
Boolean V_2)
IL_0000: ldstr ""
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -1078,8 +1078,8 @@ End Class
{
// Code size 72 (0x48)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
.try
{
IL_0000: ldarg.0
......@@ -1141,8 +1141,8 @@ End Module
{
// Code size 29 (0x1d)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldsfld "Module1.SyncObj As Object"
IL_0005: stloc.0
IL_0006: ldc.i4.0
......@@ -1187,8 +1187,8 @@ End Module
{
// Code size 35 (0x23)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldsfld "Module1.SyncObj As Object"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -1242,8 +1242,8 @@ End Class
{
// Code size 39 (0x27)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldsfld "Module1.x As T1"
IL_0005: stloc.0
IL_0006: ldc.i4.0
......
......@@ -7323,8 +7323,8 @@ End Module
{
// Code size 91 (0x5b)
.maxstack 3
.locals init (Integer V_0, //VB$ForLimit
Integer V_1) //VB$ForStep
.locals init (Integer V_0,
Integer V_1)
IL_0000: ldc.i4.3
IL_0001: stsfld "M1.p1 As Integer"
IL_0006: ldsfld "M1.p1 As Integer"
......@@ -9744,8 +9744,8 @@ AEC
{
// Code size 55 (0x37)
.maxstack 2
.locals init (Object() V_0, //VB$ForEachArray
Integer V_1) //VB$ForEachArrayIndex
.locals init (Object() V_0,
Integer V_1)
IL_0000: newobj "Sub C..ctor()"
IL_0005: callvirt "Function Object.GetType() As System.Type"
IL_000a: ldc.i4.0
......@@ -11372,13 +11372,12 @@ End Module
VerifyIL("Module1.getTypes",
<![CDATA[
{
// Code size 118 (0x76)
// Code size 116 (0x74)
.maxstack 6
.locals init (System.Array V_0, //types
System.Array V_1, //arr
Integer V_2, //i
Integer V_3,
Integer V_4) //VB$ForLimit
Integer V_3)
IL_0000: ldc.i4.4
IL_0001: newarr "Integer"
IL_0006: dup
......@@ -11405,35 +11404,35 @@ End Module
IL_003e: callvirt "Function System.Array.get_Length() As Integer"
IL_0043: ldc.i4.1
IL_0044: sub.ovf
IL_0045: stloc.s V_4
IL_0047: ldc.i4.0
IL_0048: stloc.2
IL_0049: br.s IL_006f
IL_004b: ldloc.1
IL_004c: ldc.i4.2
IL_004d: newarr "Object"
IL_0052: dup
IL_0053: ldc.i4.0
IL_0054: ldloc.2
IL_0055: box "Integer"
IL_005a: stelem.ref
IL_005b: dup
IL_005c: ldc.i4.1
IL_005d: ldloc.0
IL_005e: ldloc.2
IL_005f: callvirt "Function System.Array.GetValue(Integer) As Object"
IL_0064: stelem.ref
IL_0065: ldnull
IL_0066: call "Sub Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexSet(Object, Object(), String())"
IL_006b: ldloc.2
IL_006c: ldc.i4.1
IL_006d: add.ovf
IL_006e: stloc.2
IL_006f: ldloc.2
IL_0070: ldloc.s V_4
IL_0072: ble.s IL_004b
IL_0074: ldloc.1
IL_0075: ret
IL_0045: stloc.3
IL_0046: ldc.i4.0
IL_0047: stloc.2
IL_0048: br.s IL_006e
IL_004a: ldloc.1
IL_004b: ldc.i4.2
IL_004c: newarr "Object"
IL_0051: dup
IL_0052: ldc.i4.0
IL_0053: ldloc.2
IL_0054: box "Integer"
IL_0059: stelem.ref
IL_005a: dup
IL_005b: ldc.i4.1
IL_005c: ldloc.0
IL_005d: ldloc.2
IL_005e: callvirt "Function System.Array.GetValue(Integer) As Object"
IL_0063: stelem.ref
IL_0064: ldnull
IL_0065: call "Sub Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexSet(Object, Object(), String())"
IL_006a: ldloc.2
IL_006b: ldc.i4.1
IL_006c: add.ovf
IL_006d: stloc.2
IL_006e: ldloc.2
IL_006f: ldloc.3
IL_0070: ble.s IL_004a
IL_0072: ldloc.1
IL_0073: ret
}
]]>)
End Sub
......
......@@ -1440,7 +1440,7 @@ End Module
<![CDATA[{
// Code size 89 (0x59)
.maxstack 6
.locals init (Integer V_0, //VB$CurrentLine
.locals init (Integer V_0,
System.Exception V_1) //ex
.try
{
......
......@@ -43,7 +43,7 @@ Dispose
{
// Code size 23 (0x17)
.maxstack 2
.locals init (MyManagedClass V_0) //VB$Using
.locals init (MyManagedClass V_0)
IL_0000: ldarg.0
IL_0001: ldind.ref
IL_0002: stloc.0
......@@ -97,7 +97,7 @@ End Class
{
// Code size 20 (0x14)
.maxstack 1
.locals init (MyManagedClass V_0) //VB$Using
.locals init (MyManagedClass V_0)
IL_0000: ldarg.0
IL_0001: call "Function C1.N() As MyManagedClass"
IL_0006: stloc.0
......@@ -140,7 +140,7 @@ End Class
{
// Code size 20 (0x14)
.maxstack 1
.locals init (Object V_0) //VB$Using
.locals init (Object V_0)
IL_0000: ldnull
IL_0001: stloc.0
.try
......@@ -192,7 +192,7 @@ End Class
{
// Code size 19 (0x13)
.maxstack 1
.locals init (MyManagedClass V_0) //VB$Using
.locals init (MyManagedClass V_0)
IL_0000: newobj "Sub MyManagedClass..ctor()"
IL_0005: stloc.0
.try
......@@ -325,8 +325,8 @@ End Class
// Code size 33 (0x21)
.maxstack 1
.locals init (cls1 V_0, //o1
cls1 V_1, //VB$Using
cls1 V_2) //VB$Using
cls1 V_1,
cls1 V_2)
IL_0000: newobj "Sub cls1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -390,23 +390,22 @@ End Structure
{
// Code size 26 (0x1a)
.maxstack 1
.locals init (s1 V_0,
s1 V_1) //VB$Using
.locals init (s1 V_0)
IL_0000: ldloca.s V_0
IL_0002: initobj "s1"
IL_0008: ldloc.0
IL_0009: stloc.1
IL_0009: stloc.0
.try
{
IL_000a: br.s IL_000a
}
{
IL_000a: br.s IL_000a
}
finally
{
IL_000c: ldloca.s V_1
IL_000e: constrained. "s1"
IL_0014: callvirt "Sub System.IDisposable.Dispose()"
IL_0019: endfinally
}
{
IL_000c: ldloca.s V_0
IL_000e: constrained. "s1"
IL_0014: callvirt "Sub System.IDisposable.Dispose()"
IL_0019: endfinally
}
}
]]>)
......@@ -844,7 +843,7 @@ Dispose]]>).VerifyIL("Program.Main", <![CDATA[
// Code size 43 (0x2b)
.maxstack 1
.locals init (MyManagedClass V_0, //obj
MyManagedClass V_1) //VB$Using
MyManagedClass V_1)
IL_0000: ldloca.s V_0
IL_0002: initobj "MyManagedClass"
IL_0008: ldloc.0
......@@ -1129,7 +1128,7 @@ End Class
{
// Code size 21 (0x15)
.maxstack 1
.locals init (MyManagedClass V_0) //VB$Using
.locals init (MyManagedClass V_0)
IL_0000: ldnull
IL_0001: stloc.0
.try
......@@ -1187,7 +1186,7 @@ Dispose]]>).VerifyIL("Program.Main", <![CDATA[
{
// Code size 40 (0x28)
.maxstack 1
.locals init (MyManagedClass V_0) //VB$Using
.locals init (MyManagedClass V_0)
IL_0000: newobj "Sub MyManagedClass..ctor()"
IL_0005: stloc.0
.try
......@@ -1255,7 +1254,7 @@ Catch]]>).VerifyIL("Program.Main", <![CDATA[
// Code size 59 (0x3b)
.maxstack 1
.locals init (MyManagedClass V_0, //x
MyManagedClass V_1) //VB$Using
MyManagedClass V_1)
IL_0000: newobj "Sub MyManagedClass..ctor()"
IL_0005: stloc.0
.try
......@@ -1379,8 +1378,8 @@ End Module
.maxstack 7
.locals init (Object V_0, //o2
strd V_1,
Object V_2, //VB$Using
Object V_3) //VB$Using
Object V_2,
Object V_3)
IL_0000: ldc.i4.0
IL_0001: stsfld "strd.disposed_s As Integer"
IL_0006: ldloca.s V_1
......
......@@ -3076,8 +3076,8 @@ End Module
{
// Code size 29 (0x1d)
.maxstack 2
.locals init (Object V_0, //VB$Lock
Boolean V_1) //VB$LockTaken
.locals init (Object V_0,
Boolean V_1)
IL_0000: ldsfld "Module1.SyncObj As Object"
IL_0005: stloc.0
IL_0006: ldc.i4.0
......
......@@ -155,7 +155,7 @@ expectedOutput:="").
.locals init (Module1.S() V_0, //x
Integer V_1, //dummy
Integer V_2, //i
Module1.S& V_3) //VB$With
Module1.S& V_3)
IL_0000: ldc.i4.s 11
IL_0002: newarr "Module1.S"
IL_0007: stloc.0
......@@ -302,7 +302,7 @@ expectedOutput:="System.String: abc|cba").
{
// Code size 56 (0x38)
.maxstack 3
.locals init (String V_0) //VB$With
.locals init (String V_0)
IL_0000: ldstr "abc|"
IL_0005: ldstr "cba"
IL_000a: callvirt "Function String.ToString() As String"
......@@ -347,7 +347,7 @@ expectedOutput:="System.String: #3").
{
// Code size 62 (0x3e)
.maxstack 4
.locals init (String V_0) //VB$With
.locals init (String V_0)
IL_0000: ldc.i4.s 11
IL_0002: newarr "String"
IL_0007: dup
......@@ -396,7 +396,7 @@ expectedOutput:="System.Int32").
{
// Code size 24 (0x18)
.maxstack 1
.locals init (Integer V_0) //VB$With
.locals init (Integer V_0)
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldloc.0
......@@ -433,7 +433,7 @@ expectedOutput:="System.Int32").
{
// Code size 28 (0x1c)
.maxstack 1
.locals init (Integer V_0) //VB$With
.locals init (Integer V_0)
IL_0000: call "Function Program.get_IntProp() As Integer"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -677,13 +677,13 @@ expectedOutput:="123").
IL_000c: dup
IL_000d: ldc.i4.s 123
IL_000f: stfld "C2._Closure$__1.$VB$Local_val As Integer"
IL_0014: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_0014: ldftn "Sub C2._Closure$__1._Lambda$__2()"
IL_001a: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_001f: callvirt "Sub System.Action.Invoke()"
IL_0024: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__3",
VerifyIL("C2._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 39 (0x27)
......@@ -733,7 +733,7 @@ expectedOutput:="Program+SSS").
{
// Code size 26 (0x1a)
.maxstack 2
.locals init (Program.SSS V_0) //VB$With
.locals init (Program.SSS V_0)
IL_0000: ldloca.s V_0
IL_0002: ldc.i4.1
IL_0003: call "Sub Program.SSS..ctor(Integer)"
......@@ -780,7 +780,7 @@ expectedOutput:="Program+SSS").
{
// Code size 34 (0x22)
.maxstack 2
.locals init (Program.SSS V_0) //VB$With
.locals init (Program.SSS V_0)
IL_0000: ldloca.s V_0
IL_0002: ldc.i4.1
IL_0003: call "Sub Program.SSS..ctor(Integer)"
......@@ -829,7 +829,7 @@ expectedOutput:="12").
{
// Code size 47 (0x2f)
.maxstack 2
.locals init (C2.SSS V_0) //VB$With
.locals init (C2.SSS V_0)
IL_0000: ldloca.s V_0
IL_0002: initobj "C2.SSS"
IL_0008: ldloca.s V_0
......@@ -1224,7 +1224,7 @@ expectedOutput:="System.DateTime").
{
// Code size 38 (0x26)
.maxstack 1
.locals init (T V_0) //VB$With
.locals init (T V_0)
IL_0000: call "Public Shared Property Get TProp() As T"
IL_0005: stloc.0
IL_0006: ldloca.s V_0
......@@ -1267,7 +1267,7 @@ expectedOutput:="System.DateTime").
{
// Code size 38 (0x26)
.maxstack 1
.locals init (T V_0) //VB$With
.locals init (T V_0)
IL_0000: call "Function System.Activator.CreateInstance(Of T)() As T"
IL_0005: stloc.0
IL_0006: ldloca.s V_0
......@@ -1356,8 +1356,8 @@ expectedOutput:="System.DateTime0").
{
// Code size 80 (0x50)
.maxstack 2
.locals init (T() V_0, //VB$With
Integer V_1) //VB$With
.locals init (T() V_0,
Integer V_1)
IL_0000: ldc.i4.s 11
IL_0002: newarr "T"
IL_0007: stloc.0
......@@ -1412,7 +1412,7 @@ expectedOutput:="123text").
{
// Code size 50 (0x32)
.maxstack 2
.locals init (VB$AnonymousType_0(Of Integer, String) V_0) //VB$With
.locals init (VB$AnonymousType_0(Of Integer, String) V_0)
IL_0000: ldc.i4.1
IL_0001: ldstr "text"
IL_0006: newobj "Sub VB$AnonymousType_0(Of Integer, String)..ctor(Integer, String)"
......@@ -1796,7 +1796,7 @@ expectedOutput:=".A = 1; .B = 1/2/2003; .C = !").
{
// Code size 62 (0x3e)
.maxstack 2
.locals init (C2._Closure$__1 V_0) //$VB$Closure_2
.locals init (C2._Closure$__1 V_0) //$VB$Closure_1
IL_0000: newobj "Sub C2._Closure$__1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -1809,7 +1809,7 @@ expectedOutput:=".A = 1; .B = 1/2/2003; .C = !").
IL_001a: ldc.i4.1
IL_001b: stfld "C2.ABC.A As Integer"
IL_0020: ldloc.0
IL_0021: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_0021: ldftn "Sub C2._Closure$__1._Lambda$__2()"
IL_0027: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_002c: callvirt "Sub System.Action.Invoke()"
IL_0031: ldarg.0
......@@ -1820,7 +1820,7 @@ expectedOutput:=".A = 1; .B = 1/2/2003; .C = !").
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__3",
VerifyIL("C2._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 42 (0x2a)
......@@ -1890,15 +1890,15 @@ expectedOutput:=".A = 1; .B = 1/2/2003; .C = !").
.locals init (VB$AnonymousDelegate_0(Of C2.ABC) V_0) //b
IL_0000: ldarg.0
IL_0001: initobj "C2"
IL_0007: ldsfld "C2._ClosureCache$__5 As <generated method>"
IL_0007: ldsfld "C2._ClosureCache$__4 As <generated method>"
IL_000c: brfalse.s IL_0015
IL_000e: ldsfld "C2._ClosureCache$__5 As <generated method>"
IL_000e: ldsfld "C2._ClosureCache$__4 As <generated method>"
IL_0013: br.s IL_0027
IL_0015: ldnull
IL_0016: ldftn "Function C2._Lambda$__2(Object) As C2.ABC"
IL_001c: newobj "Sub VB$AnonymousDelegate_0(Of C2.ABC)..ctor(Object, System.IntPtr)"
IL_0021: dup
IL_0022: stsfld "C2._ClosureCache$__5 As <generated method>"
IL_0022: stsfld "C2._ClosureCache$__4 As <generated method>"
IL_0027: stloc.0
IL_0028: ldarg.0
IL_0029: ldloc.0
......@@ -1921,14 +1921,14 @@ expectedOutput:=".A = 1; .B = 1/2/2003; .C = !").
IL_0017: ldc.i4.1
IL_0018: stfld "C2.ABC.A As Integer"
IL_001d: dup
IL_001e: ldftn "Sub C2._Closure$__1._Lambda$__4()"
IL_001e: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_0024: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0029: callvirt "Sub System.Action.Invoke()"
IL_002e: ldfld "C2._Closure$__1.$VB$Local_x As C2.ABC"
IL_0033: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__4",
VerifyIL("C2._Closure$__1._Lambda$__3",
<![CDATA[
{
// Code size 42 (0x2a)
......@@ -2024,7 +2024,7 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_0043: ldfld "C2.ABC.A As Integer"
IL_0048: stfld "C2._Closure$__1.$VB$NonLocal_VB$With As Integer"
IL_004d: dup
IL_004e: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_004e: ldftn "Sub C2._Closure$__1._Lambda$__2()"
IL_0054: newobj "Sub VB$AnonymousDelegate_0..ctor(Object, System.IntPtr)"
IL_0059: callvirt "Sub VB$AnonymousDelegate_0.Invoke()"
IL_005e: ldnull
......@@ -2038,7 +2038,7 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_0076: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__3",
VerifyIL("C2._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 66 (0x42)
......@@ -2052,24 +2052,24 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_0011: ldc.i4.2
IL_0012: stfld "C2.ABC.A As Integer"
IL_0017: ldarg.0
IL_0018: ldfld "C2._Closure$__1._ClosureCache$__5 As System.Action"
IL_0018: ldfld "C2._Closure$__1._ClosureCache$__4 As System.Action"
IL_001d: brfalse.s IL_0027
IL_001f: ldarg.0
IL_0020: ldfld "C2._Closure$__1._ClosureCache$__5 As System.Action"
IL_0020: ldfld "C2._Closure$__1._ClosureCache$__4 As System.Action"
IL_0025: br.s IL_003c
IL_0027: ldarg.0
IL_0028: ldarg.0
IL_0029: ldftn "Sub C2._Closure$__1._Lambda$__4()"
IL_0029: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_002f: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0034: dup
IL_0035: stloc.0
IL_0036: stfld "C2._Closure$__1._ClosureCache$__5 As System.Action"
IL_0036: stfld "C2._Closure$__1._ClosureCache$__4 As System.Action"
IL_003b: ldloc.0
IL_003c: callvirt "Sub System.Action.Invoke()"
IL_0041: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__4",
VerifyIL("C2._Closure$__1._Lambda$__3",
<![CDATA[
{
// Code size 64 (0x40)
......@@ -2205,7 +2205,7 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_0012: dup
IL_0013: ldstr "?"
IL_0018: stfld "C2._Closure$__1.$VB$Local_sss As String"
IL_001d: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_001d: ldftn "Sub C2._Closure$__1._Lambda$__2()"
IL_0023: newobj "Sub VB$AnonymousDelegate_0..ctor(Object, System.IntPtr)"
IL_0028: callvirt "Sub VB$AnonymousDelegate_0.Invoke()"
IL_002d: ldarg.0
......@@ -2215,7 +2215,7 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_0039: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__3",
VerifyIL("C2._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 60 (0x3c)
......@@ -2227,24 +2227,24 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_000b: ldc.i4.2
IL_000c: stfld "C2.ABC.A As Integer"
IL_0011: ldarg.0
IL_0012: ldfld "C2._Closure$__1._ClosureCache$__5 As System.Action"
IL_0012: ldfld "C2._Closure$__1._ClosureCache$__4 As System.Action"
IL_0017: brfalse.s IL_0021
IL_0019: ldarg.0
IL_001a: ldfld "C2._Closure$__1._ClosureCache$__5 As System.Action"
IL_001a: ldfld "C2._Closure$__1._ClosureCache$__4 As System.Action"
IL_001f: br.s IL_0036
IL_0021: ldarg.0
IL_0022: ldarg.0
IL_0023: ldftn "Sub C2._Closure$__1._Lambda$__4()"
IL_0023: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_0029: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_002e: dup
IL_002f: stloc.0
IL_0030: stfld "C2._Closure$__1._ClosureCache$__5 As System.Action"
IL_0030: stfld "C2._Closure$__1._ClosureCache$__4 As System.Action"
IL_0035: ldloc.0
IL_0036: callvirt "Sub System.Action.Invoke()"
IL_003b: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__4",
VerifyIL("C2._Closure$__1._Lambda$__3",
<![CDATA[
{
// Code size 53 (0x35)
......@@ -2317,15 +2317,15 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
.maxstack 2
IL_0000: ldarg.0
IL_0001: initobj "C2"
IL_0007: ldsfld "C2._ClosureCache$__5 As <generated method>"
IL_0007: ldsfld "C2._ClosureCache$__4 As <generated method>"
IL_000c: brfalse.s IL_0015
IL_000e: ldsfld "C2._ClosureCache$__5 As <generated method>"
IL_000e: ldsfld "C2._ClosureCache$__4 As <generated method>"
IL_0013: br.s IL_0027
IL_0015: ldnull
IL_0016: ldftn "Sub C2._Lambda$__2(Object)"
IL_001c: newobj "Sub VB$AnonymousDelegate_0..ctor(Object, System.IntPtr)"
IL_0021: dup
IL_0022: stsfld "C2._ClosureCache$__5 As <generated method>"
IL_0022: stsfld "C2._ClosureCache$__4 As <generated method>"
IL_0027: callvirt "Sub VB$AnonymousDelegate_0.Invoke()"
IL_002c: ldarg.0
IL_002d: ldsfld "C2.ARR As C2.ABC"
......@@ -2345,13 +2345,13 @@ expectedOutput:="A = 2; B = 6/6/2006; C = ?").
IL_0010: ldsflda "C2.ARR As C2.ABC"
IL_0015: ldc.i4.2
IL_0016: stfld "C2.ABC.A As Integer"
IL_001b: ldftn "Sub C2._Closure$__1._Lambda$__4()"
IL_001b: ldftn "Sub C2._Closure$__1._Lambda$__3()"
IL_0021: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_0026: callvirt "Sub System.Action.Invoke()"
IL_002b: ret
}
]]>).
VerifyIL("C2._Closure$__1._Lambda$__4",
VerifyIL("C2._Closure$__1._Lambda$__3",
<![CDATA[
{
// Code size 41 (0x29)
......@@ -2486,7 +2486,7 @@ End Structure </file>
{
// Code size 16 (0x10)
.maxstack 1
.locals init (Struct V_0) //VB$With
.locals init (Struct V_0)
IL_0000: ldloca.s V_0
IL_0002: initobj "Struct"
IL_0008: ldloca.s V_0
......@@ -2942,7 +2942,7 @@ End Class
</file>
</compilation>, expectedOutput:="0").
VerifyDiagnostics().
VerifyIL("Clazz._Closure$__1._Lambda$__4",
VerifyIL("Clazz._Closure$__1._Lambda$__3",
<![CDATA[
{
// Code size 26 (0x1a)
......@@ -3092,7 +3092,7 @@ End Structure
{
// Code size 89 (0x59)
.maxstack 3
.locals init (Clazz._Closure$__1 V_0) //$VB$Closure_2
.locals init (Clazz._Closure$__1 V_0) //$VB$Closure_1
IL_0000: newobj "Sub Clazz._Closure$__1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -3114,7 +3114,7 @@ End Structure
IL_0036: ldstr " "
IL_003b: call "Sub System.Console.Write(String)"
IL_0040: ldloc.0
IL_0041: ldftn "Sub Clazz._Closure$__1._Lambda$__3()"
IL_0041: ldftn "Sub Clazz._Closure$__1._Lambda$__2()"
IL_0047: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_004c: callvirt "Sub System.Action.Invoke()"
IL_0051: ldloc.0
......@@ -3123,7 +3123,7 @@ End Structure
IL_0058: ret
}
]]>).
VerifyIL("Clazz._Closure$__1._Lambda$__3",
VerifyIL("Clazz._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 33 (0x21)
......@@ -3180,7 +3180,7 @@ End Structure
{
// Code size 89 (0x59)
.maxstack 3
.locals init (Clazz._Closure$__1 V_0) //$VB$Closure_2
.locals init (Clazz._Closure$__1 V_0) //$VB$Closure_1
IL_0000: newobj "Sub Clazz._Closure$__1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -3202,7 +3202,7 @@ End Structure
IL_0036: ldstr " "
IL_003b: call "Sub System.Console.Write(String)"
IL_0040: ldloc.0
IL_0041: ldftn "Sub Clazz._Closure$__1._Lambda$__3()"
IL_0041: ldftn "Sub Clazz._Closure$__1._Lambda$__2()"
IL_0047: newobj "Sub System.Action..ctor(Object, System.IntPtr)"
IL_004c: callvirt "Sub System.Action.Invoke()"
IL_0051: ldloc.0
......@@ -3211,7 +3211,7 @@ End Structure
IL_0058: ret
}
]]>).
VerifyIL("Clazz._Closure$__1._Lambda$__3",
VerifyIL("Clazz._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 33 (0x21)
......@@ -3280,9 +3280,9 @@ End Structure
{
// Code size 154 (0x9a)
.maxstack 3
.locals init (Clazz V_0, //VB$With
Clazz V_1, //VB$With
Clazz._Closure$__1 V_2) //$VB$Closure_2
.locals init (Clazz V_0,
Clazz V_1,
Clazz._Closure$__1 V_2) //$VB$Closure_1
IL_0000: ldarg.1
IL_0001: ldarg.2
IL_0002: ldc.i4.5
......@@ -3312,7 +3312,7 @@ End Structure
IL_0058: call "Sub System.Console.Write(String)"
IL_005d: ldstr "*"
IL_0062: ldloc.2
IL_0063: ldftn "Function Clazz._Closure$__1._Lambda$__3(Char) As String"
IL_0063: ldftn "Function Clazz._Closure$__1._Lambda$__2(Char) As String"
IL_0069: newobj "Sub System.Func(Of Char, String)..ctor(Object, System.IntPtr)"
IL_006e: call "Function System.Linq.Enumerable.Select(Of Char, String)(System.Collections.Generic.IEnumerable(Of Char), System.Func(Of Char, String)) As System.Collections.Generic.IEnumerable(Of String)"
IL_0073: call "Function System.Linq.Enumerable.FirstOrDefault(Of String)(System.Collections.Generic.IEnumerable(Of String)) As String"
......@@ -3327,7 +3327,7 @@ End Structure
IL_0099: ret
}
]]>).
VerifyIL("Clazz._Closure$__1._Lambda$__3",
VerifyIL("Clazz._Closure$__1._Lambda$__2",
<![CDATA[
{
// Code size 22 (0x16)
......
......@@ -110,7 +110,7 @@ b
.locals init (Windows.Data.Json.JsonArray V_0, //jsonArray
Windows.Data.Json.JsonValue V_1, //a
Windows.Data.Json.JsonValue V_2, //b
System.Collections.Generic.IEnumerator(Of Windows.Data.Json.IJsonValue) V_3) //VB$ForEachEnumerator
System.Collections.Generic.IEnumerator(Of Windows.Data.Json.IJsonValue) V_3)
IL_0000: newobj "Sub Windows.Data.Json.JsonArray..ctor()"
IL_0005: stloc.0
IL_0006: ldstr "a"
......@@ -2513,17 +2513,17 @@ End Class
// Code size 1496 (0x5d8)
.maxstack 4
.locals init (Windows.Languages.WinRTTest.IVectorIntIVectorViewIntIMapIntIntIMapViewIntInt V_0, //v
Integer() V_1, //arr
Integer V_2, //count
Integer V_3, //index
Boolean V_4, //isReadOnly
Integer V_5, //val
Integer V_6, //outVal
Boolean V_7, //success
Boolean V_8, //contains
Boolean V_9, //remove
Boolean V_10, //rez2
System.Collections.Generic.IEnumerator(Of Integer) V_11) //VB$ForEachEnumerator
Integer() V_1, //arr
Integer V_2, //count
Integer V_3, //index
Boolean V_4, //isReadOnly
Integer V_5, //val
Integer V_6, //outVal
Boolean V_7, //success
Boolean V_8, //contains
Boolean V_9, //remove
Boolean V_10, //rez2
System.Collections.Generic.IEnumerator(Of Integer) V_11)
IL_0000: newobj "Sub Windows.Languages.WinRTTest.IVectorIntIVectorViewIntIMapIntIntIMapViewIntInt..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -2605,35 +2605,35 @@ End Class
IL_00cf: ldc.i4.0
IL_00d0: stloc.3
.try
{
IL_00d1: ldloc.0
IL_00d2: callvirt "Function System.Collections.Generic.IEnumerable(Of Integer).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Integer)"
IL_00d7: stloc.s V_11
IL_00d9: br.s IL_00f7
IL_00db: ldloc.s V_11
IL_00dd: callvirt "Function System.Collections.Generic.IEnumerator(Of Integer).get_Current() As Integer"
IL_00e2: ldloc.3
IL_00e3: ldc.i4.1
IL_00e4: add.ovf
IL_00e5: stloc.3
IL_00e6: box "Integer"
IL_00eb: ldloc.3
IL_00ec: box "Integer"
IL_00f1: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_00f6: pop
IL_00f7: ldloc.s V_11
IL_00f9: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_00fe: brtrue.s IL_00db
IL_0100: leave.s IL_010e
}
{
IL_00d1: ldloc.0
IL_00d2: callvirt "Function System.Collections.Generic.IEnumerable(Of Integer).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Integer)"
IL_00d7: stloc.s V_11
IL_00d9: br.s IL_00f7
IL_00db: ldloc.s V_11
IL_00dd: callvirt "Function System.Collections.Generic.IEnumerator(Of Integer).get_Current() As Integer"
IL_00e2: ldloc.3
IL_00e3: ldc.i4.1
IL_00e4: add.ovf
IL_00e5: stloc.3
IL_00e6: box "Integer"
IL_00eb: ldloc.3
IL_00ec: box "Integer"
IL_00f1: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_00f6: pop
IL_00f7: ldloc.s V_11
IL_00f9: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_00fe: brtrue.s IL_00db
IL_0100: leave.s IL_010e
}
finally
{
IL_0102: ldloc.s V_11
IL_0104: brfalse.s IL_010d
IL_0106: ldloc.s V_11
IL_0108: callvirt "Sub System.IDisposable.Dispose()"
IL_010d: endfinally
}
{
IL_0102: ldloc.s V_11
IL_0104: brfalse.s IL_010d
IL_0106: ldloc.s V_11
IL_0108: callvirt "Sub System.IDisposable.Dispose()"
IL_010d: endfinally
}
IL_010e: ldloc.3
IL_010f: box "Integer"
IL_0114: ldc.i4.1
......@@ -3078,16 +3078,16 @@ End Class
// Code size 1378 (0x562)
.maxstack 5
.locals init (Windows.Languages.WinRTTest.IVectorStructIVectorViewStructIMapIntStructIMapViewIntStruct V_0, //v
Windows.Languages.WinRTTest.UserDefinedStruct V_1, //ud
Windows.Languages.WinRTTest.UserDefinedStruct() V_2, //arr
Integer V_3, //count
Integer V_4, //index
Boolean V_5, //isReadOnly
Windows.Languages.WinRTTest.UserDefinedStruct V_6, //outVal
Boolean V_7, //success
Boolean V_8, //contains
Windows.Languages.WinRTTest.UserDefinedStruct V_9,
System.Collections.Generic.IEnumerator(Of Windows.Languages.WinRTTest.UserDefinedStruct) V_10) //VB$ForEachEnumerator
Windows.Languages.WinRTTest.UserDefinedStruct V_1, //ud
Windows.Languages.WinRTTest.UserDefinedStruct() V_2, //arr
Integer V_3, //count
Integer V_4, //index
Boolean V_5, //isReadOnly
Windows.Languages.WinRTTest.UserDefinedStruct V_6, //outVal
Boolean V_7, //success
Boolean V_8, //contains
Windows.Languages.WinRTTest.UserDefinedStruct V_9,
System.Collections.Generic.IEnumerator(Of Windows.Languages.WinRTTest.UserDefinedStruct) V_10)
IL_0000: newobj "Sub Windows.Languages.WinRTTest.IVectorStructIVectorViewStructIMapIntStructIMapViewIntStruct..ctor()"
IL_0005: stloc.0
IL_0006: ldloca.s V_9
......@@ -3171,36 +3171,36 @@ End Class
IL_00e5: ldc.i4.0
IL_00e6: stloc.s V_4
.try
{
IL_00e8: ldloc.0
IL_00e9: callvirt "Function System.Collections.Generic.IEnumerable(Of Windows.Languages.WinRTTest.UserDefinedStruct).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Windows.Languages.WinRTTest.UserDefinedStruct)"
IL_00ee: stloc.s V_10
IL_00f0: br.s IL_0116
IL_00f2: ldloc.s V_10
IL_00f4: callvirt "Function System.Collections.Generic.IEnumerator(Of Windows.Languages.WinRTTest.UserDefinedStruct).get_Current() As Windows.Languages.WinRTTest.UserDefinedStruct"
IL_00f9: ldloc.s V_4
IL_00fb: ldc.i4.1
IL_00fc: add.ovf
IL_00fd: stloc.s V_4
IL_00ff: ldfld "Windows.Languages.WinRTTest.UserDefinedStruct.Id As UInteger"
IL_0104: box "UInteger"
IL_0109: ldloc.s V_4
IL_010b: box "Integer"
IL_0110: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_0115: pop
IL_0116: ldloc.s V_10
IL_0118: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_011d: brtrue.s IL_00f2
IL_011f: leave.s IL_012d
}
{
IL_00e8: ldloc.0
IL_00e9: callvirt "Function System.Collections.Generic.IEnumerable(Of Windows.Languages.WinRTTest.UserDefinedStruct).GetEnumerator() As System.Collections.Generic.IEnumerator(Of Windows.Languages.WinRTTest.UserDefinedStruct)"
IL_00ee: stloc.s V_10
IL_00f0: br.s IL_0116
IL_00f2: ldloc.s V_10
IL_00f4: callvirt "Function System.Collections.Generic.IEnumerator(Of Windows.Languages.WinRTTest.UserDefinedStruct).get_Current() As Windows.Languages.WinRTTest.UserDefinedStruct"
IL_00f9: ldloc.s V_4
IL_00fb: ldc.i4.1
IL_00fc: add.ovf
IL_00fd: stloc.s V_4
IL_00ff: ldfld "Windows.Languages.WinRTTest.UserDefinedStruct.Id As UInteger"
IL_0104: box "UInteger"
IL_0109: ldloc.s V_4
IL_010b: box "Integer"
IL_0110: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_0115: pop
IL_0116: ldloc.s V_10
IL_0118: callvirt "Function System.Collections.IEnumerator.MoveNext() As Boolean"
IL_011d: brtrue.s IL_00f2
IL_011f: leave.s IL_012d
}
finally
{
IL_0121: ldloc.s V_10
IL_0123: brfalse.s IL_012c
IL_0125: ldloc.s V_10
IL_0127: callvirt "Sub System.IDisposable.Dispose()"
IL_012c: endfinally
}
{
IL_0121: ldloc.s V_10
IL_0123: brfalse.s IL_012c
IL_0125: ldloc.s V_10
IL_0127: callvirt "Sub System.IDisposable.Dispose()"
IL_012c: endfinally
}
IL_012d: ldloc.s V_4
IL_012f: box "Integer"
IL_0134: ldc.i4.1
......@@ -3723,7 +3723,7 @@ End Class
.locals init (Windows.Languages.WinRTTest.ISimpleInterfaceImpl V_0, //v
Integer() V_1, //arr
Integer V_2, //index
System.Collections.Generic.IEnumerator(Of Integer) V_3) //VB$ForEachEnumerator
System.Collections.Generic.IEnumerator(Of Integer) V_3)
IL_0000: newobj "Sub Windows.Languages.WinRTTest.ISimpleInterfaceImpl..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -4229,7 +4229,7 @@ End Class
{
// Code size 226 (0xe2)
.maxstack 6
.locals init (AllMembers._Closure$__1 V_0, //$VB$Closure_2
.locals init (AllMembers._Closure$__1 V_0, //$VB$Closure_1
System.Linq.Expressions.ParameterExpression V_1,
System.Exception V_2) //e
IL_0000: newobj "Sub AllMembers._Closure$__1..ctor()"
......@@ -4400,8 +4400,8 @@ End Class
{
// Code size 448 (0x1c0)
.maxstack 4
.locals init (AllMembers._Closure$__1 V_0, //$VB$Closure_2
System.ArgumentException V_1) //e
.locals init (AllMembers._Closure$__1 V_0, //$VB$Closure_1
System.ArgumentException V_1) //e
IL_0000: newobj "Sub AllMembers._Closure$__1..ctor()"
IL_0005: stloc.0
IL_0006: ldloc.0
......@@ -4439,18 +4439,18 @@ End Class
IL_0062: ldtoken "<PrivateImplementationDetails>.__StaticArrayInitTypeSize=20 <PrivateImplementationDetails>.$$method0x6000001-864782BF337E3DBC1A27023D5C0C065C80F17087"
IL_0067: call "Sub System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"
IL_006c: ldloc.0
IL_006d: ldftn "Function AllMembers._Closure$__1._Lambda$__3(Integer) As Boolean"
IL_006d: ldftn "Function AllMembers._Closure$__1._Lambda$__2(Integer) As Boolean"
IL_0073: newobj "Sub System.Func(Of Integer, Boolean)..ctor(Object, System.IntPtr)"
IL_0078: call "Function System.Linq.Enumerable.Where(Of Integer)(System.Collections.Generic.IEnumerable(Of Integer), System.Func(Of Integer, Boolean)) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_007d: ldsfld "AllMembers._ClosureCache$__5 As System.Func(Of Integer, Integer)"
IL_007d: ldsfld "AllMembers._ClosureCache$__4 As System.Func(Of Integer, Integer)"
IL_0082: brfalse.s IL_008b
IL_0084: ldsfld "AllMembers._ClosureCache$__5 As System.Func(Of Integer, Integer)"
IL_0084: ldsfld "AllMembers._ClosureCache$__4 As System.Func(Of Integer, Integer)"
IL_0089: br.s IL_009d
IL_008b: ldnull
IL_008c: ldftn "Function AllMembers._Lambda$__4(Object, Integer) As Integer"
IL_008c: ldftn "Function AllMembers._Lambda$__3(Object, Integer) As Integer"
IL_0092: newobj "Sub System.Func(Of Integer, Integer)..ctor(Object, System.IntPtr)"
IL_0097: dup
IL_0098: stsfld "AllMembers._ClosureCache$__5 As System.Func(Of Integer, Integer)"
IL_0098: stsfld "AllMembers._ClosureCache$__4 As System.Func(Of Integer, Integer)"
IL_009d: call "Function System.Linq.Enumerable.Select(Of Integer, Integer)(System.Collections.Generic.IEnumerable(Of Integer), System.Func(Of Integer, Integer)) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_00a2: call "Function System.Linq.Enumerable.ToList(Of Integer)(System.Collections.Generic.IEnumerable(Of Integer)) As System.Collections.Generic.List(Of Integer)"
IL_00a7: ldloc.0
......@@ -4485,25 +4485,25 @@ End Class
IL_0100: pop
IL_0101: ldloc.0
IL_0102: ldfld "AllMembers._Closure$__1.$VB$Local_v As Windows.Languages.WinRTTest.IVectorInt"
IL_0107: ldsfld "AllMembers._ClosureCache$__7 As System.Func(Of Integer, Boolean)"
IL_0107: ldsfld "AllMembers._ClosureCache$__6 As System.Func(Of Integer, Boolean)"
IL_010c: brfalse.s IL_0115
IL_010e: ldsfld "AllMembers._ClosureCache$__7 As System.Func(Of Integer, Boolean)"
IL_010e: ldsfld "AllMembers._ClosureCache$__6 As System.Func(Of Integer, Boolean)"
IL_0113: br.s IL_0127
IL_0115: ldnull
IL_0116: ldftn "Function AllMembers._Lambda$__6(Object, Integer) As Boolean"
IL_0116: ldftn "Function AllMembers._Lambda$__5(Object, Integer) As Boolean"
IL_011c: newobj "Sub System.Func(Of Integer, Boolean)..ctor(Object, System.IntPtr)"
IL_0121: dup
IL_0122: stsfld "AllMembers._ClosureCache$__7 As System.Func(Of Integer, Boolean)"
IL_0122: stsfld "AllMembers._ClosureCache$__6 As System.Func(Of Integer, Boolean)"
IL_0127: call "Function System.Linq.Enumerable.Where(Of Integer)(System.Collections.Generic.IEnumerable(Of Integer), System.Func(Of Integer, Boolean)) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_012c: ldsfld "AllMembers._ClosureCache$__9 As System.Func(Of Integer, Integer)"
IL_012c: ldsfld "AllMembers._ClosureCache$__8 As System.Func(Of Integer, Integer)"
IL_0131: brfalse.s IL_013a
IL_0133: ldsfld "AllMembers._ClosureCache$__9 As System.Func(Of Integer, Integer)"
IL_0133: ldsfld "AllMembers._ClosureCache$__8 As System.Func(Of Integer, Integer)"
IL_0138: br.s IL_014c
IL_013a: ldnull
IL_013b: ldftn "Function AllMembers._Lambda$__8(Object, Integer) As Integer"
IL_013b: ldftn "Function AllMembers._Lambda$__7(Object, Integer) As Integer"
IL_0141: newobj "Sub System.Func(Of Integer, Integer)..ctor(Object, System.IntPtr)"
IL_0146: dup
IL_0147: stsfld "AllMembers._ClosureCache$__9 As System.Func(Of Integer, Integer)"
IL_0147: stsfld "AllMembers._ClosureCache$__8 As System.Func(Of Integer, Integer)"
IL_014c: call "Function System.Linq.Enumerable.Select(Of Integer, Integer)(System.Collections.Generic.IEnumerable(Of Integer), System.Func(Of Integer, Integer)) As System.Collections.Generic.IEnumerable(Of Integer)"
IL_0151: call "Function System.Linq.Enumerable.ToList(Of Integer)(System.Collections.Generic.IEnumerable(Of Integer)) As System.Collections.Generic.List(Of Integer)"
IL_0156: ldloc.0
......@@ -4519,30 +4519,30 @@ End Class
IL_0178: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_017d: pop
.try
{
IL_017e: ldstr "Dev11:205875"
IL_0183: call "Sub System.Console.WriteLine(String)"
IL_0188: ldc.i4.0
IL_0189: box "Boolean"
IL_018e: ldc.i4.0
IL_018f: box "Boolean"
IL_0194: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_0199: pop
IL_019a: leave.s IL_01bf
}
{
IL_017e: ldstr "Dev11:205875"
IL_0183: call "Sub System.Console.WriteLine(String)"
IL_0188: ldc.i4.0
IL_0189: box "Boolean"
IL_018e: ldc.i4.0
IL_018f: box "Boolean"
IL_0194: call "Function AllMembers.ValidateValue(Object, Object) As Boolean"
IL_0199: pop
IL_019a: leave.s IL_01bf
}
catch System.ArgumentException
{
IL_019c: dup
IL_019d: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"
IL_01a2: stloc.1
IL_01a3: ldstr "TestLINQ"
IL_01a8: call "Sub System.Console.WriteLine(String)"
IL_01ad: ldloc.1
IL_01ae: callvirt "Function System.ArgumentException.get_Message() As String"
IL_01b3: call "Sub System.Console.WriteLine(String)"
IL_01b8: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"
IL_01bd: leave.s IL_01bf
}
{
IL_019c: dup
IL_019d: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(System.Exception)"
IL_01a2: stloc.1
IL_01a3: ldstr "TestLINQ"
IL_01a8: call "Sub System.Console.WriteLine(String)"
IL_01ad: ldloc.1
IL_01ae: callvirt "Function System.ArgumentException.get_Message() As String"
IL_01b3: call "Sub System.Console.WriteLine(String)"
IL_01b8: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"
IL_01bd: leave.s IL_01bf
}
IL_01bf: ret
}
]]>.Value)
......
......@@ -244,10 +244,10 @@ End Module
{
// Code size 155 (0x9b)
.maxstack 3
.locals init (Integer V_0, //VB$ActiveHandler
Integer V_1, //VB$ResumeTarget
Integer V_2, //VB$CurrentStatement
Integer V_3) //VB$CurrentLine
.locals init (Integer V_0,
Integer V_1,
Integer V_2,
Integer V_3)
.try
{
IL_0000: call "Sub Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError()"
......@@ -918,12 +918,12 @@ End]]>)
{
// Code size 251 (0xfb)
.maxstack 3
.locals init (Integer V_0, //VB$ActiveHandler
Integer V_1, //VB$ResumeTarget
Integer V_2, //VB$CurrentStatement
.locals init (Integer V_0,
Integer V_1,
Integer V_2,
LockClass V_3, //lock
Object V_4, //VB$Lock
Boolean V_5) //VB$LockTaken
Object V_4,
Boolean V_5)
.try
{
IL_0000: ldc.i4.1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册