Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.graph |
Provides graph data structures and algorithms for coloring and fixed-point
computations.
|
Modifier and Type | Field and Description |
---|---|
private DiGraph.DiGraphNode<N,E> |
CheckPathsBetweenNodes.end |
private DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> |
ControlFlowGraph.entry |
private DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> |
ControlFlowGraph.implicitReturn
A special node marked by the node value key null to a singleton
"return" when control is transferred outside of the current control flow
graph.
|
private DiGraph.DiGraphNode<N,E> |
CheckPathsBetweenNodes.start |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> |
ControlFlowAnalysis.nodePriorities |
protected java.util.Set<DiGraph.DiGraphNode<N,ControlFlowGraph.Branch>> |
DataFlowAnalysis.orderedWorkSet |
private java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> |
ControlFlowAnalysis.AstControlFlowGraph.priorities |
private java.util.Comparator<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> |
ControlFlowAnalysis.priorityComparator |
Modifier and Type | Method and Description |
---|---|
DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> |
ControlFlowGraph.getEntry()
Gets the entry point of the control flow graph.
|
private DiGraph.DiGraphNode<NameAnalyzer.JsName,NameAnalyzer.RefType> |
NameAnalyzer.getGraphNode(NameAnalyzer.JsName name) |
DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> |
ControlFlowGraph.getImplicitReturn()
Gets the implicit return node.
|
Modifier and Type | Method and Description |
---|---|
java.util.Comparator<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> |
ControlFlowAnalysis.AstControlFlowGraph.getOptionalNodeComparator(boolean isForward) |
java.util.Comparator<DiGraph.DiGraphNode<N,ControlFlowGraph.Branch>> |
ControlFlowGraph.getOptionalNodeComparator(boolean isForward)
Gets a comparator for the nodes.
|
Modifier and Type | Method and Description |
---|---|
private void |
NewTypeInference.analyzeConditionalStmFwd(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> stm,
Node cond,
TypeEnv inEnv) |
private void |
NewTypeInference.buildWorkset(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> dn,
java.util.List<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> workset) |
private void |
NewTypeInference.buildWorksetHelper(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> dn,
java.util.List<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> workset,
java.util.Set<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>> seen) |
private boolean |
CheckPathsBetweenNodes.checkAllPathsWithoutBackEdges(DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b)
Verify that all non-looping paths from
a to b pass
through at least one node where nodePredicate is true. |
private boolean |
CheckPathsBetweenNodes.checkAllPathsWithoutBackEdges(DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b)
Verify that all non-looping paths from
a to b pass
through at least one node where nodePredicate is true. |
private boolean |
CheckPathsBetweenNodes.checkSomePathsWithoutBackEdges(DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b)
Verify that some non-looping paths from
a to b pass
through at least one node where nodePredicate is true. |
private boolean |
CheckPathsBetweenNodes.checkSomePathsWithoutBackEdges(DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b)
Verify that some non-looping paths from
a to b pass
through at least one node where nodePredicate is true. |
int |
NameReferenceGraphReport.DiGraphNodeComparator.compare(DiGraph.DiGraphNode<NameReferenceGraph.Name,NameReferenceGraph.Reference> node1,
DiGraph.DiGraphNode<NameReferenceGraph.Name,NameReferenceGraph.Reference> node2) |
int |
NameReferenceGraphReport.DiGraphNodeComparator.compare(DiGraph.DiGraphNode<NameReferenceGraph.Name,NameReferenceGraph.Reference> node1,
DiGraph.DiGraphNode<NameReferenceGraph.Name,NameReferenceGraph.Reference> node2) |
private void |
CheckPathsBetweenNodes.discoverBackEdges(DiGraph.DiGraphNode<N,E> u) |
protected boolean |
DataFlowAnalysis.flow(DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> node)
Performs a single flow through a node.
|
protected boolean |
DataFlowAnalysis.BranchedForwardDataFlowAnalysis.flow(DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> node) |
private void |
NameReferenceGraphReport.generateDeclarationReport(java.lang.StringBuilder builder,
DiGraph.DiGraphNode<NameReferenceGraph.Name,NameReferenceGraph.Reference> declarationNode)
Generate the HTML for describing a specific declaration.
|
private TypeEnv |
NewTypeInference.getInEnv(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> dn) |
private TypeEnv |
NewTypeInference.getOutEnv(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> dn) |
private int |
ControlFlowAnalysis.AstControlFlowGraph.getPosition(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> n)
Gets the pre-order traversal position of the given node.
|
boolean |
ControlFlowGraph.isImplicitReturn(DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> node)
Checks whether node is the implicit return.
|
protected void |
DataFlowAnalysis.joinInputs(DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> node)
Computes the new flow state at a given node's entry by merging the
output (input) lattice of the node's predecessor (successor).
|
protected void |
DataFlowAnalysis.BranchedForwardDataFlowAnalysis.joinInputs(DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> node) |
private void |
ControlFlowAnalysis.prioritizeFromEntryNode(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> entry)
Given an entry node, find all the nodes reachable from that node
and prioritize them.
|
private void |
NameAnalyzer.recordReference(DiGraph.DiGraphNode<NameAnalyzer.JsName,NameAnalyzer.RefType> from,
DiGraph.DiGraphNode<NameAnalyzer.JsName,NameAnalyzer.RefType> to,
NameAnalyzer.RefType depType)
Records a reference from one name to another name.
|
private void |
NameAnalyzer.recordReference(DiGraph.DiGraphNode<NameAnalyzer.JsName,NameAnalyzer.RefType> from,
DiGraph.DiGraphNode<NameAnalyzer.JsName,NameAnalyzer.RefType> to,
NameAnalyzer.RefType depType)
Records a reference from one name to another name.
|
private TypeEnv |
NewTypeInference.setOutEnv(DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch> dn,
TypeEnv e) |
Constructor and Description |
---|
CheckPathsBetweenNodes(DiGraph<N,E> graph,
DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b,
com.google.common.base.Predicate<N> nodePredicate,
com.google.common.base.Predicate<DiGraph.DiGraphEdge<N,E>> edgePredicate)
Inclusive check.
|
CheckPathsBetweenNodes(DiGraph<N,E> graph,
DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b,
com.google.common.base.Predicate<N> nodePredicate,
com.google.common.base.Predicate<DiGraph.DiGraphEdge<N,E>> edgePredicate)
Inclusive check.
|
CheckPathsBetweenNodes(DiGraph<N,E> graph,
DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b,
com.google.common.base.Predicate<N> nodePredicate,
com.google.common.base.Predicate<DiGraph.DiGraphEdge<N,E>> edgePredicate,
boolean inclusive)
Given a graph G with nodes A and B, this algorithm determines if all paths
from A to B contain at least one node satisfying a given predicate.
|
CheckPathsBetweenNodes(DiGraph<N,E> graph,
DiGraph.DiGraphNode<N,E> a,
DiGraph.DiGraphNode<N,E> b,
com.google.common.base.Predicate<N> nodePredicate,
com.google.common.base.Predicate<DiGraph.DiGraphEdge<N,E>> edgePredicate,
boolean inclusive)
Given a graph G with nodes A and B, this algorithm determines if all paths
from A to B contain at least one node satisfying a given predicate.
|
Constructor and Description |
---|
AstControlFlowGraph(Node entry,
java.util.Map<DiGraph.DiGraphNode<Node,ControlFlowGraph.Branch>,java.lang.Integer> priorities,
boolean edgeAnnotations)
Constructor.
|
Modifier and Type | Class and Description |
---|---|
(package private) static class |
LinkedDirectedGraph.AnnotatedLinkedDirectedGraphNode<N,E>
A directed graph node with annotations.
|
static class |
LinkedDirectedGraph.LinkedDirectedGraphNode<N,E>
A directed graph node that stores outgoing edges and incoming edges as an
list within the node itself.
|
Modifier and Type | Field and Description |
---|---|
private DiGraph.DiGraphNode<N,E> |
LinkedDirectedGraph.LinkedDirectedGraphEdge.destNode |
private DiGraph.DiGraphNode<N,E> |
LinkedDirectedGraph.LinkedDirectedGraphEdge.sourceNode |
Modifier and Type | Method and Description |
---|---|
abstract DiGraph.DiGraphNode<N,E> |
DiGraph.createDirectedGraphNode(N nodeValue) |
DiGraph.DiGraphNode<N,E> |
DiGraph.DiGraphEdge.getDestination() |
DiGraph.DiGraphNode<N,E> |
LinkedDirectedGraph.LinkedDirectedGraphEdge.getDestination() |
abstract DiGraph.DiGraphNode<N,E> |
DiGraph.getDirectedGraphNode(N nodeValue) |
DiGraph.DiGraphNode<N,E> |
LinkedDirectedGraph.getDirectedGraphNode(N nodeValue) |
DiGraph.DiGraphNode<N,E> |
DiGraph.DiGraphEdge.getSource() |
DiGraph.DiGraphNode<N,E> |
LinkedDirectedGraph.LinkedDirectedGraphEdge.getSource() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Iterable<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedGraphNodes()
Gets an immutable iterable over all the nodes in the graph.
|
java.lang.Iterable<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedGraphNodes() |
abstract java.util.List<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedPredNodes(DiGraph.DiGraphNode<N,E> n) |
java.util.List<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedPredNodes(DiGraph.DiGraphNode<N,E> dNode) |
abstract java.util.List<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedPredNodes(N nodeValue) |
java.util.List<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedPredNodes(N nodeValue) |
abstract java.util.List<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedSuccNodes(DiGraph.DiGraphNode<N,E> n) |
java.util.List<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedSuccNodes(DiGraph.DiGraphNode<N,E> dNode) |
abstract java.util.List<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedSuccNodes(N nodeValue) |
java.util.List<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedSuccNodes(N nodeValue) |
java.util.Collection<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getNodes() |
Modifier and Type | Method and Description |
---|---|
void |
LinkedDirectedGraph.connect(DiGraph.DiGraphNode<N,E> src,
E edgeValue,
DiGraph.DiGraphNode<N,E> dest)
DiGraphNode look ups can be expensive for a large graph operation, prefer this
method if you have the DiGraphNode available.
|
void |
LinkedDirectedGraph.connect(DiGraph.DiGraphNode<N,E> src,
E edgeValue,
DiGraph.DiGraphNode<N,E> dest)
DiGraphNode look ups can be expensive for a large graph operation, prefer this
method if you have the DiGraphNode available.
|
abstract java.util.List<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedPredNodes(DiGraph.DiGraphNode<N,E> n) |
java.util.List<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedPredNodes(DiGraph.DiGraphNode<N,E> dNode) |
abstract java.util.List<DiGraph.DiGraphNode<N,E>> |
DiGraph.getDirectedSuccNodes(DiGraph.DiGraphNode<N,E> n) |
java.util.List<DiGraph.DiGraphNode<N,E>> |
LinkedDirectedGraph.getDirectedSuccNodes(DiGraph.DiGraphNode<N,E> dNode) |
boolean |
LinkedDirectedGraph.isConnectedInDirection(DiGraph.DiGraphNode<N,E> dNode1,
com.google.common.base.Predicate<E> edgeMatcher,
DiGraph.DiGraphNode<N,E> dNode2)
DiGraphNode look ups can be expensive for a large graph operation, prefer this
method if you have the DiGraphNodes available.
|
boolean |
LinkedDirectedGraph.isConnectedInDirection(DiGraph.DiGraphNode<N,E> dNode1,
com.google.common.base.Predicate<E> edgeMatcher,
DiGraph.DiGraphNode<N,E> dNode2)
DiGraphNode look ups can be expensive for a large graph operation, prefer this
method if you have the DiGraphNodes available.
|
void |
DiGraph.DiGraphEdge.setDestination(DiGraph.DiGraphNode<N,E> node) |
void |
LinkedDirectedGraph.LinkedDirectedGraphEdge.setDestination(DiGraph.DiGraphNode<N,E> node) |
void |
DiGraph.DiGraphEdge.setSource(DiGraph.DiGraphNode<N,E> node) |
void |
LinkedDirectedGraph.LinkedDirectedGraphEdge.setSource(DiGraph.DiGraphNode<N,E> node) |
Constructor and Description |
---|
AnnotatedLinkedDirectedGraphEdge(DiGraph.DiGraphNode<N,E> sourceNode,
E edgeValue,
DiGraph.DiGraphNode<N,E> destNode)
Constructor.
|
AnnotatedLinkedDirectedGraphEdge(DiGraph.DiGraphNode<N,E> sourceNode,
E edgeValue,
DiGraph.DiGraphNode<N,E> destNode)
Constructor.
|
LinkedDirectedGraphEdge(DiGraph.DiGraphNode<N,E> sourceNode,
E edgeValue,
DiGraph.DiGraphNode<N,E> destNode)
Constructor.
|
LinkedDirectedGraphEdge(DiGraph.DiGraphNode<N,E> sourceNode,
E edgeValue,
DiGraph.DiGraphNode<N,E> destNode)
Constructor.
|