Escape "<" and ">" in Javadoc when not used as HTML tag syntax
This commit is contained in:
parent
d29e278291
commit
f60c164ec1
|
@ -2438,7 +2438,7 @@ public abstract class JDTJava2CAstTranslator<T extends Position> {
|
||||||
/**
|
/**
|
||||||
* Expands the form: for ( [final] Type var: iterable ) { ... } Into something equivalent to: for ( Iterator iter =
|
* Expands the form: for ( [final] Type var: iterable ) { ... } Into something equivalent to: for ( Iterator iter =
|
||||||
* iterable.iter(); iter.hasNext(); ) { [final] Type var = (Type) iter.next(); ... } Or, in the case of an array: for ( int idx =
|
* iterable.iter(); iter.hasNext(); ) { [final] Type var = (Type) iter.next(); ... } Or, in the case of an array: for ( int idx =
|
||||||
* 0; i < iterable.length; i++ ) { [final] Type var = iterable[idx]; ... } Except that the expression "iterable" is only evaluate
|
* 0; i < iterable.length; i++ ) { [final] Type var = iterable[idx]; ... } Except that the expression "iterable" is only evaluate
|
||||||
* once (or is it?)
|
* once (or is it?)
|
||||||
*
|
*
|
||||||
* @param n
|
* @param n
|
||||||
|
|
|
@ -22,7 +22,7 @@ import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||||
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
|
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class NodejsRequireJsonTest {
|
public class NodejsRequireJsonTest {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||||
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
|
import com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class NodejsRequireTargetSelectorResolveTest {
|
public class NodejsRequireTargetSelectorResolveTest {
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ import com.ibm.wala.ssa.IRFactory;
|
||||||
import com.ibm.wala.util.WalaException;
|
import com.ibm.wala.util.WalaException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class NodejsCallGraphBuilderUtil extends JSCallGraphUtil {
|
public class NodejsCallGraphBuilderUtil extends JSCallGraphUtil {
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ import com.ibm.wala.util.ssa.ClassLookupException;
|
||||||
* This class is used by WALA internals to resolve to what functions a call
|
* This class is used by WALA internals to resolve to what functions a call
|
||||||
* could potentially invoke.
|
* could potentially invoke.
|
||||||
*
|
*
|
||||||
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class NodejsRequireTargetSelector implements MethodTargetSelector {
|
public class NodejsRequireTargetSelector implements MethodTargetSelector {
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ public class NodejsRequireTargetSelector implements MethodTargetSelector {
|
||||||
* 1. let PARTS = path split(START)
|
* 1. let PARTS = path split(START)
|
||||||
* 2. let I = count of PARTS - 1
|
* 2. let I = count of PARTS - 1
|
||||||
* 3. let DIRS = []
|
* 3. let DIRS = []
|
||||||
* 4. while I >= 0,
|
* 4. while I >= 0,
|
||||||
* a. if PARTS[I] = "node_modules" CONTINUE
|
* a. if PARTS[I] = "node_modules" CONTINUE
|
||||||
* b. DIR = path join(PARTS[0 .. I] + "node_modules")
|
* b. DIR = path join(PARTS[0 .. I] + "node_modules")
|
||||||
* c. DIRS = DIRS + DIR
|
* c. DIRS = DIRS + DIR
|
||||||
|
|
|
@ -24,7 +24,7 @@ import com.ibm.wala.util.collections.HashSetFactory;
|
||||||
import com.ibm.wala.util.io.TemporaryFile;
|
import com.ibm.wala.util.io.TemporaryFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class NodejsRequiredCoreModule extends NodejsRequiredSourceModule {
|
public class NodejsRequiredCoreModule extends NodejsRequiredSourceModule {
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import com.ibm.wala.util.io.Streams;
|
||||||
* environment. The resulting function will be named GLOBAL_PREFIX + relative
|
* environment. The resulting function will be named GLOBAL_PREFIX + relative
|
||||||
* file-name. To retrieve the final function name, use getFunctioName().
|
* file-name. To retrieve the final function name, use getFunctioName().
|
||||||
*
|
*
|
||||||
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
* @author Brian Pfretzschner <brian.pfretzschner@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class NodejsRequiredSourceModule extends SourceFileModule {
|
public class NodejsRequiredSourceModule extends SourceFileModule {
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,12 @@ public class NotDetectable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This example does not work: We know 5 > 3 and sometimes length > 5 > 3. In
|
* This example does not work: We know 5 > 3 and sometimes length > 5 > 3. In
|
||||||
* case of variables this conditional relation is resolved by introducing pi
|
* case of variables this conditional relation is resolved by introducing pi
|
||||||
* nodes. For constants pi nodes can be generated, but the pi variables will
|
* nodes. For constants pi nodes can be generated, but the pi variables will
|
||||||
* not be used (maybe due to constant propagation?). Additionally 5 != 3, so
|
* not be used (maybe due to constant propagation?). Additionally 5 != 3, so
|
||||||
* even if we would use pi-variables for 5, there would be no relation to 3: 0
|
* even if we would use pi-variables for 5, there would be no relation to 3: 0
|
||||||
* -(5)-> 5, 5 -(-5)-> 0, {5,length} -(0)-> 5', 0 -(3)-> 3, 3 -(-3)-> 0 Given
|
* -(5)-> 5, 5 -(-5)-> 0, {5,length} -(0)-> 5', 0 -(3)-> 3, 3 -(-3)-> 0 Given
|
||||||
* the inequality graph above, we know that 5,5',3 are larger than 0 and 5
|
* the inequality graph above, we know that 5,5',3 are larger than 0 and 5
|
||||||
* larger 3 and length is larger than 5', but not 5' larger than 3. Which is
|
* larger 3 and length is larger than 5', but not 5' larger than 3. Which is
|
||||||
* not always the case in general anyway.
|
* not always the case in general anyway.
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class ContextSensitiveReachingDefs {
|
||||||
* balanced since a definition in a callee used as a seed for the analysis may then reach a caller, yielding a "return" without a
|
* balanced since a definition in a callee used as a seed for the analysis may then reach a caller, yielding a "return" without a
|
||||||
* corresponding "call." An alternative to this approach, used in the Reps-Horwitz-Sagiv POPL95 paper, would be to "lift" the
|
* corresponding "call." An alternative to this approach, used in the Reps-Horwitz-Sagiv POPL95 paper, would be to "lift" the
|
||||||
* domain of putstatic instructions with a 0 (bottom) element, have a 0->0 transition in all transfer functions, and then seed the
|
* domain of putstatic instructions with a 0 (bottom) element, have a 0->0 transition in all transfer functions, and then seed the
|
||||||
* analysis with the path edge (main_entry, 0) -> (main_entry, 0). We choose the partially-balanced approach to avoid pollution of
|
* analysis with the path edge (main_entry, 0) -> (main_entry, 0). We choose the partially-balanced approach to avoid pollution of
|
||||||
* the flow functions.
|
* the flow functions.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -156,8 +156,8 @@ public class ArrayBoundsGraph extends DirectedHyperGraph<Integer> {
|
||||||
/**
|
/**
|
||||||
* Add variable as constant with value value.
|
* Add variable as constant with value value.
|
||||||
*
|
*
|
||||||
* This will create the following construct: [zero] -(value)-> [h1] -0- >
|
* This will create the following construct: [zero] -(value)-> [h1] -0- >
|
||||||
* [variable] -(-value)-> [h2] -0-> [zero].
|
* [variable] -(-value)-> [h2] -0-> [zero].
|
||||||
*
|
*
|
||||||
* The bidirectional linking, allows things like
|
* The bidirectional linking, allows things like
|
||||||
*
|
*
|
||||||
|
@ -214,8 +214,8 @@ public class ArrayBoundsGraph extends DirectedHyperGraph<Integer> {
|
||||||
* Adds var as source var. A source var is a variable, which can be used as
|
* Adds var as source var. A source var is a variable, which can be used as
|
||||||
* source for shortest path computation.
|
* source for shortest path computation.
|
||||||
*
|
*
|
||||||
* This will create the following construct: [unlimited] -> [var] -> [var]
|
* This will create the following construct: [unlimited] -> [var] -> [var]
|
||||||
* -(unlimited)-> [unlimited]
|
* -(unlimited)-> [unlimited]
|
||||||
*
|
*
|
||||||
* This is a trap door construct: if [var] is not set to 0 it will get the
|
* This is a trap door construct: if [var] is not set to 0 it will get the
|
||||||
* value unlimited, if [var] is set to 0 it will stay 0.
|
* value unlimited, if [var] is set to 0 it will stay 0.
|
||||||
|
|
|
@ -112,16 +112,16 @@ public class ArrayBoundsGraphBuilder {
|
||||||
/**
|
/**
|
||||||
* Case 1: piRestrictor restricts the pi variable for upper/ lower bounds graph
|
* Case 1: piRestrictor restricts the pi variable for upper/ lower bounds graph
|
||||||
* Given this code below, we want to create a hyper edge
|
* Given this code below, we want to create a hyper edge
|
||||||
* {piParent, piRestrictor} --> {piVar}.
|
* {piParent, piRestrictor} --> {piVar}.
|
||||||
*
|
*
|
||||||
* If is op in {<, >} we now, that the distance from piRestrictor to piVar
|
* If is op in {<, >} we now, that the distance from piRestrictor to piVar
|
||||||
* is +-1 as ( a < b ) <==> ( a <= b - 1), same with "<".
|
* is +-1 as ( a < b ) <==> ( a <= b - 1), same with "<".
|
||||||
* To be more precise we introduce a helper node and add
|
* To be more precise we introduce a helper node and add
|
||||||
* {piRestrictor} -- (-)1 --> {helper}
|
* {piRestrictor} -- (-)1 --> {helper}
|
||||||
* {piParent, helper} --> {piVar}
|
* {piParent, helper} --> {piVar}
|
||||||
*
|
*
|
||||||
* Case 2: no restriction is given by the branch (i.e. the operator is not equal)
|
* Case 2: no restriction is given by the branch (i.e. the operator is not equal)
|
||||||
* {piParent} --> {piVar}
|
* {piParent} --> {piVar}
|
||||||
*
|
*
|
||||||
* <code>if (piParent op piRestrictor) {piVar = piParent}</code>
|
* <code>if (piParent op piRestrictor) {piVar = piParent}</code>
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class ConditionNormalizer {
|
||||||
* hand side of the comparison, also if the branch is not taken, the
|
* hand side of the comparison, also if the branch is not taken, the
|
||||||
* operation needs to be negated.
|
* operation needs to be negated.
|
||||||
*
|
*
|
||||||
* p.a. the condition is !(rhs >= lhs), it will be normalized to lhs > rhs
|
* p.a. the condition is !(rhs >= lhs), it will be normalized to lhs > rhs
|
||||||
*
|
*
|
||||||
* @param cnd
|
* @param cnd
|
||||||
* condition to normalize
|
* condition to normalize
|
||||||
|
|
|
@ -11,7 +11,7 @@ import com.ibm.wala.analysis.arraybounds.hypergraph.weight.edgeweights.EdgeWeigh
|
||||||
* @author Stephan Gocht {@code <stephan@gobro.de>}
|
* @author Stephan Gocht {@code <stephan@gobro.de>}
|
||||||
*
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
* Type used in HyperNodes (HyperNode<T>)
|
* Type used in HyperNodes (HyperNode<T>)
|
||||||
*/
|
*/
|
||||||
public class DirectedHyperEdge<T> {
|
public class DirectedHyperEdge<T> {
|
||||||
/** Contains all destinations of this HyperEdge */
|
/** Contains all destinations of this HyperEdge */
|
||||||
|
|
|
@ -172,8 +172,8 @@ public class ShortestPath<T> {
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* (n1, n2)->(n3)
|
* (n1, n2)->(n3)
|
||||||
* Round 1: n1 = unset, n2 = -3 -> n3 = max(unset,-3) = -3
|
* Round 1: n1 = unset, n2 = -3 -> n3 = max(unset,-3) = -3
|
||||||
* Round 2: n1 = 1, n2 = -3 -> n3 = max(1,-3) = 1
|
* Round 2: n1 = 1, n2 = -3 -> n3 = max(1,-3) = 1
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Would we compute the minimum of n3 over all rounds, it would be -3, but 1
|
* Would we compute the minimum of n3 over all rounds, it would be -3, but 1
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Comparator;
|
||||||
import com.ibm.wala.analysis.arraybounds.hypergraph.weight.Weight.Type;
|
import com.ibm.wala.analysis.arraybounds.hypergraph.weight.Weight.Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a normal Order on Weight: unlimited < ... < -1 < 0 < 1 < ... not_set
|
* Defines a normal Order on Weight: unlimited < ... < -1 < 0 < 1 < ... not_set
|
||||||
* is not comparable
|
* is not comparable
|
||||||
*
|
*
|
||||||
* @author Stephan Gocht {@code <stephan@gobro.de>}
|
* @author Stephan Gocht {@code <stephan@gobro.de>}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Comparator;
|
||||||
import com.ibm.wala.analysis.arraybounds.hypergraph.weight.Weight.Type;
|
import com.ibm.wala.analysis.arraybounds.hypergraph.weight.Weight.Type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a reverse Order on Weight: ... > 1 > 0 > -1 > ... > unlimited not_set
|
* Defines a reverse Order on Weight: ... > 1 > 0 > -1 > ... > unlimited not_set
|
||||||
* is not comparable
|
* is not comparable
|
||||||
*
|
*
|
||||||
* @author Stephan Gocht {@code <stephan@gobro.de>}
|
* @author Stephan Gocht {@code <stephan@gobro.de>}
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class CloneInterpreter implements SSAContextInterpreter {
|
||||||
private final static int NEW_PC = 0;
|
private final static int NEW_PC = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping from TypeReference -> IR TODO: Soft references?
|
* Mapping from TypeReference -> IR TODO: Soft references?
|
||||||
*/
|
*/
|
||||||
final private Map<TypeReference, IR> IRCache = HashMapFactory.make();
|
final private Map<TypeReference, IR> IRCache = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ import com.ibm.wala.util.warnings.Warnings;
|
||||||
public class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
public class FactoryBypassInterpreter extends AbstractReflectionInterpreter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Map from CallerSiteContext -> Set <TypeReference>represents the types a factory method might create in a particular context
|
* A Map from CallerSiteContext -> Set <TypeReference>represents the types a factory method might create in a particular context
|
||||||
*/
|
*/
|
||||||
private final Map<Context, Set<TypeReference>> map = HashMapFactory.make();
|
private final Map<Context, Set<TypeReference>> map = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public interface IBasicBlock<InstType> extends INodeWithNumber, Iterable<InstTyp
|
||||||
* is an index into the instruction array that contains all the instructions
|
* is an index into the instruction array that contains all the instructions
|
||||||
* for the method.
|
* for the method.
|
||||||
*
|
*
|
||||||
* If the result is < 0, the block has no instructions
|
* If the result is < 0, the block has no instructions
|
||||||
*
|
*
|
||||||
* @return the instruction index for the first instruction in the basic block.
|
* @return the instruction index for the first instruction in the basic block.
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +35,7 @@ public interface IBasicBlock<InstType> extends INodeWithNumber, Iterable<InstTyp
|
||||||
* is an index into the instruction array that contains all the instructions
|
* is an index into the instruction array that contains all the instructions
|
||||||
* for the method.
|
* for the method.
|
||||||
*
|
*
|
||||||
* If the result is < 0, the block has no instructions
|
* If the result is < 0, the block has no instructions
|
||||||
*
|
*
|
||||||
* @return the instruction index for the last instruction in the basic block
|
* @return the instruction index for the last instruction in the basic block
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class InducedCFG extends AbstractCFG<SSAInstruction, InducedCFG.BasicBloc
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A partial map from Instruction -> BasicBlock
|
* A partial map from Instruction -> BasicBlock
|
||||||
*/
|
*/
|
||||||
private final BasicBlock[] i2block;
|
private final BasicBlock[] i2block;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
|
||||||
* control flow from a CFG. This is done by detecting exceptions that may always
|
* control flow from a CFG. This is done by detecting exceptions that may always
|
||||||
* (or never) appear.
|
* (or never) appear.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface ExceptionPruningAnalysis<I, T extends IBasicBlock<I>> {
|
public interface ExceptionPruningAnalysis<I, T extends IBasicBlock<I>> {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import com.ibm.wala.ipa.callgraph.CGNode;
|
||||||
/**
|
/**
|
||||||
* Interface to retrieve the result of the interprocedural analysis.
|
* Interface to retrieve the result of the interprocedural analysis.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*/
|
*/
|
||||||
public interface InterprocAnalysisResult<I, T extends IBasicBlock<I>> {
|
public interface InterprocAnalysisResult<I, T extends IBasicBlock<I>> {
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
|
||||||
* Tries to detect impossible (or always appearing) NullPointerExceptions and removes impossible
|
* Tries to detect impossible (or always appearing) NullPointerExceptions and removes impossible
|
||||||
* control flow from the CFG.
|
* control flow from the CFG.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class NullPointerAnalysis {
|
public final class NullPointerAnalysis {
|
||||||
|
|
|
@ -27,8 +27,8 @@ import com.ibm.wala.ssa.analysis.IExplodedBasicBlock;
|
||||||
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
||||||
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
||||||
*
|
*
|
||||||
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*/
|
*/
|
||||||
public final class AnalysisUtil {
|
public final class AnalysisUtil {
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
|
||||||
* This class combines two MethodState objects. A MethodState decides if a given method call may throw an exception.
|
* This class combines two MethodState objects. A MethodState decides if a given method call may throw an exception.
|
||||||
* If the primary MethodState thinks that the call may throw an exception, the fallback MethodState is asked.
|
* If the primary MethodState thinks that the call may throw an exception, the fallback MethodState is asked.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DelegatingMethodState extends MethodState {
|
class DelegatingMethodState extends MethodState {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.ibm.wala.ssa.analysis.IExplodedBasicBlock;
|
||||||
/**
|
/**
|
||||||
* A wrapper for the interprocedural analysis result.
|
* A wrapper for the interprocedural analysis result.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class InterprocAnalysisResultWrapper implements InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> {
|
class InterprocAnalysisResultWrapper implements InterprocAnalysisResult<SSAInstruction, IExplodedBasicBlock> {
|
||||||
|
|
|
@ -24,8 +24,8 @@ import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
|
||||||
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
||||||
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
||||||
*
|
*
|
||||||
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class InterprocMethodState extends MethodState {
|
class InterprocMethodState extends MethodState {
|
||||||
|
|
|
@ -54,8 +54,8 @@ import com.ibm.wala.util.strings.Atom;
|
||||||
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
||||||
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
||||||
*
|
*
|
||||||
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class InterprocNullPointerAnalysis {
|
public final class InterprocNullPointerAnalysis {
|
||||||
|
@ -230,7 +230,7 @@ public final class InterprocNullPointerAnalysis {
|
||||||
/**
|
/**
|
||||||
* Filter for CallGraphs
|
* Filter for CallGraphs
|
||||||
*
|
*
|
||||||
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static class CallGraphFilter {
|
private static class CallGraphFilter {
|
||||||
|
|
|
@ -31,8 +31,8 @@ import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
|
||||||
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
* This class has been developed as part of a student project "Studienarbeit" by Markus Herhoffer.
|
||||||
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
* It has been adapted and integrated into the WALA project by Juergen Graf.
|
||||||
*
|
*
|
||||||
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
* @author Markus Herhoffer <markus.herhoffer@student.kit.edu>
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
final class IntraprocAnalysisState implements ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> {
|
final class IntraprocAnalysisState implements ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> {
|
||||||
|
|
|
@ -27,7 +27,7 @@ import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException;
|
||||||
/**
|
/**
|
||||||
* Intraprocedural null pointer analysis for the exploded control flow graph.
|
* Intraprocedural null pointer analysis for the exploded control flow graph.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ExplodedCFGNullPointerAnalysis implements ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> {
|
public class ExplodedCFGNullPointerAnalysis implements ExceptionPruningAnalysis<SSAInstruction, IExplodedBasicBlock> {
|
||||||
|
|
|
@ -57,7 +57,7 @@ import com.ibm.wala.util.graph.impl.SparseNumberedGraph;
|
||||||
/**
|
/**
|
||||||
* Intraprocedural dataflow analysis to detect impossible NullPointerExceptions.
|
* Intraprocedural dataflow analysis to detect impossible NullPointerExceptions.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IntraprocNullPointerAnalysis<T extends ISSABasicBlock> {
|
public class IntraprocNullPointerAnalysis<T extends ISSABasicBlock> {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
|
||||||
* Provides a way for the nullpointer analysis to decide whether or not a called method
|
* Provides a way for the nullpointer analysis to decide whether or not a called method
|
||||||
* may throw an exception.
|
* may throw an exception.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class MethodState {
|
public abstract class MethodState {
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.ibm.wala.util.intset.IntSet;
|
||||||
/**
|
/**
|
||||||
* A modifiable control flow graph.
|
* A modifiable control flow graph.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MutableCFG<X, T extends IBasicBlock<X>> extends SparseNumberedGraph<T> implements ControlFlowGraph<X, T> {
|
public class MutableCFG<X, T extends IBasicBlock<X>> extends SparseNumberedGraph<T> implements ControlFlowGraph<X, T> {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import com.ibm.wala.util.graph.Graph;
|
||||||
* An EdgeFilter that ignores all edges contained in a given graph. This ca be used
|
* An EdgeFilter that ignores all edges contained in a given graph. This ca be used
|
||||||
* to subtract a subgraph from its main graph.
|
* to subtract a subgraph from its main graph.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NegativeGraphFilter<T extends IBasicBlock<?>> implements EdgeFilter<T> {
|
public class NegativeGraphFilter<T extends IBasicBlock<?>> implements EdgeFilter<T> {
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.ibm.wala.util.intset.IntPair;
|
||||||
* functions are not distribute (similar to constant propagation). Therefore we remove
|
* functions are not distribute (similar to constant propagation). Therefore we remove
|
||||||
* back edges in the flow graph.
|
* back edges in the flow graph.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NullPointerFrameWork<T extends ISSABasicBlock> implements IKilldallFramework<T, NullPointerState> {
|
public class NullPointerFrameWork<T extends ISSABasicBlock> implements IKilldallFramework<T, NullPointerState> {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import com.ibm.wala.ssa.ISSABasicBlock;
|
||||||
/**
|
/**
|
||||||
* Intraprocedural dataflow analysis to detect impossible NullPointerExceptions.
|
* Intraprocedural dataflow analysis to detect impossible NullPointerExceptions.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NullPointerSolver<B extends ISSABasicBlock> extends DataflowSolver<B, NullPointerState> {
|
public class NullPointerSolver<B extends ISSABasicBlock> extends DataflowSolver<B, NullPointerState> {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import com.ibm.wala.ssa.SymbolTable;
|
||||||
/**
|
/**
|
||||||
* States for the ssa variables.
|
* States for the ssa variables.
|
||||||
*
|
*
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NullPointerState extends AbstractVariable<NullPointerState> {
|
public class NullPointerState extends AbstractVariable<NullPointerState> {
|
||||||
|
@ -76,7 +76,7 @@ public class NullPointerState extends AbstractVariable<NullPointerState> {
|
||||||
* <pre>
|
* <pre>
|
||||||
* v3 = phi v1, v2
|
* v3 = phi v1, v2
|
||||||
* ^ := Meet-operator
|
* ^ := Meet-operator
|
||||||
* f := phiValueMeetFunction(3, {1, 2}) = v1,v2,v3 -> v1,v2,[v1 ^ v2]
|
* f := phiValueMeetFunction(3, {1, 2}) = v1,v2,v3 -> v1,v2,[v1 ^ v2]
|
||||||
*
|
*
|
||||||
* f(1,?,?) ^ f(?,1,?) = 1,?,? ^ ?,1,? = 1,1,?
|
* f(1,?,?) ^ f(?,1,?) = 1,?,? ^ ?,1,? = 1,1,?
|
||||||
*
|
*
|
||||||
|
@ -134,7 +134,7 @@ public class NullPointerState extends AbstractVariable<NullPointerState> {
|
||||||
* <pre>
|
* <pre>
|
||||||
* ? == unknown, 1 == not null, 0 == null, * == both
|
* ? == unknown, 1 == not null, 0 == null, * == both
|
||||||
*
|
*
|
||||||
* meet | ? | 0 | 1 | * | <- rhs
|
* meet | ? | 0 | 1 | * | <- rhs
|
||||||
* -----|---|---|---|---|
|
* -----|---|---|---|---|
|
||||||
* ? | ? | 0 | 1 | * |
|
* ? | ? | 0 | 1 | * |
|
||||||
* -----|---|---|---|---|
|
* -----|---|---|---|---|
|
||||||
|
|
|
@ -51,7 +51,7 @@ import com.ibm.wala.ssa.analysis.IExplodedBasicBlock;
|
||||||
import com.ibm.wala.util.collections.Iterator2Iterable;
|
import com.ibm.wala.util.collections.Iterator2Iterable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Juergen Graf <graf@kit.edu>
|
* @author Juergen Graf <graf@kit.edu>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class NullPointerTransferFunctionProvider<T extends ISSABasicBlock> implements ITransferFunctionProvider<T, NullPointerState> {
|
class NullPointerTransferFunctionProvider<T extends ISSABasicBlock> implements ITransferFunctionProvider<T, NullPointerState> {
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class ArrayClassLoader {
|
||||||
private final static boolean DEBUG = false;
|
private final static boolean DEBUG = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* map: TypeReference -> ArrayClass
|
* map: TypeReference -> ArrayClass
|
||||||
*/
|
*/
|
||||||
final private HashMap<TypeReference, ArrayClass> arrayClasses = HashMapFactory.make();
|
final private HashMap<TypeReference, ArrayClass> arrayClasses = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ public interface IClassLoader {
|
||||||
/**
|
/**
|
||||||
* blow away references to any classes in the set
|
* blow away references to any classes in the set
|
||||||
*
|
*
|
||||||
* @param toRemove Collection<IClass>
|
* @param toRemove Collection<IClass>
|
||||||
*/
|
*/
|
||||||
public abstract void removeAll(Collection<IClass> toRemove);
|
public abstract void removeAll(Collection<IClass> toRemove);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ import com.ibm.wala.util.warnings.Warnings;
|
||||||
/**
|
/**
|
||||||
* Read in a jar file from an input stream. Most parts are copied from the NestedJarFileModule class
|
* Read in a jar file from an input stream. Most parts are copied from the NestedJarFileModule class
|
||||||
* and adapted to work with an input stream.
|
* and adapted to work with an input stream.
|
||||||
* @author Juergen Graf <juergen.graf@gmail.com>
|
* @author Juergen Graf <juergen.graf@gmail.com>
|
||||||
*/
|
*/
|
||||||
public class JarStreamModule extends JarInputStream implements Module {
|
public class JarStreamModule extends JarInputStream implements Module {
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,11 @@ import com.ibm.wala.util.intset.SparseIntSet;
|
||||||
public class CallFlowEdges {
|
public class CallFlowEdges {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from integer -> (IBinaryNonNegativeIntRelation)
|
* A map from integer -> (IBinaryNonNegativeIntRelation)
|
||||||
*
|
*
|
||||||
* For a fact d2, edges[d2] gives a relation R=(c,d1) s.t. (<c, d1> -> <s_p,d2>) was recorded as a call flow edge.
|
* For a fact d2, edges[d2] gives a relation R=(c,d1) s.t. (<c, d1> -> <s_p,d2>) was recorded as a call flow edge.
|
||||||
*
|
*
|
||||||
* Note that we handle paths of the form <c, d1> -> <s_p,d1> specially, below.
|
* Note that we handle paths of the form <c, d1> -> <s_p,d1> specially, below.
|
||||||
*
|
*
|
||||||
* TODO: more representation optimization. A special representation for triples? sparse representations for CFG? exploit shorts
|
* TODO: more representation optimization. A special representation for triples? sparse representations for CFG? exploit shorts
|
||||||
* for ints?
|
* for ints?
|
||||||
|
@ -37,9 +37,9 @@ public class CallFlowEdges {
|
||||||
private final SparseVector<IBinaryNaturalRelation> edges = new SparseVector<>(1, 1.1f);
|
private final SparseVector<IBinaryNaturalRelation> edges = new SparseVector<>(1, 1.1f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a map from integer d1 -> int set.
|
* a map from integer d1 -> int set.
|
||||||
*
|
*
|
||||||
* for fact d1, identityPaths[d1] gives the set of block numbers C s.t. for c \in C, <c, d1> -> <s_p, d1> is an edge.
|
* for fact d1, identityPaths[d1] gives the set of block numbers C s.t. for c \in C, <c, d1> -> <s_p, d1> is an edge.
|
||||||
*/
|
*/
|
||||||
private final SparseVector<IntSet> identityEdges = new SparseVector<>(1, 1.1f);
|
private final SparseVector<IntSet> identityEdges = new SparseVector<>(1, 1.1f);
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class CallFlowEdges {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record that we've discovered a call edge <c,d1> -> <s_p, d2>
|
* Record that we've discovered a call edge <c,d1> -> <s_p, d2>
|
||||||
*
|
*
|
||||||
* @param c global number identifying the call site node
|
* @param c global number identifying the call site node
|
||||||
* @param d1 source fact at the call edge
|
* @param d1 source fact at the call edge
|
||||||
|
|
|
@ -33,11 +33,11 @@ public class LocalPathEdges {
|
||||||
private final static boolean PARANOID = false;
|
private final static boolean PARANOID = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from integer (d2) -> (IBinaryNonNegativeIntRelation)
|
* A map from integer (d2) -> (IBinaryNonNegativeIntRelation)
|
||||||
*
|
*
|
||||||
* For fact d2, paths[d2] gives a relation R=(n,d1) s.t. (<s_p, d1> -> <n,d2>) is a path edge.
|
* For fact d2, paths[d2] gives a relation R=(n,d1) s.t. (<s_p, d1> -> <n,d2>) is a path edge.
|
||||||
*
|
*
|
||||||
* Note that we handle paths of the form <s_p, d1> -> <n,d1> specially, below. We also handle paths of the form <s_p, 0> -> <n,
|
* Note that we handle paths of the form <s_p, d1> -> <n,d1> specially, below. We also handle paths of the form <s_p, 0> -> <n,
|
||||||
* d1> specially below.
|
* d1> specially below.
|
||||||
*
|
*
|
||||||
* We choose this somewhat convoluted representation for the following reasons: 1) of the (n, d1, d2) tuple-space, we expect the
|
* We choose this somewhat convoluted representation for the following reasons: 1) of the (n, d1, d2) tuple-space, we expect the
|
||||||
|
@ -58,9 +58,9 @@ public class LocalPathEdges {
|
||||||
* space or time of the non-merging IFDS solver, for which the original paths representation works well. Is there a better data
|
* space or time of the non-merging IFDS solver, for which the original paths representation works well. Is there a better data
|
||||||
* structure tradeoff?
|
* structure tradeoff?
|
||||||
*
|
*
|
||||||
* A map from integer (d1) -> (IBinaryNonNegativeIntRelation)
|
* A map from integer (d1) -> (IBinaryNonNegativeIntRelation)
|
||||||
*
|
*
|
||||||
* For fact d1, paths[d1] gives a relation R=(n,d2) s.t. (<s_p, d1> -> <n,d2>) is a path edge.
|
* For fact d1, paths[d1] gives a relation R=(n,d2) s.t. (<s_p, d1> -> <n,d2>) is a path edge.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* We choose this somewhat convoluted representation for the following reasons: 1) of the (n, d1, d2) tuple-space, we expect the
|
* We choose this somewhat convoluted representation for the following reasons: 1) of the (n, d1, d2) tuple-space, we expect the
|
||||||
|
@ -71,16 +71,16 @@ public class LocalPathEdges {
|
||||||
private final SparseVector<IBinaryNaturalRelation> altPaths;
|
private final SparseVector<IBinaryNaturalRelation> altPaths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a map from integer d1 -> int set.
|
* a map from integer d1 -> int set.
|
||||||
*
|
*
|
||||||
* for fact d1, identityPaths[d1] gives the set of block numbers N s.t. for n \in N, <s_p, d1> -> <n, d1> is a path edge.
|
* for fact d1, identityPaths[d1] gives the set of block numbers N s.t. for n \in N, <s_p, d1> -> <n, d1> is a path edge.
|
||||||
*/
|
*/
|
||||||
private final SparseVector<IntSet> identityPaths = new SparseVector<>(1, 1.1f);
|
private final SparseVector<IntSet> identityPaths = new SparseVector<>(1, 1.1f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a map from integer d2 -> int set
|
* a map from integer d2 -> int set
|
||||||
*
|
*
|
||||||
* for fact d2, zeroPaths[d2] gives the set of block numbers N s.t. for n \in N, <s_p, 0> -> <n, d2> is a path edge.
|
* for fact d2, zeroPaths[d2] gives the set of block numbers N s.t. for n \in N, <s_p, 0> -> <n, d2> is a path edge.
|
||||||
*/
|
*/
|
||||||
private final SparseVector<IntSet> zeroPaths = new SparseVector<>(1, 1.1f);
|
private final SparseVector<IntSet> zeroPaths = new SparseVector<>(1, 1.1f);
|
||||||
|
|
||||||
|
@ -193,8 +193,8 @@ public class LocalPathEdges {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* N.B: If we're using the ZERO_PATH_SHORT_CIRCUIT, then we may have <s_p, d1> -> <n, d2> implicitly represented since we also
|
* N.B: If we're using the ZERO_PATH_SHORT_CIRCUIT, then we may have <s_p, d1> -> <n, d2> implicitly represented since we also
|
||||||
* have <s_p, 0> -> <n,d2>. However, getInverse() <b> will NOT </b> return these implicit d1 bits in the result. This translates
|
* have <s_p, 0> -> <n,d2>. However, getInverse() <b> will NOT </b> return these implicit d1 bits in the result. This translates
|
||||||
* to saying that the caller had better not care about any other d1 other than d1==0 if d1==0 is present. This happens to be true
|
* to saying that the caller had better not care about any other d1 other than d1==0 if d1==0 is present. This happens to be true
|
||||||
* in the single use of getInverse() in the tabulation solver, which uses getInverse() to propagate flow from an exit node back to
|
* in the single use of getInverse() in the tabulation solver, which uses getInverse() to propagate flow from an exit node back to
|
||||||
* the caller's return site(s). Since we know that we will see flow from fact 0 to the return sites(s), we don't care about other
|
* the caller's return site(s). Since we know that we will see flow from fact 0 to the return sites(s), we don't care about other
|
||||||
|
|
|
@ -25,10 +25,10 @@ import com.ibm.wala.util.math.LongUtil;
|
||||||
public class LocalSummaryEdges {
|
public class LocalSummaryEdges {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from integer n -> (IBinaryNonNegativeIntRelation)
|
* A map from integer n -> (IBinaryNonNegativeIntRelation)
|
||||||
*
|
*
|
||||||
* Let s_p be an entry to this procedure, and x be an exit. n is a integer which uniquely identifies an (s_p,x) relation. For any
|
* Let s_p be an entry to this procedure, and x be an exit. n is a integer which uniquely identifies an (s_p,x) relation. For any
|
||||||
* such n, summaries[n] gives a relation R=(d1,d2) s.t. (<s_p, d1> -> <x,d2>) is a summary edge.
|
* such n, summaries[n] gives a relation R=(d1,d2) s.t. (<s_p, d1> -> <x,d2>) is a summary edge.
|
||||||
*
|
*
|
||||||
* Note that this representation is a little different from the representation described in the PoPL 95 paper. We cache summary
|
* Note that this representation is a little different from the representation described in the PoPL 95 paper. We cache summary
|
||||||
* edges at the CALLEE, not at the CALLER!!! This allows us to avoid eagerly installing summary edges at all call sites to a
|
* edges at the CALLEE, not at the CALLER!!! This allows us to avoid eagerly installing summary edges at all call sites to a
|
||||||
|
@ -61,7 +61,7 @@ public class LocalSummaryEdges {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record a summary edge for the flow d1 -> d2 from an entry s_p to an exit x.
|
* Record a summary edge for the flow d1 -> d2 from an entry s_p to an exit x.
|
||||||
*
|
*
|
||||||
* @param s_p local block number an entry
|
* @param s_p local block number an entry
|
||||||
* @param x local block number of an exit block
|
* @param x local block number of an exit block
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class PartiallyBalancedTabulationSolver<T, P, F> extends TabulationSolver
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A path edge <s_p, i> -> <n, j> was propagated, and <s_p, i> was an unbalanced seed.
|
* A path edge <s_p, i> -> <n, j> was propagated, and <s_p, i> was an unbalanced seed.
|
||||||
* So, we added a new seed callerSeed (to some return site) in the caller. To be overridden
|
* So, we added a new seed callerSeed (to some return site) in the caller. To be overridden
|
||||||
* in subclasses.
|
* in subclasses.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,7 +12,7 @@ package com.ibm.wala.dataflow.IFDS;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* an individual edge <entry, d1> -> <target, d2>
|
* an individual edge <entry, d1> -> <target, d2>
|
||||||
*
|
*
|
||||||
* @param <T> node type in the supergraph
|
* @param <T> node type in the supergraph
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,7 +13,7 @@ package com.ibm.wala.dataflow.IFDS;
|
||||||
import com.ibm.wala.util.intset.SparseIntSet;
|
import com.ibm.wala.util.intset.SparseIntSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A flow function which has only the edge 0 -> dest
|
* A flow function which has only the edge 0 -> dest
|
||||||
*/
|
*/
|
||||||
public class SingletonFlowFunction implements IReversibleFlowFunction {
|
public class SingletonFlowFunction implements IReversibleFlowFunction {
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Collection;
|
||||||
import com.ibm.wala.util.intset.IntSet;
|
import com.ibm.wala.util.intset.IntSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The solution of a tabulation problem: a mapping from supergraph node -> bit vector representing the dataflow facts that hold at
|
* The solution of a tabulation problem: a mapping from supergraph node -> bit vector representing the dataflow facts that hold at
|
||||||
* the entry to the supergraph node.
|
* the entry to the supergraph node.
|
||||||
*
|
*
|
||||||
* @param <T> type of node in the supergraph
|
* @param <T> type of node in the supergraph
|
||||||
|
|
|
@ -110,23 +110,23 @@ public class TabulationSolver<T, P, F> {
|
||||||
private final TabulationProblem<T, P, F> problem;
|
private final TabulationProblem<T, P, F> problem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from Object (entry node in supergraph) -> LocalPathEdges.
|
* A map from Object (entry node in supergraph) -> LocalPathEdges.
|
||||||
*
|
*
|
||||||
* Logically, this represents a set of edges (s_p,d_i) -> (n, d_j). The data structure is chosen to attempt to save space over
|
* Logically, this represents a set of edges (s_p,d_i) -> (n, d_j). The data structure is chosen to attempt to save space over
|
||||||
* representing each edge explicitly.
|
* representing each edge explicitly.
|
||||||
*/
|
*/
|
||||||
final private Map<T, LocalPathEdges> pathEdges = HashMapFactory.make();
|
final private Map<T, LocalPathEdges> pathEdges = HashMapFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from Object (entry node in supergraph) -> CallFlowEdges.
|
* A map from Object (entry node in supergraph) -> CallFlowEdges.
|
||||||
*
|
*
|
||||||
* Logically, this represents a set of edges (c,d_i) -> (s_p, d_j). The data structure is chosen to attempt to save space over
|
* Logically, this represents a set of edges (c,d_i) -> (s_p, d_j). The data structure is chosen to attempt to save space over
|
||||||
* representing each edge explicitly.
|
* representing each edge explicitly.
|
||||||
*/
|
*/
|
||||||
final private Map<T, CallFlowEdges> callFlowEdges = HashMapFactory.make();
|
final private Map<T, CallFlowEdges> callFlowEdges = HashMapFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from Object (procedure) -> LocalSummaryEdges.
|
* A map from Object (procedure) -> LocalSummaryEdges.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
final protected Map<P, LocalSummaryEdges> summaryEdges = HashMapFactory.make();
|
final protected Map<P, LocalSummaryEdges> summaryEdges = HashMapFactory.make();
|
||||||
|
@ -754,7 +754,7 @@ public class TabulationSolver<T, P, F> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Propagate the fact <s_p,i> -> <n, j> has arisen as a path edge. Returns <code>true</code> iff the path edge was not previously
|
* Propagate the fact <s_p,i> -> <n, j> has arisen as a path edge. Returns <code>true</code> iff the path edge was not previously
|
||||||
* observed.
|
* observed.
|
||||||
*
|
*
|
||||||
* @param s_p entry block
|
* @param s_p entry block
|
||||||
|
@ -791,10 +791,10 @@ public class TabulationSolver<T, P, F> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merging: suppose we're doing propagate <s_p,i> -> <n,j> but we already have path edges <s_p,i> -> <n, x>, <s_p,i> -> <n,y>, and
|
* Merging: suppose we're doing propagate <s_p,i> -> <n,j> but we already have path edges <s_p,i> -> <n, x>, <s_p,i> -> <n,y>, and
|
||||||
* <s_p,i> -><n, z>.
|
* <s_p,i> -><n, z>.
|
||||||
*
|
*
|
||||||
* let \alpha be the merge function. then instead of <s_p,i> -> <n,j>, we propagate <s_p,i> -> <n, \alpha(j,x,y,z) > !!!
|
* let \alpha be the merge function. then instead of <s_p,i> -> <n,j>, we propagate <s_p,i> -> <n, \alpha(j,x,y,z) > !!!
|
||||||
*
|
*
|
||||||
* return -1 if no fact should be propagated
|
* return -1 if no fact should be propagated
|
||||||
*/
|
*/
|
||||||
|
@ -1042,9 +1042,9 @@ public class TabulationSolver<T, P, F> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that due to a path edge <s_p, d1> -> <n, d2> (the 'edge'
|
* Indicates that due to a path edge <s_p, d1> -> <n, d2> (the 'edge'
|
||||||
* parameter) and a normal flow function application, a new path edge <s_p,
|
* parameter) and a normal flow function application, a new path edge <s_p,
|
||||||
* d1> -> <m, d3> was created. To be overridden in subclasses. We also use
|
* d1> -> <m, d3> was created. To be overridden in subclasses. We also use
|
||||||
* this function to record call-to-return flow.
|
* this function to record call-to-return flow.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -1054,9 +1054,9 @@ public class TabulationSolver<T, P, F> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that due to a path edge 'edge' <s_p, d1> -> <n, d2> and
|
* Indicates that due to a path edge 'edge' <s_p, d1> -> <n, d2> and
|
||||||
* application of a call flow function, a new path edge <calleeEntry, d3> ->
|
* application of a call flow function, a new path edge <calleeEntry, d3> ->
|
||||||
* <calleeEntry, d3> was created. To be overridden in subclasses.
|
* <calleeEntry, d3> was created. To be overridden in subclasses.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -1066,10 +1066,10 @@ public class TabulationSolver<T, P, F> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Combines [25] and [26-28]. In the caller we have a path edge
|
* Combines [25] and [26-28]. In the caller we have a path edge
|
||||||
* 'edgeToCallSite' <s_c, d3> -> <c, d4>, where c is the call site. In the
|
* 'edgeToCallSite' <s_c, d3> -> <c, d4>, where c is the call site. In the
|
||||||
* callee, we have path edge 'calleeSummaryEdge' <s_p, d1> -> <e_p, d2>. Of
|
* callee, we have path edge 'calleeSummaryEdge' <s_p, d1> -> <e_p, d2>. Of
|
||||||
* course, there is a call edge <c, d4> -> <s_p, d1>. Finally, we have a
|
* course, there is a call edge <c, d4> -> <s_p, d1>. Finally, we have a
|
||||||
* return edge <e_p, d2> -> <returnSite, d5>.
|
* return edge <e_p, d2> -> <returnSite, d5>.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
protected void newSummaryEdge(PathEdge<T> edgeToCallSite, PathEdge<T> calleeSummaryEdge, T returnSite, int d5) {
|
protected void newSummaryEdge(PathEdge<T> edgeToCallSite, PathEdge<T> calleeSummaryEdge, T returnSite, int d5) {
|
||||||
|
|
|
@ -114,7 +114,7 @@ public abstract class AbstractFlowGraph extends SlowSparseNumberedLabeledGraph<O
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: LocalPointerKey -> SSAInvokeInstruction. If we have (x, foo()), that means that x was def'fed by the return value from the
|
* Map: LocalPointerKey -> SSAInvokeInstruction. If we have (x, foo()), that means that x was def'fed by the return value from the
|
||||||
* call to foo()
|
* call to foo()
|
||||||
*/
|
*/
|
||||||
protected final Map<PointerKey, SSAAbstractInvokeInstruction> callDefs = HashMapFactory.make();
|
protected final Map<PointerKey, SSAAbstractInvokeInstruction> callDefs = HashMapFactory.make();
|
||||||
|
@ -127,7 +127,7 @@ public abstract class AbstractFlowGraph extends SlowSparseNumberedLabeledGraph<O
|
||||||
protected final Map<PointerKey, Set<SSAAbstractInvokeInstruction>> callParams = HashMapFactory.make();
|
protected final Map<PointerKey, Set<SSAAbstractInvokeInstruction>> callParams = HashMapFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: LocalPointerKey -> CGNode. If we have (x, foo), then x is a parameter of method foo. For now, we have to re-discover the
|
* Map: LocalPointerKey -> CGNode. If we have (x, foo), then x is a parameter of method foo. For now, we have to re-discover the
|
||||||
* parameter position. TODO this should just be a set; we can get the CGNode from the {@link LocalPointerKey}
|
* parameter position. TODO this should just be a set; we can get the CGNode from the {@link LocalPointerKey}
|
||||||
*/
|
*/
|
||||||
protected final Map<PointerKey, CGNode> params = HashMapFactory.make();
|
protected final Map<PointerKey, CGNode> params = HashMapFactory.make();
|
||||||
|
|
|
@ -81,13 +81,13 @@ import com.ibm.wala.util.ref.ReferenceCleanser;
|
||||||
*
|
*
|
||||||
* The edges represent
|
* The edges represent
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>flow from local -> local representing assignment (i.e. phi,pi)
|
* <li>flow from local -> local representing assignment (i.e. phi,pi)
|
||||||
* <li>flow from instancekey -> local for news
|
* <li>flow from instancekey -> local for news
|
||||||
* <li>flow from formal -> actual parameter
|
* <li>flow from formal -> actual parameter
|
||||||
* <li>flow from return value -> local
|
* <li>flow from return value -> local
|
||||||
* <li>match edges
|
* <li>match edges
|
||||||
* <li>local -> local edges representing loads/stores (e.g. x = y.f will have a edge x->y, labelled with f) for a getstatic x = Y.f,
|
* <li>local -> local edges representing loads/stores (e.g. x = y.f will have a edge x->y, labelled with f) for a getstatic x = Y.f,
|
||||||
* we have an edge from x -> Y.f.
|
* we have an edge from x -> Y.f.
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* N.B: Edges go OPPOSITE the flow of values.
|
* N.B: Edges go OPPOSITE the flow of values.
|
||||||
|
@ -119,20 +119,20 @@ public class SimpleDemandPointerFlowGraph extends SlowSparseNumberedGraph<Object
|
||||||
final BitVectorIntSet cgNodesVisited = new BitVectorIntSet();
|
final BitVectorIntSet cgNodesVisited = new BitVectorIntSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: LocalPointerKey -> IField. if we have (x,f), that means x was def'fed by a getfield on f.
|
* Map: LocalPointerKey -> IField. if we have (x,f), that means x was def'fed by a getfield on f.
|
||||||
*/
|
*/
|
||||||
final Map<PointerKey, IField> getFieldDefs = HashMapFactory.make();
|
final Map<PointerKey, IField> getFieldDefs = HashMapFactory.make();
|
||||||
|
|
||||||
final Collection<PointerKey> arrayDefs = HashSetFactory.make();
|
final Collection<PointerKey> arrayDefs = HashSetFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: LocalPointerKey -> SSAInvokeInstruction. If we have (x, foo()), that means that x was def'fed by the return value from a
|
* Map: LocalPointerKey -> SSAInvokeInstruction. If we have (x, foo()), that means that x was def'fed by the return value from a
|
||||||
* call to foo()
|
* call to foo()
|
||||||
*/
|
*/
|
||||||
final Map<PointerKey, SSAInvokeInstruction> callDefs = HashMapFactory.make();
|
final Map<PointerKey, SSAInvokeInstruction> callDefs = HashMapFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: LocalPointerKey -> CGNode. If we have (x, foo), then x is a parameter of method foo. For now, we have to re-discover the
|
* Map: LocalPointerKey -> CGNode. If we have (x, foo), then x is a parameter of method foo. For now, we have to re-discover the
|
||||||
* parameter position.
|
* parameter position.
|
||||||
*/
|
*/
|
||||||
final Map<PointerKey, CGNode> params = HashMapFactory.make();
|
final Map<PointerKey, CGNode> params = HashMapFactory.make();
|
||||||
|
|
|
@ -63,12 +63,12 @@ public class SimpleMemoryAccessMap implements MemoryAccessMap {
|
||||||
private static final boolean ALWAYS_BUILD_IR = true;
|
private static final boolean ALWAYS_BUILD_IR = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: IField -> Set<MemoryAccess>
|
* Map: IField -> Set<MemoryAccess>
|
||||||
*/
|
*/
|
||||||
final private Map<IField, Set<MemoryAccess>> readMap = HashMapFactory.make();
|
final private Map<IField, Set<MemoryAccess>> readMap = HashMapFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: IField -> Set<MemoryAccess>
|
* Map: IField -> Set<MemoryAccess>
|
||||||
*/
|
*/
|
||||||
final private Map<IField, Set<MemoryAccess>> writeMap = HashMapFactory.make();
|
final private Map<IField, Set<MemoryAccess>> writeMap = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class FILiveObjectAnalysis implements ILiveObjectAnalysis {
|
||||||
private final HeapGraph<?> heapGraph;
|
private final HeapGraph<?> heapGraph;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cached map from InstanceKey -> Set<CGNode>
|
* Cached map from InstanceKey -> Set<CGNode>
|
||||||
*/
|
*/
|
||||||
final private Map<InstanceKey, Set<CGNode>> liveNodes = HashMapFactory.make();
|
final private Map<InstanceKey, Set<CGNode>> liveNodes = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ public interface ILiveObjectAnalysis {
|
||||||
* @param m method in question
|
* @param m method in question
|
||||||
* @param instructionIndex index of an instruction in SSA IR. in m. if -1, it is interpreted as a wildcard meaning "any statement"
|
* @param instructionIndex index of an instruction in SSA IR. in m. if -1, it is interpreted as a wildcard meaning "any statement"
|
||||||
* @throws WalaException
|
* @throws WalaException
|
||||||
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may be live immediately after the
|
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may be live immediately after the
|
||||||
* statement <m,instructionIndex>
|
* statement <m,instructionIndex>
|
||||||
*/
|
*/
|
||||||
public boolean mayBeLive(CGNode allocMethod, int allocPC, CGNode m, int instructionIndex) throws WalaException;
|
public boolean mayBeLive(CGNode allocMethod, int allocPC, CGNode m, int instructionIndex) throws WalaException;
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ public interface ILiveObjectAnalysis {
|
||||||
* @param m method in question
|
* @param m method in question
|
||||||
* @param instructionIndex index of an instruction in SSA IR. in m. if -1, it is interpreted as a wildcard meaning "any statement"
|
* @param instructionIndex index of an instruction in SSA IR. in m. if -1, it is interpreted as a wildcard meaning "any statement"
|
||||||
* @throws WalaException
|
* @throws WalaException
|
||||||
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may be live immediately after the
|
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may be live immediately after the
|
||||||
* statement <m,instructionIndex>
|
* statement <m,instructionIndex>
|
||||||
*/
|
*/
|
||||||
public boolean mayBeLive(InstanceKey ik, CGNode m, int instructionIndex) throws WalaException;
|
public boolean mayBeLive(InstanceKey ik, CGNode m, int instructionIndex) throws WalaException;
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ public interface ILiveObjectAnalysis {
|
||||||
* @param ik an instance key
|
* @param ik an instance key
|
||||||
* @param m method in question
|
* @param m method in question
|
||||||
* @param instructionIndices indices of instructions in SSA IR.
|
* @param instructionIndices indices of instructions in SSA IR.
|
||||||
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may be live immediately after the
|
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may be live immediately after the
|
||||||
* statement <m,instructionIndex> for any instructionIndex in the set
|
* statement <m,instructionIndex> for any instructionIndex in the set
|
||||||
*/
|
*/
|
||||||
public boolean mayBeLive(InstanceKey ik, CGNode m, IntSet instructionIndices);
|
public boolean mayBeLive(InstanceKey ik, CGNode m, IntSet instructionIndices);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public interface IMethodEscapeAnalysis {
|
||||||
* @param allocMethod a method which holds an allocation site
|
* @param allocMethod a method which holds an allocation site
|
||||||
* @param allocPC bytecode index of allocation site
|
* @param allocPC bytecode index of allocation site
|
||||||
* @param m method in question
|
* @param m method in question
|
||||||
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may escape from an activation of method m,
|
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may escape from an activation of method m,
|
||||||
* false otherwise
|
* false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean mayEscape(MethodReference allocMethod, int allocPC, MethodReference m) throws WalaException;
|
public boolean mayEscape(MethodReference allocMethod, int allocPC, MethodReference m) throws WalaException;
|
||||||
|
|
|
@ -23,7 +23,7 @@ public interface INodeEscapeAnalysis extends IMethodEscapeAnalysis {
|
||||||
* @param allocPC bytecode index of allocation site
|
* @param allocPC bytecode index of allocation site
|
||||||
* @param node method in question
|
* @param node method in question
|
||||||
* @throws WalaException
|
* @throws WalaException
|
||||||
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may escape from an activation of node m,
|
* @returns true if an object allocated at the allocation site <allocMethod,allocPC> may escape from an activation of node m,
|
||||||
* false otherwise
|
* false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean mayEscape(CGNode allocNode, int allocPC, CGNode node) throws WalaException;
|
public boolean mayEscape(CGNode allocNode, int allocPC, CGNode node) throws WalaException;
|
||||||
|
|
|
@ -16,7 +16,7 @@ package com.ibm.wala.ipa.callgraph;
|
||||||
* For example, for CFA-1, there is only one name ("caller"); and the context maps "caller" to an IMethod
|
* For example, for CFA-1, there is only one name ("caller"); and the context maps "caller" to an IMethod
|
||||||
*
|
*
|
||||||
* As another example, for CPA, there would be name for each parameter slot ("zero","one","two"), and the Context provides a mapping
|
* As another example, for CPA, there would be name for each parameter slot ("zero","one","two"), and the Context provides a mapping
|
||||||
* from this name to a set of types. eg. "one" -> {java.lang.String, java.lang.Date}
|
* from this name to a set of types. eg. "one" -> {java.lang.String, java.lang.Date}
|
||||||
*/
|
*/
|
||||||
public interface Context {
|
public interface Context {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -134,7 +134,7 @@ public class ExplicitCallGraph extends BasicCallGraph<SSAContextInterpreter> imp
|
||||||
public class ExplicitNode extends NodeImpl {
|
public class ExplicitNode extends NodeImpl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Mapping from call site program counter (int) -> Object, where Object is a CGNode if we've discovered exactly one target for
|
* A Mapping from call site program counter (int) -> Object, where Object is a CGNode if we've discovered exactly one target for
|
||||||
* the site, or an IntSet of node numbers if we've discovered more than one target for the site.
|
* the site, or an IntSet of node numbers if we've discovered more than one target for the site.
|
||||||
*/
|
*/
|
||||||
protected final SparseVector<Object> targets = new SparseVector<>();
|
protected final SparseVector<Object> targets = new SparseVector<>();
|
||||||
|
|
|
@ -31,7 +31,7 @@ import com.ibm.wala.util.intset.IntSet;
|
||||||
*
|
*
|
||||||
* @see com.ibm.wala.ipa.callgraph.impl.DelegatingContextSelector
|
* @see com.ibm.wala.ipa.callgraph.impl.DelegatingContextSelector
|
||||||
*
|
*
|
||||||
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
||||||
*/
|
*/
|
||||||
public class UnionContextSelector implements ContextSelector {
|
public class UnionContextSelector implements ContextSelector {
|
||||||
private final ContextSelector A;
|
private final ContextSelector A;
|
||||||
|
|
|
@ -188,7 +188,7 @@ public class Util {
|
||||||
/**
|
/**
|
||||||
* @return Entrypoints for a set of J2SE Main classes
|
* @return Entrypoints for a set of J2SE Main classes
|
||||||
* @throws IllegalArgumentException if classNames == null
|
* @throws IllegalArgumentException if classNames == null
|
||||||
* @throws IllegalArgumentException if (classNames != null) and (0 < classNames.length) and (classNames[0] == null)
|
* @throws IllegalArgumentException if (classNames != null) and (0 < classNames.length) and (classNames[0] == null)
|
||||||
* @throws IllegalArgumentException if classNames.length == 0
|
* @throws IllegalArgumentException if classNames.length == 0
|
||||||
*/
|
*/
|
||||||
public static Iterable<Entrypoint> makeMainEntrypoints(final ClassLoaderReference loaderRef, final IClassHierarchy cha,
|
public static Iterable<Entrypoint> makeMainEntrypoints(final ClassLoaderReference loaderRef, final IClassHierarchy cha,
|
||||||
|
|
|
@ -23,10 +23,10 @@ import com.ibm.wala.util.collections.Pair;
|
||||||
* An InstanceKey serves as the representative for an equivalence class of
|
* An InstanceKey serves as the representative for an equivalence class of
|
||||||
* objects in the heap, that can be pointed to.
|
* objects in the heap, that can be pointed to.
|
||||||
*
|
*
|
||||||
* For example, for 0-CFA, an InstanceKey would embody an <IClass>... we model
|
* For example, for 0-CFA, an InstanceKey would embody an <IClass>... we model
|
||||||
* all instances of a particular class
|
* all instances of a particular class
|
||||||
*
|
*
|
||||||
* For 0-1-CFA, an InstanceKey could be <IMethod,statement #>, representing a
|
* For 0-1-CFA, an InstanceKey could be <IMethod,statement #>, representing a
|
||||||
* particular allocation statement in a particular method.
|
* particular allocation statement in a particular method.
|
||||||
*/
|
*/
|
||||||
public interface InstanceKey extends ContextItem {
|
public interface InstanceKey extends ContextItem {
|
||||||
|
|
|
@ -14,15 +14,15 @@ package com.ibm.wala.ipa.callgraph.propagation;
|
||||||
* A PointerKey instance serves as the representative for an equivalence class
|
* A PointerKey instance serves as the representative for an equivalence class
|
||||||
* of pointers. (or more generally ...locations, if we allow primitives).
|
* of pointers. (or more generally ...locations, if we allow primitives).
|
||||||
*
|
*
|
||||||
* For example, a PointerKey for 0-CFA might be - a <CGNode,int> pair, where the
|
* For example, a PointerKey for 0-CFA might be - a <CGNode,int> pair, where the
|
||||||
* int represents an SSA value number. This PointerKey would represent all
|
* int represents an SSA value number. This PointerKey would represent all
|
||||||
* values of the pointer of a particular local variable. - a <FieldReference>,
|
* values of the pointer of a particular local variable. - a <FieldReference>,
|
||||||
* representing the set of instances of a given field in the heap, or of a
|
* representing the set of instances of a given field in the heap, or of a
|
||||||
* particular static field.
|
* particular static field.
|
||||||
*
|
*
|
||||||
* A PointerKey for 0-1-CFA, with 1-level of InstanceVar context in the Grove et
|
* A PointerKey for 0-1-CFA, with 1-level of InstanceVar context in the Grove et
|
||||||
* al. terminology, would instead of FieldReference, use a - <InstanceKey,
|
* al. terminology, would instead of FieldReference, use a - <InstanceKey,
|
||||||
* FieldReference> pair
|
* FieldReference> pair
|
||||||
*/
|
*/
|
||||||
public interface PointerKey {
|
public interface PointerKey {
|
||||||
|
|
||||||
|
|
|
@ -589,7 +589,7 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
|
||||||
* LHS U= (RHS n k)
|
* LHS U= (RHS n k)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Unary op: <lhs>:= Cast_k( <rhs>)
|
* Unary op: <lhs>:= Cast_k( <rhs>)
|
||||||
*
|
*
|
||||||
* (Again, technically a binary op -- see note for Assign)
|
* (Again, technically a binary op -- see note for Assign)
|
||||||
*
|
*
|
||||||
|
@ -803,7 +803,7 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binary op: <dummy>:= ArrayLoad( <arrayref>) Side effect: Creates new equations.
|
* Binary op: <dummy>:= ArrayLoad( <arrayref>) Side effect: Creates new equations.
|
||||||
*/
|
*/
|
||||||
public final class ArrayLoadOperator extends UnarySideEffect implements IPointerOperator {
|
public final class ArrayLoadOperator extends UnarySideEffect implements IPointerOperator {
|
||||||
protected final MutableIntSet priorInstances = rememberGetPutHistory ? IntSetUtil.make() : null;
|
protected final MutableIntSet priorInstances = rememberGetPutHistory ? IntSetUtil.make() : null;
|
||||||
|
@ -892,7 +892,7 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binary op: <dummy>:= ArrayStore( <arrayref>) Side effect: Creates new equations.
|
* Binary op: <dummy>:= ArrayStore( <arrayref>) Side effect: Creates new equations.
|
||||||
*/
|
*/
|
||||||
public final class ArrayStoreOperator extends UnarySideEffect implements IPointerOperator {
|
public final class ArrayStoreOperator extends UnarySideEffect implements IPointerOperator {
|
||||||
@Override
|
@Override
|
||||||
|
@ -976,7 +976,7 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binary op: <dummy>:= GetField( <ref>) Side effect: Creates new equations.
|
* Binary op: <dummy>:= GetField( <ref>) Side effect: Creates new equations.
|
||||||
*/
|
*/
|
||||||
public class GetFieldOperator extends UnarySideEffect implements IPointerOperator {
|
public class GetFieldOperator extends UnarySideEffect implements IPointerOperator {
|
||||||
private final IField field;
|
private final IField field;
|
||||||
|
|
|
@ -442,7 +442,7 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A graph of just the variables in the system. v1 -> v2 iff there exists equation e s.t. e uses v1 and e defs v2.
|
* A graph of just the variables in the system. v1 -> v2 iff there exists equation e s.t. e uses v1 and e defs v2.
|
||||||
*
|
*
|
||||||
* Note that this graph trickily and fragilely reuses the nodeManager from the delegateGraph, above. This will work ok as long as
|
* Note that this graph trickily and fragilely reuses the nodeManager from the delegateGraph, above. This will work ok as long as
|
||||||
* every variable is inserted in the delegateGraph.
|
* every variable is inserted in the delegateGraph.
|
||||||
|
@ -834,7 +834,7 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A graph of just the variables in the system. v1 -> v2 iff there exists an assignment equation e s.t. e uses v1 and e defs v2.
|
* A graph of just the variables in the system. v1 -> v2 iff there exists an assignment equation e s.t. e uses v1 and e defs v2.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public NumberedGraph<PointsToSetVariable> getAssignmentGraph() {
|
public NumberedGraph<PointsToSetVariable> getAssignmentGraph() {
|
||||||
|
@ -848,7 +848,7 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A graph of just the variables in the system. v1 -> v2 iff there exists an Assingnment or Filter equation e s.t. e uses v1 and e
|
* A graph of just the variables in the system. v1 -> v2 iff there exists an Assingnment or Filter equation e s.t. e uses v1 and e
|
||||||
* defs v2.
|
* defs v2.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -871,7 +871,7 @@ public class PropagationGraph implements IFixedPointSystem<PointsToSetVariable>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A graph of just the variables in the system. v1 -> v2 that are related by def-use with "interesting" operators
|
* A graph of just the variables in the system. v1 -> v2 that are related by def-use with "interesting" operators
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private abstract class FilteredConstraintGraphView extends AbstractNumberedGraph<PointsToSetVariable> {
|
private abstract class FilteredConstraintGraphView extends AbstractNumberedGraph<PointsToSetVariable> {
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class PropagationSystem extends DefaultFixedPointSolver<PointsToSetVariab
|
||||||
protected final MutableMapping<InstanceKey> instanceKeys = MutableMapping.make();
|
protected final MutableMapping<InstanceKey> instanceKeys = MutableMapping.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from IClass -> MutableSharedBitVectorIntSet The range represents the instance keys that correspond to a given class.
|
* A mapping from IClass -> MutableSharedBitVectorIntSet The range represents the instance keys that correspond to a given class.
|
||||||
* This mapping is used to filter sets based on declared types; e.g., in cast constraints
|
* This mapping is used to filter sets based on declared types; e.g., in cast constraints
|
||||||
*/
|
*/
|
||||||
final private Map<IClass, MutableIntSet> class2InstanceKey = HashMapFactory.make();
|
final private Map<IClass, MutableIntSet> class2InstanceKey = HashMapFactory.make();
|
||||||
|
@ -104,7 +104,7 @@ public class PropagationSystem extends DefaultFixedPointSolver<PointsToSetVariab
|
||||||
/**
|
/**
|
||||||
* When doing unification, we must also updated the fixed sets in unary side effects.
|
* When doing unification, we must also updated the fixed sets in unary side effects.
|
||||||
*
|
*
|
||||||
* This maintains a map from PointsToSetVariable -> Set<UnarySideEffect>
|
* This maintains a map from PointsToSetVariable -> Set<UnarySideEffect>
|
||||||
*/
|
*/
|
||||||
final private Map<PointsToSetVariable, Set<UnarySideEffect>> fixedSetMap = HashMapFactory.make();
|
final private Map<PointsToSetVariable, Set<UnarySideEffect>> fixedSetMap = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import com.ibm.wala.ipa.callgraph.ContextItem;
|
||||||
import com.ibm.wala.ipa.callgraph.ContextKey;
|
import com.ibm.wala.ipa.callgraph.ContextKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a {@link Context} which is defined by a pair consisting of <caller node, base context>.
|
* This is a {@link Context} which is defined by a pair consisting of <caller node, base context>.
|
||||||
*
|
*
|
||||||
* The base context is typically some special case; e.g., a JavaTypeContext used for reflection.
|
* The base context is typically some special case; e.g., a JavaTypeContext used for reflection.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,7 +16,7 @@ import com.ibm.wala.ipa.callgraph.ContextItem;
|
||||||
import com.ibm.wala.ipa.callgraph.ContextKey;
|
import com.ibm.wala.ipa.callgraph.ContextKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A context which is a <CGNode, CallSiteReference> pair.
|
* A context which is a <CGNode, CallSiteReference> pair.
|
||||||
*/
|
*/
|
||||||
public class CallerSiteContext extends CallerContext {
|
public class CallerSiteContext extends CallerContext {
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import com.ibm.wala.ipa.callgraph.ContextItem;
|
||||||
import com.ibm.wala.ipa.callgraph.ContextKey;
|
import com.ibm.wala.ipa.callgraph.ContextKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a context which is defined by a pair consisting of <caller node, base context>.
|
* This is a context which is defined by a pair consisting of <caller node, base context>.
|
||||||
*
|
*
|
||||||
* The base context is typically some special case; e.g., a JavaTypeContext used for reflection.
|
* The base context is typically some special case; e.g., a JavaTypeContext used for reflection.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -86,8 +86,8 @@ public class ZeroXInstanceKeys implements InstanceKeyFactory {
|
||||||
public static final int SMUSH_PRIMITIVE_HOLDERS = 8;
|
public static final int SMUSH_PRIMITIVE_HOLDERS = 8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This variant counts the N, number of allocation sites of a particular type T in each method. If N > SMUSH_LIMIT, then these N
|
* This variant counts the N, number of allocation sites of a particular type T in each method. If N > SMUSH_LIMIT, then these N
|
||||||
* allocation sites are NOT distinguished ... instead there is a single abstract allocation site for <N,T>
|
* allocation sites are NOT distinguished ... instead there is a single abstract allocation site for <N,T>
|
||||||
*
|
*
|
||||||
* Probably the best choice in many cases.
|
* Probably the best choice in many cases.
|
||||||
*/
|
*/
|
||||||
|
@ -134,7 +134,7 @@ public class ZeroXInstanceKeys implements InstanceKeyFactory {
|
||||||
final private RTAContextInterpreter contextInterpreter;
|
final private RTAContextInterpreter contextInterpreter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a Map from CGNode->Set<IClass> that should be smushed.
|
* a Map from CGNode->Set<IClass> that should be smushed.
|
||||||
*/
|
*/
|
||||||
protected final Map<CGNode, Set<IClass>> smushMap = HashMapFactory.make();
|
protected final Map<CGNode, Set<IClass>> smushMap = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -50,10 +50,10 @@ public class DelegatingExplicitCallGraph extends ExplicitCallGraph {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this implementation, super.targets is a mapping from call site ->
|
* In this implementation, super.targets is a mapping from call site ->
|
||||||
* Object, where Object is a
|
* Object, where Object is a
|
||||||
* <ul>
|
* <ul>
|
||||||
* A Mapping from call site -> Object, where Object is a
|
* A Mapping from call site -> Object, where Object is a
|
||||||
* <li>CGNode if we've discovered exactly one target for the site
|
* <li>CGNode if we've discovered exactly one target for the site
|
||||||
* <li> or an IntSet of node numbers if we've discovered more than one target
|
* <li> or an IntSet of node numbers if we've discovered more than one target
|
||||||
* for the site.
|
* for the site.
|
||||||
|
|
|
@ -63,14 +63,14 @@ public class TypeBasedHeapModel implements HeapModel {
|
||||||
private final Collection<CGNode> nodesHandled = HashSetFactory.make();
|
private final Collection<CGNode> nodesHandled = HashSetFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: <PointerKey> -> thing, where thing is a FilteredPointerKey or an InstanceKey representing a constant.
|
* Map: <PointerKey> -> thing, where thing is a FilteredPointerKey or an InstanceKey representing a constant.
|
||||||
*
|
*
|
||||||
* computed lazily
|
* computed lazily
|
||||||
*/
|
*/
|
||||||
private Map<PointerKey, Object> pKeys;
|
private Map<PointerKey, Object> pKeys;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param klasses Collection<IClass>
|
* @param klasses Collection<IClass>
|
||||||
* @throws IllegalArgumentException if cg is null
|
* @throws IllegalArgumentException if cg is null
|
||||||
*/
|
*/
|
||||||
public TypeBasedHeapModel(AnalysisOptions options, Collection<IClass> klasses, CallGraph cg) {
|
public TypeBasedHeapModel(AnalysisOptions options, Collection<IClass> klasses, CallGraph cg) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TypeBasedPointerAnalysis extends AbstractPointerAnalysis {
|
||||||
private final TypeBasedHeapModel heapModel;
|
private final TypeBasedHeapModel heapModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: IClass -> OrdinalSet
|
* Map: IClass -> OrdinalSet
|
||||||
*/
|
*/
|
||||||
private final Map<IClass, OrdinalSet<InstanceKey>> pointsTo = HashMapFactory.make();
|
private final Map<IClass, OrdinalSet<InstanceKey>> pointsTo = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
||||||
final private IClassLoader[] loaders;
|
final private IClassLoader[] loaders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from IClass -> Selector -> Set of IMethod
|
* A mapping from IClass -> Selector -> Set of IMethod
|
||||||
*/
|
*/
|
||||||
final private HashMap<IClass, Object> targetCache = HashMapFactory.make();
|
final private HashMap<IClass, Object> targetCache = HashMapFactory.make();
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
||||||
private final AnalysisScope scope;
|
private final AnalysisScope scope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from IClass (representing an interface) -> Set of IClass that implement that interface
|
* A mapping from IClass (representing an interface) -> Set of IClass that implement that interface
|
||||||
*/
|
*/
|
||||||
private final Map<IClass, Set<IClass>> implementors = HashMapFactory.make();
|
private final Map<IClass, Set<IClass>> implementors = HashMapFactory.make();
|
||||||
|
|
||||||
|
@ -645,7 +645,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number the class hierarchy tree to support efficient subclass tests. After numbering the tree, n1 is a child of n2 iff n2.left
|
* Number the class hierarchy tree to support efficient subclass tests. After numbering the tree, n1 is a child of n2 iff n2.left
|
||||||
* <= n1.left ^ n1.left <= n2.right. Described as "relative numbering" by Vitek, Horspool, and Krall, OOPSLA 97
|
* <= n1.left ^ n1.left <= n2.right. Described as "relative numbering" by Vitek, Horspool, and Krall, OOPSLA 97
|
||||||
*
|
*
|
||||||
* TODO: this implementation is recursive; un-recursify if needed
|
* TODO: this implementation is recursive; un-recursify if needed
|
||||||
*/
|
*/
|
||||||
|
@ -999,7 +999,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error
|
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error
|
||||||
*
|
*
|
||||||
* kind of ugly. a better scheme?
|
* kind of ugly. a better scheme?
|
||||||
*/
|
*/
|
||||||
|
@ -1016,7 +1016,7 @@ public class ClassHierarchy implements IClassHierarchy {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of RuntimeException
|
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of RuntimeException
|
||||||
*
|
*
|
||||||
* kind of ugly. a better scheme?
|
* kind of ugly. a better scheme?
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -144,14 +144,14 @@ public interface IClassHierarchy extends Iterable<IClass> {
|
||||||
public Collection<IClass> computeSubClasses(TypeReference type);
|
public Collection<IClass> computeSubClasses(TypeReference type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error
|
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error
|
||||||
*
|
*
|
||||||
* kind of ugly. a better scheme?
|
* kind of ugly. a better scheme?
|
||||||
*/
|
*/
|
||||||
public Collection<TypeReference> getJavaLangErrorTypes();
|
public Collection<TypeReference> getJavaLangErrorTypes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of {@link RuntimeException}
|
* Solely for optimization; return a Collection<TypeReference> representing the subclasses of {@link RuntimeException}
|
||||||
*
|
*
|
||||||
* kind of ugly. a better scheme?
|
* kind of ugly. a better scheme?
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -33,7 +33,7 @@ import com.ibm.wala.util.collections.Iterator2Iterable;
|
||||||
* Computes interprocedural field accesses for a given method.
|
* Computes interprocedural field accesses for a given method.
|
||||||
*
|
*
|
||||||
* @author Martin Seidel
|
* @author Martin Seidel
|
||||||
* @author Juergen Graf <juergen.graf@gmail.com>
|
* @author Juergen Graf <juergen.graf@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class ModRefFieldAccess {
|
public final class ModRefFieldAccess {
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class BypassMethodTargetSelector implements MethodTargetSelector {
|
||||||
static final boolean DEBUG = false;
|
static final boolean DEBUG = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method summaries collected for methods. Mapping Object -> MethodSummary where Object is either a
|
* Method summaries collected for methods. Mapping Object -> MethodSummary where Object is either a
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>MethodReference
|
* <li>MethodReference
|
||||||
* <li>TypeReference
|
* <li>TypeReference
|
||||||
|
@ -75,7 +75,7 @@ public class BypassMethodTargetSelector implements MethodTargetSelector {
|
||||||
private final ClassHierarchyMethodTargetSelector chaMethodTargetSelector;
|
private final ClassHierarchyMethodTargetSelector chaMethodTargetSelector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping from MethodReference -> SyntheticMethod We may call syntheticMethod.put(m,null) .. in which case we use containsKey()
|
* Mapping from MethodReference -> SyntheticMethod We may call syntheticMethod.put(m,null) .. in which case we use containsKey()
|
||||||
* to check for having already considered m.
|
* to check for having already considered m.
|
||||||
*/
|
*/
|
||||||
final private HashMap<MethodReference, SummarizedMethod> syntheticMethods = HashMapFactory.make();
|
final private HashMap<MethodReference, SummarizedMethod> syntheticMethods = HashMapFactory.make();
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class MethodBypass {
|
||||||
static final boolean DEBUG = false;
|
static final boolean DEBUG = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method summaries collected for methods. Mapping Object -> MethodSummary where Object is either a
|
* Method summaries collected for methods. Mapping Object -> MethodSummary where Object is either a
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>MethodReference
|
* <li>MethodReference
|
||||||
* <li>TypeReference
|
* <li>TypeReference
|
||||||
|
@ -57,7 +57,7 @@ public class MethodBypass {
|
||||||
private final IClassHierarchy cha;
|
private final IClassHierarchy cha;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping from MethodReference -> SyntheticMethod
|
* Mapping from MethodReference -> SyntheticMethod
|
||||||
*/
|
*/
|
||||||
final private HashMap<MethodReference, SummarizedMethod> syntheticMethods = HashMapFactory.make();
|
final private HashMap<MethodReference, SummarizedMethod> syntheticMethods = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class MethodSummary {
|
||||||
private ArrayList<SSAInstruction> statements;
|
private ArrayList<SSAInstruction> statements;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: value number -> constant
|
* Map: value number -> constant
|
||||||
*/
|
*/
|
||||||
private Map<Integer, ConstantValue> constantValues;
|
private Map<Integer, ConstantValue> constantValues;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.ibm.wala.util.strings.Atom;
|
||||||
* names in synthetic methods. This should not change th analysis-result but may come in handy when
|
* names in synthetic methods. This should not change th analysis-result but may come in handy when
|
||||||
* debugging.
|
* debugging.
|
||||||
*
|
*
|
||||||
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
||||||
* @since 2013-11-25
|
* @since 2013-11-25
|
||||||
*/
|
*/
|
||||||
public class SummarizedMethodWithNames extends SummarizedMethod {
|
public class SummarizedMethodWithNames extends SummarizedMethod {
|
||||||
|
|
|
@ -79,7 +79,7 @@ import com.ibm.wala.util.strings.Atom;
|
||||||
* @see com.ibm.wala.dalvik.ipa.callgraph.impl.DexFakeRootMethod
|
* @see com.ibm.wala.dalvik.ipa.callgraph.impl.DexFakeRootMethod
|
||||||
* @see com.ibm.wala.ipa.summaries.MethodSummary
|
* @see com.ibm.wala.ipa.summaries.MethodSummary
|
||||||
*
|
*
|
||||||
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
||||||
* @since 2013-09-08
|
* @since 2013-09-08
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("javadoc")
|
@SuppressWarnings("javadoc")
|
||||||
|
|
|
@ -269,7 +269,7 @@ public class XMLMethodSummaryReader implements BytecodeConstants {
|
||||||
private int nextLocal = -1;
|
private int nextLocal = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from String (variable name) -> Integer (local number)
|
* A mapping from String (variable name) -> Integer (local number)
|
||||||
*/
|
*/
|
||||||
private Map<String, Integer> symbolTable = null;
|
private Map<String, Integer> symbolTable = null;
|
||||||
|
|
||||||
|
|
|
@ -26,19 +26,19 @@ import com.ibm.wala.util.ref.CacheReference;
|
||||||
/**
|
/**
|
||||||
* A cache for auxiliary information based on an SSA representation
|
* A cache for auxiliary information based on an SSA representation
|
||||||
*
|
*
|
||||||
* A mapping from (IMethod,Context) -> SSAOptions -> SoftReference -> something
|
* A mapping from (IMethod,Context) -> SSAOptions -> SoftReference -> something
|
||||||
*
|
*
|
||||||
* This doesn't work very well ... GCs don't do such a great job with SoftReferences ... revamp it.
|
* This doesn't work very well ... GCs don't do such a great job with SoftReferences ... revamp it.
|
||||||
*/
|
*/
|
||||||
public class AuxiliaryCache implements IAuxiliaryCache {
|
public class AuxiliaryCache implements IAuxiliaryCache {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from IMethod -> SSAOptions -> SoftReference -> IR
|
* A mapping from IMethod -> SSAOptions -> SoftReference -> IR
|
||||||
*/
|
*/
|
||||||
private HashMap<Pair<IMethod, Context>, Map<SSAOptions, Object>> dictionary = HashMapFactory.make();
|
private HashMap<Pair<IMethod, Context>, Map<SSAOptions, Object>> dictionary = HashMapFactory.make();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Help out the garbage collector: clear this cache when the number of items is > RESET_THRESHOLD
|
* Help out the garbage collector: clear this cache when the number of items is > RESET_THRESHOLD
|
||||||
*/
|
*/
|
||||||
final private static int RESET_THRESHOLD = 2000;
|
final private static int RESET_THRESHOLD = 2000;
|
||||||
|
|
||||||
|
|
|
@ -28,17 +28,17 @@ public class DefUse {
|
||||||
static final boolean DEBUG = false;
|
static final boolean DEBUG = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from integer (value number) -> {@link SSAInstruction} that defines the value
|
* A mapping from integer (value number) -> {@link SSAInstruction} that defines the value
|
||||||
*/
|
*/
|
||||||
final private SSAInstruction[] defs;
|
final private SSAInstruction[] defs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from integer (value number) -> bit vector holding integers representing instructions that use the value number
|
* A mapping from integer (value number) -> bit vector holding integers representing instructions that use the value number
|
||||||
*/
|
*/
|
||||||
final private MutableIntSet[] uses;
|
final private MutableIntSet[] uses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Mapping from integer -> Instruction
|
* A Mapping from integer -> Instruction
|
||||||
*/
|
*/
|
||||||
final protected ArrayList<SSAInstruction> allInstructions = new ArrayList<>();
|
final protected ArrayList<SSAInstruction> allInstructions = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ interface IAuxiliaryCache {
|
||||||
Object find(IMethod m, Context c, SSAOptions options);
|
Object find(IMethod m, Context c, SSAOptions options);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cache new auxiliary information for an <m,options> pair
|
* cache new auxiliary information for an <m,options> pair
|
||||||
*
|
*
|
||||||
* @param m a method
|
* @param m a method
|
||||||
* @param options options governing ssa construction
|
* @param options options governing ssa construction
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class SSABuilder extends AbstractIntStackMachine {
|
||||||
final private SymbolTable symbolTable;
|
final private SymbolTable symbolTable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A logical mapping from <bcIndex, valueNumber> -> local number if null, don't build it.
|
* A logical mapping from <bcIndex, valueNumber> -> local number if null, don't build it.
|
||||||
*/
|
*/
|
||||||
private final SSA2LocalMap localMap;
|
private final SSA2LocalMap localMap;
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ public class SSABuilder extends AbstractIntStackMachine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A logical mapping from <pc, valueNumber> -> local number Note: make sure this class remains static: this persists as part of
|
* A logical mapping from <pc, valueNumber> -> local number Note: make sure this class remains static: this persists as part of
|
||||||
* the IR!!
|
* the IR!!
|
||||||
*/
|
*/
|
||||||
private static class SSA2LocalMap implements com.ibm.wala.ssa.IR.SSA2LocalMap {
|
private static class SSA2LocalMap implements com.ibm.wala.ssa.IR.SSA2LocalMap {
|
||||||
|
@ -931,7 +931,7 @@ public class SSABuilder extends AbstractIntStackMachine {
|
||||||
private final ShrikeCFG shrikeCFG;
|
private final ShrikeCFG shrikeCFG;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping Integer -> IntPair where p maps to (vn,L) iff we've started a range at pc p where value number vn corresponds to
|
* Mapping Integer -> IntPair where p maps to (vn,L) iff we've started a range at pc p where value number vn corresponds to
|
||||||
* local L
|
* local L
|
||||||
*/
|
*/
|
||||||
private final IntPair[] localStoreMap;
|
private final IntPair[] localStoreMap;
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ public class SSACFG implements ControlFlowGraph<SSAInstruction, ISSABasicBlock>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* has exceptional edge src -> dest
|
* has exceptional edge src -> dest
|
||||||
*
|
*
|
||||||
* @throws IllegalArgumentException if dest is null
|
* @throws IllegalArgumentException if dest is null
|
||||||
*/
|
*/
|
||||||
|
@ -1057,7 +1057,7 @@ public class SSACFG implements ControlFlowGraph<SSAInstruction, ISSABasicBlock>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* has normal edge src -> dest
|
* has normal edge src -> dest
|
||||||
*
|
*
|
||||||
* @throws IllegalArgumentException if dest is null
|
* @throws IllegalArgumentException if dest is null
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,7 +15,7 @@ import com.ibm.wala.ipa.callgraph.Context;
|
||||||
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
|
import com.ibm.wala.ipa.callgraph.impl.Everywhere;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from IMethod -> SSAOptions -> SoftReference -> Something
|
* A mapping from IMethod -> SSAOptions -> SoftReference -> Something
|
||||||
*
|
*
|
||||||
* This doesn't work very well ... GCs don't do such a great job with SoftReferences ... revamp it.
|
* This doesn't work very well ... GCs don't do such a great job with SoftReferences ... revamp it.
|
||||||
*/
|
*/
|
||||||
|
@ -132,21 +132,21 @@ public class SSACache {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate the cached IR for a <method,context> pair
|
* Invalidate the cached IR for a <method,context> pair
|
||||||
*/
|
*/
|
||||||
public void invalidateIR(IMethod method, Context c) {
|
public void invalidateIR(IMethod method, Context c) {
|
||||||
irCache.invalidate(method, c);
|
irCache.invalidate(method, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate the cached {@link DefUse} for a <method,context> pair
|
* Invalidate the cached {@link DefUse} for a <method,context> pair
|
||||||
*/
|
*/
|
||||||
public void invalidateDU(IMethod method, Context c) {
|
public void invalidateDU(IMethod method, Context c) {
|
||||||
duCache.invalidate(method, c);
|
duCache.invalidate(method, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate all cached information for a <method,context> pair
|
* Invalidate all cached information for a <method,context> pair
|
||||||
*/
|
*/
|
||||||
public void invalidate(IMethod method, Context c) {
|
public void invalidate(IMethod method, Context c) {
|
||||||
invalidateIR(method, c);
|
invalidateIR(method, c);
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class SymbolTable implements Cloneable {
|
||||||
final private int[] parameters;
|
final private int[] parameters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping from Constant -> value number
|
* Mapping from Constant -> value number
|
||||||
*/
|
*/
|
||||||
private HashMap<ConstantValue, Integer> constants = HashMapFactory.make(10);
|
private HashMap<ConstantValue, Integer> constants = HashMapFactory.make(10);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class SymbolTable implements Cloneable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Values. Note: this class must maintain the following invariant: values.length > nextFreeValueNumber.
|
* Values. Note: this class must maintain the following invariant: values.length > nextFreeValueNumber.
|
||||||
*/
|
*/
|
||||||
private Value[] values = new Value[5];
|
private Value[] values = new Value[5];
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class DeadAssignmentElimination {
|
||||||
private static class DeadValueSystem extends DefaultFixedPointSolver<BooleanVariable> {
|
private static class DeadValueSystem extends DefaultFixedPointSolver<BooleanVariable> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map: value number -> BooleanVariable isLive
|
* Map: value number -> BooleanVariable isLive
|
||||||
*/
|
*/
|
||||||
final private Map<Integer, BooleanVariable> vars = HashMapFactory.make();
|
final private Map<Integer, BooleanVariable> vars = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.ibm.wala.util.strings.UTF8Convert;
|
||||||
public final class Descriptor {
|
public final class Descriptor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mapping from Key -> Descriptor
|
* A mapping from Key -> Descriptor
|
||||||
*/
|
*/
|
||||||
private static final Map<Key, Descriptor> map = HashMapFactory.make();
|
private static final Map<Key, Descriptor> map = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ public final class FieldReference extends MemberReference {
|
||||||
private final static boolean DEBUG = false;
|
private final static boolean DEBUG = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to canonicalize MemberReferences a mapping from Key -> MemberReference
|
* Used to canonicalize MemberReferences a mapping from Key -> MemberReference
|
||||||
*/
|
*/
|
||||||
final private static HashMap<Key, FieldReference> dictionary = HashMapFactory.make();
|
final private static HashMap<Key, FieldReference> dictionary = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import com.ibm.wala.util.strings.Atom;
|
||||||
*/
|
*/
|
||||||
public final class MethodReference extends MemberReference {
|
public final class MethodReference extends MemberReference {
|
||||||
/**
|
/**
|
||||||
* Used to canonicalize MethodReferences a mapping from Key -> MethodReference
|
* Used to canonicalize MethodReferences a mapping from Key -> MethodReference
|
||||||
*/
|
*/
|
||||||
final private static HashMap<Key, MethodReference> dictionary = HashMapFactory.make();
|
final private static HashMap<Key, MethodReference> dictionary = HashMapFactory.make();
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public final class TypeName implements Serializable {
|
||||||
private static final long serialVersionUID = -3256390509887654326L;
|
private static final long serialVersionUID = -3256390509887654326L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* canonical mapping from TypeNameKey -> TypeName
|
* canonical mapping from TypeNameKey -> TypeName
|
||||||
*/
|
*/
|
||||||
private final static Map<TypeNameKey, TypeName> map = HashMapFactory.make();
|
private final static Map<TypeNameKey, TypeName> map = HashMapFactory.make();
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ public final class TypeName implements Serializable {
|
||||||
* 0 => class
|
* 0 => class
|
||||||
* >0 => mask of levels of array, reference, pointer
|
* >0 => mask of levels of array, reference, pointer
|
||||||
*
|
*
|
||||||
* When the mask is > 0, it represents levels of type qualifiers (in C
|
* When the mask is > 0, it represents levels of type qualifiers (in C
|
||||||
* terminology) for array, reference and pointer types. There is also a
|
* terminology) for array, reference and pointer types. There is also a
|
||||||
* special mask for when the innermost type is a primitive. The mask is
|
* special mask for when the innermost type is a primitive. The mask is
|
||||||
* a bitfield laid out in inverse dimension order.
|
* a bitfield laid out in inverse dimension order.
|
||||||
|
|
|
@ -579,9 +579,9 @@ public final class TypeReference implements Serializable {
|
||||||
* TypeReferences are canonical. However, note that two TypeReferences can be non-equal, yet still represent the same
|
* TypeReferences are canonical. However, note that two TypeReferences can be non-equal, yet still represent the same
|
||||||
* IClass.
|
* IClass.
|
||||||
*
|
*
|
||||||
* For example, the there can be two TypeReferences <Application,java.lang.Object> and <Primordial,java.lang.Object>.
|
|
||||||
* These two TypeReference are <bf>NOT</bf> equal(), but they both represent the IClass which is named
|
* These two TypeReference are <bf>NOT</bf> equal(), but they both represent the IClass which is named
|
||||||
* <Primordial,java.lang.Object>
|
* For example, the there can be two TypeReferences <Application,java.lang.Object> and <Primordial,java.lang.Object>.
|
||||||
|
* <Primordial,java.lang.Object>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public final boolean equals(Object other) {
|
public final boolean equals(Object other) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import com.ibm.wala.shrikeCT.InvalidClassFileException;
|
||||||
* Under construction.
|
* Under construction.
|
||||||
*
|
*
|
||||||
* ClassSignature:
|
* ClassSignature:
|
||||||
* (<FormalTypeParameter+>)? SuperclassSignature SuperinterfaceSignature*
|
* (<FormalTypeParameter+>)? SuperclassSignature SuperinterfaceSignature*
|
||||||
*
|
*
|
||||||
* SuperclassSignature:
|
* SuperclassSignature:
|
||||||
* ClassTypeSignature
|
* ClassTypeSignature
|
||||||
|
|
|
@ -28,7 +28,7 @@ import com.ibm.wala.types.TypeReference;
|
||||||
* Identifier TypeArguments?
|
* Identifier TypeArguments?
|
||||||
*
|
*
|
||||||
* TypeArguments:
|
* TypeArguments:
|
||||||
* <TypeArguments+>
|
* <TypeArguments+>
|
||||||
*
|
*
|
||||||
* @author sjfink
|
* @author sjfink
|
||||||
*
|
*
|
||||||
|
|
|
@ -54,7 +54,7 @@ import com.ibm.wala.types.TypeReference;
|
||||||
*
|
*
|
||||||
* This Class does not consider Boxing / Unboxing
|
* This Class does not consider Boxing / Unboxing
|
||||||
*
|
*
|
||||||
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
||||||
* @since 2013-11-21
|
* @since 2013-11-21
|
||||||
*/
|
*/
|
||||||
public class PrimitiveAssignability {
|
public class PrimitiveAssignability {
|
||||||
|
|
|
@ -243,7 +243,7 @@ public class BytecodeStream implements BytecodeConstants {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the offset of the branch (as a signed short) Used for if<cond>, ificmp<cond>, ifacmp<cond>, goto, jsr
|
* Returns the offset of the branch (as a signed short) Used for if<cond>, ificmp<cond>, ifacmp<cond>, goto, jsr
|
||||||
*
|
*
|
||||||
* @return branch offset
|
* @return branch offset
|
||||||
* @see #getWideBranchOffset()
|
* @see #getWideBranchOffset()
|
||||||
|
|
|
@ -51,7 +51,7 @@ package com.ibm.wala.util.ssa;
|
||||||
* In typical cases this should not be propergated out from the utility
|
* In typical cases this should not be propergated out from the utility
|
||||||
* classes.
|
* classes.
|
||||||
*
|
*
|
||||||
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
||||||
*/
|
*/
|
||||||
public class ClassLookupException extends RuntimeException {
|
public class ClassLookupException extends RuntimeException {
|
||||||
private static final long serialVersionUID = 7551139209041666026L;
|
private static final long serialVersionUID = 7551139209041666026L;
|
||||||
|
|
|
@ -52,7 +52,7 @@ import com.ibm.wala.types.TypeReference;
|
||||||
*
|
*
|
||||||
* This mainly applies to the connectThrough-Function.
|
* This mainly applies to the connectThrough-Function.
|
||||||
*
|
*
|
||||||
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
* @author Tobias Blaschke <code@tobiasblaschke.de>
|
||||||
*/
|
*/
|
||||||
public interface IInstantiator {
|
public interface IInstantiator {
|
||||||
/**
|
/**
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue