Class LocalAllocator

  • All Implemented Interfaces:
    MethodData.Results

    public class LocalAllocator
    extends java.lang.Object
    implements MethodData.Results
    This method annotation parcels out fresh local variables for use as temporaries by instrumentation code. It assumes that local variables are not allocated by any other mechanism.
    • Method Detail

      • notifyUpdate

        public boolean notifyUpdate​(MethodData info,
                                    IInstruction[] newInstructions,
                                    ExceptionHandler[][] newHandlers,
                                    int[] newInstructionMap)
        This should not 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
      • allocate

        public static int allocate​(MethodData info,
                                   int count)
                            throws java.lang.IllegalArgumentException
        Allocates a new local variable of the specified type.
        Throws:
        java.lang.IllegalArgumentException
      • allocate

        public static int allocate​(MethodData info,
                                   java.lang.String type)
                            throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • allocate

        public static int allocate​(MethodData info)
                            throws java.lang.IllegalArgumentException
        Allocates a new local that will fit any type.
        Throws:
        java.lang.IllegalArgumentException