Class LiveVarStore

  • All Implemented Interfaces:
    Store<LiveVarStore>

    public class LiveVarStore
    extends java.lang.Object
    implements Store<LiveVarStore>
    A live variable store contains a set of live variables represented by nodes.
    • Constructor Detail

      • LiveVarStore

        public LiveVarStore()
        Create a new LiveVarStore.
      • LiveVarStore

        public LiveVarStore​(java.util.Set<LiveVarNode> liveVarNodeSet)
        Create a new LiveVarStore.
        Parameters:
        liveVarNodeSet - the set of live variable nodes. The parameter is captured and the caller should not retain an alias.
    • Method Detail

      • putLiveVar

        public void putLiveVar​(LiveVarNode variable)
        Add the information of a live variable into the live variable set.
        Parameters:
        variable - a live variable
      • killLiveVar

        public void killLiveVar​(LiveVarNode variable)
        Remove the information of a live variable from the live variable set.
        Parameters:
        variable - a live variable
      • addUseInExpression

        public void addUseInExpression​(Node expression)
        Add the information of live variables in an expression to the live variable set.
        Parameters:
        expression - a node
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Description copied from interface: Store
        Returns true if this is equal to the given argument.
        Specified by:
        equals in interface Store<LiveVarStore>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare against this
        Returns:
        true if this is equal to the given argument
      • hashCode

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

        public LiveVarStore copy()
        Description copied from interface: Store
        Returns an exact copy of this store.
        Specified by:
        copy in interface Store<LiveVarStore>
        Returns:
        an exact copy of this store
      • leastUpperBound

        public LiveVarStore leastUpperBound​(LiveVarStore other)
        Description copied from interface: Store
        Compute the least upper bound of two stores.

        Important: This method must fulfill the following contract:

        • Does not change this.
        • Does not change other.
        • Returns a fresh object which is not aliased yet.
        • Returns an object of the same (dynamic) type as this, even if the signature is more permissive.
        • Is commutative.
        Specified by:
        leastUpperBound in interface Store<LiveVarStore>
      • canAlias

        public boolean canAlias​(JavaExpression a,
                                JavaExpression b)
        Description copied from interface: Store
        Can the objects a and b be aliases? Returns a conservative answer (i.e., returns true if not enough information is available to determine aliasing).
        Specified by:
        canAlias in interface Store<LiveVarStore>
      • visualize

        public java.lang.String visualize​(CFGVisualizer<?,​LiveVarStore,​?> viz)
        Description copied from interface: Store
        Delegate visualization responsibility to a visualizer.
        Specified by:
        visualize in interface Store<LiveVarStore>
        Parameters:
        viz - the visualizer to visualize this store
        Returns:
        the String representation of this store
      • toString

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