Package gnu.jel

Class OPcall


public class OPcall extends OP
A tree node, representing a method call (field/local variable load).
  • Field Details

    • m

      public Member m
      Holds method to be executed
    • nplv

      public int nplv
      local variable number (in case m=null), number of formal parameters of the method to call otherwise.
    • arrayTypeCodes

      protected static final byte[] arrayTypeCodes
    • arrayStoreCodes

      protected static final int[] arrayStoreCodes
  • Constructor Details

    • OPcall

      public OPcall(Member m, int np, Stack<OP> paramOPs, boolean aEval) throws CompilationException
      Prepares a new method/field call/get operation to be added to the code.
      Parameters:
      m - method/field to call/get.
      np - number of actual formal parameters (not considering "this")
      paramOPs - stack holding the operands
      aEval - indicates if the method call should be attempted at the compile time
      Throws:
      CompilationException
    • OPcall

      public OPcall(int lvarn, Class<?> type)
      Prepares access to the local variable (formal parameter) of method.
      Parameters:
      lvarn - local variable number.
      type - local variable type.
  • Method Details

    • eval

      public Object eval() throws Exception
      Attempts to evaluate this function.
      Specified by:
      eval in class OP
      Returns:
      the OPload, representing the function's result (if it can \ be evaluated).
      Throws:
      Exception - if the function can't be evaluated, or the evaluation results in error.
    • compile

      public void compile(ClassFile cf)
      Description copied from class: OP
      Called to generate the code implementing this OP.
      Specified by:
      compile in class OP
      Parameters:
      cf - class file with a new open method to write the code into.