Class InstructionTypeCounter
- java.lang.Object
-
- com.ibm.wala.shrike.shrikeBT.info.InstructionTypeCounter
-
- All Implemented Interfaces:
MethodData.Results
public class InstructionTypeCounter extends java.lang.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 java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getArrayStoreCount
public static int getArrayStoreCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getGetCount
public static int getGetCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getPutCount
public static int getPutCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getMonitorCount
public static int getMonitorCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getInvokeCount
public static int getInvokeCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getComparisonCount
public static int getComparisonCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getArrayLengthCount
public static int getArrayLengthCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getConstantCount
public static int getConstantCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getShiftCount
public static int getShiftCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getSwitchesCount
public static int getSwitchesCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getSwapCount
public static int getSwapCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getBinaryOpCount
public static int getBinaryOpCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getCheckCastCount
public static int getCheckCastCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getThrowCount
public static int getThrowCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getConditionalBranchCount
public static int getConditionalBranchCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getConversionCount
public static int getConversionCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getDupCount
public static int getDupCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getGotoCount
public static int getGotoCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getReturnCount
public static int getReturnCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getInstanceOfCount
public static int getInstanceOfCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getLocalLoadCount
public static int getLocalLoadCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getLocalStoreCount
public static int getLocalStoreCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getNewCount
public static int getNewCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getPopCount
public static int getPopCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getUnaryOpCount
public static int getUnaryOpCount(MethodData info) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-