edu.umd.cs.findbugs.ba.vna

Class ValueNumberAnalysis

public class ValueNumberAnalysis extends FrameDataflowAnalysis<ValueNumber,ValueNumberFrame>

A dataflow analysis to track the production and flow of values in the Java stack frame. See the ValueNumber class for an explanation of what the value numbers mean, and when they can be compared.

This class is still experimental.

Author: David Hovemeyer

See Also: ValueNumber DominatorsAnalysis

Field Summary
static booleanDEBUG
Constructor Summary
ValueNumberAnalysis(MethodGen methodGen, DepthFirstSearch dfs, LoadedFieldSet loadedFieldSet, RepositoryLookupFailureCallback lookupFailureCallback)
Method Summary
voidcompactValueNumbers(Dataflow<ValueNumberFrame,ValueNumberAnalysis> dataflow)
Compact the value numbers assigned.
ValueNumberFramecreateFact()
Iterator<ValueNumberFrame>factIterator()
Get an Iterator over all dataflow facts that we've recorded for the Locations in the CFG.
ValueNumbergetClassObjectValue(String className)
ValueNumbergetEntryValue(int local)
ValueNumberFactorygetFactory()
MergeTreegetMergeTree()
intgetNumValuesAllocated()
ValueNumbergetThisValue()
voidinitEntryFact(ValueNumberFrame result)
booleanisThisValue(ValueNumber value)
static voidmain(String[] argv)
Test driver.
voidmeetInto(ValueNumberFrame fact, Edge edge, ValueNumberFrame result)
voidsetMergeTree(MergeTree mergeTree)

Field Detail

DEBUG

public static final boolean DEBUG

Constructor Detail

ValueNumberAnalysis

public ValueNumberAnalysis(MethodGen methodGen, DepthFirstSearch dfs, LoadedFieldSet loadedFieldSet, RepositoryLookupFailureCallback lookupFailureCallback)

Method Detail

compactValueNumbers

public void compactValueNumbers(Dataflow<ValueNumberFrame,ValueNumberAnalysis> dataflow)
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)

createFact

public ValueNumberFrame createFact()

factIterator

public 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).

getClassObjectValue

public ValueNumber getClassObjectValue(String className)

getEntryValue

public ValueNumber getEntryValue(int local)

getFactory

public ValueNumberFactory getFactory()

getMergeTree

public MergeTree getMergeTree()

getNumValuesAllocated

public int getNumValuesAllocated()

getThisValue

public ValueNumber getThisValue()

initEntryFact

public void initEntryFact(ValueNumberFrame result)

isThisValue

public boolean isThisValue(ValueNumber value)

main

public static void main(String[] argv)
Test driver.

meetInto

public void meetInto(ValueNumberFrame fact, Edge edge, ValueNumberFrame result)

setMergeTree

public void setMergeTree(MergeTree mergeTree)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.