Package org.eclipse.m2m.atl.engine.emfvm
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.
-
-
Constructor Summary
Constructors Constructor Description ASMOperation(ASM asm, java.lang.String name)ASMOperation constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLineNumberEntry(java.lang.String id, int begin, int end)Adds a line number entry.voidaddLocalVariableEntry(int slot, java.lang.String variableName, int begin, int end)Adds a local variable entry with the given parameters.voidaddParameter(java.lang.String parameterName, java.lang.String type)Adds a parameter.java.lang.Objectexec(AbstractStackFrame frame)Executes an operation.java.lang.Objectexec(AbstractStackFrame frame, org.eclipse.core.runtime.IProgressMonitor monitor)Executes an operation.protected static java.lang.reflect.MethodfindMethod(java.lang.Class<?> caller, java.lang.String name, java.lang.Class<?>[] argumentTypes)Looks for a method into cache and metamodel.ASMgetASM()Bytecode[]getBytecodes()Returns the bytecodes.java.lang.StringgetContext()java.util.List<?>getInstructions()java.util.List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LineNumberEntry>getLineNumberTable()java.util.List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LocalVariableEntry>getLocalVariableTable()intgetMaxLocals()java.lang.StringgetName()java.util.List<java.lang.String>getParameters()java.lang.StringresolveLineNumber(int l)Returns the line at the specified number.java.lang.StringresolveVariableName(int slot, int l)Resolves a variable name by its slot number and its index.voidsetBytecodes(Bytecode[] bytecodes)Sets the bytecodes for the operation.voidsetContext(java.lang.String context)java.lang.StringtoString()
-
-
-
Field Detail
-
MAX_STACK
public static final int MAX_STACK
The max size of the Stack.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ASMOperation
public ASMOperation(ASM asm, java.lang.String name)
ASMOperation constructor.- Parameters:
asm- the parent asmname- operation name
-
-
Method Detail
-
getMaxLocals
public int getMaxLocals()
- Overrides:
getMaxLocalsin classOperation- See Also:
Operation.getMaxLocals()
-
getParameters
public java.util.List<java.lang.String> getParameters()
-
setContext
public void setContext(java.lang.String context)
-
getContext
public java.lang.String getContext()
-
addParameter
public void addParameter(java.lang.String parameterName, java.lang.String type)Adds a parameter.- Parameters:
parameterName- the parameter nametype- the parameter type
-
addLineNumberEntry
public void addLineNumberEntry(java.lang.String id, int begin, int end)Adds a line number entry.- Parameters:
id- the parameter idbegin- the begin indexend- the end index
-
getLineNumberTable
public java.util.List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LineNumberEntry> getLineNumberTable()
-
resolveLineNumber
public java.lang.String resolveLineNumber(int l)
Returns the line at the specified number.- Overrides:
resolveLineNumberin classOperation- Parameters:
l- the line number- Returns:
- the line at the specified number
- See Also:
Operation.resolveLineNumber(int)
-
addLocalVariableEntry
public void addLocalVariableEntry(int slot, java.lang.String variableName, int begin, int end)Adds a local variable entry with the given parameters.- Parameters:
slot- the slot numbervariableName- the variable namebegin- the begin indexend- the end index
-
getLocalVariableTable
public java.util.List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LocalVariableEntry> getLocalVariableTable()
-
resolveVariableName
public java.lang.String resolveVariableName(int slot, int l)Resolves a variable name by its slot number and its index.- Overrides:
resolveVariableNamein classOperation- Parameters:
slot- the slot numberl- the variable index- Returns:
- the variable name
- See Also:
Operation.resolveVariableName(int, int)
-
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 java.lang.String getName()
- Overrides:
getNamein classOperation- See Also:
Operation.getName()
-
exec
public java.lang.Object exec(AbstractStackFrame frame, org.eclipse.core.runtime.IProgressMonitor monitor)
Executes an operation.- Parameters:
frame- the frame for executionmonitor- the progress monitor- Returns:
- the result
-
exec
public java.lang.Object exec(AbstractStackFrame frame)
Executes an operation.- Specified by:
execin classOperation- Parameters:
frame- the frame for execution- Returns:
- the result
- See Also:
Operation.exec(org.eclipse.m2m.atl.engine.emfvm.lib.AbstractStackFrame)
-
getASM
public ASM getASM()
-
findMethod
protected static java.lang.reflect.Method findMethod(java.lang.Class<?> caller, java.lang.String name, java.lang.Class<?>[] argumentTypes)Looks for a method into cache and metamodel.- Parameters:
caller- The class of the methodname- The method nameargumentTypes- The types of all arguments- Returns:
- the method if found, null otherwise
-
getInstructions
public java.util.List<?> getInstructions()
- Overrides:
getInstructionsin classOperation- See Also:
Operation.getInstructions()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-