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 intgetArrayLengthCount(MethodData info)static intgetArrayLoadCount(MethodData info)static intgetArrayStoreCount(MethodData info)static intgetBinaryOpCount(MethodData info)static intgetCheckCastCount(MethodData info)static intgetComparisonCount(MethodData info)static intgetConditionalBranchCount(MethodData info)static intgetConstantCount(MethodData info)static intgetConversionCount(MethodData info)static intgetDupCount(MethodData info)static intgetGetCount(MethodData info)static intgetGotoCount(MethodData info)static intgetInstanceOfCount(MethodData info)static intgetInvokeCount(MethodData info)static intgetLocalLoadCount(MethodData info)static intgetLocalStoreCount(MethodData info)static intgetMonitorCount(MethodData info)static intgetNewCount(MethodData info)static intgetPopCount(MethodData info)static intgetPutCount(MethodData info)static intgetReturnCount(MethodData info)static intgetShiftCount(MethodData info)static intgetSwapCount(MethodData info)static intgetSwitchesCount(MethodData info)static intgetThrowCount(MethodData info)static intgetUnaryOpCount(MethodData info)booleannotifyUpdate(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:
notifyUpdatein 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
-
-