1 instantiation of DagState
Microsoft.CodeAnalysis.CSharp (1)
Binder\DecisionDagBuilder.cs (1)
2994private static readonly ObjectPool<DagState> s_dagStatePool = new ObjectPool<DagState>(static () => new DagState());
65 references to DagState
Microsoft.CodeAnalysis.CSharp (65)
Binder\DecisionDagBuilder.cs (65)
41/// the initial state in a <see cref="DagState"/>, and then for each such state description we decide what the test 43/// represented by a <see cref="DagState"/> is a collection of partially matched cases represented by <see 44/// cref="StateForCase"/>. When we have computed <see cref="DagState"/> descriptions for all of the states, we 54private static readonly ObjectPool<PooledDictionary<DagState, DagState>> s_uniqueStatePool = 55PooledDictionary<DagState, DagState>.CreatePool(DagStateEquivalence.Instance); 1189PooledDictionary<DagState, DagState> uniqueState = s_uniqueStatePool.Allocate(); 1265Dictionary<DagState, DagState> uniqueState) 1270using var workList = TemporaryArray<DagState>.Empty; 1278DagState uniquifyState(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues) 1280var state = DagState.GetInstance(cases, remainingValues); 1281if (uniqueState.TryGetValue(state, out DagState? existingState)) 1335var initialState = uniquifyState(new 1343DagState state = workList.RemoveLast(); 1406static DecisionDag removeUnnecessaryStates(DagState initialState, DecisionDag result) 1412if (result.TryGetTopologicallySortedReachableStates(out ImmutableArray<DagState> states)) 1416var stateToIndex = PooledDictionary<DagState, int>.GetInstance(); 1423DagState state = states[i]; 1425DagState? trueBranch = state.TrueBranch; 1426DagState? falseBranch = state.FalseBranch; 1577/// Compute the <see cref="BoundDecisionDag"/> corresponding to each <see cref="DagState"/> of the given <see cref="DecisionDag"/> 1578/// and store it in <see cref="DagState.Dag"/>. 1586bool wasAcyclic = decisionDag.TryGetTopologicallySortedReachableStates(out ImmutableArray<DagState> sortedStates); 1610var state = sortedStates[i]; 1676DagState state, 1691DagState state, 1894private FrozenArrayBuilder<StateForCase> RemoveEvaluation(DagState state, BoundDagEvaluation e) 2754public readonly DagState RootNode; 2755public DecisionDag(DagState rootNode) 2763private static void AddSuccessor(ref TemporaryArray<DagState> builder, DagState state) 2772/// <param name="result">Topologically sorted <see cref="DagState"/> nodes.</param> 2774public bool TryGetTopologicallySortedReachableStates(out ImmutableArray<DagState> result) 2791var stateIdentifierMap = PooledDictionary<DagState, int>.GetInstance(); 2828foreach (DagState state in allStates) 2994private static readonly ObjectPool<DagState> s_dagStatePool = new ObjectPool<DagState>(static () => new DagState()); 3019public DagState? TrueBranch, FalseBranch; 3029/// Created an instance of <see cref="DagState"/>. Will take ownership of <paramref name="cases"/>. That 3033public static DagState GetInstance(FrozenArrayBuilder<StateForCase> cases, ImmutableDictionary<BoundDagTemp, IValueSet> remainingValues) 3035var dagState = s_dagStatePool.Allocate(); 3091private sealed class DagStateEquivalence : IEqualityComparer<DagState> 3097public bool Equals(DagState? x, DagState? y) 3116public int GetHashCode(DagState x) 3220DagState state, 3257protected abstract RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e); 3259public Tests RemoveEvaluation(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, BoundDagEvaluation e) 3264protected Tests RemoveEvaluationAndUpdateTempReferences(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3363DagState state, 3373protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3387DagState state, 3397protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3414DagState state, 3544protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 3618public static Tests RemoveEvaluation(One tests, DecisionDagBuilder builder, DagState state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e, out Tests? condition) 3814private static Tests RemoveIndexerEvaluation(One tests, DecisionDagBuilder dagBuilder, DagState state, ref ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagIndexerEvaluation s1, out Tests? condition) 4003protected override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder builder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e) 4018DagState state, 4045DagState state, 4124protected sealed override RemoveEvaluationAndUpdateTempReferencesResult RemoveEvaluationAndUpdateTempReferencesCore(DecisionDagBuilder dagBuilder, DagState state, ImmutableArray<BoundPatternBinding> bindings, ImmutableDictionary<BoundDagTemp, BoundDagTemp> tempMap, BoundDagEvaluation e)