Package com.ibm.wala.dalvik.classLoader
Class DexIMethod
java.lang.Object
com.ibm.wala.dalvik.classLoader.DexIMethod
- All Implemented Interfaces:
com.ibm.wala.classLoader.IBytecodeMethod<Instruction>,com.ibm.wala.classLoader.IMember,com.ibm.wala.classLoader.IMethod,com.ibm.wala.ipa.callgraph.ContextItem,com.ibm.wala.ipa.cha.IClassHierarchyDweller
public class DexIMethod
extends Object
implements com.ibm.wala.classLoader.IBytecodeMethod<Instruction>
A wrapper around a EncodedMethod object (from dexlib) that represents a method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
com.ibm.wala.ipa.callgraph.ContextItem.Value<T extends Object>Nested classes/interfaces inherited from interface com.ibm.wala.classLoader.IMethod
com.ibm.wala.classLoader.IMethod.SourcePosition -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InstructionArrayprotected final DexIClassThe declaring class for this method. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetAddressFromIndex(int index) Collection<com.ibm.wala.types.annotations.Annotation>Collection<com.ibm.wala.types.annotations.Annotation>getAnnotations(boolean runtimeInvisible) Iterator<com.ibm.wala.types.TypeReference>intgetBytecodeIndex(int i) Collection<com.ibm.wala.classLoader.CallSiteReference>com.ibm.wala.ipa.cha.IClassHierarchycom.ibm.wala.types.TypeReference[]com.ibm.wala.classLoader.IClasscom.ibm.wala.types.DescriptorintIterator<com.ibm.wala.types.FieldReference>Iterator<com.ibm.wala.types.FieldReference>com.ibm.wala.shrike.shrikeBT.ExceptionHandler[][]com.ibm.wala.shrike.shrikeBT.IndirectionDatagetInstructionFromIndex(int instructionIndex) intgetInstructionIndex(int bytecodeindex) intgetLineNumber(int bcIndex) getLocalVariableName(int bcIndex, int localNumber) intXXX not fully about the + 2.intcom.ibm.wala.core.util.strings.AtomgetName()Collection<com.ibm.wala.classLoader.NewSiteReference>intintCollection<com.ibm.wala.types.annotations.Annotation>[]com.ibm.wala.classLoader.IMethod.SourcePositiongetParameterSourcePosition(int paramNum) com.ibm.wala.types.TypeReferencegetParameterType(int index) com.ibm.wala.types.MethodReferenceintcom.ibm.wala.types.TypeReferencecom.ibm.wala.types.Selectorcom.ibm.wala.classLoader.IMethod.SourcePositiongetSourcePosition(int instructionIndex) static intprotected voidhandleINVOKE_VIRTUAL(int instLoc, String cname, String mname, String pname, int[] args, org.jf.dexlib2.Opcode opcode) booleaninthashCode()booleanprotected InstructionArraybooleanbooleanbooleanisBridge()booleanisClinit()booleanisEnum()booleanisFinal()booleanisInit()booleanisModule()booleanisNative()booleanbooleanbooleanisPublic()booleanisStatic()booleanbooleanbooleanbooleanprotected voidorg.jf.dexlib2.iface.MethodtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.ibm.wala.classLoader.IMethod
getNumberOfDefaultParameters
-
Field Details
-
myClass
The declaring class for this method. -
instructions
-
-
Constructor Details
-
DexIMethod
-
-
Method Details
-
getTotalInsts
public static int getTotalInsts() -
toEncodedMethod
public org.jf.dexlib2.iface.Method toEncodedMethod()- Returns:
- the EncodedMethod object for which this DexIMethod is a wrapper.
-
getDeclaredExceptions
public com.ibm.wala.types.TypeReference[] getDeclaredExceptions() throws UnsupportedOperationException- Specified by:
getDeclaredExceptionsin interfacecom.ibm.wala.classLoader.IMethod- Throws:
UnsupportedOperationException
-
getLocalVariableName
- Specified by:
getLocalVariableNamein interfacecom.ibm.wala.classLoader.IMethod
-
getMaxLocals
public int getMaxLocals()XXX not fully about the + 2.- Returns:
- the RegisterCount + 2 to make some room for the return and exception register
- See Also:
-
ShrikeCTMethod.getMaxLocals()
-
getReturnReg
public int getReturnReg() -
getExceptionReg
public int getExceptionReg() -
getMaxStackHeight
public int getMaxStackHeight() -
getDescriptor
public com.ibm.wala.types.Descriptor getDescriptor()- Specified by:
getDescriptorin interfacecom.ibm.wala.classLoader.IMethod
-
getNumberOfParameters
public int getNumberOfParameters()- Specified by:
getNumberOfParametersin interfacecom.ibm.wala.classLoader.IMethod
-
getNumberOfParameterRegisters
public int getNumberOfParameterRegisters() -
getParameterType
public com.ibm.wala.types.TypeReference getParameterType(int index) - Specified by:
getParameterTypein interfacecom.ibm.wala.classLoader.IMethod
-
getReference
public com.ibm.wala.types.MethodReference getReference()- Specified by:
getReferencein interfacecom.ibm.wala.classLoader.IMethod
-
getReturnType
public com.ibm.wala.types.TypeReference getReturnType()- Specified by:
getReturnTypein interfacecom.ibm.wala.classLoader.IMethod
-
getSelector
public com.ibm.wala.types.Selector getSelector()- Specified by:
getSelectorin interfacecom.ibm.wala.classLoader.IMethod
-
getSignature
- Specified by:
getSignaturein interfacecom.ibm.wala.classLoader.IMethod
-
hasExceptionHandler
public boolean hasExceptionHandler()- Specified by:
hasExceptionHandlerin interfacecom.ibm.wala.classLoader.IMethod
-
hasLocalVariableTable
public boolean hasLocalVariableTable()- Specified by:
hasLocalVariableTablein interfacecom.ibm.wala.classLoader.IMethod
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstractin interfacecom.ibm.wala.classLoader.IMethod
-
isClinit
public boolean isClinit()- Specified by:
isClinitin interfacecom.ibm.wala.classLoader.IMethod
-
isFinal
public boolean isFinal()- Specified by:
isFinalin interfacecom.ibm.wala.classLoader.IMethod
-
isInit
public boolean isInit()- Specified by:
isInitin interfacecom.ibm.wala.classLoader.IMethod
-
isNative
public boolean isNative()- Specified by:
isNativein interfacecom.ibm.wala.classLoader.IMethod
-
isBridge
public boolean isBridge()- Specified by:
isBridgein interfacecom.ibm.wala.classLoader.IMethod
-
isPrivate
public boolean isPrivate()- Specified by:
isPrivatein interfacecom.ibm.wala.classLoader.IMethod
-
isProtected
public boolean isProtected()- Specified by:
isProtectedin interfacecom.ibm.wala.classLoader.IMethod
-
isPublic
public boolean isPublic()- Specified by:
isPublicin interfacecom.ibm.wala.classLoader.IMethod
-
isSynchronized
public boolean isSynchronized()- Specified by:
isSynchronizedin interfacecom.ibm.wala.classLoader.IMethod
-
isWalaSynthetic
public boolean isWalaSynthetic()- Specified by:
isWalaSyntheticin interfacecom.ibm.wala.classLoader.IMethod
-
isSynthetic
public boolean isSynthetic()- Specified by:
isSyntheticin interfacecom.ibm.wala.classLoader.IMethod
-
isStatic
public boolean isStatic()- Specified by:
isStaticin interfacecom.ibm.wala.classLoader.IMember
-
isVolatile
public boolean isVolatile() -
isAnnotation
public boolean isAnnotation()- Specified by:
isAnnotationin interfacecom.ibm.wala.classLoader.IMethod
-
isEnum
public boolean isEnum()- Specified by:
isEnumin interfacecom.ibm.wala.classLoader.IMethod
-
isModule
public boolean isModule()- Specified by:
isModulein interfacecom.ibm.wala.classLoader.IMethod
-
getDeclaringClass
public com.ibm.wala.classLoader.IClass getDeclaringClass()- Specified by:
getDeclaringClassin interfacecom.ibm.wala.classLoader.IMember
-
getClassHierarchy
public com.ibm.wala.ipa.cha.IClassHierarchy getClassHierarchy()- Specified by:
getClassHierarchyin interfacecom.ibm.wala.ipa.cha.IClassHierarchyDweller
-
getName
public com.ibm.wala.core.util.strings.Atom getName()- Specified by:
getNamein interfacecom.ibm.wala.classLoader.IMember
-
getLineNumber
public int getLineNumber(int bcIndex) - Specified by:
getLineNumberin interfacecom.ibm.wala.classLoader.IMethod
-
toString
-
equals
-
hashCode
public int hashCode() -
getBytecodeIndex
public int getBytecodeIndex(int i) - Specified by:
getBytecodeIndexin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getHandlers
public com.ibm.wala.shrike.shrikeBT.ExceptionHandler[][] getHandlers()- Specified by:
getHandlersin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getInstructions
- Specified by:
getInstructionsin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
parseBytecode
protected void parseBytecode() -
handleINVOKE_VIRTUAL
-
getDexInstructions
-
instructions
-
getAddressFromIndex
public int getAddressFromIndex(int index) -
getInstructionIndex
public int getInstructionIndex(int bytecodeindex) - Specified by:
getInstructionIndexin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getInstructionFromIndex
-
getIndirectionData
public com.ibm.wala.shrike.shrikeBT.IndirectionData getIndirectionData()- Specified by:
getIndirectionDatain interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getCallSites
- Specified by:
getCallSitesin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>- Throws:
UnsupportedOperationException-TODO: Review this implementation - it may be horribly wrong!
-
getFieldsRead
- Specified by:
getFieldsReadin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getFieldsWritten
- Specified by:
getFieldsWrittenin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getArraysWritten
- Specified by:
getArraysWrittenin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getNewSites
- Specified by:
getNewSitesin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getSourcePosition
public com.ibm.wala.classLoader.IMethod.SourcePosition getSourcePosition(int instructionIndex) - Specified by:
getSourcePositionin interfacecom.ibm.wala.classLoader.IMethod
-
getParameterSourcePosition
public com.ibm.wala.classLoader.IMethod.SourcePosition getParameterSourcePosition(int paramNum) - Specified by:
getParameterSourcePositionin interfacecom.ibm.wala.classLoader.IMethod
-
getAnnotations
- Specified by:
getAnnotationsin interfacecom.ibm.wala.classLoader.IMember
-
getAnnotations
public Collection<com.ibm.wala.types.annotations.Annotation> getAnnotations(boolean runtimeInvisible) - Specified by:
getAnnotationsin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-
getParameterAnnotations
- Specified by:
getParameterAnnotationsin interfacecom.ibm.wala.classLoader.IBytecodeMethod<Instruction>
-