Skip to content

Commit a62f684

Browse files
authored
Merge pull request #2051 from MarcMil/hashsparseset
Use HashSparseSets, which do not have a linear adding cost
2 parents 4afc8cf + a765f6d commit a62f684

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/soot/toolkits/scalar/InitAnalysis.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public InitAnalysis(DirectedBodyGraph<Unit> g) {
5252

5353
@Override
5454
protected FlowSet<Local> entryInitialFlow() {
55-
return new ArraySparseSet<Local>();
55+
return new HashSparseSet<Local>();
5656
}
5757

5858
@Override
5959
protected FlowSet<Local> newInitialFlow() {
60-
FlowSet<Local> ret = new ArraySparseSet<Local>();
60+
FlowSet<Local> ret = new HashSparseSet<Local>();
6161
allLocals.copy(ret);
6262
return ret;
6363
}

src/main/java/soot/toolkits/scalar/SimpleLiveLocals.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ public SimpleLiveLocals(DirectedBodyGraph<Unit> graph) {
7777

7878
@Override
7979
public List<Local> getLiveLocalsAfter(Unit s) {
80-
// ArraySparseSet returns a unbacked list of elements!
80+
// HashSparseSet returns a unbacked list of elements!
8181
return analysis.getFlowAfter(s).toList();
8282
}
8383

8484
@Override
8585
public List<Local> getLiveLocalsBefore(Unit s) {
86-
// ArraySparseSet returns a unbacked list of elements!
86+
// HashSparseSet returns a unbacked list of elements!
8787
return analysis.getFlowBefore(s).toList();
8888
}
8989

@@ -94,7 +94,7 @@ private static class Analysis extends BackwardFlowAnalysis<Unit, FlowSet<Local>>
9494

9595
@Override
9696
protected FlowSet<Local> newInitialFlow() {
97-
return new ArraySparseSet<Local>();
97+
return new HashSparseSet<Local>();
9898
}
9999

100100
@Override

0 commit comments

Comments
 (0)