Class LocalVariableGen

    • Constructor Detail

      • LocalVariableGen

        public LocalVariableGen​(int index,
                                java.lang.String name,
                                Type type,
                                InstructionHandle start,
                                InstructionHandle end)
        Generate a local variable that with index 'index'. Note that double and long variables need two indexs. Index indices have to be provided by the user.
        Parameters:
        index - index of local variable.
        name - its name.
        type - its type.
        start - from where the instruction is valid (null means from the start).
        end - until where the instruction is valid (null means to the end).
      • LocalVariableGen

        public LocalVariableGen​(int index,
                                java.lang.String name,
                                Type type,
                                InstructionHandle start,
                                InstructionHandle end,
                                int origIndex)
        Generates a local variable that with index 'index'. Note that double and long variables need two indexs. Index indices have to be provided by the user.
        Parameters:
        index - index of local variable.
        name - its name.
        type - its type.
        start - from where the instruction is valid (null means from the start).
        end - until where the instruction is valid (null means to the end).
        origIndex - index of local variable prior to any changes to index.
    • Method Detail

      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        We consider to local variables to be equal, if the use the same index and are valid in the same range.
        Overrides:
        equals in class java.lang.Object
      • getIndex

        public int getIndex()
        Gets the index.
        Returns:
        The index.
      • getLiveToEnd

        public boolean getLiveToEnd()
        Gets whether the variable lives to the end.
        Returns:
        true if the variable lives to the end.
      • getLocalVariable

        public LocalVariable getLocalVariable​(ConstantPoolGen cp)
        Gets LocalVariable object. This relies on that the instruction list has already been dumped to byte code or that the 'setPositions' methods has been called for the instruction list. Note that due to the conversion from byte code offset to InstructionHandle, it is impossible to tell the difference between a live range that ends BEFORE the last insturction of the method or a live range that ends AFTER the last instruction of the method. Hence the liveToEnd flag to differentiate between these two cases.
        Parameters:
        cp - constant pool.
        Returns:
        The local variable.
      • getOrigIndex

        public int getOrigIndex()
        Gets the original index.
        Returns:
        The original index.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • setEnd

        public void setEnd​(InstructionHandle end)
        Sets the end instruction handle.
        Parameters:
        end - The end instruction handle.
      • setIndex

        public void setIndex​(int index)
        Sets the index.
        Parameters:
        index - The index.
      • setLiveToEnd

        public void setLiveToEnd​(boolean liveToEnd)
        Sets whether the variable lives to the end.
        Parameters:
        liveToEnd - true if the variable lives to the end.
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: NamedAndTyped
        Sets the name.
        Specified by:
        setName in interface NamedAndTyped
        Parameters:
        name - The name.
      • setStart

        public void setStart​(InstructionHandle start)
        Sets the start instruction handle.
        Parameters:
        start - The start instruction handle.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object