Module xl.compiler

Class XMethod

All Implemented Interfaces:
Manageable, PersistenceCapable, Shareable, Member, Method, Signature, TypeId, UserFields, XObject, Map, ExpressionFactory, ValueObserver, Routine, Serializable, Cloneable

public class XMethod extends ComplexMethod implements Method
See Also:
  • Constructor Details

  • Method Details

    • getLocalForVMX

      public Local getLocalForVMX()
    • getRoutineField

      public Field getRoutineField()
    • updateParameters

      public void updateParameters()
    • getRoutineId

      public String getRoutineId()
    • getTypeLoader

      public TypeLoader getTypeLoader()
      Overrides:
      getTypeLoader in class Expression
    • setXFrameSize

      public final void setXFrameSize(int xsize)
    • getFrameSize

      public int getFrameSize()
      Description copied from interface: Routine
      Computes the number of VMXState stack elements for the frame of this routine. This includes the parameters, if any.
      Specified by:
      getFrameSize in interface Routine
      Overrides:
      getFrameSize in class MethodExpression
      Returns:
      the size of the frame in terms of stack elements
    • hasJavaParameters

      public boolean hasJavaParameters()
      Description copied from interface: Routine
      Determines whether this routine expects its parameters on the Java frame or the normal frame.
      Specified by:
      hasJavaParameters in interface Routine
      Overrides:
      hasJavaParameters in class MethodExpression
      Returns:
      true iff parameters are expected on the Java frame
    • getModifiers

      public final int getModifiers()
      Description copied from interface: Member
      Returns the modifiers of this member as a combination of the bit masks which are defined in this interface.
      Specified by:
      getModifiers in interface Member
      Returns:
      modifiers of this member
    • getModifiersEx

      public final long getModifiersEx()
    • setPublic

      public final void setPublic()
    • getDeclaringType

      public final Type getDeclaringType()
      Description copied from interface: Member
      Returns the declaring type of which this is a member. May be null if such a type does not exist.
      Specified by:
      getDeclaringType in interface Member
      Returns:
      this member's declaring type
    • getSimpleName

      public final String getSimpleName()
      Description copied from interface: Member
      Returns the simple name of this member. This is the single identifier with which the member is declared in source code, e.g., Object, out, println.
      Specified by:
      getSimpleName in interface Member
      Returns:
      simple name of the member
    • getDescriptor

      public final String getDescriptor()
      Description copied from interface: Member
      Returns a descriptor for this member. Descriptors are constructed as follows:
      • For types, descriptors are defined as for the Java Virtual Machine. For primitive types these are the single characters 'Z', 'B', 'S', 'C', 'I', 'J', 'F', 'D', 'V' for boolean, byte, short, char, int, long, float, double, void. For array types, the descriptor is the character '[' plus the descriptor of its component type, e.g., [[I for int[][]. For non-array reference types, the descriptor is the character 'L', followed by the binary name (see Type.getBinaryName()) of the type, where '.' has to be replaced by '/', followed by ';', e.g., Ljava/lang/Object;.
      • For fields, the descriptor is the character 'f', followed by the simple name of the field, followed by the character ';', followed by the descriptor of the field's type. E.g., fout;Ljava/io/PrintStream; for the field System.out.
      • For methods and constructors, the descriptor is the character 'm', followed by the simple name of the method (which is <init> for constructors), followed by the characters ';' and '(', followed by the descriptors of the method's parameter types, followed by ')', followed by the descriptor of the return type. E.g. mprintln;(Ljava/lang/String;)V for the method PrintStream.println(String).
      Specified by:
      getDescriptor in interface Member
      Returns:
      the member's descriptor
    • getReturnType

      public final Type getReturnType()
      Specified by:
      getReturnType in interface Method
    • getParameterCount

      public final int getParameterCount()
      Specified by:
      getParameterCount in interface Signature
    • getParameterType

      public final Type getParameterType(int index)
      Specified by:
      getParameterType in interface Signature
    • getExceptionCount

      public int getExceptionCount()
      Specified by:
      getExceptionCount in interface Method
    • getExceptionType

      public Type getExceptionType(int index)
      Specified by:
      getExceptionType in interface Method
    • getDeclaredAnnotationCount

      public int getDeclaredAnnotationCount()
      Specified by:
      getDeclaredAnnotationCount in interface Member
    • getDeclaredAnnotation

      public Annotation getDeclaredAnnotation(int index)
      Specified by:
      getDeclaredAnnotation in interface Member
    • getParameterAnnotationCount

      public int getParameterAnnotationCount(int param)
      Specified by:
      getParameterAnnotationCount in interface Method
    • getParameterAnnotation

      public Annotation getParameterAnnotation(int param, int index)
      Specified by:
      getParameterAnnotation in interface Method
    • invoke

      public final Object invoke(Object instance, Object[] arguments) throws InvocationTargetException
      Specified by:
      invoke in interface Method
      Throws:
      InvocationTargetException
    • invoke

      public final Object invoke(Object instance, Object[] arguments, VMXState t) throws InvocationTargetException
      Throws:
      InvocationTargetException
    • evaluateImpl

      protected void evaluateImpl(VMXState t)
      Overrides:
      evaluateImpl in class ComplexMethod
    • paramString

      protected String paramString()
      Description copied from class: Node
      Computes the class-specific part of the string returned by Node.toString() which shall be enclosed in brackets. This should be used to show important properties of this node.
      Overrides:
      paramString in class Expression
      Returns:
      string describing some important properties of this node
    • getGeneratorType

      public static Type getGeneratorType(Method method)
    • getGeneratorOrReturnType

      public static Type getGeneratorOrReturnType(Method method)
    • getConsumerType

      public static Class getConsumerType(int typeId)
    • hasEmptyBytecode

      public boolean hasEmptyBytecode()
    • writeImpl

      protected void writeImpl(BytecodeWriter writer, boolean discard)
      Overrides:
      writeImpl in class Expression