Class Invoke

All Implemented Interfaces:
Serializable, Comparable<Invoke>, Stmt, Indexable

public class Invoke extends DefinitionStmt<Var,InvokeExp> implements Comparable<Invoke>
Representation of invocation statement, e.g., r = o.m(...) or o.m(...).
See Also:
  • Field Details

    • index

      protected int index
    • lineNumber

      protected int lineNumber
  • Constructor Details

  • Method Details

    • getLValue

      @Nullable public Var getLValue()
      Specified by:
      getLValue in class DefinitionStmt<Var,InvokeExp>
      Returns:
      the left-hand side expression. If this Stmt is an Invoke which does not have a left-hand side expression, e.g., o.m(...), then this method returns null; otherwise, it must return a non-null value.
    • getResult

      @Nullable public Var getResult()
    • getRValue

      public InvokeExp getRValue()
      Specified by:
      getRValue in class DefinitionStmt<Var,InvokeExp>
      Returns:
      the right-hand side expression.
    • getInvokeExp

      public InvokeExp getInvokeExp()
      Returns:
      the invocation expression of this invoke.
      See Also:
    • getMethodRef

      public MethodRef getMethodRef()
      Returns:
      the method reference of this invoke.
      See Also:
    • isVirtual

      public boolean isVirtual()
    • isInterface

      public boolean isInterface()
    • isSpecial

      public boolean isSpecial()
    • isStatic

      public boolean isStatic()
    • isDynamic

      public boolean isDynamic()
    • getContainer

      public JMethod getContainer()
    • getDef

      public Optional<LValue> getDef()
      Specified by:
      getDef in interface Stmt
      Returns:
      the (optional) left-value expression defined in this Stmt. In Tai-e IR, each Stmt can define at most one expression.
    • getUses

      public Set<RValue> getUses()
      Specified by:
      getUses in interface Stmt
      Returns:
      a list of right-value expressions used in this Stmt.
    • accept

      public <T> T accept(StmtVisitor<T> visitor)
      Specified by:
      accept in interface Stmt
    • compareTo

      public int compareTo(@Nonnull Invoke other)
      Specified by:
      compareTo in interface Comparable<Invoke>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getIndex

      public int getIndex()
      Specified by:
      getIndex in interface Indexable
      Specified by:
      getIndex in interface Stmt
      Returns:
      the index of this Stmt in the container IR.
    • setIndex

      public void setIndex(int index)
      Specified by:
      setIndex in interface Stmt
    • getLineNumber

      public int getLineNumber()
      Specified by:
      getLineNumber in interface Stmt
      Returns:
      the line number of this Stmt in the original source file. If the line number is unavailable, return -1.
    • setLineNumber

      public void setLineNumber(int lineNumber)
      Specified by:
      setLineNumber in interface Stmt
    • canFallThrough

      public boolean canFallThrough()
      Specified by:
      canFallThrough in interface Stmt
      Returns:
      true if execution after this statement could continue at the following statement, otherwise false.