@eagleoutice/flowr 2.2.9 → 2.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/cli/repl/server/compact.d.ts +2 -2
- package/cli/repl/server/compact.js +3 -3
- package/cli/repl/server/messages/message-analysis.d.ts +2 -2
- package/cli/repl/server/messages/message-analysis.js +2 -2
- package/config.d.ts +9 -0
- package/config.js +8 -2
- package/dataflow/environments/default-builtin-config.js +15 -2
- package/dataflow/environments/environment.js +4 -2
- package/dataflow/extractor.d.ts +1 -1
- package/dataflow/extractor.js +8 -6
- package/dataflow/graph/edge.js +4 -1
- package/dataflow/graph/graph.d.ts +6 -0
- package/dataflow/graph/graph.js +13 -0
- package/dataflow/graph/resolve-graph.js +8 -0
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +3 -0
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +4 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +7 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +21 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +4 -2
- package/dataflow/processor.d.ts +7 -7
- package/documentation/data/server/doc-data-server-messages.js +2 -2
- package/documentation/print-interface-wiki.js +3 -0
- package/documentation/print-query-wiki.js +20 -1
- package/package.json +3 -3
- package/queries/catalog/call-context-query/call-context-query-executor.js +13 -0
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +4 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.js +38 -3
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +10 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +5 -1
- package/queries/catalog/project-query/project-query-executor.d.ts +3 -0
- package/queries/catalog/project-query/project-query-executor.js +17 -0
- package/queries/catalog/project-query/project-query-format.d.ts +67 -0
- package/queries/catalog/project-query/project-query-format.js +26 -0
- package/queries/query.d.ts +60 -1
- package/queries/query.js +3 -1
- package/slicing/static/fingerprint.js +8 -1
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +5 -16
- package/slicing/static/slicer-types.d.ts +2 -0
- package/slicing/static/static-slicer.d.ts +4 -2
- package/slicing/static/static-slicer.js +24 -18
- package/slicing/static/visiting-queue.d.ts +7 -1
- package/slicing/static/visiting-queue.js +20 -6
- package/util/version.js +1 -1
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VisitingQueue = void 0;
|
|
4
4
|
const fingerprint_1 = require("./fingerprint");
|
|
5
|
-
const static_slicer_1 = require("./static-slicer");
|
|
6
|
-
const assert_1 = require("../../util/assert");
|
|
7
5
|
class VisitingQueue {
|
|
8
6
|
threshold;
|
|
9
7
|
timesHitThreshold = 0;
|
|
10
8
|
seen = new Map();
|
|
9
|
+
seenByCache = new Set();
|
|
11
10
|
idThreshold = new Map();
|
|
12
11
|
queue = [];
|
|
12
|
+
cache = new Map();
|
|
13
13
|
// the set of potential additions holds nodes which may be added if a second edge deems them relevant (e.g., found with the `defined-by-on-call` edge)
|
|
14
14
|
// additionally it holds which node id added the addition so we can separate their inclusion on the structure
|
|
15
15
|
potentialAdditions = new Map();
|
|
16
|
-
|
|
16
|
+
cachedCallTargets = new Map();
|
|
17
|
+
constructor(threshold, cache) {
|
|
17
18
|
this.threshold = threshold;
|
|
19
|
+
this.cache = cache;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Adds a node to the queue if it has not been seen before.
|
|
@@ -26,16 +28,22 @@ class VisitingQueue {
|
|
|
26
28
|
add(target, env, envFingerprint, onlyForSideEffects) {
|
|
27
29
|
const idCounter = this.idThreshold.get(target) ?? 0;
|
|
28
30
|
if (idCounter > this.threshold) {
|
|
29
|
-
static_slicer_1.slicerLogger.warn(`id: ${target} has been visited ${idCounter} times, skipping`);
|
|
30
31
|
this.timesHitThreshold++;
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
/* we do not include the in call part in the fingerprint as it is 'deterministic' from the source position */
|
|
34
35
|
const print = (0, fingerprint_1.fingerprint)(target, envFingerprint, onlyForSideEffects);
|
|
35
36
|
if (!this.seen.has(print)) {
|
|
37
|
+
const cached = this.cache?.get(print);
|
|
38
|
+
if (cached) {
|
|
39
|
+
this.seenByCache.add(target);
|
|
40
|
+
for (const id of cached) {
|
|
41
|
+
this.queue.push({ id, baseEnvironment: env, envFingerprint, onlyForSideEffects });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
36
44
|
this.idThreshold.set(target, idCounter + 1);
|
|
37
45
|
this.seen.set(print, target);
|
|
38
|
-
this.queue.push({ id: target, baseEnvironment: env, onlyForSideEffects });
|
|
46
|
+
this.queue.push({ id: target, baseEnvironment: env, envFingerprint, onlyForSideEffects });
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
next() {
|
|
@@ -47,10 +55,16 @@ class VisitingQueue {
|
|
|
47
55
|
hasId(id) {
|
|
48
56
|
return this.idThreshold.has(id);
|
|
49
57
|
}
|
|
58
|
+
memoizeCallTargets(id, targets) {
|
|
59
|
+
if (!this.cachedCallTargets.has(id)) {
|
|
60
|
+
this.cachedCallTargets.set(id, targets());
|
|
61
|
+
}
|
|
62
|
+
return this.cachedCallTargets.get(id);
|
|
63
|
+
}
|
|
50
64
|
status() {
|
|
51
65
|
return {
|
|
52
66
|
timesHitThreshold: this.timesHitThreshold,
|
|
53
|
-
result: new Set([...this.seen.values()]
|
|
67
|
+
result: new Set([...this.seen.values(), ...this.seenByCache])
|
|
54
68
|
};
|
|
55
69
|
}
|
|
56
70
|
}
|
package/util/version.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.flowrVersion = flowrVersion;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
// this is automatically replaced with the current version by release-it
|
|
6
|
-
const version = '2.2.
|
|
6
|
+
const version = '2.2.11';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|