C# Class Rhino.Optimizer.BodyCodegen

Exibir arquivo Open project: hazzik/Rhino.Net Class Usage Examples

Public Properties

Property Type Description
scriptOrFnIndex int

Public Methods

Method Description
BodyCodegen ( ) : System

Private Methods

Method Description
AddDoubleWrap ( ) : void
AddGoto ( Node target, int jumpcode ) : void
AddGotoWithReturn ( Node target ) : void
AddInstructionCount ( ) : void

Generate calls to ScriptRuntime.addInstructionCount to keep track of executed instructions and call observeInstructionCount() if a threshold is exceeded.
Calculates the count from getCurrentCodeOffset - savedCodeOffset

AddInstructionCount ( int count ) : void

Generate calls to ScriptRuntime.addInstructionCount to keep track of executed instructions and call observeInstructionCount() if a threshold is exceeded.
Takes the count as a parameter - used to add monitoring to loops and other blocks that don't have any ops - this allows for monitoring/killing of while(true) loops and such.

Generate calls to ScriptRuntime.addInstructionCount to keep track of executed instructions and call observeInstructionCount() if a threshold is exceeded.
Takes the count as a parameter - used to add monitoring to loops and other blocks that don't have any ops - this allows for monitoring/killing of while(true) loops and such.

AddJumpedBooleanWrap ( int trueLabel, int falseLabel ) : void
AddNewObjectArray ( int size ) : void
AddObjectToDouble ( ) : void
AddOptRuntimeInvoke ( string methodName, string methodSignature ) : void
AddScriptRuntimeInvoke ( string methodName, string methodSignature ) : void
DcpLoadAsNumber ( int dcp_register ) : void
DcpLoadAsObject ( int dcp_register ) : void
DecReferenceWordLocal ( short local ) : void
ExceptionTypeToName ( int exceptionType ) : string
GenSimpleCompare ( int type, int trueGOTO, int falseGOTO ) : void
GenerateActivationExit ( ) : void
GenerateArrayLiteralFactory ( Node node, int count ) : void
GenerateBodyCode ( ) : void
GenerateCallArgArray ( Node node, Node argChild, bool directCall ) : void
GenerateCatchBlock ( int exceptionType, short savedVariableObject, int catchLabel, int exceptionLocal, int handler ) : void
GenerateCheckForThrowOrClose ( int label, bool hasLocals, int nextState ) : void
GenerateEpilogue ( ) : void
GenerateExpression ( Node node, Node parent ) : void
GenerateFunctionAndThisObj ( Node node, Node parent ) : void
GenerateGenerator ( ) : void
GenerateGetGeneratorLocalsState ( ) : void
GenerateGetGeneratorResumptionPoint ( ) : void
GenerateGetGeneratorStackState ( ) : void
GenerateIfJump ( Node node, Node parent, int trueLabel, int falseLabel ) : void
GenerateIntegerUnwrap ( ) : void
GenerateIntegerWrap ( ) : void
GenerateNestedFunctionInits ( ) : void
GenerateObjectLiteralFactory ( Node node, int count ) : void
GeneratePrologue ( ) : void

Generate the prologue for a function or script.

Generate the prologue for a function or script.

GenerateSaveLocals ( Node node ) : bool
GenerateSetGeneratorResumptionPoint ( int nextState ) : void
GenerateStatement ( Node node ) : void
GenerateThrowJavaScriptException ( ) : void
GenerateYieldPoint ( Node node, bool exprContext ) : void
GetConsecutiveSlots ( int count, bool isConst ) : short
GetFinallyAtTarget ( Node node ) : Node

Get a FINALLY node at a point in the IR.

Get a FINALLY node at a point in the IR. This is strongly dependent on the generated IR. If the node is a TARGET, it only check the next node to see if it is a FINALLY node.

GetLocalBlockRegister ( Node node ) : int
GetNewWordLocal ( ) : short
GetNewWordLocal ( bool isConst ) : short
GetNewWordPairLocal ( bool isConst ) : short

Const locals use an extra slot to hold the has-been-assigned-once flag at runtime.

Const locals use an extra slot to hold the has-been-assigned-once flag at runtime.

GetNextGeneratorState ( Node node ) : int
GetTargetLabel ( Node target ) : int
IncReferenceWordLocal ( short local ) : void
InitBodyGeneration ( ) : void
InlineFinally ( Node finallyTarget ) : void
InlineFinally ( Node finallyTarget, int finallyStart, int finallyEnd ) : void

Inline a FINALLY node into the method bytecode.

Inline a FINALLY node into the method bytecode. This method takes a label that points to the real start of the finally block as implemented in the bytecode. This is because in some cases, the finally block really starts before any of the code in the Node. For example, the catch-all-rethrow finally block has a few instructions prior to the finally block made by the user. In addition, an end label that should be unmarked is given as a method parameter. It is the responsibility of any callers of this method to mark the label. The start and end labels of the finally block are used to exclude the inlined block from the proper exception handler. For example, an inlined finally block should not be handled by a catch-all-rethrow.

IsArithmeticNode ( Node node ) : bool
NodeIsDirectCallParameter ( Node node ) : int
ReleaseWordLocal ( short local ) : void
SaveCurrentCodeOffset ( ) : void

Save the current code offset.

Save the current code offset. This saved code offset is used to compute instruction counts in subsequent calls to AddInstructionCount() .

UpdateLineNumber ( Node node ) : void
VarIsDirectCallParameter ( int varIndex ) : bool
VisitArithmetic ( Node node, int opCode, Node child, Node parent ) : void
VisitArrayLiteral ( Node node, Node child, bool topLevel ) : void
VisitBitOp ( Node node, int type, Node child ) : void
VisitDotQuery ( Node node, Node child ) : void
VisitFunction ( OptFunctionNode ofn, int functionType ) : void
VisitGetProp ( Node node, Node child ) : void
VisitGetVar ( Node node ) : void
VisitGoto ( Jump node, int type, Node child ) : void
VisitIfJumpEqOp ( Node node, Node child, int trueGOTO, int falseGOTO ) : void
VisitIfJumpRelOp ( Node node, Node child, int trueGOTO, int falseGOTO ) : void
VisitIncDec ( Node node ) : void
VisitObjectLiteral ( Node node, Node child, bool topLevel ) : void
VisitOptimizedCall ( Node node, OptFunctionNode target, int type, Node child ) : void
VisitSetConst ( Node node, Node child ) : void
VisitSetConstVar ( Node node, Node child, bool needValue ) : void
VisitSetElem ( int type, Node node, Node child ) : void
VisitSetName ( Node node, Node child ) : void
VisitSetProp ( int type, Node node, Node child ) : void
VisitSetVar ( Node node, Node child, bool needValue ) : void
VisitSpecialCall ( Node node, int type, int specialType, Node child ) : void
VisitStandardCall ( Node node, Node child ) : void
VisitStandardNew ( Node node, Node child ) : void
VisitStrictSetName ( Node node, Node child ) : void
VisitSwitch ( Jump switchNode, Node child ) : void
VisitTryCatchFinally ( Jump node, Node child ) : void
VisitTypeofname ( Node node ) : void

Method Details

BodyCodegen() public method

public BodyCodegen ( ) : System
return System

Property Details

scriptOrFnIndex public_oe property

public int scriptOrFnIndex
return int