arkanalyzer 1.0.19 → 1.0.20
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/lib/Scene.d.ts +11 -5
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +74 -29
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +3 -1
- package/lib/core/common/DummyMainCreater.d.ts +4 -0
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +63 -44
- package/lib/core/dataflow/GenericDataFlow.d.ts +143 -0
- package/lib/core/dataflow/GenericDataFlow.d.ts.map +1 -0
- package/lib/core/dataflow/GenericDataFlow.js +109 -0
- package/lib/core/dataflow/ReachingDef.d.ts +63 -0
- package/lib/core/dataflow/ReachingDef.d.ts.map +1 -0
- package/lib/core/dataflow/ReachingDef.js +168 -0
- package/lib/core/graph/BaseExplicitGraph.d.ts +3 -8
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseImplicitGraph.d.ts +78 -0
- package/lib/core/graph/BaseImplicitGraph.d.ts.map +1 -0
- package/lib/core/graph/BaseImplicitGraph.js +78 -0
- package/lib/core/graph/GraphTraits.d.ts +8 -0
- package/lib/core/graph/GraphTraits.d.ts.map +1 -0
- package/lib/core/graph/GraphTraits.js +16 -0
- package/lib/core/graph/Scc.d.ts +3 -2
- package/lib/core/graph/Scc.d.ts.map +1 -1
- package/lib/core/graph/Scc.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/save/GraphPrinter.d.ts +4 -3
- package/lib/save/GraphPrinter.d.ts.map +1 -1
- package/lib/utils/SparseBitVector.d.ts +1 -1
- package/lib/utils/SparseBitVector.d.ts.map +1 -1
- package/lib/utils/SparseBitVector.js +11 -10
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparseBitVector.d.ts","sourceRoot":"","sources":["../../src/utils/SparseBitVector.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,MAAM,IAAI,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"SparseBitVector.d.ts","sourceRoot":"","sources":["../../src/utils/SparseBitVector.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,MAAM,IAAI,GAAG,WAAW,CAAC;AAG/B,cAAM,sBAAsB;IACxB,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,IAAI,CAAO;gBAEP,WAAW,GAAE,MAAqB;IAM9C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIzB,KAAK,IAAI,IAAI;IAIb,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAGD,OAAO,IAAI,OAAO;IAKlB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMzB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAKzB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO3B,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAO7B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAUrC,KAAK,IAAI,MAAM;IASf,SAAS,IAAI,MAAM;IAUnB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAuBhC,MAAM,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO;IAW5C,SAAS,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO;IAajD,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO;IAarD,YAAY,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO;IAiBlD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAUjC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAgB/B,MAAM,IAAI,OAAO;IAUjB,OAAO,CAAC,kBAAkB;CAwB7B;AAED,qBAAa,eAAe;IACxB,OAAO,CAAC,YAAY,CAAS;IAG7B,OAAO,CAAC,QAAQ,CAAkD;gBAEtD,YAAY,GAAE,MAAqB;IAI/C,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAE/C;IAGD,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAWzB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAO7B,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAUnC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAY3B,KAAK,IAAI,IAAI;IAKb,KAAK,IAAI,eAAe;IAaxB,SAAS,IAAI,MAAM;IAYnB,KAAK,IAAI,MAAM;IASf,OAAO,IAAI,OAAO;IAIlB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC;IAsC7C;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO;IAkBrC;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO;IAwBxC;;;OAGG;IACH,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO;IAoC5C;;;;OAIG;IACH,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO;IA2B3C,QAAQ,IAAI,MAAM;CAIrB"}
|
|
@@ -15,18 +15,19 @@
|
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.SparseBitVector = void 0;
|
|
18
|
-
const BITWORD_SIZE =
|
|
18
|
+
const BITWORD_SIZE = 16; // bits of a Word
|
|
19
|
+
const DEFAULT_SIZE = 64;
|
|
19
20
|
class SparseBitVectorElement {
|
|
20
|
-
constructor(elementSize =
|
|
21
|
+
constructor(elementSize = DEFAULT_SIZE) {
|
|
21
22
|
this.ELEMENT_SIZE = elementSize;
|
|
22
23
|
this.BITWORDS_NUM = Math.ceil(this.ELEMENT_SIZE / BITWORD_SIZE);
|
|
23
|
-
this.bits = new
|
|
24
|
+
this.bits = new Uint16Array(this.BITWORDS_NUM);
|
|
24
25
|
}
|
|
25
26
|
word(idx) {
|
|
26
27
|
return this.bits[idx];
|
|
27
28
|
}
|
|
28
29
|
clone() {
|
|
29
|
-
return new
|
|
30
|
+
return new Uint16Array(this.bits);
|
|
30
31
|
}
|
|
31
32
|
get elementSize() {
|
|
32
33
|
return this.ELEMENT_SIZE;
|
|
@@ -42,7 +43,7 @@ class SparseBitVectorElement {
|
|
|
42
43
|
set(bitIdx) {
|
|
43
44
|
const wordIndex = Math.floor(bitIdx / BITWORD_SIZE);
|
|
44
45
|
const bitOffset = bitIdx % BITWORD_SIZE;
|
|
45
|
-
this.bits[wordIndex] |=
|
|
46
|
+
this.bits[wordIndex] |= 1 << bitOffset;
|
|
46
47
|
}
|
|
47
48
|
setWord(word) {
|
|
48
49
|
this.bits = word;
|
|
@@ -71,7 +72,7 @@ class SparseBitVectorElement {
|
|
|
71
72
|
// Count the number of set bits in this element
|
|
72
73
|
count() {
|
|
73
74
|
let numBits = 0;
|
|
74
|
-
this.bits.forEach(word => {
|
|
75
|
+
this.bits.forEach((word) => {
|
|
75
76
|
numBits += this.countBits(word);
|
|
76
77
|
});
|
|
77
78
|
return numBits;
|
|
@@ -169,7 +170,7 @@ class SparseBitVectorElement {
|
|
|
169
170
|
// Step 2: Group bits into 4-bit chunks and add
|
|
170
171
|
v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
|
|
171
172
|
// Step 3: Group bits into 8-bit chunks and add
|
|
172
|
-
v = (v + (v >> 4)) &
|
|
173
|
+
v = (v + (v >> 4)) & 0xf0f0f0f;
|
|
173
174
|
// Step 4: Multiply by a magic number to sum all 8-bit chunks into the highest byte
|
|
174
175
|
v = (v * 0x1010101) >> 24;
|
|
175
176
|
return v;
|
|
@@ -205,7 +206,7 @@ class SparseBitVectorElement {
|
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
class SparseBitVector {
|
|
208
|
-
constructor(elementsSize =
|
|
209
|
+
constructor(elementsSize = DEFAULT_SIZE) {
|
|
209
210
|
// Unordered storage of elements.
|
|
210
211
|
// key is actually the element index (normally it is in element)
|
|
211
212
|
this.elements = new Map();
|
|
@@ -404,7 +405,7 @@ class SparseBitVector {
|
|
|
404
405
|
}
|
|
405
406
|
}
|
|
406
407
|
if (needDeleteIdx.size > 0) {
|
|
407
|
-
needDeleteIdx.forEach(idx => this.elements.delete(idx));
|
|
408
|
+
needDeleteIdx.forEach((idx) => this.elements.delete(idx));
|
|
408
409
|
changed = true;
|
|
409
410
|
}
|
|
410
411
|
return changed;
|
|
@@ -430,7 +431,7 @@ class SparseBitVector {
|
|
|
430
431
|
}
|
|
431
432
|
}
|
|
432
433
|
if (needDeleteIdx.size > 0) {
|
|
433
|
-
needDeleteIdx.forEach(idx => this.elements.delete(idx));
|
|
434
|
+
needDeleteIdx.forEach((idx) => this.elements.delete(idx));
|
|
434
435
|
changed = true;
|
|
435
436
|
}
|
|
436
437
|
return changed;
|