C# Class Rhino.Optimizer.Codegen

This class generates code for a given IR tree.
This class generates code for a given IR tree.
Inheritance: Evaluator
Mostra file Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
CaptureStackInfo ( RhinoException ex ) : void
Compile ( CompilerEnvirons compilerEnv, ScriptNode tree, string encodedSource, bool returnFunction ) : object
CompileToClassFile ( CompilerEnvirons compilerEnv, string mainClassName, ScriptNode scriptOrFn, string encodedSource, bool returnFunction ) : byte[]
CreateFunctionObject ( Context cx, Scriptable scope, object bytecode, object staticSecurityDomain ) : System.Function
CreateScriptObject ( object bytecode, object staticSecurityDomain ) : System.Script
GetPatchedStack ( RhinoException ex, string nativeStackTrace ) : string
GetScriptStack ( RhinoException ex ) : IList
GetSourcePositionFromStack ( Context cx, int linep ) : string
SetEvalScriptFlag ( System.Script script ) : void
SetMainMethodClass ( string className ) : void

Private Methods

Method Description
AddDoubleWrap ( ClassFileWriter cfw ) : void
BadTree ( ) : Exception
CleanName ( ScriptNode n ) : string

Gets a Java-compatible "informative" name for the the ScriptOrFnNode

CollectScriptNodes_r ( ScriptNode n, ObjArray x ) : void
DefineClass ( object bytecode, object staticSecurityDomain ) : Type
EmitConstantDudeInitializers ( ClassFileWriter cfw ) : void
EmitDirectConstructor ( ClassFileWriter cfw, OptFunctionNode ofn ) : void
EmitRegExpInit ( ClassFileWriter cfw ) : void
GenerateCallMethod ( ClassFileWriter cfw ) : void
GenerateCode ( string encodedSource ) : byte[]
GenerateExecute ( ClassFileWriter cfw ) : void
GenerateFunctionConstructor ( ClassFileWriter cfw ) : void
GenerateFunctionInit ( ClassFileWriter cfw, OptFunctionNode ofn ) : void
GenerateMain ( ClassFileWriter cfw ) : void
GenerateNativeFunctionOverrides ( ClassFileWriter cfw, string encodedSource ) : void
GenerateResumeGenerator ( ClassFileWriter cfw ) : void
GenerateScriptCtor ( ClassFileWriter cfw ) : void
GetBodyMethodName ( ScriptNode n ) : string
GetBodyMethodSignature ( ScriptNode n ) : string
GetCompiledRegexpName ( ScriptNode n, int regexpIndex ) : string
GetDirectCtorName ( ScriptNode n ) : string
GetFunctionInitMethodName ( OptFunctionNode ofn ) : string
GetIndex ( ScriptNode n ) : int
GetStaticConstantWrapperType ( double num ) : string
InitOptFunctions_r ( ScriptNode scriptOrFn ) : void
InitScriptNodesData ( ScriptNode scriptOrFn ) : void
IsGenerator ( ScriptNode node ) : bool
PushNumberAsObject ( ClassFileWriter cfw, double num ) : void
PushUndefined ( ClassFileWriter cfw ) : void
ReportClassFileFormatException ( ScriptNode scriptOrFn, string message ) : Exception
Transform ( ScriptNode tree ) : void

Method Details

CaptureStackInfo() public method

public CaptureStackInfo ( RhinoException ex ) : void
ex Rhino.RhinoException
return void

Compile() public method

public Compile ( CompilerEnvirons compilerEnv, ScriptNode tree, string encodedSource, bool returnFunction ) : object
compilerEnv Rhino.CompilerEnvirons
tree Rhino.Ast.ScriptNode
encodedSource string
returnFunction bool
return object

CompileToClassFile() public method

public CompileToClassFile ( CompilerEnvirons compilerEnv, string mainClassName, ScriptNode scriptOrFn, string encodedSource, bool returnFunction ) : byte[]
compilerEnv Rhino.CompilerEnvirons
mainClassName string
scriptOrFn Rhino.Ast.ScriptNode
encodedSource string
returnFunction bool
return byte[]

CreateFunctionObject() public method

public CreateFunctionObject ( Context cx, Scriptable scope, object bytecode, object staticSecurityDomain ) : System.Function
cx Rhino.Context
scope Scriptable
bytecode object
staticSecurityDomain object
return System.Function

CreateScriptObject() public method

public CreateScriptObject ( object bytecode, object staticSecurityDomain ) : System.Script
bytecode object
staticSecurityDomain object
return System.Script

GetPatchedStack() public method

public GetPatchedStack ( RhinoException ex, string nativeStackTrace ) : string
ex Rhino.RhinoException
nativeStackTrace string
return string

GetScriptStack() public method

public GetScriptStack ( RhinoException ex ) : IList
ex Rhino.RhinoException
return IList

GetSourcePositionFromStack() public method

public GetSourcePositionFromStack ( Context cx, int linep ) : string
cx Rhino.Context
linep int
return string

SetEvalScriptFlag() public method

public SetEvalScriptFlag ( System.Script script ) : void
script System.Script
return void

SetMainMethodClass() public method

public SetMainMethodClass ( string className ) : void
className string
return void