C# Class Mosa.Compiler.Framework.BaseMethodCompilerStage

Basic base class for method compiler pipeline stages
Inheritance: IMethodCompilerStage
Mostrar archivo Open project: tgiphil/MOSA-Project Class Usage Examples

Protected Properties

Property Type Description
instructionCount int

Public Methods

Method Description
AddMissingBlocks ( IList blocks, bool cleanUp ) : IList
AllocateVirtualRegisterOrStackSlot ( MosaType type ) : Operand

Allocates the virtual register or stack slot.

CreateTraceLog ( string section ) : TraceLog
GetFormattedStageName ( ) : string
GetInstructionSize ( InstructionSize size, MosaType type ) : InstructionSize

Gets the size of the instruction.

GetInstructionSize ( MosaType type ) : InstructionSize

Gets the size of the instruction.

GetLoadInstruction ( MosaType type ) : BaseIRInstruction
GetMoveInstruction ( MosaType type ) : BaseIRInstruction
GetStoreInstruction ( MosaType type ) : BaseIRInstruction
IsTraceable ( ) : bool
StoreOnStack ( MosaType type ) : bool

Stores the on stack.

UpdateCounter ( string name, int count ) : void

Updates the counter.

Protected Methods

Method Description
AllocateVirtualRegister ( MosaType type ) : Operand

Allocates the virtual register.

CreateNewBlock ( ) : BasicBlock

Create an empty block.

CreateNewBlock ( int label ) : BasicBlock

Create an empty block.

CreateNewBlockContext ( ) : Context

Create an empty block.

CreateNewBlockContext ( int label ) : Context

Create an empty block.

CreateNewBlockContexts ( int blocks ) : Mosa.Compiler.Framework.Context[]

Creates empty blocks.

CreateNewBlocks ( int blocks ) : Mosa.Compiler.Framework.BasicBlock[]

Creates empty blocks.

CreateTraceLog ( ) : TraceLog
Dump ( bool before ) : void

Dumps this instance.

EmptyBlockOfAllInstructions ( BasicBlock block ) : void

Empties the block of all instructions.

FindFinallyExceptionContext ( InstructionNode node ) : MosaExceptionHandler
FindImmediateExceptionContext ( int label ) : MosaExceptionHandler
FindNextEnclosingFinallyContext ( MosaExceptionHandler exceptionContext ) : MosaExceptionHandler
Finish ( ) : void
IMethodCompilerStage ( ) : void
IMethodCompilerStage ( BaseMethodCompiler compiler ) : void

Setups the specified compiler.

IsEmptyBlockWithSingleJump ( BasicBlock block ) : bool

Determines whether [is empty block with single jump] [the specified block].

IsSourceAndTargetWithinSameTryOrException ( InstructionNode node ) : bool
NewCompilerTraceEvent ( CompilerEvent compileEvent, string message ) : void
RemoveEmptyBlockWithSingleJump ( BasicBlock block ) : void
ReplaceBranchTargets ( BasicBlock block, BasicBlock oldTarget, BasicBlock newTarget ) : void

Replaces the branch targets.

Run ( ) : void
Setup ( ) : void
Split ( InstructionNode node ) : BasicBlock

Splits the block.

Split ( Context ctx ) : Context

Splits the block.

UpdatePhiList ( BasicBlock removedBlock, BasicBlock nextBlocks ) : void

Private Methods

Method Description
ITraceFactory ( string section ) : TraceLog
MustSignExtendOnLoad ( MosaType source ) : bool

Determines if the load should sign extend the given source operand.

MustZeroExtendOnLoad ( MosaType source ) : bool

Determines if the load should sign extend the given source operand.

SubmitTraceLog ( TraceLog traceLog ) : void
SubmitTraceLogs ( IList traceLogs ) : void

Method Details

AddMissingBlocks() public method

public AddMissingBlocks ( IList blocks, bool cleanUp ) : IList
blocks IList
cleanUp bool
return IList

AllocateVirtualRegister() protected method

Allocates the virtual register.
protected AllocateVirtualRegister ( MosaType type ) : Operand
type MosaType The type.
return Operand

AllocateVirtualRegisterOrStackSlot() public method

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

CreateNewBlock() protected method

Create an empty block.
protected CreateNewBlock ( ) : BasicBlock
return BasicBlock

CreateNewBlock() protected method

Create an empty block.
protected CreateNewBlock ( int label ) : BasicBlock
label int The label.
return BasicBlock

CreateNewBlockContext() protected method

Create an empty block.
protected CreateNewBlockContext ( ) : Context
return Context

CreateNewBlockContext() protected method

Create an empty block.
protected CreateNewBlockContext ( int label ) : Context
label int The label.
return Context

CreateNewBlockContexts() protected method

Creates empty blocks.
protected CreateNewBlockContexts ( int blocks ) : Mosa.Compiler.Framework.Context[]
blocks int The Blocks.
return Mosa.Compiler.Framework.Context[]

CreateNewBlocks() protected method

Creates empty blocks.
protected CreateNewBlocks ( int blocks ) : Mosa.Compiler.Framework.BasicBlock[]
blocks int The Blocks.
return Mosa.Compiler.Framework.BasicBlock[]

CreateTraceLog() protected method

protected CreateTraceLog ( ) : TraceLog
return TraceLog

CreateTraceLog() public method

public CreateTraceLog ( string section ) : TraceLog
section string
return TraceLog

Dump() protected method

Dumps this instance.
protected Dump ( bool before ) : void
before bool
return void

EmptyBlockOfAllInstructions() protected method

Empties the block of all instructions.
protected EmptyBlockOfAllInstructions ( BasicBlock block ) : void
block BasicBlock The block.
return void

FindFinallyExceptionContext() protected method

protected FindFinallyExceptionContext ( InstructionNode node ) : MosaExceptionHandler
node InstructionNode
return Mosa.Compiler.MosaTypeSystem.MosaExceptionHandler

FindImmediateExceptionContext() protected method

protected FindImmediateExceptionContext ( int label ) : MosaExceptionHandler
label int
return Mosa.Compiler.MosaTypeSystem.MosaExceptionHandler

FindNextEnclosingFinallyContext() protected method

protected FindNextEnclosingFinallyContext ( MosaExceptionHandler exceptionContext ) : MosaExceptionHandler
exceptionContext Mosa.Compiler.MosaTypeSystem.MosaExceptionHandler
return Mosa.Compiler.MosaTypeSystem.MosaExceptionHandler

Finish() protected method

protected Finish ( ) : void
return void

GetFormattedStageName() public method

public GetFormattedStageName ( ) : string
return string

GetInstructionSize() public static method

Gets the size of the instruction.
public static GetInstructionSize ( InstructionSize size, MosaType type ) : InstructionSize
size InstructionSize The size.
type MosaType The type.
return InstructionSize

GetInstructionSize() public static method

Gets the size of the instruction.
public static GetInstructionSize ( MosaType type ) : InstructionSize
type MosaType The type.
return InstructionSize

GetLoadInstruction() public static method

public static GetLoadInstruction ( MosaType type ) : BaseIRInstruction
type MosaType
return Mosa.Compiler.Framework.IR.BaseIRInstruction

GetMoveInstruction() public static method

public static GetMoveInstruction ( MosaType type ) : BaseIRInstruction
type MosaType
return Mosa.Compiler.Framework.IR.BaseIRInstruction

GetStoreInstruction() public static method

public static GetStoreInstruction ( MosaType type ) : BaseIRInstruction
type MosaType
return Mosa.Compiler.Framework.IR.BaseIRInstruction

IMethodCompilerStage() protected method

protected IMethodCompilerStage ( ) : void
return void

IMethodCompilerStage() protected method

Setups the specified compiler.
protected IMethodCompilerStage ( BaseMethodCompiler compiler ) : void
compiler BaseMethodCompiler The compiler.
return void

IsEmptyBlockWithSingleJump() protected method

Determines whether [is empty block with single jump] [the specified block].
protected IsEmptyBlockWithSingleJump ( BasicBlock block ) : bool
block BasicBlock The block.
return bool

IsSourceAndTargetWithinSameTryOrException() protected method

protected IsSourceAndTargetWithinSameTryOrException ( InstructionNode node ) : bool
node InstructionNode
return bool

IsTraceable() public method

public IsTraceable ( ) : bool
return bool

NewCompilerTraceEvent() protected method

protected NewCompilerTraceEvent ( CompilerEvent compileEvent, string message ) : void
compileEvent CompilerEvent
message string
return void

RemoveEmptyBlockWithSingleJump() protected method

protected RemoveEmptyBlockWithSingleJump ( BasicBlock block ) : void
block BasicBlock
return void

ReplaceBranchTargets() protected method

Replaces the branch targets.
protected ReplaceBranchTargets ( BasicBlock block, BasicBlock oldTarget, BasicBlock newTarget ) : void
block BasicBlock The current from block.
oldTarget BasicBlock The current destination block.
newTarget BasicBlock The new target block.
return void

Run() protected method

protected Run ( ) : void
return void

Setup() protected method

protected Setup ( ) : void
return void

Split() protected method

Splits the block.
protected Split ( InstructionNode node ) : BasicBlock
node InstructionNode The node.
return BasicBlock

Split() protected method

Splits the block.
protected Split ( Context ctx ) : Context
ctx Context The context.
return Context

StoreOnStack() public method

Stores the on stack.
public StoreOnStack ( MosaType type ) : bool
type MosaType The type.
return bool

UpdateCounter() public method

Updates the counter.
public UpdateCounter ( string name, int count ) : void
name string The name.
count int The count.
return void

UpdatePhiList() protected static method

protected static UpdatePhiList ( BasicBlock removedBlock, BasicBlock nextBlocks ) : void
removedBlock BasicBlock
nextBlocks BasicBlock
return void

Property Details

instructionCount protected_oe property

protected int instructionCount
return int