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)
Linker.Dataflow\CompilerGeneratedState.cs (2)
170
foreach (
var
instruction in method.Body.Instructions(_context))
460
foreach (
var
instr in context.GetMethodIL(body).Instructions)
Linker.Dataflow\FlowAnnotations.cs (1)
556
foreach (
Instruction
instruction in _context.GetMethodIL(body).Instructions)
Linker.Dataflow\HandleCallAction.cs (2)
23
readonly
Instruction
_operation;
30
Instruction
operation,
Linker.Dataflow\MethodBodyScanner.cs (27)
175
public int MoveNext(
Instruction
op)
315
foreach (
Instruction
operation in methodIL.Instructions)
641
NewKnownStack(knownStacks, ((
Instruction
)operation.Operand).Offset, currentStack);
678
NewKnownStack(knownStacks, ((
Instruction
)operation.Operand).Offset, currentStack);
685
NewKnownStack(knownStacks, ((
Instruction
)operation.Operand).Offset, new Stack<StackSlot>(methodBody.MaxStackSize));
722
Instruction
[] targets = (
Instruction
[])operation.Operand;
723
foreach (
Instruction
target in targets)
751
NewKnownStack(knownStacks, ((
Instruction
)operation.Operand).Offset, currentStack);
780
private void ScanLdarg(
Instruction
operation, Stack<StackSlot> currentStack, MethodDefinition thisMethod)
801
Instruction
operation,
816
Instruction
operation,
841
void ScanLdtoken(MethodIL methodIL,
Instruction
operation, Stack<StackSlot> currentStack)
898
Instruction
operation,
916
Instruction
operation,
937
protected void StoreInReference(MultiValue target, MultiValue source, MethodIL methodIL,
Instruction
operation, LocalVariableStore locals, int curBasicBlock, ref InterproceduralState ipState, int? parameterIndex)
982
Instruction
operation,
1015
protected virtual void HandleStoreField(MethodIL methodIL, FieldValue field,
Instruction
operation, MultiValue valueToStore, int? parameterIndex)
1019
protected virtual void HandleStoreParameter(MethodIL methodIL, MethodParameterValue parameter,
Instruction
operation, MultiValue valueToStore, int? parameterIndex)
1023
protected virtual void HandleReturnValue(MethodIL method, MethodReturnValue thisParameter,
Instruction
operation, MultiValue valueToReturn)
1035
Instruction
operation,
1069
private static VariableDefinition GetLocalDef(
Instruction
operation, Collection<VariableDefinition> localVariables)
1152
Instruction
operation,
1185
Instruction
operation,
1231
Instruction
operation,
1249
Instruction
operation,
1280
Instruction
operation,
Linker.Dataflow\ReflectionMethodBodyScanner.cs (6)
118
private void HandleStoreValueWithDynamicallyAccessedMembers(ValueWithDynamicallyAccessedMembers targetValue,
Instruction
operation, MultiValue sourceValue, int? parameterIndex)
127
protected override void HandleStoreField(MethodIL methodIL, FieldValue field,
Instruction
operation, MultiValue valueToStore, int? parameterIndex)
130
protected override void HandleStoreParameter(MethodIL methodIL, MethodParameterValue parameter,
Instruction
operation, MultiValue valueToStore, int? parameterIndex)
133
protected override void HandleReturnValue(MethodIL methodIL, MethodReturnValue returnValue,
Instruction
operation, MultiValue valueToStore)
161
public override MultiValue HandleCall(MethodIL callingMethodIL, MethodReference calledMethod,
Instruction
operation, ValueNodeList methodParams)
214
Instruction
operation,
Linker.Dataflow\ScannerExtensions.cs (4)
22
foreach (
Instruction
operation in methodIL.Instructions)
27
if (value is
Instruction
inst)
31
else if (value is
Instruction
[] instructions)
33
foreach (
Instruction
switchLabel in instructions)
Linker.Dataflow\TrimAnalysisMethodCallPattern.cs (2)
17
public readonly
Instruction
Operation;
24
Instruction
operation,
Linker.Steps\AddBypassNGenStep.cs (3)
107
instructions.Add(
Instruction
.Create(OpCodes.Ldarg_0));
108
instructions.Add(
Instruction
.Create(OpCodes.Call, systemAttributeDefaultConstructor));
109
instructions.Add(
Instruction
.Create(OpCodes.Ret));
Linker.Steps\CodeRewriterStep.cs (16)
137
var
instruction = CreateConstantResultInstruction(Context, method);
180
public static
Instruction
? CreateConstantResultInstruction(LinkContext context, MethodDefinition method)
186
public static
Instruction
? CreateConstantResultInstruction(LinkContext context, TypeReference inputRtype, object? value = null)
211
return
Instruction
.Create(OpCodes.Ldc_I4_1);
213
return
Instruction
.Create(OpCodes.Ldc_I4_0);
217
return
Instruction
.Create(OpCodes.Ldstr, svalue);
219
return
Instruction
.Create(OpCodes.Ldnull);
225
return
Instruction
.Create(OpCodes.Ldnull);
229
return
Instruction
.Create(OpCodes.Ldc_R8, dvalue);
232
return
Instruction
.Create(OpCodes.Ldc_R8, 0.0);
236
return
Instruction
.Create(OpCodes.Ldc_R4, fvalue);
239
return
Instruction
.Create(OpCodes.Ldc_R4, 0.0f);
249
return
Instruction
.Create(OpCodes.Ldc_I4, intValue);
252
return
Instruction
.Create(OpCodes.Ldc_I4_0);
257
return
Instruction
.Create(OpCodes.Ldc_I8, longValue);
260
return
Instruction
.Create(OpCodes.Ldc_I8, 0L);
Linker.Steps\MarkStep.cs (13)
72
readonly List<(TypeDefinition Type, MethodBody Body,
Instruction
Instr)> _pending_isinst_instr;
231
_pending_isinst_instr = new List<(TypeDefinition, MethodBody,
Instruction
)>();
517
Instruction
instr = item.Instr;
520
ilProcessor.InsertAfter(instr,
Instruction
.Create(OpCodes.Ldnull));
521
Instruction
new_instr =
Instruction
.Create(OpCodes.Pop);
3101
foreach (
var
ins in Context.GetMethodIL(body).Instructions)
3809
foreach (
Instruction
instruction in methodIL.Instructions)
3883
foreach (
Instruction
instruction in methodIL.Instructions)
3920
bool InstructionRequiresReflectionMethodBodyScannerForFieldAccess(
Instruction
instruction)
3936
bool InstructionRequiresReflectionMethodBodyScannerForTypeAccess(
Instruction
instruction)
3950
protected virtual void MarkInstruction(
Instruction
instruction, MethodDefinition method, ref bool requiresReflectionMethodBodyScanner, ref MessageOrigin origin)
4084
protected internal virtual bool ProcessReflectionDependency(MethodBody body,
Instruction
instruction)
Linker.Steps\UnreachableBlocksOptimizer.cs (129)
99
static bool HasJumpIntoTargetRange(Collection<
Instruction
> instructions, int firstInstr, int lastInstr, Func<
Instruction
, int?>? mapping = null)
101
foreach (
var
instr in instructions)
107
if (instr.Operand is
Instruction
target)
129
foreach (
var
rtarget in (
Instruction
[])instr.Operand)
158
static bool IsSideEffectFreeLoad(
Instruction
instr)
249
Instruction
? constant = CodeRewriterStep.CreateConstantResultInstruction(_context, method);
302
Instruction
? GetSizeOfResult(TypeReference type)
323
return TryGetMethodCallResult(new CalleePayload(sizeOfImpl, Array.Empty<
Instruction
>()))?.Instruction;
326
static
Instruction
? EvaluateIntrinsicCall(MethodReference method,
Instruction
[] arguments)
351
return
Instruction
.Create(OpCodes.Ldstr, string.Concat(sleft, sright));
354
return
Instruction
.Create(OpCodes.Ldc_I4, result ? 1 : 0); // op_Equality / op_Inequality
364
static
Instruction
[]? GetArgumentsOnStack(MethodDefinition method, Collection<
Instruction
> instructions, int index)
367
return Array.Empty<
Instruction
>();
369
Instruction
[]? result = null;
372
Instruction
instr = instructions[index - i];
376
result ??= new
Instruction
[method.GetMetadataParametersCount()];
386
static bool IsConstantValue(
Instruction
instr)
414
static bool GetConstantValue(
Instruction
instruction, out object? value)
493
Collection<
Instruction
> instrs = body.Instructions;
500
Instruction
instr = instrs[i];
538
var
nop =
Instruction
.Create(OpCodes.Nop);
564
var
nop =
Instruction
.Create(OpCodes.Nop);
579
Instruction
? value = optimizer.GetSizeOfResult(operand);
598
bool CanInlineInstanceCall(Collection<
Instruction
> instructions, int index)
610
static bool IsCalledWithoutSideEffects(MethodDefinition method, Collection<
Instruction
> instructions, int index)
625
Dictionary<
Instruction
, int>? mapping;
637
List<(int,
Instruction
)>? conditionInstrsToReplace;
654
Collection<
Instruction
> Instructions => Body.Instructions;
660
Collection<
Instruction
>? FoldedInstructions { get; set; }
666
FoldedInstructions = new Collection<
Instruction
>(Instructions);
667
mapping = new Dictionary<
Instruction
, int>();
670
public void Rewrite(int index,
Instruction
newInstruction)
684
void RewriteCondition(int index,
Instruction
instr, int operand)
692
Rewrite(index,
Instruction
.Create(OpCodes.Br, (
Instruction
)instr.Operand));
704
Rewrite(index,
Instruction
.Create(OpCodes.Br, (
Instruction
)instr.Operand));
714
var targets = (
Instruction
[])instr.Operand;
719
RewriteConditionTo(index,
Instruction
.Create(operand == 0 ? OpCodes.Brfalse : OpCodes.Brtrue, targets[operand]));
720
Rewrite(index,
Instruction
.Create(OpCodes.Br, targets[operand]));
739
void RewriteConditionTo(int index,
Instruction
instruction)
741
conditionInstrsToReplace ??= new List<(int,
Instruction
)>();
769
static int GetStackBehaviourDelta(
Instruction
instruction, out bool unknown)
863
Rewrite(index,
Instruction
.Create(OpCodes.Nop));
894
foreach (
var
instr in nopInstructions)
905
Instruction
? targetResult;
909
var
instr = instructions[i];
923
Instruction
[]? args = GetArgumentsOnStack(md, FoldedInstructions ?? instructions, i);
1002
processor.Replace(index,
Instruction
.Create(OpCodes.Ldnull));
1003
processor.InsertAfter(Instructions[index],
Instruction
.Create(OpCodes.Throw));
1028
var
instr = FoldedInstructions[i];
1048
Rewrite(i,
Instruction
.Create(OpCodes.Br, (
Instruction
)instr.Operand));
1084
Rewrite(i,
Instruction
.Create(OpCodes.Br, (
Instruction
)instr.Operand));
1151
Rewrite(i,
Instruction
.Create(OpCodes.Ldc_I4_1));
1155
Rewrite(i,
Instruction
.Create(OpCodes.Ldc_I4_0));
1172
Rewrite(i,
Instruction
.Create(OpCodes.Ldc_I4_0));
1191
Instruction
target;
1201
var
instr = FoldedInstructions[i++];
1206
target = (
Instruction
)instr.Operand;
1215
case
Instruction
starget:
1218
case
Instruction
[] mtargets:
1219
foreach (
var
t in mtargets)
1312
int GetInstructionIndex(
Instruction
instruction)
1323
int? TryGetInstructionIndex(
Instruction
instruction)
1345
static bool IsPairedStlocLdloc(
Instruction
first,
Instruction
second)
1379
Collection<
Instruction
> Instructions => body.Instructions;
1422
var
instr = instrs[i];
1440
public void Process(List<int>? conditionInstrsToRemove, List<(int,
Instruction
)>? conditionInstrsToReplace, out List<
Instruction
>? sentinelNops)
1452
var
instr = instrs[pair.Item1];
1476
var
instr = instrs[i];
1478
Instruction
newInstr;
1481
newInstr =
Instruction
.Create(OpCodes.Ret);
1485
newInstr =
Instruction
.Create(OpCodes.Nop);
1515
var
instr = instrs[index];
1528
var
nop =
Instruction
.Create(OpCodes.Nop);
1530
sentinelNops ??= new List<
Instruction
>();
1533
ILProcessor.Replace(index - 1,
Instruction
.Create(OpCodes.Pop));
1538
var
pop =
Instruction
.Create(OpCodes.Pop);
1540
ILProcessor.InsertAfter(pop,
Instruction
.Create(OpCodes.Pop));
1550
ILProcessor.Replace(index,
Instruction
.Create(OpCodes.Pop));
1569
foreach (
var
instr in Instructions)
1615
VariableDefinition? GetVariableReference(
Instruction
instruction)
1645
Stack<
Instruction
>? stack_instr;
1646
Dictionary<int,
Instruction
>? locals;
1662
public
Instruction
? Result { get; private set; }
1674
Instruction
[]? arguments = callee.Arguments;
1676
Collection<
Instruction
> instructions = callee.Method.Body.Instructions;
1681
Instruction
? jmpTarget = null;
1682
Instruction
? linstr;
1693
var
instr = instructions[i];
1718
jmpTarget = (
Instruction
)instr.Operand;
1730
jmpTarget = (
Instruction
)instr.Operand;
1747
jmpTarget = (
Instruction
)instr.Operand;
1908
PushOnStack(
Instruction
.Create(OpCodes.Ldc_I4, lint == rint ? 1 : 0));
1914
PushOnStack(
Instruction
.Create(OpCodes.Ldc_I4, llong == rlong ? 1 : 0));
1928
PushOnStack(
Instruction
.Create(OpCodes.Ldc_I8, (long)oint));
1947
Instruction
[]? args;
1950
args = Array.Empty<
Instruction
>();
2037
if (stack_instr == null || !stack_instr.TryPop(out
Instruction
? instr))
2055
bool EvaluateConditionalJump(
Instruction
instr, out
Instruction
? target)
2066
target = (
Instruction
)instr.Operand;
2086
var
instr = stack_instr.Pop();
2112
static
Instruction
? GetArgumentValue(
Instruction
[]? arguments, int index)
2120
Instruction
[]? GetArgumentsOnStack(MethodDefinition method)
2127
var result = new
Instruction
[length];
2134
Instruction
? GetLocalsValue(int index, MethodBody body)
2136
if (locals != null && locals.TryGetValue(index, out
Instruction
? instruction))
2158
Instruction
? instr;
2176
Instruction
? instr;
2210
void PushOnStack(
Instruction
instruction)
2212
stack_instr ??= new Stack<
Instruction
>();
2219
locals ??= new Dictionary<int,
Instruction
>();
2227
readonly record struct CalleePayload(MethodDefinition Method,
Instruction
[]? Arguments = null)
2232
readonly record struct MethodResult(
Instruction
Instruction, bool IsSideEffectFree)
2234
public
Instruction
GetPrototype() => Instruction.GetPrototype();
Linker\BannedApiExtensions.cs (1)
15
public static Collection<
Instruction
> Instructions(this MethodBody body, LinkContext context)
Linker\LinkerILProcessor.cs (21)
15
Collections.Generic.Collection<
Instruction
> Instructions => _ilProcessor.Body.Instructions;
28
public void InsertBefore(
Instruction
target,
Instruction
instruction)
38
public void InsertAfter(
Instruction
target,
Instruction
instruction)
44
public void Append(
Instruction
instruction)
46
Instruction
? lastInstruction = Instructions.Count == 0 ? null : Instructions[Instructions.Count - 1];
51
public void Replace(
Instruction
target,
Instruction
instruction)
59
public void Replace(int index,
Instruction
instruction) => Replace(_ilProcessor.Body.Instructions[index], instruction);
61
public void Remove(
Instruction
instruction)
67
Instruction
? nextInstruction = Instructions.Count == index + 1 ? null : Instructions[index + 1];
68
Instruction
? previousInstruction = index == 0 ? null : Instructions[index - 1];
78
void RedirectScopeStart(
Instruction
oldTarget,
Instruction
? newTarget)
100
static void RedirectScopeEnd(
Instruction
? oldTarget,
Instruction
? newTarget)
107
void ReplaceInstructionReference(
Instruction
oldTarget,
Instruction
? newTarget)
109
foreach (
var
instr in Instructions)
114
if (instr.Operand is
Instruction
?[] instructions)
Linker\MethodBodyScanner.cs (3)
17
Instruction
? previousMeaningful = null;
19
foreach (
var
ins in body.Instructions)
121
foreach (
Instruction
instruction in methodIL.Instructions)
Linker\MethodIL.cs (1)
24
public Collection<
Instruction
> Instructions => Body.Instructions;
Linker\ParameterHelpers.cs (1)
13
public static ParameterIndex GetParameterIndex(MethodDefinition thisMethod,
Instruction
operation)
Linker\TypeReferenceWalker.cs (1)
199
foreach (
var
instr in body.Instructions)
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)
5
using 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)
6
using 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)
5
using 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)
7
using 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)
7
using 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)
8
using 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)
5
using 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)
7
using static Mono.Cecil.Cil.
Instruction
;
14
public IEnumerable<
Instruction
> ConvertFromString(string value, ILContext context, BaseNode node)
CompiledConverters\UriTypeConverter.cs (2)
5
using 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)
7
using 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)
7
using 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)
7
using 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)
7
using 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)
9
using 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)
11
using 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)
11
using 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)
19
foreach (
var
instr in method.Body.Instructions)
TLens.Analyzers\InterfacesAnalyzer.cs (1)
41
foreach (
var
instr in instrs)
TLens.Analyzers\InverterCtorsChainAnalyzer.cs (1)
21
foreach (
var
instr in method.Body.Instructions)
TLens.Analyzers\LargeStaticArraysAnalyzer.cs (1)
18
foreach (
var
instr in method.Body.Instructions)
TLens.Analyzers\LargeStringsAnalyzer.cs (1)
19
foreach (
var
instr in method.Body.Instructions)
TLens.Analyzers\LimitedMethodCalls.cs (1)
20
foreach (
var
instr in instrs)
TLens.Analyzers\RedundantFieldInitializationAnalyzer.cs (3)
37
foreach (
var
instr in instrs)
101
static bool IsDefaultNumeric(
Instruction
instruction)
106
static bool IsLoadIntPtrOrUIntPtrZero(
Instruction
instruction)
TLens.Analyzers\TypeInstatiationAnalyzer.cs (1)
20
foreach (
var
instr in instrs)
TLens.Analyzers\UnnecessaryFieldsAssignmentAnalyzer.cs (1)
31
foreach (
var
instr in method.Body.Instructions)
TLens.Analyzers\UnusedParametersAnalyzer.cs (1)
29
foreach (
var
instr in method.Body.Instructions)
TLens.Analyzers\UserOperatorCalledForNullCheckAnalyzer.cs (1)
28
foreach (
var
instr in instrs)