7 writes to _count
System.Text.Json (7)
System\Text\Json\Serialization\WriteStack.cs (7)
190_count = 1; 201_count++; 212if (_count++ > 0 || _indexOffset == 0) 244_count = 0; 251_continuationCount = _count--; 253else if (--_count == 0 && _indexOffset > 0) 267if (--_count > 0 || _indexOffset == 0)
20 references to _count
System.Text.Json (20)
System\Text\Json\Serialization\WriteStack.cs (20)
20public readonly int CurrentDepth => _count; 34Debug.Assert(_count - _indexOffset > 0); 36return ref _stack[_count - _indexOffset - 1]; 56/// Offset used to derive the index of the current frame in the stack buffer from the current value of <see cref="_count"/>, 132else if (_count - _indexOffset == _stack.Length) 175return _count == 0 ? Current.JsonTypeInfo : Current.JsonPropertyInfo!.JsonTypeInfo; 180Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 186if (_count == 0 && Current.PolymorphicSerializationState == PolymorphicSerializationState.None) 199_stack[_count - _indexOffset] = Current; 214Current = _stack[_count - _indexOffset]; 218if (_continuationCount == _count) 232Debug.Assert(_count > 0); 233Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 240if (_count == 1 && _indexOffset > 0) 259int currentIndex = _count - _indexOffset; 269Current = _stack[_count - _indexOffset]; 287int currentIndex = _count - _indexOffset; 337Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 338int currentIndex = _count - _indexOffset; 3920 => (_count - 1, true), // Not a continuation, report previous frames and Current.