Class ASMOperation

java.lang.Object
org.eclipse.m2m.atl.engine.emfvm.lib.Operation
org.eclipse.m2m.atl.engine.emfvm.ASMOperation

public class ASMOperation extends Operation
ASM commands scheduler.
  • Field Details

    • MAX_STACK

      public static final int MAX_STACK
      The max size of the Stack.
      See Also:
  • Constructor Details

    • ASMOperation

      public ASMOperation(ASM asm, String name)
      ASMOperation constructor.
      Parameters:
      asm - the parent asm
      name - operation name
  • Method Details

    • getMaxLocals

      public int getMaxLocals()
      Overrides:
      getMaxLocals in class Operation
      See Also:
    • getParameters

      public List<String> getParameters()
    • setContext

      public void setContext(String context)
    • getContext

      public String getContext()
    • addParameter

      public void addParameter(String parameterName, String type)
      Adds a parameter.
      Parameters:
      parameterName - the parameter name
      type - the parameter type
    • addLineNumberEntry

      public void addLineNumberEntry(String id, int begin, int end)
      Adds a line number entry.
      Parameters:
      id - the parameter id
      begin - the begin index
      end - the end index
    • getLineNumberTable

      public List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LineNumberEntry> getLineNumberTable()
    • resolveLineNumber

      public String resolveLineNumber(int l)
      Returns the line at the specified number.
      Overrides:
      resolveLineNumber in class Operation
      Parameters:
      l - the line number
      Returns:
      the line at the specified number
      See Also:
    • addLocalVariableEntry

      public void addLocalVariableEntry(int slot, String variableName, int begin, int end)
      Adds a local variable entry with the given parameters.
      Parameters:
      slot - the slot number
      variableName - the variable name
      begin - the begin index
      end - the end index
    • getLocalVariableTable

      public List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LocalVariableEntry> getLocalVariableTable()
    • resolveVariableName

      public String resolveVariableName(int slot, int l)
      Resolves a variable name by its slot number and its index.
      Overrides:
      resolveVariableName in class Operation
      Parameters:
      slot - the slot number
      l - the variable index
      Returns:
      the variable name
      See Also:
    • setBytecodes

      public void setBytecodes(Bytecode[] bytecodes)
      Sets the bytecodes for the operation.
      Parameters:
      bytecodes - the bytecodes to set
    • getBytecodes

      public Bytecode[] getBytecodes()
      Returns the bytecodes.
      Returns:
      The bytecodes, if any
    • getName

      public String getName()
      Overrides:
      getName in class Operation
      See Also:
    • exec

      public Object exec(AbstractStackFrame frame, org.eclipse.core.runtime.IProgressMonitor monitor)
      Executes an operation.
      Parameters:
      frame - the frame for execution
      monitor - the progress monitor
      Returns:
      the result
    • exec

      public Object exec(AbstractStackFrame frame)
      Executes an operation.
      Specified by:
      exec in class Operation
      Parameters:
      frame - the frame for execution
      Returns:
      the result
      See Also:
    • getASM

      public ASM getASM()
    • findMethod

      protected static Method findMethod(Class<?> caller, String name, Class<?>[] argumentTypes)
      Looks for a method into cache and metamodel.
      Parameters:
      caller - The class of the method
      name - The method name
      argumentTypes - The types of all arguments
      Returns:
      the method if found, null otherwise
    • getInstructions

      public List<?> getInstructions()
      Overrides:
      getInstructions in class Operation
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: