Class LiveLocalStoreAnalysis

  • All Implemented Interfaces:
    DataflowAnalysis<java.util.BitSet>, Debug

    public class LiveLocalStoreAnalysis
    extends BackwardDataflowAnalysis<java.util.BitSet>
    implements Debug
    Dataflow analysis to find live stores of locals. This is just a backward analysis to see which loads reach stores of the same local.

    This analysis also computes which stores that were killed by a subsequent store on any subsequent reachable path. (The FindDeadLocalStores detector uses this information to reduce false positives.)

    Author:
    David Hovemeyer
    • Method Detail

      • createFact

        public java.util.BitSet createFact()
        Description copied from interface: DataflowAnalysis
        Create empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used.
        Specified by:
        createFact in interface DataflowAnalysis<java.util.BitSet>
      • copy

        public void copy​(java.util.BitSet source,
                         java.util.BitSet dest)
        Description copied from interface: DataflowAnalysis
        Copy dataflow facts.
        Specified by:
        copy in interface DataflowAnalysis<java.util.BitSet>
      • makeFactTop

        public void makeFactTop​(java.util.BitSet fact)
        Description copied from interface: DataflowAnalysis
        Make given fact the top value.
        Specified by:
        makeFactTop in interface DataflowAnalysis<java.util.BitSet>
      • same

        public boolean same​(java.util.BitSet fact1,
                            java.util.BitSet fact2)
        Description copied from interface: DataflowAnalysis
        Are given dataflow facts the same?
        Specified by:
        same in interface DataflowAnalysis<java.util.BitSet>
      • meetInto

        public void meetInto​(java.util.BitSet fact,
                             Edge edge,
                             java.util.BitSet result)
                      throws DataflowAnalysisException
        Description copied from interface: DataflowAnalysis
        Meet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.
        Specified by:
        meetInto in interface DataflowAnalysis<java.util.BitSet>
        Parameters:
        fact - the predecessor fact (incoming edge)
        edge - the edge from the predecessor
        result - the result fact
        Throws:
        DataflowAnalysisException
      • factToString

        public java.lang.String factToString​(java.util.BitSet fact)
        Description copied from interface: DataflowAnalysis
        Return a String representation of given Fact. For debugging purposes.
        Specified by:
        factToString in interface DataflowAnalysis<java.util.BitSet>
        Overrides:
        factToString in class BasicAbstractDataflowAnalysis<java.util.BitSet>
        Parameters:
        fact - a dataflow fact
        Returns:
        String representation of the fact
      • isTop

        public boolean isTop​(java.util.BitSet fact)
        Return whether or not given fact is the special TOP value.
        Specified by:
        isTop in interface DataflowAnalysis<java.util.BitSet>
      • isStoreAlive

        public boolean isStoreAlive​(java.util.BitSet fact,
                                    int local)
        Return whether or not a store of given local is alive.
        Parameters:
        fact - a dataflow fact created by this analysis
        local - the local
      • killedByStore

        public boolean killedByStore​(java.util.BitSet fact,
                                     int local)
        Return whether or not a store of given local was killed by a subsequent (dominated) store.