org.eclipse.m2m.atl.engine.emfvm
Class ASMOperation

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

public class ASMOperation
extends Operation

ASM commands sheduler.


Nested Class Summary
 class ASMOperation.LineNumberEntry
           
 class ASMOperation.LocalVariableEntry
           
 
Field Summary
static int MAX_STACK
           
 
Fields inherited from class org.eclipse.m2m.atl.engine.emfvm.lib.Operation
maxLocals
 
Constructor Summary
ASMOperation(java.lang.String name)
           
 
Method Summary
 void addLineNumberEntry(java.lang.String id, int begin, int end)
           
 void addLocalVariableEntry(int slot, java.lang.String name, int begin, int end)
           
 void addParameter(java.lang.String name, java.lang.String type)
           
 void cacheMethod(java.lang.Class caller, java.lang.String signature, java.lang.reflect.Method method)
          Stores a method in a cache.
 java.lang.Object exec(StackFrame frame)
           
 java.lang.reflect.Method findCachedMethod(java.lang.Class caller, java.lang.String signature)
          Find a method in the cache
 java.lang.reflect.Method findMethod(java.lang.Class cls, java.lang.String name, java.lang.Class[] argumentTypes)
          Looks for a method into cache and metamodel.
 java.lang.String getContext()
           
 java.util.List getLineNumberTable()
           
 java.util.List getLocalVariableTable()
           
 int getMaxLocals()
           
static java.lang.String getMethodSignature(java.lang.String name, java.lang.Class[] argumentTypes)
          Generates a String signature to store methods
 java.lang.String getName()
           
 java.lang.String resolveLineNumber(int l)
           
 java.lang.String resolveVariableName(int slot, int l)
           
 void setBytecodes(Bytecode[] bytecodes)
           
 void setContext(java.lang.String context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_STACK

public static final int MAX_STACK
See Also:
Constant Field Values
Constructor Detail

ASMOperation

public ASMOperation(java.lang.String name)
Method Detail

getMaxLocals

public int getMaxLocals()
Overrides:
getMaxLocals in class Operation

setContext

public void setContext(java.lang.String context)

getContext

public java.lang.String getContext()

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String type)

addLineNumberEntry

public void addLineNumberEntry(java.lang.String id,
                               int begin,
                               int end)

getLineNumberTable

public java.util.List getLineNumberTable()

resolveLineNumber

public java.lang.String resolveLineNumber(int l)

addLocalVariableEntry

public void addLocalVariableEntry(int slot,
                                  java.lang.String name,
                                  int begin,
                                  int end)

getLocalVariableTable

public java.util.List getLocalVariableTable()

resolveVariableName

public java.lang.String resolveVariableName(int slot,
                                            int l)

setBytecodes

public void setBytecodes(Bytecode[] bytecodes)

getName

public java.lang.String getName()

exec

public java.lang.Object exec(StackFrame frame)
Specified by:
exec in class Operation

findMethod

public java.lang.reflect.Method findMethod(java.lang.Class cls,
                                           java.lang.String name,
                                           java.lang.Class[] argumentTypes)
                                    throws java.lang.NoSuchMethodException
Looks for a method into cache and metamodel.

Parameters:
cls - The class of the method
name - The method name
argumentTypes - The types of all arguments
Returns:
the method
Throws:
java.lang.NoSuchMethodException

findCachedMethod

public java.lang.reflect.Method findCachedMethod(java.lang.Class caller,
                                                 java.lang.String signature)
Find a method in the cache

Parameters:
caller - The class of the method
signature - The method signature
Returns:
the method

cacheMethod

public void cacheMethod(java.lang.Class caller,
                        java.lang.String signature,
                        java.lang.reflect.Method method)
Stores a method in a cache.

Parameters:
caller - The class of the method
signature - The method signature
method - The method to store

getMethodSignature

public static java.lang.String getMethodSignature(java.lang.String name,
                                                  java.lang.Class[] argumentTypes)
Generates a String signature to store methods

Parameters:
name -
argumentTypes -
Returns:
The method signature

Copyright 2007 IBM Corporation and others.
All Rights Reserved.