|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mozilla.javascript.optimizer.Codegen
public class Codegen
This class generates code for a given IR tree.
| Constructor Summary | |
|---|---|
Codegen()
|
|
| Method Summary | |
|---|---|
void |
captureStackInfo(RhinoException ex)
Capture stack information from the given exception. |
java.lang.Object |
compile(CompilerEnvirons compilerEnv,
ScriptNode tree,
java.lang.String encodedSource,
boolean returnFunction)
Compile the script or function from intermediate representation tree into an executable form. |
Function |
createFunctionObject(Context cx,
Scriptable scope,
java.lang.Object bytecode,
java.lang.Object staticSecurityDomain)
Create a function object. |
Script |
createScriptObject(java.lang.Object bytecode,
java.lang.Object staticSecurityDomain)
Create a script object. |
java.lang.String |
getPatchedStack(RhinoException ex,
java.lang.String nativeStackTrace)
Given a native stack trace, patch it with script-specific source and line information |
java.util.List<java.lang.String> |
getScriptStack(RhinoException ex)
Get the script stack for the given exception |
java.lang.String |
getSourcePositionFromStack(Context cx,
int[] linep)
Get the source position information by examining the stack. |
void |
setEvalScriptFlag(Script script)
Mark the given script to indicate it was created by a call to eval() or to a Function constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Codegen()
| Method Detail |
|---|
public void captureStackInfo(RhinoException ex)
Evaluator
captureStackInfo in interface Evaluatorex - an exception thrown during execution
public java.lang.String getSourcePositionFromStack(Context cx,
int[] linep)
Evaluator
getSourcePositionFromStack in interface Evaluatorcx - Contextlinep - Array object of length >= 1; getSourcePositionFromStack
will assign the line number to linep[0].
public java.lang.String getPatchedStack(RhinoException ex,
java.lang.String nativeStackTrace)
Evaluator
getPatchedStack in interface Evaluatorex - exceptionnativeStackTrace - the native stack trace
public java.util.List<java.lang.String> getScriptStack(RhinoException ex)
Evaluator
getScriptStack in interface Evaluatorex - exception from execution
public void setEvalScriptFlag(Script script)
Evaluator
setEvalScriptFlag in interface Evaluatorscript - script to mark as from eval
public java.lang.Object compile(CompilerEnvirons compilerEnv,
ScriptNode tree,
java.lang.String encodedSource,
boolean returnFunction)
Evaluator
compile in interface EvaluatorcompilerEnv - Compiler environmenttree - parse treeencodedSource - encoding of the source code for decompilationreturnFunction - if true, compiling a function
public Script createScriptObject(java.lang.Object bytecode,
java.lang.Object staticSecurityDomain)
Evaluator
createScriptObject in interface Evaluatorbytecode - opaque object returned by compilestaticSecurityDomain - security domain
public Function createFunctionObject(Context cx,
Scriptable scope,
java.lang.Object bytecode,
java.lang.Object staticSecurityDomain)
Evaluator
createFunctionObject in interface Evaluatorcx - Current contextscope - scope of the functionbytecode - opaque object returned by compilestaticSecurityDomain - security domain
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||