Skip to content

Commit 7be3336

Browse files
author
Max Schaefer
committed
JavaScript: Document per-function caches in CFG extractor.
1 parent 6ad45b2 commit 7be3336

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,13 +773,17 @@ public Finally(SourceLocation loc, BlockStatement body) {
773773
public <Q, A> A accept(Visitor<Q, A> v, Q q) { return null; }
774774
}
775775

776-
// associate statements with their (direct or indirect) labels
776+
// associate statements with their (direct or indirect) labels;
777+
// per-function cache, cleared after each function
777778
private Map<Statement, Set<String>> loopLabels = new LinkedHashMap<Statement, Set<String>>();
778779

779-
// cache the set of normal control flow successors
780+
// cache the set of normal control flow successors;
781+
// per-function cache, cleared after each function
780782
private Map<Node, Object> followingCache = new LinkedHashMap<Node, Object>();
781783

782-
// map from a node in a chain of property accesses or calls to the successor info for the first node in the chain
784+
// map from a node in a chain of property accesses or calls to the successor info
785+
// for the first node in the chain;
786+
// per-function cache, cleared after each function
783787
private Map<Chainable, SuccessorInfo> chainRootSuccessors = new LinkedHashMap<Chainable, SuccessorInfo>();
784788

785789
/**

0 commit comments

Comments
 (0)