类 TracedStack


  • public class TracedStack
    extends Stack
    This Stack saves additional information with stack elements, to keep track of their origins.

    The stack stores a given producer Value along with each Value it stores. It then generalizes a given collected Value with the producer Value of each Value it loads. The producer Value and the initial collected Value can be set. The generalized collected Value can be retrieved, either taking into account dup/swap instructions as proper instructions or ignoring them.

    • 构造器概要

      构造器 
      构造器 说明
      TracedStack​(int maxSize)
      Creates a new TracedStack with a given maximum size.
      TracedStack​(TracedStack tracedStack)
      Creates a new TracedStack that is a copy of the given TracedStack.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void clear()
      Clears the stack.
      void copy​(TracedStack other)  
      void dup()
      Duplicates the top Category 1 value.
      void dup_x1()
      Duplicates the top Category 1 value, one Category 1 element down the stack.
      void dup_x2()
      Duplicates the top Category 1 value, two Category 1 elements (or one Category 2 element) down the stack.
      void dup2()
      Duplicates the top Category 2 value (or alternatively, the equivalent Category 1 stack elements).
      void dup2_x1()
      Duplicates the top Category 2 value, one Category 1 element down the stack (or alternatively, the equivalent Category 1 stack values).
      void dup2_x2()
      Duplicates the top Category 2 value, one Category 2 stack element down the stack (or alternatively, the equivalent Category 1 stack values).
      boolean equals​(java.lang.Object object)  
      boolean generalize​(TracedStack other)  
      Value getBottomActualProducerValue​(int index)
      Gets the specified actual producer Value from the stack, ignoring dup/swap instructions, without disturbing it.
      Value getBottomProducerValue​(int index)
      Gets the specified producer Value from the stack, without disturbing it.
      Value getTopActualProducerValue​(int index)
      Gets the specified actual producer Value from the stack, ignoring dup/swap instructions, without disturbing it.
      Value getTopProducerValue​(int index)
      Gets the specified producer Value from the stack, without disturbing it.
      int hashCode()  
      Value pop()
      Pops the top Value from the stack.
      void pop1()
      Pops the top category 1 value from the stack.
      void pop2()
      Pops the top category 2 value from the stack (or alternatively, two Category 1 stack elements).
      void push​(Value value)
      Pushes the given Value onto the stack.
      void removeTop​(int index)
      Removes the specified Value from the stack.
      void reset​(int size)
      Resets this Stack, so that it can be reused.
      void setProducerValue​(Value producerValue)
      Sets the Value that will be stored along with all push and pop instructions.
      void swap()
      Swaps the top two Category 1 values.
      java.lang.String toString()  
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 构造器详细资料

      • TracedStack

        public TracedStack​(int maxSize)
        Creates a new TracedStack with a given maximum size.
      • TracedStack

        public TracedStack​(TracedStack tracedStack)
        Creates a new TracedStack that is a copy of the given TracedStack.
    • 方法详细资料

      • setProducerValue

        public void setProducerValue​(Value producerValue)
        Sets the Value that will be stored along with all push and pop instructions.
      • getBottomProducerValue

        public Value getBottomProducerValue​(int index)
        Gets the specified producer Value from the stack, without disturbing it.
        参数:
        index - the index of the stack element, counting from the bottom of the stack.
        返回:
        the producer value at the specified position.
      • getBottomActualProducerValue

        public Value getBottomActualProducerValue​(int index)
        Gets the specified actual producer Value from the stack, ignoring dup/swap instructions, without disturbing it.
        参数:
        index - the index of the stack element, counting from the bottom of the stack.
        返回:
        the producer value at the specified position.
      • getTopProducerValue

        public Value getTopProducerValue​(int index)
        Gets the specified producer Value from the stack, without disturbing it.
        参数:
        index - the index of the stack element, counting from the top of the stack.
        返回:
        the producer value at the specified position.
      • getTopActualProducerValue

        public Value getTopActualProducerValue​(int index)
        Gets the specified actual producer Value from the stack, ignoring dup/swap instructions, without disturbing it.
        参数:
        index - the index of the stack element, counting from the top of the stack.
        返回:
        the producer value at the specified position.
      • reset

        public void reset​(int size)
        从类复制的说明: Stack
        Resets this Stack, so that it can be reused.
        覆盖:
        reset 在类中 Stack
      • generalize

        public boolean generalize​(TracedStack other)
      • clear

        public void clear()
        从类复制的说明: Stack
        Clears the stack.
        覆盖:
        clear 在类中 Stack
      • removeTop

        public void removeTop​(int index)
        从类复制的说明: Stack
        Removes the specified Value from the stack.
        覆盖:
        removeTop 在类中 Stack
        参数:
        index - the index of the stack element, counting from the top of the stack.
      • push

        public void push​(Value value)
        从类复制的说明: Stack
        Pushes the given Value onto the stack.
        覆盖:
        push 在类中 Stack
      • pop

        public Value pop()
        从类复制的说明: Stack
        Pops the top Value from the stack.
        覆盖:
        pop 在类中 Stack
      • pop1

        public void pop1()
        从类复制的说明: Stack
        Pops the top category 1 value from the stack.
        覆盖:
        pop1 在类中 Stack
      • pop2

        public void pop2()
        从类复制的说明: Stack
        Pops the top category 2 value from the stack (or alternatively, two Category 1 stack elements).
        覆盖:
        pop2 在类中 Stack
      • dup

        public void dup()
        从类复制的说明: Stack
        Duplicates the top Category 1 value.
        覆盖:
        dup 在类中 Stack
      • dup_x1

        public void dup_x1()
        从类复制的说明: Stack
        Duplicates the top Category 1 value, one Category 1 element down the stack.
        覆盖:
        dup_x1 在类中 Stack
      • dup_x2

        public void dup_x2()
        从类复制的说明: Stack
        Duplicates the top Category 1 value, two Category 1 elements (or one Category 2 element) down the stack.
        覆盖:
        dup_x2 在类中 Stack
      • dup2

        public void dup2()
        从类复制的说明: Stack
        Duplicates the top Category 2 value (or alternatively, the equivalent Category 1 stack elements).
        覆盖:
        dup2 在类中 Stack
      • dup2_x1

        public void dup2_x1()
        从类复制的说明: Stack
        Duplicates the top Category 2 value, one Category 1 element down the stack (or alternatively, the equivalent Category 1 stack values).
        覆盖:
        dup2_x1 在类中 Stack
      • dup2_x2

        public void dup2_x2()
        从类复制的说明: Stack
        Duplicates the top Category 2 value, one Category 2 stack element down the stack (or alternatively, the equivalent Category 1 stack values).
        覆盖:
        dup2_x2 在类中 Stack
      • swap

        public void swap()
        从类复制的说明: Stack
        Swaps the top two Category 1 values.
        覆盖:
        swap 在类中 Stack
      • equals

        public boolean equals​(java.lang.Object object)
        覆盖:
        equals 在类中 Stack
      • hashCode

        public int hashCode()
        覆盖:
        hashCode 在类中 Stack
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 Stack