7 writes to _count
System.Text.Json (7)
System\Text\Json\Serialization\WriteStack.cs (7)
196_count = 1; 207_count++; 218if (_count++ > 0 || _indexOffset == 0) 250_count = 0; 257_continuationCount = _count--; 259else if (--_count == 0 && _indexOffset > 0) 273if (--_count > 0 || _indexOffset == 0)
20 references to _count
System.Text.Json (20)
System\Text\Json\Serialization\WriteStack.cs (20)
21public readonly int CurrentDepth => _count; 35Debug.Assert(_count - _indexOffset > 0); 37return ref _stack[_count - _indexOffset - 1]; 57/// Offset used to derive the index of the current frame in the stack buffer from the current value of <see cref="_count"/>, 138else if (_count - _indexOffset == _stack.Length) 181return _count == 0 ? Current.JsonTypeInfo : Current.JsonPropertyInfo!.JsonTypeInfo; 186Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 192if (_count == 0 && Current.PolymorphicSerializationState == PolymorphicSerializationState.None) 205_stack[_count - _indexOffset] = Current; 220Current = _stack[_count - _indexOffset]; 224if (_continuationCount == _count) 238Debug.Assert(_count > 0); 239Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 246if (_count == 1 && _indexOffset > 0) 265int currentIndex = _count - _indexOffset; 275Current = _stack[_count - _indexOffset]; 322int currentIndex = _count - _indexOffset; 372Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 373int currentIndex = _count - _indexOffset; 4270 => (_count - 1, true), // Not a continuation, report previous frames and Current.