Class LockAnalysis
java.lang.Object
- All Implemented Interfaces:
DataflowAnalysis<LockSet>
Analysis to determine where particular values are locked in a method. The
dataflow values are maps of value numbers to the number of times those values
are locked.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate final booleanprivate final booleanprivate final org.apache.bcel.generic.MethodGenprivate final ValueNumberAnalysisprivate final ValueNumberDataflow -
Constructor Summary
ConstructorsConstructorDescriptionLockAnalysis(org.apache.bcel.generic.MethodGen methodGen, ValueNumberDataflow vnaDataflow, DepthFirstSearch dfs) -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy dataflow facts.Create empty (uninitialized) dataflow facts for one program point.voidinitEntryFact(LockSet result) Initialize the "entry" fact for the graph.booleanisFactValid(LockSet fact) Determine whether the given fact is valid (neither top nor bottom).booleanIs the given fact the top value.private voidvoidmakeFactTop(LockSet fact) Make given fact the top value.voidMeet a dataflow fact associated with an incoming edge into another fact.private voidmodifyLock(ValueNumberFrame frame, LockSet fact, int delta) booleanAre given dataflow facts the same?voidtransferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, LockSet fact) Transfer function for a single instruction.Methods inherited from class ForwardDataflowAnalysis
getBlockOrder, getDepthFirstSearch, isForwardsMethods inherited from class AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transferMethods inherited from class BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIteration
-
Field Details
-
DEBUG
private static final boolean DEBUG -
methodGen
private final org.apache.bcel.generic.MethodGen methodGen -
vnaDataflow
-
vna
-
isSynchronized
private final boolean isSynchronized -
isStatic
private final boolean isStatic
-
-
Constructor Details
-
LockAnalysis
public LockAnalysis(org.apache.bcel.generic.MethodGen methodGen, ValueNumberDataflow vnaDataflow, DepthFirstSearch dfs)
-
-
Method Details
-
createFact
Description copied from interface:DataflowAnalysisCreate empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used. -
copy
Description copied from interface:DataflowAnalysisCopy dataflow facts. -
initEntryFact
Description copied from interface:DataflowAnalysisInitialize the "entry" fact for the graph. -
makeFactTop
Description copied from interface:DataflowAnalysisMake given fact the top value. -
isTop
Description copied from interface:DataflowAnalysisIs the given fact the top value. -
same
Description copied from interface:DataflowAnalysisAre given dataflow facts the same? -
meetInto
Description copied from interface:DataflowAnalysisMeet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.- Parameters:
fact- the predecessor fact (incoming edge)edge- the edge from the predecessorresult- the result fact- Throws:
DataflowAnalysisException
-
transferInstruction
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, LockSet fact) throws DataflowAnalysisException Description copied from class:AbstractDataflowAnalysisTransfer function for a single instruction.- Specified by:
transferInstructionin classAbstractDataflowAnalysis<LockSet>- Parameters:
handle- the instructionbasicBlock- the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutinesfact- which should be modified based on the instruction- Throws:
DataflowAnalysisException
-
modifyLock
private void modifyLock(ValueNumberFrame frame, LockSet fact, int delta) throws DataflowAnalysisException - Throws:
DataflowAnalysisException
-
lockOp
-
isFactValid
Description copied from class:AbstractDataflowAnalysisDetermine whether the given fact is valid (neither top nor bottom).- Specified by:
isFactValidin classAbstractDataflowAnalysis<LockSet>
-