Package com.ibm.wala.shrikeBT.info
Class InstructionTypeCounter
- java.lang.Object
-
- com.ibm.wala.shrikeBT.info.InstructionTypeCounter
-
- All Implemented Interfaces:
MethodData.Results
public class InstructionTypeCounter extends Object implements MethodData.Results
This method annotation counts the number of instructions of each type (according to each Instruction subclass). The get...Count methods are the only methods needed by clients. These methods check to see if the MethodData object already has an InstructionTypeCounter annotation before recomputing the counts and returning the desired count.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
getArrayLengthCount(MethodData info)
static int
getArrayLoadCount(MethodData info)
static int
getArrayStoreCount(MethodData info)
static int
getBinaryOpCount(MethodData info)
static int
getCheckCastCount(MethodData info)
static int
getComparisonCount(MethodData info)
static int
getConditionalBranchCount(MethodData info)
static int
getConstantCount(MethodData info)
static int
getConversionCount(MethodData info)
static int
getDupCount(MethodData info)
static int
getGetCount(MethodData info)
static int
getGotoCount(MethodData info)
static int
getInstanceOfCount(MethodData info)
static int
getInvokeCount(MethodData info)
static int
getLocalLoadCount(MethodData info)
static int
getLocalStoreCount(MethodData info)
static int
getMonitorCount(MethodData info)
static int
getNewCount(MethodData info)
static int
getPopCount(MethodData info)
static int
getPutCount(MethodData info)
static int
getReturnCount(MethodData info)
static int
getShiftCount(MethodData info)
static int
getSwapCount(MethodData info)
static int
getSwitchesCount(MethodData info)
static int
getThrowCount(MethodData info)
static int
getUnaryOpCount(MethodData info)
boolean
notifyUpdate(MethodData info, IInstruction[] newInstructions, ExceptionHandler[][] newHandlers, int[] newInstructionMap)
Whenever the underlying method is updated, we'll throw away our counts so they can be reconstructed from scratch next time.
-
-
-
Method Detail
-
notifyUpdate
public boolean notifyUpdate(MethodData info, IInstruction[] newInstructions, ExceptionHandler[][] newHandlers, int[] newInstructionMap)
Whenever the underlying method is updated, we'll throw away our counts so they can be reconstructed from scratch next time. This is not to be called by clients.- Specified by:
notifyUpdate
in interfaceMethodData.Results
- Parameters:
info
- the method data this annotation is attached tonewInstructions
- the instructions the method will change tonewHandlers
- the handler lists the method will change tonewInstructionMap
- the instructions-to-bytecodes map the method will change to- Returns:
- true to remove the object from the info set, for example because the annotation is now invalid
-
getArrayLoadCount
public static int getArrayLoadCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getArrayStoreCount
public static int getArrayStoreCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getGetCount
public static int getGetCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getPutCount
public static int getPutCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getMonitorCount
public static int getMonitorCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getInvokeCount
public static int getInvokeCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getComparisonCount
public static int getComparisonCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getArrayLengthCount
public static int getArrayLengthCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getConstantCount
public static int getConstantCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getShiftCount
public static int getShiftCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getSwitchesCount
public static int getSwitchesCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getSwapCount
public static int getSwapCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getBinaryOpCount
public static int getBinaryOpCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getCheckCastCount
public static int getCheckCastCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getThrowCount
public static int getThrowCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getConditionalBranchCount
public static int getConditionalBranchCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getConversionCount
public static int getConversionCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getDupCount
public static int getDupCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getGotoCount
public static int getGotoCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getReturnCount
public static int getReturnCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getInstanceOfCount
public static int getInstanceOfCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getLocalLoadCount
public static int getLocalLoadCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getLocalStoreCount
public static int getLocalStoreCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getNewCount
public static int getNewCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getPopCount
public static int getPopCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getUnaryOpCount
public static int getUnaryOpCount(MethodData info) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-