6 writes to _currentMethod
ILAssembler (6)
GrammarVisitor.cs (6)
1021_currentMethod = new(VisitMethodHead(methodHead).Value); 1025_currentMethod = null; 1728_currentMethod = new(VisitMethodHead(methodHead).Value); 1730_currentMethod = null; 3896_currentMethod = new(methodDefinition); 3968_currentMethod = null;
108 references to _currentMethod
ILAssembler (108)
GrammarVisitor.cs (108)
1954if (_currentMethod is null) 1964for (int i = 0; i < _currentMethod.Definition.GenericParameters.Count; i++) 1966EntityRegistry.GenericParameterEntity? genericParameter = _currentMethod.Definition.GenericParameters[i]; 2356if (_currentMethod is not null && _currentDocumentPath is not null) 2358int ilOffset = _currentMethod.Definition.MethodBody.Offset; 2359_currentMethod.Definition.DebugInfo.DocumentPath ??= _currentDocumentPath; 2364_currentMethod.Definition.DebugInfo.SequencePoints.Add( 2369_currentMethod.Definition.DebugInfo.SequencePoints.Add( 2717LabelHandle start = _currentMethod!.Definition.MethodBody.DefineLabel(); 2718_currentMethod.Definition.MethodBody.MarkLabel(start); 2724var start = _currentMethod!.Labels.TryGetValue(VisitId(id).Value, out LabelHandle startLabel) ? startLabel : _currentMethod.Labels[VisitId(id).Value] = _currentMethod.Definition.MethodBody.DefineLabel(); 2729var start = _currentMethod!.Definition.MethodBody.DefineLabel(); 2730_currentMethod.Definition.MethodBody.MarkLabel(start, VisitInt32(offset).Value); 2776LabelHandle start = _currentMethod!.Definition.MethodBody.DefineLabel(); 2777_currentMethod.Definition.MethodBody.MarkLabel(start); 2779LabelHandle end = _currentMethod.Definition.MethodBody.DefineLabel(); 2780_currentMethod.Definition.MethodBody.MarkLabel(end); 2786var start = _currentMethod!.Labels.TryGetValue(VisitId(ids[0]).Value, out LabelHandle startLabel) ? startLabel : _currentMethod.Labels[VisitId(ids[0]).Value] = _currentMethod.Definition.MethodBody.DefineLabel(); 2787var end = _currentMethod!.Labels.TryGetValue(VisitId(ids[1]).Value, out LabelHandle endLabel) ? endLabel : _currentMethod.Labels[VisitId(ids[1]).Value] = _currentMethod.Definition.MethodBody.DefineLabel(); 2793var start = _currentMethod!.Definition.MethodBody.DefineLabel(); 2794var end = _currentMethod.Definition.MethodBody.DefineLabel(); 2795_currentMethod.Definition.MethodBody.MarkLabel(start, VisitInt32(offsets[0]).Value); 2796_currentMethod.Definition.MethodBody.MarkLabel(end, VisitInt32(offsets[1]).Value); 2949if (!_currentMethod!.Labels.TryGetValue(label, out var handle)) 2951handle = _currentMethod.Definition.MethodBody.DefineLabel(); 2952_currentMethod.Labels[label] = handle; 2954if (!_currentMethod.UndefinedLabelReferences.ContainsKey(label)) 2956_currentMethod.UndefinedLabelReferences[label] = context; 2959_currentMethod.Definition.MethodBody.Branch(opcode, handle); 2964LabelHandle label = _currentMethod!.Definition.MethodBody.DefineLabel(); 2965_currentMethod.Definition.MethodBody.Branch(opcode, label); 2966_currentMethod.Definition.MethodBody.MarkLabel(label, _currentMethod.Definition.MethodBody.Offset + offset); 2972_currentMethod!.Definition.MethodBody.OpCode(opcode); 2975_currentMethod.Definition.MethodBody.Token(VisitMdtoken(mdtoken).Value.Handle); 2982memberRef.RecordBlobToWriteResolvedHandle(_currentMethod.Definition.MethodBody.CodeBuilder.ReserveBytes(4)); 2986_currentMethod.Definition.MethodBody.Token(fieldRef.Handle); 2996_currentMethod!.Definition.MethodBody.LoadConstantI4(arg); 3000_currentMethod!.Definition.MethodBody.OpCode(opcode); 3001_currentMethod.Definition.MethodBody.CodeBuilder.WriteByte((byte)arg); 3007_currentMethod!.Definition.MethodBody.LoadConstantI8(VisitInt64(context.int64()).Value); 3015_currentMethod!.Definition.MethodBody.OpCode(opcode); 3019memberRef.RecordBlobToWriteResolvedHandle(_currentMethod.Definition.MethodBody.CodeBuilder.ReserveBytes(4)); 3023_currentMethod.Definition.MethodBody.Token(methodRef.Handle); 3033_currentMethod!.Definition.MethodBody.OpCode(opcode); 3071_currentMethod!.Definition.MethodBody.LoadConstantR4((float)value); 3075_currentMethod!.Definition.MethodBody.LoadConstantR8(value); 3093_currentMethod!.Definition.MethodBody.Token(_entityRegistry.GetOrCreateStandaloneSignature(signature).Handle); 3135_currentMethod!.Definition.MethodBody.LoadString(_metadataBuilder.GetOrAddUserString(str)); 3145if (!_currentMethod!.Labels.TryGetValue(labelName, out var handle)) 3147handle = _currentMethod.Definition.MethodBody.DefineLabel(); 3148_currentMethod.Labels[labelName] = handle; 3150if (!_currentMethod.UndefinedLabelReferences.ContainsKey(labelName)) 3152_currentMethod.UndefinedLabelReferences[labelName] = context; 3160LabelHandle labelHandle = _currentMethod!.Definition.MethodBody.DefineLabel(); 3164var switchEncoder = _currentMethod!.Definition.MethodBody.Switch(labels.Count); 3174_currentMethod.Definition.MethodBody.MarkLabel(label.Label, _currentMethod.Definition.MethodBody.Offset + offset); 3181_currentMethod!.Definition.MethodBody.OpCode(opcode); 3182_currentMethod.Definition.MethodBody.Token(tok.Handle); 3187_currentMethod!.Definition.MethodBody.OpCode(opcode); 3188_currentMethod.Definition.MethodBody.Token(arg.Handle); 3195_currentMethod!.Definition.MethodBody.OpCode(opcode); 3202_currentMethod.Definition.MethodBody.CodeBuilder.WriteByte((byte)value); 3206_currentMethod.Definition.MethodBody.CodeBuilder.WriteInt32(value); 3216if (_currentMethod!.ArgumentNames.TryGetValue(varName, out var argIndex)) 3220if (_currentMethod.Definition.SignatureHeader.IsInstance) 3232for (int i = _currentMethod!.LocalsScopes.Count - 1; i >= 0 ; i--) 3234if (_currentMethod.LocalsScopes[i].TryGetValue(varName, out var localIndex)) 3251_currentMethod.Definition.MethodBody.CodeBuilder.WriteByte((byte)index.Value); 3255_currentMethod.Definition.MethodBody.CodeBuilder.WriteInt32(index.Value); 3392if (_currentMethod is null) 3398foreach (var undefinedLabel in _currentMethod.UndefinedLabelReferences) 3404if (!_currentMethod.DeclaredLabels.Contains(labelName)) 3420_currentMethod!.DeclaredLabels.Add(labelName); 3421if (!_currentMethod!.Labels.TryGetValue(labelName, out var label)) 3423label = _currentMethod.Definition.MethodBody.DefineLabel(); 3424_currentMethod.Labels[labelName] = label; 3426_currentMethod.Definition.MethodBody.MarkLabel(label); 3612Debug.Assert(_currentMethod is not null); 3613var currentMethod = _currentMethod!; 4585int numLocalsScopes = _currentMethod!.LocalsScopes.Count; 4587_currentMethod.LocalsScopes.RemoveRange(numLocalsScopes, _currentMethod.LocalsScopes.Count - numLocalsScopes); 4703_currentMethod!.Definition.MethodBody.ControlFlowBuilder!.AddFinallyRegion(tryStart, tryEnd, finallyClause.Start, finallyClause.End); 4706_currentMethod!.Definition.MethodBody.ControlFlowBuilder!.AddFaultRegion(tryStart, tryEnd, faultClause.Start, faultClause.End); 4709_currentMethod!.Definition.MethodBody.ControlFlowBuilder!.AddCatchRegion(tryStart, tryEnd, catchClause.Start, catchClause.End, catchClause.Type.Handle); 4712_currentMethod!.Definition.MethodBody.ControlFlowBuilder!.AddFilterRegion(tryStart, tryEnd, filterClause.Start, filterClause.End, filterClause.FilterStart); 4974LabelHandle start = _currentMethod!.Definition.MethodBody.DefineLabel(); 4975_currentMethod.Definition.MethodBody.MarkLabel(start); 4977LabelHandle end = _currentMethod.Definition.MethodBody.DefineLabel(); 4978_currentMethod.Definition.MethodBody.MarkLabel(end); 4984var start = _currentMethod!.Labels.TryGetValue(VisitId(ids[0]).Value, out LabelHandle startLabel) ? startLabel : _currentMethod.Labels[VisitId(ids[0]).Value] = _currentMethod.Definition.MethodBody.DefineLabel(); 4985var end = _currentMethod!.Labels.TryGetValue(VisitId(ids[1]).Value, out LabelHandle endLabel) ? endLabel : _currentMethod.Labels[VisitId(ids[1]).Value] = _currentMethod.Definition.MethodBody.DefineLabel(); 4991var start = _currentMethod!.Definition.MethodBody.DefineLabel(); 4992var end = _currentMethod.Definition.MethodBody.DefineLabel(); 4993_currentMethod.Definition.MethodBody.MarkLabel(start, VisitInt32(offsets[0]).Value); 4994_currentMethod.Definition.MethodBody.MarkLabel(end, VisitInt32(offsets[1]).Value);