Skip to content

Commit

Permalink
fix the bug in using M-kO: fail to initialize prePTA and use PAG
Browse files Browse the repository at this point in the history
  • Loading branch information
QilinPTA committed Dec 5, 2023
1 parent 592063b commit b25487d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions qilin.pta/src/qilin/pta/tools/MahjongPTA.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package qilin.pta.tools;

import qilin.core.pag.PAG;
import qilin.parm.ctxcons.CtxConstructor;
import qilin.parm.heapabst.MahjongAbstractor;
import qilin.parm.select.CtxSelector;
Expand Down Expand Up @@ -46,6 +47,7 @@ public MahjongPTA(int k, int hk, CtxConstructor ctxCons) {
CtxSelector ds = new DebloatingSelector(csHeap);
this.ctxSel = new PipelineSelector(us, ds);
this.heapAbst = new MahjongAbstractor(pag, mergedHeap, heapModelMap);
this.prePTA = new Spark();
System.out.println("Mahjong ...");
}

Expand All @@ -55,11 +57,12 @@ protected void preAnalysis() {
prePTA.pureRun();

Mahjong.run(prePTA, heapModelMap);
PAG prePAG = prePTA.getPag();
heapModelMap.forEach((origin, merged) -> {
if (pag.findAllocNode(origin) == null || pag.findAllocNode(merged) == null) {
if (prePAG.findAllocNode(origin) == null || prePAG.findAllocNode(merged) == null) {
return;
}
if (pag.findAllocNode(origin).getType() != pag.findAllocNode(merged).getType()) {
if (prePAG.findAllocNode(origin).getType() != prePAG.findAllocNode(merged).getType()) {
return;
}
if (!csHeap.add(merged)) {
Expand All @@ -69,8 +72,8 @@ protected void preAnalysis() {
csHeap.removeAll(mergedHeap);
System.out.println("#MERGE HEAP (not-single):" + mergedHeap.size());
System.out.println("#NON-MERGED HEAP (single):" + csHeap.size());
for (Object mh : mergedHeap) {
System.out.println(mh);
}
// for (Object mh : mergedHeap) {
// System.out.println(mh);
// }
}
}

0 comments on commit b25487d

Please sign in to comment.