Class 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 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 interface MethodData.Results
        Parameters:
        info - the method data this annotation is attached to
        newInstructions - the instructions the method will change to
        newHandlers - the handler lists the method will change to
        newInstructionMap - 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