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>

public class CompilerData<T extends ScriptOrFn<T>> extends ACompilerData<T,CompilerData<?>>
See Also:
  • Field Details

  • Method Details

    • getInstructions

      public Instruction[] getInstructions()
    • getLineNumbers

      public int[] getLineNumbers()
    • getInstructionCount

      public int getInstructionCount()
    • dumpInstructions

      public void dumpInstructions(PrintStream out, JSDescriptor.Builder<?> desc)
    • getFirstLineNumber

      public int getFirstLineNumber()
    • getPcFirstLineNumber

      public int getPcFirstLineNumber()
    • getLineSetFromPc

      public List<Integer> getLineSetFromPc(int pc)
      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:
      getLineNumberFromPc in class ACompilerData<T extends ScriptOrFn<T>,CompilerData<?>>
    • getLineNumberTableForDebug

      public String getLineNumberTableForDebug()
    • execute

      public Object execute(Context cx, T executableObject, Object newTarget, VarScope scope, Object thisObj, Object[] args)
      Description copied from interface: JSCodeExec
      Executes the code represented by this object.
      Parameters:
      cx - should be context in which the call is being made
      executableObject - 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: JSCodeResume
      Resuem execution of the code represented by this object.
      Parameters:
      cx - should be context in which the call is being made
      executableObject - 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 on NativeGenerator and 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

      public String toString()
      Overrides:
      toString in class Object