com.android.dx.dex.code
Class DalvCode

java.lang.Object
  extended by 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.


Nested Class Summary
static interface DalvCode.AssignIndicesCallback
          Class used as a callback for assignIndices(com.android.dx.dex.code.DalvCode.AssignIndicesCallback).
 
Constructor Summary
DalvCode(int positionInfo, OutputFinisher unprocessedInsns, CatchBuilder unprocessedCatches)
          Constructs an instance.
 
Method Summary
 void assignIndices(DalvCode.AssignIndicesCallback callback)
          Assign indices in all instructions that need them, using the given callback to perform lookups.
 CatchTable getCatches()
          Gets the catch (exception handler) table.
 HashSet<Type> getCatchTypes()
          Gets the set of catch types handled anywhere in the code.
 HashSet<Constant> getInsnConstants()
          Gets the set of all constants referred to by instructions in the code.
 DalvInsnList getInsns()
          Gets the list of instructions.
 LocalList getLocals()
          Gets the source positions list.
 PositionList getPositions()
          Gets the source positions list.
 boolean hasAnyCatches()
          Gets whether this instance has any catches at all (either typed or catch-all).
 boolean hasLocals()
          Gets whether this instance has any local variable data to represent.
 boolean hasPositions()
          Gets whether this instance has any position data to represent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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


Copyright © 2015. All rights reserved.