C# 클래스 Gendarme.Framework.Rocks.InstructionRocks

InstructionRocks contains extensions methods for Instruction and the related collection classes.
파일 보기 프로젝트 열기: remobjects/mono-tools

공개 메소드들

메소드 설명
GetField ( this self ) : FieldDefinition

Get the FieldDefinition associated with the Instruction.

GetMethod ( this self ) : MethodReference

Get the MethodReference or MethodDefinition (but not a CallSite) associated with the Instruction

Older (pre 0.9) Cecil CallSite did not inherit from MethodReference so this was not an issue

GetOperand ( this self, Mono.Cecil.MethodDefinition method ) : object

Return the operand of the Instruction. For macro instruction the operand is constructed.

GetOperandType ( this self, Mono.Cecil.MethodDefinition method ) : TypeReference

Return the type associated with the instruction's operand (INCOMPLETE).

GetParameter ( this self, Mono.Cecil.MethodDefinition method ) : Mono.Cecil.ParameterDefinition

Get the ParameterDefinition associated with the Instruction.

GetPopCount ( this self, IMethodSignature method ) : int

Get the number of values removed on the stack for this instruction.

GetPushCount ( this self ) : int

Get the number of values placed on the stack by this instruction.

GetVariable ( this self, Mono.Cecil.MethodDefinition method ) : Mono.Cecil.Cil.VariableDefinition

Get the VariableDefinition associated with the Instruction.

Is ( this self, Code code ) : bool

Helper method to avoid patterns like "ins.Previous != null && ins.Previous.OpCode.Code == Code.Newobj" and replace it with a shorter "ins.Previous.Is (Code.Newobj)".

IsLoadArgument ( this self ) : bool

Return if the Instruction is a load of an argument (ldarg* family).

IsLoadElement ( this self ) : bool

Return if the Instruction is the load of an element (ldelem* family)

IsLoadIndirect ( this self ) : bool

Return if the Instruction is a load indirect (ldind* family)

IsLoadLocal ( this self ) : bool

Return if the Instruction is a load of a local variable (ldloc* family).

IsOperandZero ( this self ) : bool

Determine if the instruction operand contains the constant zero (0).

IsStoreArgument ( this self ) : bool

Return if the Instruction is a store of an argument (starg* family).

IsStoreLocal ( this self ) : bool

Return if the Instruction is a store of a local variable (stloc* family).

TraceBack ( this self, IMethodSignature method ) : Instruction

Return the instruction that match the current instruction. This is computed by substracting push and adding pop counts until the total becomes zero.

TraceBack ( this self, IMethodSignature method, int offset ) : Instruction

Return the instruction that match the current instruction. This is computed by substracting push and adding pop counts until the total becomes zero.

메소드 상세

GetField() 공개 정적인 메소드

Get the FieldDefinition associated with the Instruction.
public static GetField ( this self ) : FieldDefinition
self this The Instruction on which the extension method can be called.
리턴 Mono.Cecil.FieldDefinition

GetMethod() 공개 정적인 메소드

Get the MethodReference or MethodDefinition (but not a CallSite) associated with the Instruction
Older (pre 0.9) Cecil CallSite did not inherit from MethodReference so this was not an issue
public static GetMethod ( this self ) : MethodReference
self this The Instruction on which the extension method can be called.
리턴 Mono.Cecil.MethodReference

GetOperand() 공개 정적인 메소드

Return the operand of the Instruction. For macro instruction the operand is constructed.
public static GetOperand ( this self, Mono.Cecil.MethodDefinition method ) : object
self this The Instruction on which the extension method can be called.
method Mono.Cecil.MethodDefinition The method inside which the instruction comes from.
리턴 object

GetOperandType() 공개 정적인 메소드

Return the type associated with the instruction's operand (INCOMPLETE).
public static GetOperandType ( this self, Mono.Cecil.MethodDefinition method ) : TypeReference
self this The Instruction on which the extension method can be called.
method Mono.Cecil.MethodDefinition The method inside which the instruction comes from.
리턴 Mono.Cecil.TypeReference

GetParameter() 공개 정적인 메소드

Get the ParameterDefinition associated with the Instruction.
public static GetParameter ( this self, Mono.Cecil.MethodDefinition method ) : Mono.Cecil.ParameterDefinition
self this The Instruction on which the extension method can be called.
method Mono.Cecil.MethodDefinition The method inside which the instruction comes from. /// Needed for the macro instruction where only the variable index is available.
리턴 Mono.Cecil.ParameterDefinition

GetPopCount() 공개 정적인 메소드

Get the number of values removed on the stack for this instruction.
public static GetPopCount ( this self, IMethodSignature method ) : int
self this The Instruction on which the extension method can be called.
method IMethodSignature The method inside which the instruction comes from /// (needed for StackBehaviour.Varpop).
리턴 int

GetPushCount() 공개 정적인 메소드

Get the number of values placed on the stack by this instruction.
public static GetPushCount ( this self ) : int
self this The Instruction on which the extension method can be called.
리턴 int

GetVariable() 공개 정적인 메소드

Get the VariableDefinition associated with the Instruction.
public static GetVariable ( this self, Mono.Cecil.MethodDefinition method ) : Mono.Cecil.Cil.VariableDefinition
self this The Instruction on which the extension method can be called.
method Mono.Cecil.MethodDefinition The method inside which the instruction comes from. /// Needed for the macro instruction where only the variable index is available.
리턴 Mono.Cecil.Cil.VariableDefinition

Is() 공개 정적인 메소드

Helper method to avoid patterns like "ins.Previous != null && ins.Previous.OpCode.Code == Code.Newobj" and replace it with a shorter "ins.Previous.Is (Code.Newobj)".
public static Is ( this self, Code code ) : bool
self this The Instruction on which the extension method can be called.
code Code The Code to compare to.
리턴 bool

IsLoadArgument() 공개 정적인 메소드

Return if the Instruction is a load of an argument (ldarg* family).
public static IsLoadArgument ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

IsLoadElement() 공개 정적인 메소드

Return if the Instruction is the load of an element (ldelem* family)
public static IsLoadElement ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

IsLoadIndirect() 공개 정적인 메소드

Return if the Instruction is a load indirect (ldind* family)
public static IsLoadIndirect ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

IsLoadLocal() 공개 정적인 메소드

Return if the Instruction is a load of a local variable (ldloc* family).
public static IsLoadLocal ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

IsOperandZero() 공개 정적인 메소드

Determine if the instruction operand contains the constant zero (0).
public static IsOperandZero ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

IsStoreArgument() 공개 정적인 메소드

Return if the Instruction is a store of an argument (starg* family).
public static IsStoreArgument ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

IsStoreLocal() 공개 정적인 메소드

Return if the Instruction is a store of a local variable (stloc* family).
public static IsStoreLocal ( this self ) : bool
self this The Instruction on which the extension method can be called.
리턴 bool

TraceBack() 공개 정적인 메소드

Return the instruction that match the current instruction. This is computed by substracting push and adding pop counts until the total becomes zero.
public static TraceBack ( this self, IMethodSignature method ) : Instruction
self this The Instruction on which the extension method can be called.
method IMethodSignature The method from which the instruction was extracted.
리턴 Mono.Cecil.Cil.Instruction

TraceBack() 공개 정적인 메소드

Return the instruction that match the current instruction. This is computed by substracting push and adding pop counts until the total becomes zero.
public static TraceBack ( this self, IMethodSignature method, int offset ) : Instruction
self this The Instruction on which the extension method can be called.
method IMethodSignature The method from which the instruction was extracted.
offset int Offset to add the the Pop count. Useful to track several parameters to a method.
리턴 Mono.Cecil.Cil.Instruction