CodeGen\Optimizer\StackScheduler.Analyzer.vb (64)
46Private ReadOnly _evalStack As ArrayBuilder(Of (expression As BoundExpression, context As ExprContext))
49Private _context As ExprContext = ExprContext.None
69evalStack As ArrayBuilder(Of ValueTuple(Of BoundExpression, ExprContext)),
88Dim evalStack = ArrayBuilder(Of ValueTuple(Of BoundExpression, ExprContext)).GetInstance()
104result = VisitExpression(expr, ExprContext.Value)
112Private Function VisitExpressionCore(node As BoundExpression, context As ExprContext) As BoundExpression
118Dim prevContext As ExprContext = Me._context
132Case ExprContext.Sideeffects
135Case ExprContext.AssignmentTarget
138Case ExprContext.Value, ExprContext.Address, ExprContext.Box
149Private Sub PushEvalStack(result As BoundExpression, context As ExprContext)
150Debug.Assert(result IsNot Nothing OrElse context = ExprContext.None)
170Private Function VisitExpression(node As BoundExpression, context As ExprContext) As BoundExpression
188Private Function VisitExpressionCoreWithStackGuard(node As BoundExpression, context As ExprContext) As BoundExpression
214Dim prevContext As ExprContext = Me._context
252Private Function LhsUsesStackWhenAssignedTo(node As BoundNode, context As ExprContext) As Boolean
253Debug.Assert(context = ExprContext.AssignmentTarget)
331If Me._context = ExprContext.Sideeffects Then
358Dim origContext As ExprContext = Me._context
365Dim rewrittenSideeffect As BoundExpression = Me.VisitExpression(sideeffect, ExprContext.Sideeffects)
483Return node.Update(Me.VisitExpression(node.Expression, ExprContext.Sideeffects))
489Case ExprContext.Address
496Case ExprContext.AssignmentTarget
503Case ExprContext.Sideeffects
506Case ExprContext.Value,
507ExprContext.Box
518Dim left = DirectCast(VisitExpression(node.ByRefLocal, ExprContext.AssignmentTarget), BoundLocal)
524Dim right As BoundExpression = VisitExpression(node.LValue, ExprContext.Address)
545ExprContext.Address,
546ExprContext.AssignmentTarget))
551Debug.Assert(Me._context <> ExprContext.AssignmentTarget, "assignment expression cannot be a target of another assignment")
559Dim rhsContext As ExprContext
560If Me._context = ExprContext.Address Then
562rhsContext = ExprContext.Address
565Debug.Assert(Me._context = ExprContext.Value OrElse
566Me._context = ExprContext.Box OrElse
567Me._context = ExprContext.Sideeffects, "assignment expression cannot be a target of another assignment")
569rhsContext = ExprContext.Value
588PushEvalStack(Nothing, ExprContext.None)
664Dim context As ExprContext
669context = ExprContext.Box
672context = ExprContext.Value
676context = ExprContext.Address
712Dim context As ExprContext = If(i = parameters.Length OrElse Not parameters(i).IsByRef, ExprContext.Value, ExprContext.Address)
746Me._context = ExprContext.Value
762receiver = VisitExpression(receiver, ExprContext.Box)
767(_context = ExprContext.AssignmentTarget OrElse
768_context = ExprContext.Address OrElse
771receiver = VisitExpression(receiver, ExprContext.Address)
773receiver = VisitExpression(receiver, ExprContext.Value)
885Me.PushEvalStack(Nothing, ExprContext.None)
966PushEvalStack(node, ExprContext.Value)
1003Me.PushEvalStack(Nothing, ExprContext.None)
1102Dim exceptionVariableOpt As BoundExpression = Me.VisitExpression(node.ExceptionSourceOpt, ExprContext.Value)
1106Dim errorLineNumberOpt As BoundExpression = Me.VisitExpression(node.ErrorLineNumberOpt, ExprContext.Value)
1110Dim exceptionFilterOpt As BoundExpression = Me.VisitExpression(node.ExceptionFilterOpt, ExprContext.Value)
1132Dim rewrittenInitializer As BoundExpression = Me.VisitExpression(initializer, ExprContext.Value)
1259Return top.context = If(Not local.IsByRef, ExprContext.Value, ExprContext.Address) AndAlso