use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.
the class FullSensitiveNode method get_all_context_sensitive_objects.
@Override
public void get_all_context_sensitive_objects(long l, long r, PtSensVisitor visitor) {
if (parent != this) {
getRepresentative().get_all_context_sensitive_objects(l, r, visitor);
return;
}
GeomPointsTo geomPTA = (GeomPointsTo) Scene.v().getPointsToAnalysis();
for (Map.Entry<AllocNode, GeometricManager> entry : pt_objs.entrySet()) {
AllocNode obj = entry.getKey();
SootMethod sm = obj.getMethod();
int sm_int = geomPTA.getIDFromSootMethod(sm);
if (sm_int == -1)
continue;
GeometricManager gm = entry.getValue();
SegmentNode[] int_entry = gm.getFigures();
for (int i = 0; i < GeometricManager.Divisions; ++i) {
// We iterate all the figures
SegmentNode p = int_entry[i];
while (p != null) {
long L = p.I1;
long R = L + p.L;
long objL = -1, objR = -1;
// Now we compute which context sensitive objects are pointed to by this pointer
if (l <= L && L < r) {
// L------------R
if (i == GeometricManager.ONE_TO_ONE) {
long d = r - L;
if (R < r)
d = p.L;
objL = p.I2;
objR = objL + d;
} else {
objL = p.I2;
objR = p.I2 + ((RectangleNode) p).L_prime;
}
} else if (L <= l && l < R) {
// L--------------------R
if (i == GeometricManager.ONE_TO_ONE) {
long d = R - l;
if (R > r)
d = r - l;
objL = p.I2 + l - L;
objR = objL + d;
} else {
objL = p.I2;
objR = p.I2 + ((RectangleNode) p).L_prime;
}
}
// Now we test which context versions this interval [objL, objR) maps to
if (objL != -1 && objR != -1)
visitor.visit(obj, objL, objR, sm_int);
p = p.next;
}
}
}
}
use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.
the class FullSensitiveNode method print_context_sensitive_points_to.
@Override
public void print_context_sensitive_points_to(PrintStream outPrintStream) {
for (Iterator<AllocNode> it = pt_objs.keySet().iterator(); it.hasNext(); ) {
AllocNode obj = it.next();
SegmentNode[] int_entry = find_points_to(obj);
for (int j = 0; j < GeometricManager.Divisions; ++j) {
SegmentNode p = int_entry[j];
while (p != null) {
outPrintStream.print("(" + obj.toString() + ", " + p.I1 + ", " + p.I2 + ", " + p.L + ", ");
if (p instanceof RectangleNode)
outPrintStream.print(((RectangleNode) p).L_prime + ", ");
outPrintStream.println(symbols[j] + ")");
p = p.next;
}
}
}
}
use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.
the class FullSensitiveNode method addPointsTo.
// -----------------------------------Private Functions---------------------------------------
/**
* A non-interface public function.
* It adds the points-to tuple to the geometric manager.
*/
private boolean addPointsTo(int code, AllocNode obj) {
GeometricManager gm = pt_objs.get(obj);
if (gm == null) {
gm = new GeometricManager();
pt_objs.put(obj, gm);
} else if (gm == deadManager) {
// We preclude the propagation of this object
return false;
}
SegmentNode p = gm.addNewFigure(code, pres);
if (p != null) {
new_pts.put(obj, gm);
return true;
}
return false;
}
use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.
the class GeometricManager method flush.
/**
* Remove the new labels for all the figures.
*/
public void flush() {
hasNewFigure = false;
for (int i = 0; i < Divisions; ++i) {
SegmentNode p = header[i];
while (p != null && p.is_new == true) {
p.is_new = false;
p = p.next;
}
}
}
use of soot.jimple.spark.geom.dataRep.SegmentNode in project soot by Sable.
the class IFigureManager method reclaimSegmentNode.
/**
* Return the segment node to cache.
* @param p
* @return
*/
protected static SegmentNode reclaimSegmentNode(SegmentNode p) {
SegmentNode q = p.next;
p.next = segHeader;
segHeader = p;
return q;
}
Aggregations