Package org.jf.dexlib2.dexbacked
Class DexBackedMethodImplementation
- java.lang.Object
-
- org.jf.dexlib2.dexbacked.DexBackedMethodImplementation
-
- All Implemented Interfaces:
MethodImplementation
- Direct Known Subclasses:
CDexBackedMethodImplementation
public class DexBackedMethodImplementation extends java.lang.Object implements MethodImplementation
-
-
Field Summary
Fields Modifier and Type Field Description protected intcodeOffsetDexBackedDexFiledexFileDexBackedMethodmethod
-
Constructor Summary
Constructors Modifier Constructor Description protectedDexBackedMethodImplementation(DexBackedDexFile dexFile, DexBackedMethod method, int codeOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<? extends DebugItem>getDebugItems()Get a list of debug items for this method.protected intgetDebugOffset()java.lang.Iterable<? extends Instruction>getInstructions()Gets the instructions in this method.protected intgetInstructionsSize()protected intgetInstructionsStartOffset()java.util.Iterator<java.lang.String>getParameterNames(DexReader dexReader)intgetRegisterCount()Gets the number of registers in this method.intgetSize()Calculate and return the private size of a method implementation.protected intgetTriesSize()java.util.List<? extends DexBackedTryBlock>getTryBlocks()Gets a list of the try blocks defined for this method.
-
-
-
Field Detail
-
dexFile
@Nonnull public final DexBackedDexFile dexFile
-
method
@Nonnull public final DexBackedMethod method
-
codeOffset
protected final int codeOffset
-
-
Constructor Detail
-
DexBackedMethodImplementation
protected DexBackedMethodImplementation(@Nonnull DexBackedDexFile dexFile, @Nonnull DexBackedMethod method, int codeOffset)
-
-
Method Detail
-
getRegisterCount
public int getRegisterCount()
Description copied from interface:MethodImplementationGets the number of registers in this method.- Specified by:
getRegisterCountin interfaceMethodImplementation- Returns:
- The number of register in this method.
-
getInstructionsSize
protected int getInstructionsSize()
-
getInstructionsStartOffset
protected int getInstructionsStartOffset()
-
getInstructions
@Nonnull public java.lang.Iterable<? extends Instruction> getInstructions()
Description copied from interface:MethodImplementationGets the instructions in this method.- Specified by:
getInstructionsin interfaceMethodImplementation- Returns:
- An Iterable of the instructions in this method
-
getTriesSize
protected int getTriesSize()
-
getTryBlocks
@Nonnull public java.util.List<? extends DexBackedTryBlock> getTryBlocks()
Description copied from interface:MethodImplementationGets a list of the try blocks defined for this method. Try blocks may overlap freely, and do not need to be strictly nested, as in java. This is a more relaxed requirement than specified by the dex format, where try blocks may not overlap, and must be specified in ascending order. When writing to a dex file, the try blocks will be massaged into the appropriate format. In any region where there are overlapping try blocks, set of exception handlers for the overlapping region will consist of the union of all handlers in any try block that covers that region. If multiple overlapping try blocks define a handler for the same exception type, or define a catch-all handler, then those duplicate handlers must use the same handler offset.- Specified by:
getTryBlocksin interfaceMethodImplementation- Returns:
- A list of the TryBlock items
-
getDebugOffset
protected int getDebugOffset()
-
getDebugItems
@Nonnull public java.lang.Iterable<? extends DebugItem> getDebugItems()
Description copied from interface:MethodImplementationGet a list of debug items for this method. This generally matches the semantics of the debug_info_item in the dex specification, although in an easier to digest form. The addresses of the DebugItems in the returned list will be in non-descending order.- Specified by:
getDebugItemsin interfaceMethodImplementation- Returns:
- A list of DebugInfo items
-
getParameterNames
@Nonnull public java.util.Iterator<java.lang.String> getParameterNames(@Nullable DexReader dexReader)
-
getSize
public int getSize()
Calculate and return the private size of a method implementation. Calculated as: debug info size + instructions size + try-catch size- Returns:
- size in bytes
-
-