Class DalvCode

java.lang.Object
com.android.dx.dex.code.DalvCode

public final class DalvCode extends Object
Container for all the pieces of a concrete method. Each instance corresponds to a code structure in a .dex file.
  • Constructor Details

    • DalvCode

      public DalvCode(int positionInfo, OutputFinisher unprocessedInsns, CatchBuilder unprocessedCatches)
      Constructs an instance.
      Parameters:
      positionInfo - how much position info to preserve; one of the static constants in PositionList
      unprocessedInsns - non-null; the instruction list, ready for final processing
      unprocessedCatches - non-null; unprocessed catch (exception handler) table
  • Method Details

    • assignIndices

      public void assignIndices(DalvCode.AssignIndicesCallback callback)
      Assign indices in all instructions that need them, using the given callback to perform lookups. This must be called before getInsns().
      Parameters:
      callback - non-null; callback object
    • hasPositions

      public boolean hasPositions()
      Gets whether this instance has any position data to represent.
      Returns:
      true iff this instance has any position data to represent
    • hasLocals

      public boolean hasLocals()
      Gets whether this instance has any local variable data to represent.
      Returns:
      true iff this instance has any local variable data to represent
    • hasAnyCatches

      public boolean hasAnyCatches()
      Gets whether this instance has any catches at all (either typed or catch-all).
      Returns:
      whether this instance has any catches at all
    • getCatchTypes

      public HashSet<Type> getCatchTypes()
      Gets the set of catch types handled anywhere in the code.
      Returns:
      non-null; the set of catch types
    • getInsnConstants

      public HashSet<Constant> getInsnConstants()
      Gets the set of all constants referred to by instructions in the code.
      Returns:
      non-null; the set of constants
    • getInsns

      public DalvInsnList getInsns()
      Gets the list of instructions.
      Returns:
      non-null; the instruction list
    • getCatches

      public CatchTable getCatches()
      Gets the catch (exception handler) table.
      Returns:
      non-null; the catch table
    • getPositions

      public PositionList getPositions()
      Gets the source positions list.
      Returns:
      non-null; the source positions list
    • getLocals

      public LocalList getLocals()
      Gets the source positions list.
      Returns:
      non-null; the source positions list