java.lang.Object
org.htmlunit.corejs.javascript.AInterpreter<CallFrameV2,CompilerData<?>>
org.htmlunit.corejs.javascript.InterpreterV2
- All Implemented Interfaces:
Evaluator
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.AInterpreter
AInterpreter.ContinuationJump<T extends ACallFrame<T,U>, U extends ACompilerData<?, U>>, AInterpreter.DebugScope -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddInstructionCount(Context cx, CallFrameV2 frame, int extra) compileFunction(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Compile a function from intermediate representation tree into an executable form.compileScript(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Compile a script from intermediate representation tree into an executable form.createFunctionObject(Context cx, VarScope scope, CompilationResult<JSFunction> compiled, Object staticSecurityDomain) Create a function object.createScriptObject(CompilationResult<JSScript> compiled, Object staticSecurityDomain) Create a script object.static booleandoEquals(Context cx, CallFrameV2 frame, Operand left, Operand right) static booleandoShallowEquals(Context cx, CallFrameV2 frame, Operand left, Operand right) static voidinitFunction(Context cx, VarScope scope, JSDescriptor<?> parent, int index) static voidinitFunction(Context cx, VarScope scope, JSDescriptor<?> parent, int index, boolean hoist) static Objectinterpret(Context cx, CallFrameV2 frame, Object throwable) static <T extends ScriptOrFn<T>>
Objectinterpret(T fun, CompilerData<T> data, Context cx, VarScope scope, Object thisObj, Object newTarget, Object[] args) static ObjectresumeGenerator(Context cx, VarScope scope, int operation, Object savedState, Object value) static booleanshouldOverrideNativeCall(Object securityDomain, Callable fun, Scriptable funThisObj) Methods inherited from class org.htmlunit.corejs.javascript.AInterpreter
captureStackInfo, enterFrame, getPatchedStack, getScriptStack, getScriptStackElements, getSourcePositionFromStack
-
Field Details
-
INVOCATION_COST
public static final int INVOCATION_COST- See Also:
-
-
Constructor Details
-
InterpreterV2
public InterpreterV2()
-
-
Method Details
-
interpret
-
shouldOverrideNativeCall
public static boolean shouldOverrideNativeCall(Object securityDomain, Callable fun, Scriptable funThisObj) -
initFunction
-
initFunction
public static void initFunction(Context cx, VarScope scope, JSDescriptor<?> parent, int index, boolean hoist) -
interpret
public static <T extends ScriptOrFn<T>> Object interpret(T fun, CompilerData<T> data, Context cx, VarScope scope, Object thisObj, Object newTarget, Object[] args) -
resumeGenerator
-
doShallowEquals
-
doEquals
-
compileScript
public CompilationResult<JSScript> compileScript(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Description copied from interface:EvaluatorCompile a script from intermediate representation tree into an executable form.- Parameters:
compilerEnv- Compiler environmenttree- parse treerawSource- the source code- Returns:
- a result that can be passed to
Evaluator.createScriptObject(org.htmlunit.corejs.javascript.CompilationResult<org.htmlunit.corejs.javascript.JSScript>, java.lang.Object)
-
compileFunction
public CompilationResult<JSFunction> compileFunction(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Description copied from interface:EvaluatorCompile a function from intermediate representation tree into an executable form.- Parameters:
compilerEnv- Compiler environmenttree- parse treerawSource- the source code- Returns:
- a result that can be passed to
Evaluator.createFunctionObject(org.htmlunit.corejs.javascript.Context, org.htmlunit.corejs.javascript.VarScope, org.htmlunit.corejs.javascript.CompilationResult<org.htmlunit.corejs.javascript.JSFunction>, java.lang.Object)
-
createScriptObject
Description copied from interface:EvaluatorCreate a script object.- Parameters:
compiled- the result returned byEvaluator.compileScript(org.htmlunit.corejs.javascript.CompilerEnvirons, org.htmlunit.corejs.javascript.ast.ScriptNode, java.lang.String)staticSecurityDomain- security domain- Returns:
- Script object that can be evaluated
-
createFunctionObject
public Function createFunctionObject(Context cx, VarScope scope, CompilationResult<JSFunction> compiled, Object staticSecurityDomain) Description copied from interface:EvaluatorCreate a function object.- Parameters:
cx- Current contextscope- scope of the functioncompiled- the result returned byEvaluator.compileFunction(org.htmlunit.corejs.javascript.CompilerEnvirons, org.htmlunit.corejs.javascript.ast.ScriptNode, java.lang.String)staticSecurityDomain- security domain- Returns:
- Function object that can be called
-
addInstructionCount
-