Module org.htmlunit.corejs
Class CompilerData<T extends ScriptOrFn<T>>
java.lang.Object
org.htmlunit.corejs.javascript.JSCode<T>
org.htmlunit.corejs.javascript.ACompilerData<T,CompilerData<?>>
org.htmlunit.corejs.javascript.interpreterv2.CompilerData<T>
- All Implemented Interfaces:
Serializable,JSCodeExec<T>,JSCodeResume<T>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCompilerData.Builder<T extends ScriptOrFn<T>>Mutable working state for building an immutableCompilerData.Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.JSCode
JSCode.NullBuilder<V extends ScriptOrFn<V>>Nested classes/interfaces inherited from interface org.htmlunit.corejs.javascript.JSCodeResume
JSCodeResume.NullResume<T extends ScriptOrFn<T>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intfinal Instruction[]Fields inherited from class org.htmlunit.corejs.javascript.ACompilerData
exceptionTable, maxFrameSize, maxLocals, maxStack, maxVarsFields inherited from class org.htmlunit.corejs.javascript.JSCode
NOT_CALLABLEFields inherited from interface org.htmlunit.corejs.javascript.JSCodeResume
NULL_RESUMABLE -
Method Summary
Modifier and TypeMethodDescriptionvoiddumpInstructions(PrintStream out, JSDescriptor.Builder<?> desc) execute(Context cx, T executableObject, Object newTarget, VarScope scope, Object thisObj, Object[] args) Executes the code represented by this object.intintintgetLineNumberFromPc(int pc, int pcLineStart) int[]getLineSetFromPc(int pc) Get the set of line numbers associated with a given PC.intResuem execution of the code represented by this object.toString()
-
Field Details
-
EXCEPTION_TRY_START_SLOT
public static final int EXCEPTION_TRY_START_SLOT- See Also:
-
EXCEPTION_TRY_END_SLOT
public static final int EXCEPTION_TRY_END_SLOT- See Also:
-
EXCEPTION_HANDLER_SLOT
public static final int EXCEPTION_HANDLER_SLOT- See Also:
-
EXCEPTION_TYPE_SLOT
public static final int EXCEPTION_TYPE_SLOT- See Also:
-
EXCEPTION_LOCAL_SLOT
public static final int EXCEPTION_LOCAL_SLOT- See Also:
-
EXCEPTION_SCOPE_SLOT
public static final int EXCEPTION_SCOPE_SLOT- See Also:
-
EXCEPTION_SLOT_SIZE
public static final int EXCEPTION_SLOT_SIZE- See Also:
-
instructions
-
-
Method Details
-
getInstructions
-
getLineNumbers
public int[] getLineNumbers() -
getInstructionCount
public int getInstructionCount() -
dumpInstructions
-
getFirstLineNumber
public int getFirstLineNumber() -
getPcFirstLineNumber
public int getPcFirstLineNumber() -
getLineSetFromPc
Get the set of line numbers associated with a given PC.- Parameters:
pc- The program counter- Returns:
- List of line numbers, or null if PC has no associated lines
-
getLineNumberFromPc
public int getLineNumberFromPc(int pc, int pcLineStart) - Specified by:
getLineNumberFromPcin classACompilerData<T extends ScriptOrFn<T>,CompilerData<?>>
-
getLineNumberTableForDebug
-
execute
public Object execute(Context cx, T executableObject, Object newTarget, VarScope scope, Object thisObj, Object[] args) Description copied from interface:JSCodeExecExecutes the code represented by this object.- Parameters:
cx- should be context in which the call is being madeexecutableObject- should be function or script which owns this code.newTarget- should be null in the case of script or function calls, and the `new.target` of constructors.scope- should be the scope in which the script, function, or constructor should execute. This should normally be derived from the scope which the function or constructor was declared, or for scripts should be the scope in which they are being executed.thisObj- should be the value of `this` that the code will see while executing.args- is the array of arguments passed to the code.- Returns:
- the result of executing the code.
-
resume
public Object resume(Context cx, T executableObject, Object state, VarScope scope, int operation, Object value) Description copied from interface:JSCodeResumeResuem execution of the code represented by this object.- Parameters:
cx- should be context in which the call is being madeexecutableObject- should be function or script which owns this code.state- should be the state object created at some previous point when execution was yielded.scope- should be the scope in which the code will be executed.operation- should be one of the constants defined onNativeGeneratorand represents the operation being performed.value- represents the value being passed into the generator (see https://tc39.es/ecma262/#sec-generatorresume for details).- Returns:
- the result of executing the code.
-
toString
-