From 7be3336aaf3ee18dbf44f12659e8a81e4c8cc6e1 Mon Sep 17 00:00:00 2001 From: Max Schaefer Date: Mon, 4 Feb 2019 08:17:21 +0000 Subject: [PATCH] JavaScript: Document per-function caches in CFG extractor. --- .../src/com/semmle/js/extractor/CFGExtractor.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java b/javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java index eccd0aa2dd7..0b33ec730b2 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java +++ b/javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java @@ -773,13 +773,17 @@ public class CFGExtractor { public A accept(Visitor v, Q q) { return null; } } - // associate statements with their (direct or indirect) labels + // associate statements with their (direct or indirect) labels; + // per-function cache, cleared after each function private Map> loopLabels = new LinkedHashMap>(); - // cache the set of normal control flow successors + // cache the set of normal control flow successors; + // per-function cache, cleared after each function private Map followingCache = new LinkedHashMap(); - // map from a node in a chain of property accesses or calls to the successor info for the first node in the chain + // map from a node in a chain of property accesses or calls to the successor info + // for the first node in the chain; + // per-function cache, cleared after each function private Map chainRootSuccessors = new LinkedHashMap(); /**