Class CastOpCodeHandlerBase
- Namespace
- Echo.Platforms.AsmResolver.Emulation.Dispatch.ObjectModel
- Assembly
- Echo.Platforms.AsmResolver.dll
Provides a base for instructions implementing type-casting and boxing behavior.
public abstract class CastOpCodeHandlerBase : FallThroughOpCodeHandler, ICilOpCodeHandler
- Inheritance
-
CastOpCodeHandlerBase
- Implements
- Derived
- Inherited Members
Methods
DispatchInternal(CilExecutionContext, CilInstruction)
Evaluates a CIL instruction in the provided execution context, without increasing the program counter.
protected override CilDispatchResult DispatchInternal(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.
HandleFailedCast(CilExecutionContext, TypeSignature, TypeSignature)
Handles the case when the pushed value is incompatible with the type specified in the instruction.
protected virtual CilDispatchResult HandleFailedCast(CilExecutionContext context, TypeSignature originalType, TypeSignature targetType)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
originalTypeTypeSignatureThe type of the pushed object.
targetTypeTypeSignatureThe type that the object was attempted to be converted to.
Returns
- CilDispatchResult
The final dispatcher result.
HandleNull(CilExecutionContext, TypeSignature)
Handles the case when the pushed value is null.
protected virtual CilDispatchResult HandleNull(CilExecutionContext context, TypeSignature targetType)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
targetTypeTypeSignatureThe type to convert the null reference to.
Returns
- CilDispatchResult
The final dispatcher result.
HandleSuccessfulCast(CilExecutionContext, ObjectHandle, TypeSignature)
Handles the case when the pushed value is compatible with the type specified in the instruction.
protected abstract CilDispatchResult HandleSuccessfulCast(CilExecutionContext context, ObjectHandle handle, TypeSignature targetType)
Parameters
contextCilExecutionContextThe context to evaluate the instruction in.
handleObjectHandleThe address of the object.
targetTypeTypeSignatureThe type to convert the object to to.
Returns
- CilDispatchResult
The final dispatcher result.