Package com.ibm.wala.classLoader
Class ShrikeCTMethod
- java.lang.Object
-
- com.ibm.wala.classLoader.ShrikeBTMethod
-
- com.ibm.wala.classLoader.ShrikeCTMethod
-
- All Implemented Interfaces:
IBytecodeMethod
,IMember
,IMethod
,ContextItem
,IClassHierarchyDweller
,BytecodeConstants
public final class ShrikeCTMethod extends ShrikeBTMethod implements IBytecodeMethod
A wrapper around a Shrike object that represents a method
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.wala.classLoader.ShrikeBTMethod
ShrikeBTMethod.BytecodeInfo
-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
Nested classes/interfaces inherited from interface com.ibm.wala.classLoader.IMethod
IMethod.SourcePosition
-
-
Field Summary
-
Fields inherited from class com.ibm.wala.classLoader.ShrikeBTMethod
declaringClass
-
Fields inherited from interface com.ibm.wala.shrikeBT.BytecodeConstants
JBC_aaload, JBC_aastore, JBC_aconst_null, JBC_aload, JBC_aload_0, JBC_aload_1, JBC_aload_2, JBC_aload_3, JBC_anewarray, JBC_areturn, JBC_arraylength, JBC_astore, JBC_astore_0, JBC_astore_1, JBC_astore_2, JBC_astore_3, JBC_athrow, JBC_baload, JBC_bastore, JBC_bipush, JBC_caload, JBC_castore, JBC_checkcast, JBC_d2f, JBC_d2i, JBC_d2l, JBC_dadd, JBC_daload, JBC_dastore, JBC_dcmpg, JBC_dcmpl, JBC_dconst_0, JBC_dconst_1, JBC_ddiv, JBC_dload, JBC_dload_0, JBC_dload_1, JBC_dload_2, JBC_dload_3, JBC_dmul, JBC_dneg, JBC_drem, JBC_dreturn, JBC_dstore, JBC_dstore_0, JBC_dstore_1, JBC_dstore_2, JBC_dstore_3, JBC_dsub, JBC_dup, JBC_dup_x1, JBC_dup_x2, JBC_dup2, JBC_dup2_x1, JBC_dup2_x2, JBC_f2d, JBC_f2i, JBC_f2l, JBC_fadd, JBC_faload, JBC_fastore, JBC_fcmpg, JBC_fcmpl, JBC_fconst_0, JBC_fconst_1, JBC_fconst_2, JBC_fdiv, JBC_fload, JBC_fload_0, JBC_fload_1, JBC_fload_2, JBC_fload_3, JBC_fmul, JBC_fneg, JBC_frem, JBC_freturn, JBC_fstore, JBC_fstore_0, JBC_fstore_1, JBC_fstore_2, JBC_fstore_3, JBC_fsub, JBC_getfield, JBC_getstatic, JBC_goto, JBC_goto_w, JBC_i2d, JBC_i2f, JBC_i2l, JBC_iadd, JBC_iaload, JBC_iand, JBC_iastore, JBC_iconst_0, JBC_iconst_1, JBC_iconst_2, JBC_iconst_3, JBC_iconst_4, JBC_iconst_5, JBC_iconst_m1, JBC_idiv, JBC_if_acmpeq, JBC_if_acmpne, JBC_if_icmpeq, JBC_if_icmpge, JBC_if_icmpgt, JBC_if_icmple, JBC_if_icmplt, JBC_if_icmpne, JBC_ifeq, JBC_ifge, JBC_ifgt, JBC_ifle, JBC_iflt, JBC_ifne, JBC_ifnonnull, JBC_ifnull, JBC_iinc, JBC_iload, JBC_iload_0, JBC_iload_1, JBC_iload_2, JBC_iload_3, JBC_impdep1, JBC_impdep2, JBC_imul, JBC_ineg, JBC_instanceof, JBC_int2byte, JBC_int2char, JBC_int2short, JBC_invokeinterface, JBC_invokespecial, JBC_invokestatic, JBC_invokevirtual, JBC_ior, JBC_irem, JBC_ireturn, JBC_ishl, JBC_ishr, JBC_istore, JBC_istore_0, JBC_istore_1, JBC_istore_2, JBC_istore_3, JBC_isub, JBC_iushr, JBC_ixor, JBC_jsr, JBC_jsr_w, JBC_l2d, JBC_l2f, JBC_l2i, JBC_ladd, JBC_laload, JBC_land, JBC_lastore, JBC_lcmp, JBC_lconst_0, JBC_lconst_1, JBC_ldc, JBC_ldc_w, JBC_ldc2_w, JBC_ldiv, JBC_length, JBC_lload, JBC_lload_0, JBC_lload_1, JBC_lload_2, JBC_lload_3, JBC_lmul, JBC_lneg, JBC_lookupswitch, JBC_lor, JBC_lrem, JBC_lreturn, JBC_lshl, JBC_lshr, JBC_lstore, JBC_lstore_0, JBC_lstore_1, JBC_lstore_2, JBC_lstore_3, JBC_lsub, JBC_lushr, JBC_lxor, JBC_monitorenter, JBC_monitorexit, JBC_multianewarray, JBC_name, JBC_new, JBC_newarray, JBC_nop, JBC_pop, JBC_pop2, JBC_putfield, JBC_putstatic, JBC_ret, JBC_return, JBC_saload, JBC_sastore, JBC_sipush, JBC_swap, JBC_tableswitch, JBC_wide, JBC_xxxunusedxxx
-
-
Constructor Summary
Constructors Constructor Description ShrikeCTMethod(IClass klass, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Annotation>
getAnnotations()
Get the annotations on this member, if anyCollection<Annotation>
getAnnotations(boolean runtimeInvisible)
byte[]
getBytecodes()
IClassHierarchy
getClassHierarchy()
protected String[]
getDeclaredExceptionTypeNames()
IndirectionData
getIndirectionData()
String
getLocalVariableName(int bcIndex, int localNumber)
int
getMaxLocals()
int
getMaxStackHeight()
protected String
getMethodName()
protected String
getMethodSignature()
MethodTypeSignature
getMethodTypeSignature()
UNDER CONSTRUCTIONprotected int
getModifiers()
Collection<Annotation>[]
getParameterAnnotations()
get annotations on parameters as an array of Collections, where each array element gives the annotations on the corresponding parameter.TypeReference
getReturnType()
Collection<Annotation>
getRuntimeInvisibleAnnotations()
read the runtime-invisible annotations from the class fileCollection<Annotation>
getRuntimeVisibleAnnotations()
read the runtime-visible annotations from the class fileboolean
hasExceptionHandler()
boolean
hasLocalVariableTable()
protected Decoder
makeDecoder()
Find the decoder object for this method, or create one if necessary.protected void
processDebugInfo(ShrikeBTMethod.BytecodeInfo bcInfo)
END Custom change: precise positions-
Methods inherited from class com.ibm.wala.classLoader.ShrikeBTMethod
clearCaches, equals, getArraysRead, getArraysWritten, getBCInfo, getBytecodeIndex, getBytecodeStream, getCallSites, getCastTypes, getCaughtExceptionTypes, getDeclaredExceptions, getDeclaringClass, getDescriptor, getFieldsRead, getFieldsWritten, getHandlers, getImplicitExceptionTypes, getInstructions, getLineNumber, getName, getNumberOfParameters, getNumShrikeInstructions, getParameterSourcePosition, getParameterType, getReference, getSelector, getSignature, getSourcePosition, hashCode, hasMonitorOp, isAbstract, isBridge, isClinit, isFinal, isInit, isNative, isPrivate, isProtected, isPublic, isStatic, isSynchronized, isSynthetic, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.wala.classLoader.IBytecodeMethod
getBytecodeIndex, getCallSites, getHandlers, getInstructions
-
Methods inherited from interface com.ibm.wala.classLoader.IMember
getDeclaringClass, getName, isStatic
-
Methods inherited from interface com.ibm.wala.classLoader.IMethod
getDeclaredExceptions, getDescriptor, getLineNumber, getNumberOfParameters, getParameterSourcePosition, getParameterType, getReference, getSelector, getSignature, getSourcePosition, isAbstract, isBridge, isClinit, isFinal, isInit, isNative, isPrivate, isProtected, isPublic, isSynchronized, isSynthetic
-
-
-
-
Constructor Detail
-
ShrikeCTMethod
public ShrikeCTMethod(IClass klass, int index)
-
-
Method Detail
-
getBytecodes
public byte[] getBytecodes()
- Specified by:
getBytecodes
in classShrikeBTMethod
-
getMethodName
protected String getMethodName() throws InvalidClassFileException
- Specified by:
getMethodName
in classShrikeBTMethod
- Throws:
InvalidClassFileException
-
getMethodSignature
protected String getMethodSignature() throws InvalidClassFileException
- Specified by:
getMethodSignature
in classShrikeBTMethod
- Throws:
InvalidClassFileException
-
getModifiers
protected int getModifiers()
- Specified by:
getModifiers
in classShrikeBTMethod
-
makeDecoder
protected Decoder makeDecoder()
Description copied from class:ShrikeBTMethod
Find the decoder object for this method, or create one if necessary.- Specified by:
makeDecoder
in classShrikeBTMethod
- Returns:
- null if the method has no code.
-
getMaxLocals
public int getMaxLocals()
- Specified by:
getMaxLocals
in classShrikeBTMethod
-
getMaxStackHeight
public int getMaxStackHeight()
- Specified by:
getMaxStackHeight
in classShrikeBTMethod
-
hasExceptionHandler
public boolean hasExceptionHandler()
- Specified by:
hasExceptionHandler
in interfaceIMethod
- Specified by:
hasExceptionHandler
in classShrikeBTMethod
- Returns:
- true iff this method has at least one exception handler
-
getDeclaredExceptionTypeNames
protected String[] getDeclaredExceptionTypeNames() throws InvalidClassFileException
- Specified by:
getDeclaredExceptionTypeNames
in classShrikeBTMethod
- Throws:
InvalidClassFileException
-
processDebugInfo
protected void processDebugInfo(ShrikeBTMethod.BytecodeInfo bcInfo) throws InvalidClassFileException
END Custom change: precise positions- Specified by:
processDebugInfo
in classShrikeBTMethod
- Throws:
InvalidClassFileException
-
getLocalVariableName
public String getLocalVariableName(int bcIndex, int localNumber)
- Specified by:
getLocalVariableName
in interfaceIMethod
- Specified by:
getLocalVariableName
in classShrikeBTMethod
- Returns:
- the (source code) name of the local variable of a given number at the specified program counter, or null if the information is not available.
-
hasLocalVariableTable
public boolean hasLocalVariableTable()
- Specified by:
hasLocalVariableTable
in interfaceIMethod
- Specified by:
hasLocalVariableTable
in classShrikeBTMethod
- Returns:
- true iff the local variable table information for this method is available
-
getReturnType
public TypeReference getReturnType()
- Specified by:
getReturnType
in interfaceIMethod
- Returns:
- the name of the return type for this method
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Specified by:
getClassHierarchy
in interfaceIClassHierarchyDweller
-
getMethodTypeSignature
public MethodTypeSignature getMethodTypeSignature() throws InvalidClassFileException
UNDER CONSTRUCTION- Throws:
InvalidClassFileException
-
getRuntimeInvisibleAnnotations
public Collection<Annotation> getRuntimeInvisibleAnnotations() throws InvalidClassFileException
read the runtime-invisible annotations from the class file- Throws:
InvalidClassFileException
-
getRuntimeVisibleAnnotations
public Collection<Annotation> getRuntimeVisibleAnnotations() throws InvalidClassFileException
read the runtime-visible annotations from the class file- Throws:
InvalidClassFileException
-
getAnnotations
public Collection<Annotation> getAnnotations(boolean runtimeInvisible) throws InvalidClassFileException
- Specified by:
getAnnotations
in interfaceIBytecodeMethod
- Throws:
InvalidClassFileException
-
getAnnotations
public Collection<Annotation> getAnnotations()
Description copied from interface:IMember
Get the annotations on this member, if any- Specified by:
getAnnotations
in interfaceIMember
-
getParameterAnnotations
public Collection<Annotation>[] getParameterAnnotations()
get annotations on parameters as an array of Collections, where each array element gives the annotations on the corresponding parameter. Note that the 'this' parameter for an instance method cannot have annotations.- Specified by:
getParameterAnnotations
in interfaceIBytecodeMethod
-
getIndirectionData
public IndirectionData getIndirectionData()
- Specified by:
getIndirectionData
in interfaceIBytecodeMethod
- Returns:
- information about any indirect uses of local variables
-
-