18 instantiations of Instruction
Mono.Cecil (18)
Mono.Cecil.Cil\CodeReader.cs (1)
155 var current = new Instruction (offset, opcode);
Mono.Cecil.Cil\Instruction.cs (17)
65 return new Instruction (opcode, operand); 153 return new Instruction (opcode, null); 164 return new Instruction (opcode, type); 174 return new Instruction (opcode, site); 185 return new Instruction (opcode, method); 196 return new Instruction (opcode, field); 206 return new Instruction (opcode, value); 215 return new Instruction (opcode, value); 224 return new Instruction (opcode, value); 232 return new Instruction (opcode, value); 240 return new Instruction (opcode, value); 248 return new Instruction (opcode, value); 256 return new Instruction (opcode, value); 267 return new Instruction (opcode, target); 277 return new Instruction (opcode, targets); 288 return new Instruction (opcode, variable); 299 return new Instruction (opcode, parameter);
819 references to Instruction
illink (233)
Microsoft.Maui.Controls.Build.Tasks (397)
CompiledConverters\BindablePropertyConverter.cs (3)
15 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 21 yield return Instruction.Create(OpCodes.Ldnull); 25 yield return Instruction.Create(OpCodes.Ldsfld, bpRef);
CompiledConverters\BoundsTypeConverter.cs (7)
14 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 59 IEnumerable<Instruction> GenerateIL(ILContext context, double x, double y, double w, double h, ModuleDefinition module) 67 yield return Instruction.Create(OpCodes.Ldc_R8, x); 68 yield return Instruction.Create(OpCodes.Ldc_R8, y); 69 yield return Instruction.Create(OpCodes.Ldc_R8, w); 70 yield return Instruction.Create(OpCodes.Ldc_R8, h); 71 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Rect"), parameterTypes: new[] {
CompiledConverters\BrushTypeConverter.cs (4)
11 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 22 foreach (var instruction in colorConverter.ConvertFromString(value, context, node)) 25 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "SolidColorBrush"), parameterTypes: new[] { 39 yield return Instruction.Create(OpCodes.Call, propertyGetterReference);
CompiledConverters\ColorTypeConverter.cs (9)
12 public virtual IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 27 yield return Instruction.Create(OpCodes.Ldc_R4, color.Red); 28 yield return Instruction.Create(OpCodes.Ldc_R4, color.Green); 29 yield return Instruction.Create(OpCodes.Ldc_R4, color.Blue); 30 yield return Instruction.Create(OpCodes.Ldc_R4, color.Alpha); 32 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Color"), parameterTypes: new[] { 48 yield return Instruction.Create(OpCodes.Ldnull); 59 yield return Instruction.Create(OpCodes.Ldsfld, fieldReference); 70 yield return Instruction.Create(OpCodes.Call, propertyGetterReference);
CompiledConverters\ColumnDefinitionCollectionTypeConverter.cs (3)
5using static Mono.Cecil.Cil.Instruction; 12 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 28 foreach (var instruction in gridlengthconverter.ConvertFromString(parts[i], context, node))
CompiledConverters\ConstraintTypeConverter.cs (2)
6using static Mono.Cecil.Cil.Instruction; 13 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledConverters\CornerRadiusTypeConverter.cs (4)
13 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 39 IEnumerable<Instruction> GenerateIL(ILContext context, ModuleDefinition module, params double[] args) 42 yield return Instruction.Create(OpCodes.Ldc_R8, d); 43 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: args.Select(a => ("mscorlib", "System", "Double")).ToArray()));
CompiledConverters\EasingTypeConverter.cs (2)
5using static Mono.Cecil.Cil.Instruction; 12 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledConverters\EnumTypeConverter.cs (2)
11 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 18 yield return Instruction.Create(OpCodes.Ldc_I4, (int)(object)enumValue);
CompiledConverters\FlexBasisTypeConverter.cs (8)
13 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 21 yield return Instruction.Create(OpCodes.Ldsfld, 30 yield return Instruction.Create(OpCodes.Ldc_R4, (float)(relflex / 100)); 31 yield return Instruction.Create(OpCodes.Ldc_I4_1); //isRelative: true 32 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui.Layouts", "FlexBasis"), parameterTypes: new[] { 39 yield return Instruction.Create(OpCodes.Ldc_R4, flex); 40 yield return Instruction.Create(OpCodes.Ldc_I4_0); //isRelative: false 41 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui.Layouts", "FlexBasis"), parameterTypes: new[] {
CompiledConverters\FontSizeTypeConverter.cs (8)
12 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 21 yield return Instruction.Create(OpCodes.Ldc_R8, size); 29 yield return Instruction.Create(OpCodes.Ldc_I4, (int)namedSize); 33 yield return Instruction.Create(OpCodes.Ldloc, context.Variables[parent]); 34 yield return Instruction.Create(OpCodes.Callvirt, module.ImportMethodReference( 41 yield return Instruction.Create(OpCodes.Ldtoken, module.ImportReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "Label"))); 42 yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference( 49 yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(
CompiledConverters\GridLengthTypeConverter.cs (2)
7using static Mono.Cecil.Cil.Instruction; 14 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledConverters\ICompiledTypeConverter.cs (3)
12 IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node); 21 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 25 yield return Instruction.Create(OpCodes.Ldc_I4_1);
CompiledConverters\ImageSourceTypeConverter.cs (7)
11 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 20 yield return Instruction.Create(OpCodes.Ldstr, value); 21 yield return Instruction.Create(OpCodes.Ldc_I4_1); // (int)UriKind.Absolute is 1 22 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("System", "System", "Uri"), parameterTypes: new[] { 25 yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ImageSource"), "FromUri", parameterTypes: new[] { 30 yield return Instruction.Create(OpCodes.Ldstr, value); 31 yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ImageSource"), "FromFile", parameterTypes: new[] {
CompiledConverters\LayoutOptionsConverter.cs (2)
13 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 34 yield return Instruction.Create(OpCodes.Ldsfld, fieldReference);
CompiledConverters\ListStringTypeConverter.cs (2)
7using static Mono.Cecil.Cil.Instruction; 14 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledConverters\PointTypeConverter.cs (6)
12 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 17 foreach (var instruction in CreatePoint(context, module, point)) 26 public IEnumerable<Instruction> CreatePoint(ILContext context, ModuleDefinition module, Point point) 28 yield return Instruction.Create(OpCodes.Ldc_R8, point.X); 29 yield return Instruction.Create(OpCodes.Ldc_R8, point.Y); 30 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Point"), parameterTypes: new[] {
CompiledConverters\RDSourceTypeConverter.cs (12)
8using static Mono.Cecil.Cil.Instruction; 15 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 47 foreach (var instruction in CreateUri(context, (ILRootNode)rootNode, value, node, asmName)) 57 foreach (var instruction in CreateResourceDictionaryType(context, currentModule, module, node, rdNode, resourceTypeRef, uriVarDef)) 71 foreach (var instruction in LoadResourceDictionaryFromSource(context, currentModule, (ILRootNode)rootNode, node, rdNode, uriVarDef, resourcePath, asmName)) 78 private static IEnumerable<Instruction> CreateUri(ILContext context, ILRootNode rootNode, string value, BaseNode node, string asmName) 85 foreach (var instruction in (new UriTypeConverter()).ConvertFromString(value, context, node)) 89 private static IEnumerable<Instruction> CreateResourceDictionaryType( 115 foreach (var instruction in context.Variables[rdNode].LoadAs(context.Cache, currentModule.GetTypeDefinition(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary")), currentModule)) 121 private static IEnumerable<Instruction> LoadResourceDictionaryFromSource( 132 foreach (var instruction in context.Variables[rdNode].LoadAs(context.Cache, currentModule.GetTypeDefinition(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary")), currentModule)) 149 foreach (var instruction in node.PushXmlLineInfo(context))
CompiledConverters\RectangleTypeConverter.cs (7)
14 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 32 IEnumerable<Instruction> GenerateIL(ILContext context, double x, double y, double w, double h, ModuleDefinition module) 40 yield return Instruction.Create(OpCodes.Ldc_R8, x); 41 yield return Instruction.Create(OpCodes.Ldc_R8, y); 42 yield return Instruction.Create(OpCodes.Ldc_R8, w); 43 yield return Instruction.Create(OpCodes.Ldc_R8, h); 44 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Rect"), parameterTypes: new[] {
CompiledConverters\RowDefinitionCollectionTypeConverter.cs (3)
5using static Mono.Cecil.Cil.Instruction; 12 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 28 foreach (var instruction in gridlengthconverter.ConvertFromString(parts[i], context, node))
CompiledConverters\StrokeShapeTypeConverter.cs (55)
16 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 26 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Ellipse"), parameterTypes: null)); 36 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: null)); 45 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: null)); 52 yield return Instruction.Create(OpCodes.Ldc_R8, p1.X); 53 yield return Instruction.Create(OpCodes.Ldc_R8, p1.Y); 54 yield return Instruction.Create(OpCodes.Ldc_R8, 0d); 55 yield return Instruction.Create(OpCodes.Ldc_R8, 0d); 56 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: new[] { 66 yield return Instruction.Create(OpCodes.Ldc_R8, p1.X); 67 yield return Instruction.Create(OpCodes.Ldc_R8, p1.Y); 68 yield return Instruction.Create(OpCodes.Ldc_R8, p2.X); 69 yield return Instruction.Create(OpCodes.Ldc_R8, p2.Y); 71 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: new[] { 88 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Path"), parameterTypes: null)); 92 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Path"), parameterTypes: null)); 93 yield return Instruction.Create(OpCodes.Dup); 94 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "PathGeometryConverter"), parameterTypes: null)); 95 yield return Instruction.Create(OpCodes.Ldstr, parts[1]); 96 yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(context.Cache, ("System", "System.ComponentModel", "TypeConverter"), "ConvertFromInvariantString", parameterTypes: new[] { 98 yield return Instruction.Create(OpCodes.Call, module.ImportPropertySetterReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Path"), "Data")); 107 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polygon"), parameterTypes: null)); 116 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polygon"), parameterTypes: null)); 120 foreach (var instruction in CreatePointCollection(context, module, points)) 125 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polygon"), parameterTypes: new[] { 135 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polyline"), parameterTypes: null)); 144 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polyline"), parameterTypes: null)); 148 foreach (var instruction in CreatePointCollection(context, module, points)) 153 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polyline"), parameterTypes: new[] { 160 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Rectangle"), parameterTypes: null)); 169 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), parameterTypes: null)); 173 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), parameterTypes: null)); 174 yield return Instruction.Create(OpCodes.Dup); 179 yield return Instruction.Create(OpCodes.Ldc_R8, cornerRadius.TopLeft); 180 yield return Instruction.Create(OpCodes.Ldc_R8, cornerRadius.TopRight); 181 yield return Instruction.Create(OpCodes.Ldc_R8, cornerRadius.BottomLeft); 182 yield return Instruction.Create(OpCodes.Ldc_R8, cornerRadius.BottomRight); 184 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: new[] { 190 yield return Instruction.Create(OpCodes.Call, module.ImportPropertySetterReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), "CornerRadius")); 196 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Rectangle"), parameterTypes: null)); 197 yield return Instruction.Create(OpCodes.Dup); 199 yield return Instruction.Create(OpCodes.Ldc_R8, radius); 200 yield return Instruction.Create(OpCodes.Ldc_R8, radius); 201 yield return Instruction.Create(OpCodes.Ldc_R8, radius); 202 yield return Instruction.Create(OpCodes.Ldc_R8, radius); 204 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: new[] { 210 yield return Instruction.Create(OpCodes.Call, module.ImportPropertySetterReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), "CornerRadius")); 217 IEnumerable<Instruction> CreatePointCollection(ILContext context, ModuleDefinition module, PointCollection points) 220 yield return Instruction.Create(OpCodes.Ldc_I4, points.Count); 221 yield return Instruction.Create(OpCodes.Newarr, pointType); 226 yield return Instruction.Create(OpCodes.Dup); 227 yield return Instruction.Create(OpCodes.Ldc_I4, i); 229 foreach (var instruction in pointTypeConverter.CreatePoint(context, module, points[i])) 235 yield return Instruction.Create(OpCodes.Stelem_Any, pointType); 238 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, type: ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "PointCollection"), paramCount: 1));
CompiledConverters\ThicknessTypeConverter.cs (4)
13 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node) 44 IEnumerable<Instruction> GenerateIL(ILContext context, ModuleDefinition module, params double[] args) 47 yield return Instruction.Create(OpCodes.Ldc_R8, d); 48 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("Microsoft.Maui", "Microsoft.Maui", "Thickness"), parameterTypes: args.Select(a => ("mscorlib", "System", "Double")).ToArray()));
CompiledConverters\TypeTypeConverter.cs (2)
7using static Mono.Cecil.Cil.Instruction; 14 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledConverters\UriTypeConverter.cs (2)
5using static Mono.Cecil.Cil.Instruction; 12 public IEnumerable<Instruction> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledMarkupExtensions\ArrayExtension.cs (13)
11 public IEnumerable<Instruction> ProvideValue(IElementNode node, ModuleDefinition module, ILContext context, out TypeReference memberRef) 20 IEnumerable<Instruction> ProvideValue(TypeReference typeTypeRef, IReadOnlyList<INode> items, ModuleDefinition module, ILContext context) 24 yield return Instruction.Create(OpCodes.Ldc_I4, n); 25 yield return Instruction.Create(OpCodes.Newarr, typeTypeRef); 42 yield return Instruction.Create(OpCodes.Dup); 43 yield return Instruction.Create(OpCodes.Ldc_I4, i); 44 yield return Instruction.Create(OpCodes.Ldelema, typeTypeRef); 45 foreach (var instruction in vardef.LoadAs(context.Cache, typeTypeRef, module)) 47 yield return Instruction.Create(OpCodes.Stobj, typeTypeRef); 51 yield return Instruction.Create(OpCodes.Dup); 52 yield return Instruction.Create(OpCodes.Ldc_I4, i); 53 foreach (var instruction in vardef.LoadAs(context.Cache, typeTypeRef, module)) 55 yield return Instruction.Create(OpCodes.Stelem_Ref);
CompiledMarkupExtensions\DataTemplateExtension.cs (3)
7using static Mono.Cecil.Cil.Instruction; 14 public IEnumerable<Instruction> ProvideValue(IElementNode node, ModuleDefinition module, ILContext context, out TypeReference typeRef) 29 return new List<Instruction> {
CompiledMarkupExtensions\ICompiledMarkupExtension.cs (1)
10 IEnumerable<Instruction> ProvideValue(IElementNode node, ModuleDefinition module, ILContext context, out TypeReference typeRef);
CompiledMarkupExtensions\NullExtension.cs (2)
12 public IEnumerable<Instruction> ProvideValue(IElementNode node, ModuleDefinition module, ILContext context, out TypeReference typeRef) 15 return new[] { Instruction.Create(OpCodes.Ldnull) };
CompiledMarkupExtensions\StaticExtension.cs (17)
13 public IEnumerable<Instruction> ProvideValue(IElementNode node, ModuleDefinition module, ILContext context, out TypeReference memberRef) 39 return new[] { Instruction.Create(OpCodes.Ldsfld, fieldRef) }; 43 return new[] { Instruction.Create(((bool)fieldDef.Constant) ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0) }; 45 return new[] { Instruction.Create(OpCodes.Ldstr, (string)fieldDef.Constant) }; 47 return new[] { Instruction.Create(OpCodes.Ldnull) }; 49 return new[] { Instruction.Create(OpCodes.Ldc_I4, (char)fieldDef.Constant) }; 51 return new[] { Instruction.Create(OpCodes.Ldc_R4, (float)fieldDef.Constant) }; 53 return new[] { Instruction.Create(OpCodes.Ldc_R8, (double)fieldDef.Constant) }; 55 return new[] { Instruction.Create(OpCodes.Ldc_I4, (int)fieldDef.Constant) }; 57 return new[] { Instruction.Create(OpCodes.Ldc_I4, (uint)fieldDef.Constant) }; 59 return new[] { Instruction.Create(OpCodes.Ldc_I8, (long)fieldDef.Constant) }; 61 return new[] { Instruction.Create(OpCodes.Ldc_I8, (ulong)fieldDef.Constant) }; 67 return new[] { Instruction.Create(OpCodes.Ldc_I8, (long)fieldDef.Constant) }; 69 return new[] { Instruction.Create(OpCodes.Ldc_I8, (ulong)fieldDef.Constant) }; 71 return new[] { Instruction.Create(OpCodes.Ldc_I4, (uint)fieldDef.Constant) }; 73 return new[] { Instruction.Create(OpCodes.Ldc_I4, (int)fieldDef.Constant) }; 79 return new[] { Instruction.Create(OpCodes.Call, getterDef) };
CompiledMarkupExtensions\StaticResourceExtension.cs (11)
7using static Mono.Cecil.Cil.Instruction; 15 public IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ModuleDefinition module, BaseNode node, ILContext context) 40 foreach (var instruction in TryConvert(irn.CollectionItems[0] as ValueNode, eNode, vardefref, module, context)) 61 foreach (var instruction in TryConvert(irn2.CollectionItems[0] as ValueNode, eNode, vardefref, module, context)) 86 foreach (var instruction in TryConvert(irn3.CollectionItems[0] as ValueNode, eNode, vardefref, module, context)) 103 foreach (var instruction in FallBack(keyValueNode.Value as string, eNode, module, context).ToList()) 111 public static IEnumerable<Instruction> TryConvert(ValueNode stringResourceNode, IElementNode node, VariableDefinitionReference vardefref, ModuleDefinition module, ILContext context) 123 foreach (var instruction in stringResourceNode.PushConvertedValue(context, bpRef, requiredServices => stringResourceNode.PushServiceProvider(context, requiredServices, bpRef: bpRef), true, false)) 136 foreach (var instruction in stringResourceNode.PushConvertedValue( 151 public static IEnumerable<Instruction> FallBack(string key, IElementNode node, ModuleDefinition module, ILContext context) 185 foreach (var instruction in node.PushServiceProvider(context, requiredServices, bpRef, propertyRef, declaringTypeReference))
CompiledMarkupExtensions\TypeExtension.cs (3)
7using static Mono.Cecil.Cil.Instruction; 14 public IEnumerable<Instruction> ProvideValue(IElementNode node, ModuleDefinition module, ILContext context, out TypeReference memberRef) 35 return new List<Instruction> {
CompiledValueProviders\ICompiledValueProvider.cs (1)
10 IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ModuleDefinition module, BaseNode node, ILContext context);
CompiledValueProviders\SetterValueProvider.cs (4)
12 public IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ModuleDefinition module, BaseNode node, ILContext context) 38 foreach (var instruction in vardefref.VariableDefinition.LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, setterType), module)) 42 foreach (var instruction in ((ValueNode)valueNode).PushConvertedValue(context, bpRef, (requiredServices) => valueNode.PushServiceProvider(context, requiredServices, bpRef: bpRef), boxValueTypes: true, unboxValueTypes: false)) 46 yield return Instruction.Create(OpCodes.Callvirt, module.ImportPropertySetterReference(context.Cache, setterType, propertyName: "Value"));
CompiledValueProviders\StyleSheetProvider.cs (3)
7using static Mono.Cecil.Cil.Instruction; 14 public IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ModuleDefinition module, BaseNode node, ILContext context) 69 foreach (var instruction in node.PushXmlLineInfo(context))
CreateObjectVisitor.cs (8)
9using static Mono.Cecil.Cil.Instruction; 295 IEnumerable<Instruction> PushCtorArguments(MethodReference ctorinfo, ElementNode enode) 310 foreach (var instruction in vardef.LoadAs(Context.Cache, parameter.ParameterType.ResolveGenericParameters(ctorinfo), Module)) 314 foreach (var instruction in vnode.PushConvertedValue(Context, 324 IEnumerable<Instruction> PushCtorXArguments(MethodReference factoryCtorInfo, ElementNode enode) 348 foreach (var instruction in vardef.LoadAs(Context.Cache, parameter.ParameterType.ResolveGenericParameters(factoryCtorInfo), Module)) 352 foreach (var instruction in vnode.PushConvertedValue(Context, 392 IEnumerable<Instruction> PushValueFromLanguagePrimitive(TypeDefinition typedef, ElementNode node)
DebugXamlCTask.cs (5)
75 foreach (var instr in initComp.Body.Instructions) 118 var br2 = Instruction.Create(OpCodes.Ldarg_0); 119 var ret = Instruction.Create(OpCodes.Ret);
ILProcessorExtensions.cs (2)
8 public static void Append(this ILProcessor processor, IEnumerable<Instruction> instructions) 10 foreach (var instruction in instructions)
MethodBodyExtensions.cs (7)
22 static void ExpandMacro(Instruction instruction, OpCode opcode, object operand) 33 var instruction = self.Instructions[i]; 40 self.Instructions.Insert(++i, Instruction.Create(OpCodes.Conv_I8)); 49 var instruction = self.Instructions[i]; 54 var next = self.Instructions[i + 1]; 68 foreach (var instruction in self.Instructions) 83 var instruction = (from instr in self.Instructions where instr.OpCode.Code == Code.Stloc && instr.Operand == varDef select instr).First();
NodeILExtensions.cs (79)
11using static Mono.Cecil.Cil.Instruction; 99 public static IEnumerable<Instruction> PushConvertedValue(this ValueNode node, ILContext context, 101 Func<TypeReference[], IEnumerable<Instruction>> pushServiceProvider, bool boxValueTypes, bool unboxValueTypes) 121 public static IEnumerable<Instruction> PushConvertedValue(this ValueNode node, ILContext context, FieldReference bpRef, 122 Func<TypeReference[], IEnumerable<Instruction>> pushServiceProvider, bool boxValueTypes, bool unboxValueTypes) 148 public static IEnumerable<Instruction> PushConvertedValue(this ValueNode node, ILContext context, 149 TypeReference targetTypeRef, TypeReference typeConverter, Func<TypeReference[], IEnumerable<Instruction>> pushServiceProvider, 164 IEnumerable<Instruction> instructions; 167 instructions = (IEnumerable<Instruction>)converter.Invoke(compiledConverter, new object[] { 178 foreach (var i in instructions) 181 yield return Instruction.Create(OpCodes.Box, module.ImportReference(targetTypeRef)); 205 foreach (var instruction in pushServiceProvider(requiredServiceType)) 209 yield return Instruction.Create(OpCodes.Callvirt, convertFromInvariantStringReference); 212 yield return Instruction.Create(OpCodes.Unbox_Any, module.ImportReference(targetTypeRef)); 235 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(Char.Parse, node, str))); 237 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => SByte.Parse(s, CultureInfo.InvariantCulture), node, str))); 239 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => Int16.Parse(s, CultureInfo.InvariantCulture), node, str))); 241 yield return Instruction.Create(OpCodes.Ldc_I4, TryFormat(s => Int32.Parse(s, CultureInfo.InvariantCulture), node, str)); 243 yield return Instruction.Create(OpCodes.Ldc_I8, TryFormat(s => Int64.Parse(s, CultureInfo.InvariantCulture), node, str)); 245 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => Byte.Parse(s, CultureInfo.InvariantCulture), node, str))); 247 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => UInt16.Parse(s, CultureInfo.InvariantCulture), node, str))); 249 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => UInt32.Parse(s, CultureInfo.InvariantCulture), node, str))); 251 yield return Instruction.Create(OpCodes.Ldc_I8, unchecked((long)TryFormat(s => UInt64.Parse(s, CultureInfo.InvariantCulture), node, str))); 253 yield return Instruction.Create(OpCodes.Ldc_R4, TryFormat(s => Single.Parse(str, CultureInfo.InvariantCulture), node, str)); 255 yield return Instruction.Create(OpCodes.Ldc_R8, TryFormat(s => Double.Parse(str, CultureInfo.InvariantCulture), node, str)); 259 yield return Instruction.Create(OpCodes.Ldc_I4_1); 261 yield return Instruction.Create(OpCodes.Ldc_I4_0); 267 yield return Instruction.Create(OpCodes.Ldc_I8, ticks); 268 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("mscorlib", "System", "TimeSpan"), parameterTypes: new[] { ("mscorlib", "System", "Int64") })); 274 yield return Instruction.Create(OpCodes.Ldc_I8, ticks); 275 yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.Cache, ("mscorlib", "System", "DateTime"), parameterTypes: new[] { ("mscorlib", "System", "Int64") })); 278 yield return Instruction.Create(OpCodes.Ldstr, str.Substring(2)); 280 yield return Instruction.Create(OpCodes.Ldstr, str); 282 yield return Instruction.Create(OpCodes.Ldstr, str); 340 static Instruction PushParsedEnum(XamlCache cache, TypeReference enumRef, string value, IXmlLineInfo lineInfo) 414 return Instruction.Create(OpCodes.Ldc_I4, (int)b); 416 return Instruction.Create(OpCodes.Ldc_I4, (int)sb); 418 return Instruction.Create(OpCodes.Ldc_I4, (int)s); 420 return Instruction.Create(OpCodes.Ldc_I4, (int)us); 422 return Instruction.Create(OpCodes.Ldc_I4, (int)i); 424 return Instruction.Create(OpCodes.Ldc_I4, (uint)ui); 426 return Instruction.Create(OpCodes.Ldc_I4, (long)l); 428 return Instruction.Create(OpCodes.Ldc_I4, (ulong)ul); 434 public static IEnumerable<Instruction> PushXmlLineInfo(this INode node, ILContext context) 463 public static IEnumerable<Instruction> PushParentObjectsArray(this INode node, ILContext context) 483 yield return Instruction.Create(OpCodes.Ldnull); 489 yield return Instruction.Create(OpCodes.Ldarg_0); 490 yield return Instruction.Create(OpCodes.Ldfld, context.ParentContextValues); 497 yield return Instruction.Create(OpCodes.Ldarg_0); 498 yield return Instruction.Create(OpCodes.Ldfld, context.ParentContextValues); 499 yield return Instruction.Create(OpCodes.Ldlen); 500 yield return Instruction.Create(OpCodes.Conv_I4); 503 yield return Instruction.Create(OpCodes.Ldc_I4_0); 506 yield return Instruction.Create(OpCodes.Stloc, parentObjectLength); 509 yield return Instruction.Create(OpCodes.Ldloc, parentObjectLength); 510 yield return Instruction.Create(OpCodes.Ldc_I4, nodes.Count); 511 yield return Instruction.Create(OpCodes.Add); 512 yield return Instruction.Create(OpCodes.Newarr, module.TypeSystem.Object); 515 yield return Instruction.Create(OpCodes.Stloc, finalArray); 539 yield return Instruction.Create(OpCodes.Ldloc, finalArray); 545 yield return Instruction.Create(OpCodes.Dup); 546 yield return Instruction.Create(OpCodes.Ldc_I4, i); 547 foreach (var instruction in context.Variables[en].LoadAs(context.Cache, module.TypeSystem.Object, module)) 549 yield return Instruction.Create(OpCodes.Stelem_Ref); 554 static IEnumerable<Instruction> PushTargetProperty(ILContext context, FieldReference bpRef, PropertyReference propertyRef, TypeReference declaringTypeReference, ModuleDefinition module) 579 static IEnumerable<Instruction> PushNamescopes(INode node, ILContext context, ModuleDefinition module) 591 yield return Instruction.Create(OpCodes.Ldc_I4, scopes.Count); 592 yield return Instruction.Create(OpCodes.Newarr, module.ImportReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope"))); 597 yield return Instruction.Create(OpCodes.Dup); 598 yield return Instruction.Create(OpCodes.Ldc_I4, i); 599 yield return Instruction.Create(OpCodes.Ldloc, scope); 600 yield return Instruction.Create(OpCodes.Stelem_Ref); 605 public static IEnumerable<Instruction> PushServiceProvider(this INode node, ILContext context, TypeReference[] requiredServices, FieldReference bpRef = null, PropertyReference propertyRef = null, TypeReference declaringTypeReference = null) 638 foreach (var instruction in pushParentIl) 641 foreach (var instruction in PushTargetProperty(context, bpRef, propertyRef, declaringTypeReference, module)) 644 foreach (var instruction in PushNamescopes(node, context, module)) 676 foreach (var instruction in variableDefinition.LoadAs(context.Cache, module.TypeSystem.Object, module)) 686 foreach (var instruction in PushTargetProperty(context, bpRef, propertyRef, declaringTypeReference, module)) 724 foreach (var instruction in node.PushXmlLineInfo(context))
SetNamescopesAndRegisterNamesVisitor.cs (4)
106 var stloc = Instruction.Create(OpCodes.Stloc, vardef); 181 var nop = Instruction.Create(OpCodes.Nop);
SetPropertiesVisitor.cs (70)
11using static Mono.Cecil.Cil.Instruction; 253 public static IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ILContext context, 275 foreach (var instruction in context.Variables[node].LoadAs(context.Cache, markupExtension, module)) 277 yield return Instruction.Create(OpCodes.Ldnull); //ArrayExtension does not require ServiceProvider 278 yield return Instruction.Create(OpCodes.Callvirt, provideValue); 281 yield return Instruction.Create(OpCodes.Castclass, module.ImportReference(arrayTypeRef.MakeArrayType())); 282 yield return Instruction.Create(OpCodes.Stloc, vardefref.VariableDefinition); 313 foreach (var instruction in instructions) 398 foreach (var instruction in context.Variables[node].LoadAs(context.Cache, markupExtension, module)) 403 foreach (var instruction in node.PushServiceProvider(context, requiredServiceType, bpRef, propertyRef, propertyDeclaringTypeRef)) 427 var instructions = (IEnumerable<Instruction>)cProvideValue.Invoke(valueProvider, [ 432 foreach (var i in instructions) 438 foreach (var instruction in context.Variables[node].LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, markupExtensionType), module)) 443 foreach (var instruction in node.PushServiceProvider(context, requiredServiceType, bpRef, propertyRef, propertyDeclaringTypeRef)) 467 var instructions = (IEnumerable<Instruction>)cProvideValue.Invoke(compiledValueProvider, new object[] { 472 foreach (var i in instructions) 479 foreach (var instruction in context.Variables[node].LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, valueProviderInterface), module)) 484 foreach (var instruction in node.PushServiceProvider(context, requiredServiceType, bpRef, propertyRef, propertyDeclaringTypeRef)) 495 static bool TryCompileBindingPath(ElementNode node, ILContext context, VariableDefinition bindingExt, (string, string, string) bindingExtensionType, out IEnumerable<Instruction> instructions) 593 IEnumerable<Instruction> GenerateInstructions() 620 foreach (var instruction in bindingExt.LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, bindingExtensionType), module)) 622 foreach (var instruction in CompiledBindingGetGetter(tSourceRef, tPropertyRef, properties, node, context)) 626 foreach (var instruction in CompiledBindingGetSetter(tSourceRef, tPropertyRef, properties, node, context)) 633 foreach (var instruction in CompiledBindingGetHandlers(tSourceRef, tPropertyRef, properties, node, context)) 764 static IEnumerable<Instruction> DigProperties(IEnumerable<(PropertyDefinition property, TypeReference propDeclTypeRef, string indexArg)> properties, Dictionary<TypeReference, VariableDefinition> locs, Func<Instruction> fallback, IXmlLineInfo lineInfo, ModuleDefinition module) 821 static IEnumerable<Instruction> CompiledBindingGetGetter(TypeReference tSourceRef, TypeReference tPropertyRef, IList<(PropertyDefinition property, TypeReference propDeclTypeRef, string indexArg)> properties, ElementNode node, ILContext context) 874 Instruction pop = null; 915 static IEnumerable<Instruction> CompiledBindingGetSetter(TypeReference tSourceRef, TypeReference tPropertyRef, IList<(PropertyDefinition property, TypeReference propDeclTypeRef, string indexArg)> properties, ElementNode node, ILContext context) 964 Instruction pop = null; 968 pop = Instruction.Create(Pop); 993 pop = Instruction.Create(Pop); 1040 static IEnumerable<Instruction> CompiledBindingGetHandlers(TypeReference tSourceRef, TypeReference tPropertyRef, IList<(PropertyDefinition property, TypeReference propDeclTypeRef, string indexArg)> properties, ElementNode node, ILContext context) 1170 public static IEnumerable<Instruction> SetPropertyValue(VariableDefinition parent, XmlName propertyName, INode valueNode, ILContext context, IXmlLineInfo iXmlLineInfo) 1202 public static IEnumerable<Instruction> GetPropertyValue(VariableDefinition parent, XmlName propertyName, ILContext context, IXmlLineInfo lineInfo, out TypeReference propertyType) 1252 static IEnumerable<Instruction> ConnectEvent(VariableDefinition parent, string localName, INode valueNode, IXmlLineInfo iXmlLineInfo, ILContext context) 1314 foreach (var instruction in (context.Root as VariableDefinition).LoadAs(context.Cache, ctor.Parameters[0].ParameterType.ResolveGenericParameters(ctor), module)) 1352 static IEnumerable<Instruction> SetDynamicResource(VariableDefinition parent, FieldReference bpRef, IElementNode elementNode, IXmlLineInfo iXmlLineInfo, ILContext context) 1358 foreach (var instruction in parent.LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, dynamicResourceHandlerType), module)) 1361 foreach (var instruction in context.Variables[elementNode].LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, dynamicResourceType), module)) 1391 static IEnumerable<Instruction> SetBinding(VariableDefinition parent, FieldReference bpRef, IElementNode elementNode, IXmlLineInfo iXmlLineInfo, ILContext context) 1401 foreach (var instruction in parent.LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, bindableObjectType), module)) 1404 foreach (var instruction in context.Variables[elementNode].LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, parameterTypes[1]), module)) 1458 static IEnumerable<Instruction> SetValue(VariableDefinition parent, FieldReference bpRef, INode node, IXmlLineInfo iXmlLineInfo, ILContext context) 1470 foreach (var instruction in parent.LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, bindableObjectType), module)) 1478 foreach (var instruction in valueNode.PushConvertedValue(context, bpRef, (requiredServices) => valueNode.PushServiceProvider(context, requiredServices, bpRef: bpRef), true, false)) 1483 var @else = Create(OpCodes.Nop); 1484 var endif = Create(OpCodes.Nop); 1505 foreach (var instruction in context.Variables[elementNode].LoadAs(context.Cache, bpTypeRef, module)) 1524 static IEnumerable<Instruction> GetValue(VariableDefinition parent, FieldReference bpRef, IXmlLineInfo iXmlLineInfo, ILContext context, out TypeReference propertyType) 1530 static IEnumerable<Instruction> GetValue(VariableDefinition parent, FieldReference bpRef, IXmlLineInfo iXmlLineInfo, ILContext context) 1535 foreach (var instruction in parent.LoadAs(context.Cache, module.GetTypeDefinition(context.Cache, bindableObjectType), module)) 1602 static IEnumerable<Instruction> Set(VariableDefinition parent, string localName, INode node, IXmlLineInfo iXmlLineInfo, ILContext context) 1629 yield return Instruction.Create(OpCodes.Ldloca, parent); 1631 yield return Instruction.Create(OpCodes.Ldloc, parent); 1636 foreach (var instruction in valueNode.PushConvertedValue(context, propertyType, new ICustomAttributeProvider[] { property, propertyType.ResolveCached(context.Cache) }, (requiredServices) => valueNode.PushServiceProvider(context, requiredServices, propertyRef: property), false, true)) 1639 yield return Instruction.Create(OpCodes.Call, propertySetterRef); 1641 yield return Instruction.Create(OpCodes.Callvirt, propertySetterRef); 1645 foreach (var instruction in context.Variables[elementNode].LoadAs(context.Cache, propertyType, module)) 1648 yield return Instruction.Create(OpCodes.Call, propertySetterRef); 1650 yield return Instruction.Create(OpCodes.Callvirt, propertySetterRef); 1654 static IEnumerable<Instruction> Get(VariableDefinition parent, string localName, IXmlLineInfo iXmlLineInfo, ILContext context, out TypeReference propertyType) 1740 static IEnumerable<Instruction> Add(VariableDefinition parent, XmlName propertyName, INode node, IXmlLineInfo iXmlLineInfo, ILContext context) 1747 foreach (var instruction in GetPropertyValue(parent, propertyName, context, iXmlLineInfo, out propertyType)) 1752 foreach (var instruction in AddToResourceDictionary(parent, elementNode, iXmlLineInfo, context)) 1761 foreach (var instruction in vardef.LoadAs(context.Cache, adderRef.Parameters[0].ParameterType.ResolveGenericParameters(adderRef), module)) 1763 yield return Instruction.Create(OpCodes.Callvirt, adderRef); 1765 yield return Instruction.Create(OpCodes.Pop); 1768 static IEnumerable<Instruction> AddToResourceDictionary(VariableDefinition parent, IElementNode node, IXmlLineInfo lineInfo, ILContext context) 1783 foreach (var instruction in context.Variables[node].LoadAs(context.Cache, module.TypeSystem.Object, module))
VariableDefinitionExtensions.cs (5)
9 public static IEnumerable<Instruction> LoadAs(this VariableDefinition self, XamlCache cache, TypeReference type, ModuleDefinition module, bool box = true, bool unbox = true) 13 yield return Instruction.Create(OpCodes.Ldloc, self); 16 yield return Instruction.Create(OpCodes.Call, module.ImportReference(implicitOperator)); 18 yield return Instruction.Create(OpCodes.Box, module.ImportReference(self.VariableType)); 20 yield return Instruction.Create(OpCodes.Unbox_Any, module.ImportReference(type));
Mono.Cecil (166)
Mono.Cecil.Cil\CodeReader.cs (13)
155 var current = new Instruction (offset, opcode); 174 object ReadOperand (Instruction instruction) 243 void ResolveBranches (Collection<Instruction> instructions) 249 var instruction = items [i]; 257 var branches = new Instruction [offsets.Length]; 267 Instruction GetInstruction (int offset) 272 static Instruction GetInstruction (Collection<Instruction> instructions, int offset) 283 var instruction = items [mid]; 425 var end_instruction = GetInstruction (scope.end.Offset); 438 var instruction = GetInstruction (sequence_point.Offset); 452 var start_instruction = GetInstruction (scope.Start.Offset); 456 var end_instruction = GetInstruction (scope.End.Offset);
Mono.Cecil.Cil\CodeWriter.cs (28)
178 var instruction = items [i]; 194 void WriteOperand (Instruction instruction) 208 var targets = (Instruction []) operand; 216 var target = (Instruction) operand; 222 var target = (Instruction) operand; 277 int GetTargetOffset (Instruction instruction) 280 var last = body.instructions [body.instructions.size - 1]; 330 Dictionary<Instruction, int> stack_sizes = null; 336 var instruction = items [i]; 347 void ComputeExceptionHandlerStackSize (ref Dictionary<Instruction, int> stack_sizes) 366 static void AddExceptionStackSize (Instruction handler_start, ref Dictionary<Instruction, int> stack_sizes) 372 stack_sizes = new Dictionary<Instruction, int> (); 377 static void ComputeStackSize (Instruction instruction, ref Dictionary<Instruction, int> stack_sizes, ref int stack_size, ref int max_stack) 391 static void CopyBranchStackSize (Instruction instruction, ref Dictionary<Instruction, int> stack_sizes, int stack_size) 399 CopyBranchStackSize (ref stack_sizes, (Instruction) instruction.operand, stack_size); 402 var targets = (Instruction []) instruction.operand; 409 static void CopyBranchStackSize (ref Dictionary<Instruction, int> stack_sizes, Instruction target, int stack_size) 412 stack_sizes = new Dictionary<Instruction, int> (); 423 static void ComputeStackSize (Instruction instruction, ref int stack_size) 434 static void ComputeStackDelta (Instruction instruction, ref int stack_size) 540 static bool IsFatRange (Instruction start, Instruction end)
Mono.Cecil.Cil\ExceptionHandler.cs (10)
22 Instruction try_start; 23 Instruction try_end; 24 Instruction filter_start; 25 Instruction handler_start; 26 Instruction handler_end; 31 public Instruction TryStart { 36 public Instruction TryEnd { 41 public Instruction FilterStart { 46 public Instruction HandlerStart { 51 public Instruction HandlerEnd {
Mono.Cecil.Cil\ILProcessor.cs (51)
20 readonly Collection<Instruction> instructions; 32 public Instruction Create (OpCode opcode) 34 return Instruction.Create (opcode); 37 public Instruction Create (OpCode opcode, TypeReference type) 39 return Instruction.Create (opcode, type); 42 public Instruction Create (OpCode opcode, CallSite site) 44 return Instruction.Create (opcode, site); 47 public Instruction Create (OpCode opcode, MethodReference method) 49 return Instruction.Create (opcode, method); 52 public Instruction Create (OpCode opcode, FieldReference field) 54 return Instruction.Create (opcode, field); 57 public Instruction Create (OpCode opcode, string value) 59 return Instruction.Create (opcode, value); 62 public Instruction Create (OpCode opcode, sbyte value) 64 return Instruction.Create (opcode, value); 67 public Instruction Create (OpCode opcode, byte value) 70 return Instruction.Create (opcode, body.Variables [value]); 73 return Instruction.Create (opcode, body.GetParameter (value)); 75 return Instruction.Create (opcode, value); 78 public Instruction Create (OpCode opcode, int value) 81 return Instruction.Create (opcode, body.Variables [value]); 84 return Instruction.Create (opcode, body.GetParameter (value)); 86 return Instruction.Create (opcode, value); 89 public Instruction Create (OpCode opcode, long value) 91 return Instruction.Create (opcode, value); 94 public Instruction Create (OpCode opcode, float value) 96 return Instruction.Create (opcode, value); 99 public Instruction Create (OpCode opcode, double value) 101 return Instruction.Create (opcode, value); 104 public Instruction Create (OpCode opcode, Instruction target) 106 return Instruction.Create (opcode, target); 109 public Instruction Create (OpCode opcode, Instruction [] targets) 111 return Instruction.Create (opcode, targets); 114 public Instruction Create (OpCode opcode, VariableDefinition variable) 116 return Instruction.Create (opcode, variable); 119 public Instruction Create (OpCode opcode, ParameterDefinition parameter) 121 return Instruction.Create (opcode, parameter); 184 public void Emit (OpCode opcode, Instruction target) 189 public void Emit (OpCode opcode, Instruction [] targets) 204 public void InsertBefore (Instruction target, Instruction instruction) 218 public void InsertAfter (Instruction target, Instruction instruction) 232 public void InsertAfter (int index, Instruction instruction) 242 public void Append (Instruction instruction) 250 public void Replace (Instruction target, Instruction instruction) 261 public void Replace (int index, Instruction instruction) 270 public void Remove (Instruction instruction)
Mono.Cecil.Cil\Instruction.cs (27)
23 internal Instruction previous; 24 internal Instruction next; 41 public Instruction Previous { 46 public Instruction Next { 63 public Instruction GetPrototype () 74 return size + (1 + ((Instruction []) operand).Length) * 4; 118 AppendLabel (instruction, (Instruction) operand); 121 var labels = (Instruction []) operand; 142 static void AppendLabel (StringBuilder builder, Instruction instruction) 148 public static Instruction Create (OpCode opcode) 156 public static Instruction Create (OpCode opcode, TypeReference type) 167 public static Instruction Create (OpCode opcode, CallSite site) 177 public static Instruction Create (OpCode opcode, MethodReference method) 188 public static Instruction Create (OpCode opcode, FieldReference field) 199 public static Instruction Create (OpCode opcode, string value) 209 public static Instruction Create (OpCode opcode, sbyte value) 218 public static Instruction Create (OpCode opcode, byte value) 227 public static Instruction Create (OpCode opcode, int value) 235 public static Instruction Create (OpCode opcode, long value) 243 public static Instruction Create (OpCode opcode, float value) 251 public static Instruction Create (OpCode opcode, double value) 259 public static Instruction Create (OpCode opcode, Instruction target) 270 public static Instruction Create (OpCode opcode, Instruction [] targets) 280 public static Instruction Create (OpCode opcode, VariableDefinition variable) 291 public static Instruction Create (OpCode opcode, ParameterDefinition parameter)
Mono.Cecil.Cil\MethodBody.cs (25)
28 internal Collection<Instruction> instructions; 55 public Collection<Instruction> Instructions { 212 class InstructionCollection : Collection<Instruction> { 227 protected override void OnAdd (Instruction item, int index) 232 var previous = items [index - 1]; 237 protected override void OnInsert (Instruction item, int index) 241 var current = items [index]; 243 var last = items [index - 1]; 251 var previous = current.previous; 264 protected override void OnSet (Instruction item, int index) 266 var current = items [index]; 277 protected override void OnRemove (Instruction item, int index) 279 var previous = item.previous; 283 var next = item.next; 294 void RemoveSequencePoint (Instruction instruction) 309 void UpdateDebugInformation (Instruction removedInstruction, Instruction existingInstruction) 398 readonly Instruction [] items; 399 readonly Instruction removed_instruction; 400 readonly Instruction existing_instruction; 404 Instruction cache_instruction; 408 public InstructionOffsetResolver (Instruction[] instructions, Instruction removedInstruction, Instruction existingInstruction) 472 var item = items [i];
Mono.Cecil.Cil\SequencePoint.cs (1)
67 public SequencePoint (Instruction instruction, Document document)
Mono.Cecil.Cil\Symbols.cs (11)
162 public ScopeDebugInformation (Instruction start, Instruction end) 193 readonly Instruction instruction; 213 internal Instruction ResolvedInstruction => instruction; 215 public InstructionOffset (Instruction instruction) 560 public AsyncMethodBodyDebugInformation (Instruction catchHandler) 594 public StateMachineScope (Instruction start, Instruction end) 766 public SequencePoint GetSequencePoint (Instruction instruction) 778 public IDictionary<Instruction, SequencePoint> GetSequencePointMapping () 780 var instruction_mapping = new Dictionary<Instruction, SequencePoint> ();
Mono.Cecil.Rocks (10)
Mono.Cecil.Rocks\MethodBodyRocks.cs (10)
27 foreach (var instruction in self.Instructions) { 165 static void ExpandMacro (Instruction instruction, OpCode opcode, object operand) 171 static void MakeMacro (Instruction instruction, OpCode opcode) 189 var instruction = self.Instructions [i]; 196 self.Instructions.Insert (++i, Instruction.Create (OpCodes.Conv_I8)); 207 foreach (var instruction in self.Instructions) { 340 foreach (var instruction in body.Instructions) { 349 static bool OptimizeBranch (Instruction instruction) 351 var offset = ((Instruction) instruction.Operand).Offset - (instruction.Offset + instruction.OpCode.Size + 4); 406 foreach (var instruction in body.Instructions) {
tlens (13)
TLens.Analyzers\DuplicatedCodeAnalyzer.cs (1)
19foreach (var instr in method.Body.Instructions)
TLens.Analyzers\InterfacesAnalyzer.cs (1)
41foreach (var instr in instrs)
TLens.Analyzers\InverterCtorsChainAnalyzer.cs (1)
21foreach (var instr in method.Body.Instructions)
TLens.Analyzers\LargeStaticArraysAnalyzer.cs (1)
18foreach (var instr in method.Body.Instructions)
TLens.Analyzers\LargeStringsAnalyzer.cs (1)
19foreach (var instr in method.Body.Instructions)
TLens.Analyzers\LimitedMethodCalls.cs (1)
20foreach (var instr in instrs)
TLens.Analyzers\RedundantFieldInitializationAnalyzer.cs (3)
37foreach (var instr in instrs) 101static bool IsDefaultNumeric(Instruction instruction) 106static bool IsLoadIntPtrOrUIntPtrZero(Instruction instruction)
TLens.Analyzers\TypeInstatiationAnalyzer.cs (1)
20foreach (var instr in instrs)
TLens.Analyzers\UnnecessaryFieldsAssignmentAnalyzer.cs (1)
31foreach (var instr in method.Body.Instructions)
TLens.Analyzers\UnusedParametersAnalyzer.cs (1)
29foreach (var instr in method.Body.Instructions)
TLens.Analyzers\UserOperatorCalledForNullCheckAnalyzer.cs (1)
28foreach (var instr in instrs)