73 references to MethodBody
ILAssembler (73)
EntityRegistry.cs (2)
255if (methodDef.MethodBody.CodeBuilder.Count != 0) 258methodDef.MethodBody.CodeBuilder.WriteContentTo(ilStream);
GrammarVisitor.cs (71)
2358int ilOffset = _currentMethod.Definition.MethodBody.Offset; 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); 2951handle = _currentMethod.Definition.MethodBody.DefineLabel(); 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)); 3147handle = _currentMethod.Definition.MethodBody.DefineLabel(); 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); 3251_currentMethod.Definition.MethodBody.CodeBuilder.WriteByte((byte)index.Value); 3255_currentMethod.Definition.MethodBody.CodeBuilder.WriteInt32(index.Value); 3423label = _currentMethod.Definition.MethodBody.DefineLabel(); 3426_currentMethod.Definition.MethodBody.MarkLabel(label); 3617currentMethod.Definition.MethodBody.CodeBuilder.WriteByte((byte)VisitInt32(context.GetChild<CILParser.Int32Context>(0)).Value); 3664label = currentMethod.Definition.MethodBody.DefineLabel(); 3667currentMethod.Definition.MethodBody.MarkLabel(label); 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);