Class ValueNumberAnalysis

    • Method Detail

      • getClassObjectValue

        public ValueNumber getClassObjectValue​(java.lang.String className)
      • setMergeTree

        public void setMergeTree​(MergeTree mergeTree)
      • getMergeTree

        public MergeTree getMergeTree()
      • getNumValuesAllocated

        public int getNumValuesAllocated()
      • isThisValue

        public boolean isThisValue​(ValueNumber value)
      • getEntryValue

        public ValueNumber getEntryValue​(int local)
        Get the value number assigned to the given local variable upon entry to the method.
        Parameters:
        local - local variable number
        Returns:
        ValueNumber assigned to the local variable
      • getEntryValueForParameter

        public ValueNumber getEntryValueForParameter​(int param)
        Get the value number assigned to the given parameter upon entry to the method.
        Parameters:
        param - a parameter (0 == first parameter)
        Returns:
        the ValueNumber assigned to that parameter
      • createFact

        public ValueNumberFrame 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.
      • initEntryFact

        public void initEntryFact​(ValueNumberFrame result)
        Description copied from interface: DataflowAnalysis
        Initialize the "entry" fact for the graph.
      • transfer

        public void transfer​(BasicBlock basicBlock,
                             org.apache.bcel.generic.InstructionHandle end,
                             ValueNumberFrame start,
                             ValueNumberFrame result)
                      throws DataflowAnalysisException
        Description copied from interface: DataflowAnalysis
        Transfer function for the analysis. Taking dataflow facts at start (which might be either the entry or exit of the block, depending on whether the analysis is forwards or backwards), modify result to be the facts at the other end of the block.
        Specified by:
        transfer in interface DataflowAnalysis<ValueNumberFrame>
        Overrides:
        transfer in class AbstractDataflowAnalysis<ValueNumberFrame>
        Parameters:
        basicBlock - the basic block
        end - if nonnull, stop before considering this instruction; otherwise, consider all of the instructions in the basic block
        start - dataflow facts at beginning of block (if forward analysis) or end of block (if backwards analysis)
        result - resulting dataflow facts at other end of block
        Throws:
        DataflowAnalysisException
      • factIterator

        public java.util.Iterator<ValueNumberFrame> factIterator()
        Get an Iterator over all dataflow facts that we've recorded for the Locations in the CFG. Note that this does not include result facts (since there are no Locations corresponding to the end of basic blocks).
      • compactValueNumbers

        @Deprecated
        public void compactValueNumbers​(Dataflow<ValueNumberFrame,​ValueNumberAnalysis> dataflow)
        Deprecated.

        Compact the value numbers assigned. This should be done only after the dataflow algorithm has executed. This works by modifying the actual ValueNumber objects assigned. After this method is called, the getNumValuesAllocated() method of this object will return a value less than or equal to the value it would have returned before the call to this method.

        This method should be called at most once.

        Parameters:
        dataflow - the Dataflow object which executed this analysis (and has all of the block result values)
      • getExceptionValueNumber

        private ValueNumber getExceptionValueNumber​(BasicBlock handlerBlock)
        Mark value numbers in a value number frame for compaction. private static void markFrameValues(ValueNumberFrame frame, ValueCompacter compacter) { // We don't need to do anything for top and bottom frames. if (!frame.isValid()) { return; } for (int j = 0; j < frame.getNumSlots(); ++j) { ValueNumber value = frame.getValue(j); int number = value.getNumber(); if (!compacter.isUsed(number)) { compacter.discovered[number] = compacter.allocateValue(); compacter.setUsed(number); } } }