C# Class Jurassic.Compiler.OptimizationInfo

Represents information about one or more code generation optimizations.
ファイルを表示 Open project: paulbartrum/jurassic Class Usage Examples

Public Methods

Method Description
EmitLongJump ( ILGenerator generator, ILLabel targetLabel ) : void

Emits code to branch between statements, even if code generation is within a finally block (where unconditional branches are not allowed).

GetBreakTarget ( string labelName = null ) : ILLabel

Returns the break target for the statement with the given label, if one is provided, or the top-most break target otherwise.

GetContinueTarget ( string labelName = null ) : ILLabel

Returns the continue target for the statement with the given label, if one is provided, or the top-most continue target otherwise.

GetRegExpVariable ( ILGenerator generator, Jurassic.Compiler.RegularExpressionLiteral literal ) : ILLocalVariable

Retrieves a variable that can be used to store a shared instance of a regular expression.

MarkSequencePoint ( ILGenerator generator, Jurassic.Compiler.SourceCodeSpan span ) : void

Emits a sequence point, and sets the SourceSpan property.

OptimizationInfo ( ScriptEngine engine ) : System

Creates a new OptimizationInfo instance.

PopBreakOrContinueInfo ( ) : void

Removes the top-most break or continue information from the stack.

PushBreakOrContinueInfo ( IList labelNames, ILLabel breakTarget, ILLabel continueTarget, bool labelledOnly ) : void

Pushes information about break or continue targets to a stack.

Private Methods

Method Description
GetBreakOrContinueLabelDepth ( ILLabel label ) : int

Searches for the given label in the break/continue stack.

Method Details

EmitLongJump() public method

Emits code to branch between statements, even if code generation is within a finally block (where unconditional branches are not allowed).
public EmitLongJump ( ILGenerator generator, ILLabel targetLabel ) : void
generator ILGenerator The generator to output the CIL to.
targetLabel ILLabel The label to jump to.
return void

GetBreakTarget() public method

Returns the break target for the statement with the given label, if one is provided, or the top-most break target otherwise.
public GetBreakTarget ( string labelName = null ) : ILLabel
labelName string The label associated with the break target. Can be /// null.
return ILLabel

GetContinueTarget() public method

Returns the continue target for the statement with the given label, if one is provided, or the top-most continue target otherwise.
public GetContinueTarget ( string labelName = null ) : ILLabel
labelName string The label associated with the continue target. Can be /// null.
return ILLabel

GetRegExpVariable() public method

Retrieves a variable that can be used to store a shared instance of a regular expression.
public GetRegExpVariable ( ILGenerator generator, Jurassic.Compiler.RegularExpressionLiteral literal ) : ILLocalVariable
generator ILGenerator The IL generator used to create the variable.
literal Jurassic.Compiler.RegularExpressionLiteral The regular expression literal.
return ILLocalVariable

MarkSequencePoint() public method

Emits a sequence point, and sets the SourceSpan property.
public MarkSequencePoint ( ILGenerator generator, Jurassic.Compiler.SourceCodeSpan span ) : void
generator ILGenerator The IL generator used to emit the sequence point.
span Jurassic.Compiler.SourceCodeSpan The source code span.
return void

OptimizationInfo() public method

Creates a new OptimizationInfo instance.
public OptimizationInfo ( ScriptEngine engine ) : System
engine ScriptEngine The associated script engine.
return System

PopBreakOrContinueInfo() public method

Removes the top-most break or continue information from the stack.
public PopBreakOrContinueInfo ( ) : void
return void

PushBreakOrContinueInfo() public method

Pushes information about break or continue targets to a stack.
public PushBreakOrContinueInfo ( IList labelNames, ILLabel breakTarget, ILLabel continueTarget, bool labelledOnly ) : void
labelNames IList The label names associated with the break or continue target. /// Can be null.
breakTarget ILLabel The IL label to jump to if a break statement is encountered.
continueTarget ILLabel The IL label to jump to if a continue statement is /// encountered. Can be null.
labelledOnly bool true if break or continue statements without a label /// should ignore this entry; false otherwise.
return void