C# Class Mosa.Compiler.Framework.BaseMethodCompiler

Base class of a method compiler.
A method compiler is responsible for compiling a single function of an object. There are various classes derived from BaseMethodCompiler, which provide specific features, such as jit compilation, runtime optimized jitting and others. MethodCompilerBase instances are usually created by invoking CreateMethodCompiler on a specific compiler instance.
Inheritance: IMethodCompiler, IDisposable
Mostra file Open project: tgiphil/MOSA-Project Class Usage Examples

Public Properties

Property Type Description
ConstantZero Operand
StackFrame Operand

Public Methods

Method Description
AddStackLocal ( MosaType type ) : Operand

Adds the stack local.

AddStackLocal ( MosaType type, bool pinned ) : Operand

Adds the stack local.

AllocateVirtualRegisterOrStackSlot ( MosaType type ) : Operand

Allocates the virtual register or stack slot.

Compile ( ) : void

Compiles the method referenced by this method compiler.

CreateVirtualRegister ( MosaType type ) : Operand

Creates a new virtual register operand.

FormatStageName ( IPipelineStage stage ) : string
GetStage ( Type stageType ) : IPipelineStage

Gets the stage.

SetLocalVariables ( IList locals ) : void

Allocates the local variable virtual registers.

SetProtectedRegions ( IList protectedRegions ) : void

Sets the protected regions.

Stop ( ) : void

Stops the method compiler.

StoreOnStack ( MosaType type ) : bool
ToString ( ) : string

Returns a System.String that represents this instance.

Protected Methods

Method Description
BaseMethodCompiler ( BaseCompiler compiler, MosaMethod method, BasicBlocks basicBlocks, int threadID ) : System

Initializes a new instance of the BaseMethodCompiler class.

BeginCompile ( ) : void

Called before the method compiler begins compiling the method.

EndCompile ( ) : void

Called after the method compiler has finished compiling the method.

EvaluateParameterOperands ( ) : void

Evaluates the parameter operands.

InitializeType ( ) : void

Initializes the type.

Private Methods

Method Description
LayoutParameters ( int offsetOfFirst ) : int
LayoutParameters ( ) : void
SetStackParameter ( int index, MosaType type, string name ) : Operand

Method Details

AddStackLocal() public method

Adds the stack local.
public AddStackLocal ( MosaType type ) : Operand
type MosaType The type.
return Operand

AddStackLocal() public method

Adds the stack local.
public AddStackLocal ( MosaType type, bool pinned ) : Operand
type MosaType The type.
pinned bool
return Operand

AllocateVirtualRegisterOrStackSlot() public method

Allocates the virtual register or stack slot.
public AllocateVirtualRegisterOrStackSlot ( MosaType type ) : Operand
type MosaType The type.
return Operand

BaseMethodCompiler() protected method

Initializes a new instance of the BaseMethodCompiler class.
protected BaseMethodCompiler ( BaseCompiler compiler, MosaMethod method, BasicBlocks basicBlocks, int threadID ) : System
compiler BaseCompiler The assembly compiler.
method MosaMethod The method to compile by this instance.
basicBlocks BasicBlocks The basic blocks.
threadID int The thread identifier.
return System

BeginCompile() protected method

Called before the method compiler begins compiling the method.
protected BeginCompile ( ) : void
return void

Compile() public method

Compiles the method referenced by this method compiler.
public Compile ( ) : void
return void

CreateVirtualRegister() public method

Creates a new virtual register operand.
public CreateVirtualRegister ( MosaType type ) : Operand
type MosaType The signature type of the virtual register.
return Operand

EndCompile() protected method

Called after the method compiler has finished compiling the method.
protected EndCompile ( ) : void
return void

EvaluateParameterOperands() protected method

Evaluates the parameter operands.
protected EvaluateParameterOperands ( ) : void
return void

FormatStageName() public method

public FormatStageName ( IPipelineStage stage ) : string
stage IPipelineStage
return string

GetStage() public method

Gets the stage.
public GetStage ( Type stageType ) : IPipelineStage
stageType System.Type Type of the stage.
return IPipelineStage

InitializeType() protected method

Initializes the type.
protected InitializeType ( ) : void
return void

SetLocalVariables() public method

Allocates the local variable virtual registers.
public SetLocalVariables ( IList locals ) : void
locals IList The locals.
return void

SetProtectedRegions() public method

Sets the protected regions.
public SetProtectedRegions ( IList protectedRegions ) : void
protectedRegions IList The protected regions.
return void

Stop() public method

Stops the method compiler.
public Stop ( ) : void
return void

StoreOnStack() public method

public StoreOnStack ( MosaType type ) : bool
type MosaType
return bool

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : string
return string

Property Details

ConstantZero public_oe property

The constant zero
public Operand ConstantZero
return Operand

StackFrame public_oe property

The stack frame
public Operand StackFrame
return Operand