Class CallHandlerBase
- Namespace
- Echo.Platforms.AsmResolver.Emulation.Dispatch.ObjectModel
- Assembly
- Echo.Platforms.AsmResolver.dll
Provides a base implementation for operation codes that call functions or methods.
public abstract class CallHandlerBase : ICilOpCodeHandler
- Inheritance
-
CallHandlerBase
- Implements
- Derived
- Inherited Members
Methods
DevirtualizeMethodInternal(CilExecutionContext, IMethodDescriptor, IList<BitVector>)
Devirtualizes and resolves the method that is referenced by the provided instruction.
protected abstract MethodDevirtualizationResult DevirtualizeMethodInternal(CilExecutionContext context, IMethodDescriptor method, IList<BitVector> arguments)
Parameters
contextCilExecutionContextThe execution context the instruction is evaluated in.
methodIMethodDescriptorThe method that is being devirtualized.
argumentsIList<BitVector>The arguments pushed onto the stack.
Returns
- MethodDevirtualizationResult
The result of the devirtualization.
Dispatch(CilExecutionContext, CilInstruction)
Evaluates a CIL instruction in the provided execution context.
public virtual CilDispatchResult Dispatch(CilExecutionContext context, CilInstruction instruction)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
instructionCilInstructionThe instruction to dispatch and evaluate.
Returns
- CilDispatchResult
A value indicating whether the dispatch was successful or caused an error.
FindMethodImplementationInType(TypeDefinition?, MethodDefinition?)
Finds a matching implementation or override of a base method in a type.
protected static MethodDefinition? FindMethodImplementationInType(TypeDefinition? type, MethodDefinition? baseMethod)
Parameters
typeTypeDefinitionThe type to search in.
baseMethodMethodDefinitionThe method to find an implementation for.
Returns
- MethodDefinition
The method, or
nullif none is found.
GetArguments(CilExecutionContext, IMethodDescriptor)
Pops the required arguments for a method call from the stack.
protected IList<BitVector> GetArguments(CilExecutionContext context, IMethodDescriptor method)
Parameters
contextCilExecutionContextThe context to evaluate the method call in.
methodIMethodDescriptorThe method to pop arguments for.
Returns
HandleCall(CilExecutionContext, CilInstruction, IMethodDescriptor, IList<BitVector>)
Handles the actual calling mechanism of the instruction.
protected CilDispatchResult HandleCall(CilExecutionContext context, CilInstruction instruction, IMethodDescriptor method, IList<BitVector> arguments)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
instructionCilInstructionThe instruction to dispatch and evaluate.
methodIMethodDescriptorThe method that is called.
argumentsIList<BitVector>The arguments to call the method with.
Returns
- CilDispatchResult
The dispatching result.
ShouldPopInstanceObject(IMethodDescriptor)
Determines whether the instance object should be popped from the stack for the provided method.
protected virtual bool ShouldPopInstanceObject(IMethodDescriptor method)
Parameters
methodIMethodDescriptorThe method to test.
Returns
- bool
trueif the instance object should be popped,falseotherwise.