Search in sources :

Example 26 with InstanceFieldRef

use of soot.jimple.InstanceFieldRef in project soot by Sable.

the class DavaBody method javafy_ref.

private void javafy_ref(ValueBox vb) {
    Ref r = (Ref) vb.getValue();
    if (r instanceof StaticFieldRef) {
        SootFieldRef fieldRef = ((StaticFieldRef) r).getFieldRef();
        // addPackage(fieldRef.declaringClass().getJavaPackageName());
        String className = fieldRef.declaringClass().toString();
        String packageName = fieldRef.declaringClass().getJavaPackageName();
        String classPackageName = packageName;
        if (className.lastIndexOf('.') > 0) {
            // 0 doesnt make sense
            classPackageName = className.substring(0, className.lastIndexOf('.'));
        }
        if (!packageName.equals(classPackageName))
            throw new DecompilationException("Unable to retrieve package name for identifier. Please report to developer.");
        addToImportList(className);
        vb.setValue(new DStaticFieldRef(fieldRef, getMethod().getDeclaringClass().getName()));
    } else if (r instanceof ArrayRef) {
        ArrayRef ar = (ArrayRef) r;
        javafy(ar.getBaseBox());
        javafy(ar.getIndexBox());
    } else if (r instanceof InstanceFieldRef) {
        InstanceFieldRef ifr = (InstanceFieldRef) r;
        javafy(ifr.getBaseBox());
        vb.setValue(new DInstanceFieldRef(ifr.getBase(), ifr.getFieldRef(), thisLocals));
    } else if (r instanceof ThisRef) {
        ThisRef tr = (ThisRef) r;
        vb.setValue(new DThisRef((RefType) tr.getType()));
    }
}
Also used : ArrayRef(soot.jimple.ArrayRef) DThisRef(soot.dava.internal.javaRep.DThisRef) CaughtExceptionRef(soot.jimple.CaughtExceptionRef) DThisRef(soot.dava.internal.javaRep.DThisRef) ArrayRef(soot.jimple.ArrayRef) SootMethodRef(soot.SootMethodRef) SootFieldRef(soot.SootFieldRef) DStaticFieldRef(soot.dava.internal.javaRep.DStaticFieldRef) ThisRef(soot.jimple.ThisRef) DInstanceFieldRef(soot.dava.internal.javaRep.DInstanceFieldRef) Ref(soot.jimple.Ref) InstanceFieldRef(soot.jimple.InstanceFieldRef) ParameterRef(soot.jimple.ParameterRef) StaticFieldRef(soot.jimple.StaticFieldRef) DThisRef(soot.dava.internal.javaRep.DThisRef) ThisRef(soot.jimple.ThisRef) DInstanceFieldRef(soot.dava.internal.javaRep.DInstanceFieldRef) DInstanceFieldRef(soot.dava.internal.javaRep.DInstanceFieldRef) InstanceFieldRef(soot.jimple.InstanceFieldRef) DStaticFieldRef(soot.dava.internal.javaRep.DStaticFieldRef) SootFieldRef(soot.SootFieldRef) DStaticFieldRef(soot.dava.internal.javaRep.DStaticFieldRef) StaticFieldRef(soot.jimple.StaticFieldRef)

Example 27 with InstanceFieldRef

use of soot.jimple.InstanceFieldRef in project soot by Sable.

the class DexIfTransformer method internalTransform.

@Override
protected void internalTransform(final Body body, String phaseName, Map<String, String> options) {
    final DexDefUseAnalysis localDefs = new DexDefUseAnalysis(body);
    Set<IfStmt> ifSet = getNullIfCandidates(body);
    for (IfStmt ifs : ifSet) {
        ConditionExpr ifCondition = (ConditionExpr) ifs.getCondition();
        Local[] twoIfLocals = new Local[] { (Local) ifCondition.getOp1(), (Local) ifCondition.getOp2() };
        usedAsObject = false;
        for (Local loc : twoIfLocals) {
            Set<Unit> defs = localDefs.collectDefinitionsWithAliases(loc);
            // process normally
            doBreak = false;
            for (Unit u : defs) {
                // put correct local in l
                if (u instanceof DefinitionStmt) {
                    l = (Local) ((DefinitionStmt) u).getLeftOp();
                } else {
                    throw new RuntimeException("ERROR: def can not be something else than Assign or Identity statement! (def: " + u + " class: " + u.getClass() + "");
                }
                // check defs
                u.apply(new // Alex: should also end
                AbstractStmtSwitch() {

                    // as soon as detected
                    // as not used as an
                    // object
                    @Override
                    public void caseAssignStmt(AssignStmt stmt) {
                        Value r = stmt.getRightOp();
                        if (r instanceof FieldRef) {
                            usedAsObject = isObject(((FieldRef) r).getFieldRef().type());
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        } else if (r instanceof ArrayRef) {
                            ArrayRef ar = (ArrayRef) r;
                            if (ar.getType() instanceof UnknownType) {
                                // isObject
                                usedAsObject = stmt.hasTag("ObjectOpTag");
                            // (findArrayType
                            // (g,
                            // localDefs,
                            // localUses,
                            // stmt));
                            } else {
                                usedAsObject = isObject(ar.getType());
                            }
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        } else if (r instanceof StringConstant || r instanceof NewExpr || r instanceof NewArrayExpr) {
                            usedAsObject = true;
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        } else if (r instanceof CastExpr) {
                            usedAsObject = isObject(((CastExpr) r).getCastType());
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        } else if (r instanceof InvokeExpr) {
                            usedAsObject = isObject(((InvokeExpr) r).getType());
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        } else if (r instanceof LengthExpr) {
                            usedAsObject = false;
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }
                    }

                    @Override
                    public void caseIdentityStmt(IdentityStmt stmt) {
                        if (stmt.getLeftOp() == l) {
                            usedAsObject = isObject(stmt.getRightOp().getType());
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }
                    }
                });
                if (doBreak)
                    break;
                // check uses
                for (Unit use : localDefs.getUsesOf(l)) {
                    use.apply(new AbstractStmtSwitch() {

                        private boolean examineInvokeExpr(InvokeExpr e) {
                            List<Value> args = e.getArgs();
                            List<Type> argTypes = e.getMethodRef().parameterTypes();
                            assert args.size() == argTypes.size();
                            for (int i = 0; i < args.size(); i++) {
                                if (args.get(i) == l && isObject(argTypes.get(i))) {
                                    return true;
                                }
                            }
                            // check for base
                            SootMethodRef sm = e.getMethodRef();
                            if (!sm.isStatic()) {
                                if (e instanceof AbstractInvokeExpr) {
                                    AbstractInstanceInvokeExpr aiiexpr = (AbstractInstanceInvokeExpr) e;
                                    Value b = aiiexpr.getBase();
                                    if (b == l) {
                                        return true;
                                    }
                                }
                            }
                            return false;
                        }

                        @Override
                        public void caseInvokeStmt(InvokeStmt stmt) {
                            InvokeExpr e = stmt.getInvokeExpr();
                            usedAsObject = examineInvokeExpr(e);
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }

                        @Override
                        public void caseAssignStmt(AssignStmt stmt) {
                            Value left = stmt.getLeftOp();
                            Value r = stmt.getRightOp();
                            if (left instanceof ArrayRef) {
                                if (((ArrayRef) left).getIndex() == l) {
                                    // doBreak = true;
                                    return;
                                }
                            }
                            // used to assign
                            if (stmt.getRightOp() == l) {
                                Value l = stmt.getLeftOp();
                                if (l instanceof StaticFieldRef && isObject(((StaticFieldRef) l).getFieldRef().type())) {
                                    usedAsObject = true;
                                    if (usedAsObject)
                                        doBreak = true;
                                    return;
                                } else if (l instanceof InstanceFieldRef && isObject(((InstanceFieldRef) l).getFieldRef().type())) {
                                    usedAsObject = true;
                                    if (usedAsObject)
                                        doBreak = true;
                                    return;
                                } else if (l instanceof ArrayRef) {
                                    Type aType = ((ArrayRef) l).getType();
                                    if (aType instanceof UnknownType) {
                                        // isObject(
                                        usedAsObject = stmt.hasTag("ObjectOpTag");
                                    // findArrayType(g,
                                    // localDefs,
                                    // localUses,
                                    // stmt));
                                    } else {
                                        usedAsObject = isObject(aType);
                                    }
                                    if (usedAsObject)
                                        doBreak = true;
                                    return;
                                }
                            }
                            // assignment)
                            if (r instanceof FieldRef) {
                                // isObject(((FieldRef)
                                usedAsObject = true;
                                // r).getFieldRef().type());
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            } else if (r instanceof ArrayRef) {
                                ArrayRef ar = (ArrayRef) r;
                                if (ar.getBase() == l) {
                                    usedAsObject = true;
                                } else {
                                    // used as index
                                    usedAsObject = false;
                                }
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            } else if (r instanceof StringConstant || r instanceof NewExpr) {
                                throw new RuntimeException("NOT POSSIBLE StringConstant or NewExpr at " + stmt);
                            } else if (r instanceof NewArrayExpr) {
                                usedAsObject = false;
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            } else if (r instanceof CastExpr) {
                                usedAsObject = isObject(((CastExpr) r).getCastType());
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            } else if (r instanceof InvokeExpr) {
                                usedAsObject = examineInvokeExpr((InvokeExpr) stmt.getRightOp());
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            } else if (r instanceof LengthExpr) {
                                usedAsObject = true;
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            } else if (r instanceof BinopExpr) {
                                usedAsObject = false;
                                if (usedAsObject)
                                    doBreak = true;
                                return;
                            }
                        }

                        @Override
                        public void caseIdentityStmt(IdentityStmt stmt) {
                            if (stmt.getLeftOp() == l)
                                throw new RuntimeException("IMPOSSIBLE 0");
                        }

                        @Override
                        public void caseEnterMonitorStmt(EnterMonitorStmt stmt) {
                            usedAsObject = stmt.getOp() == l;
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }

                        @Override
                        public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
                            usedAsObject = stmt.getOp() == l;
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }

                        @Override
                        public void caseReturnStmt(ReturnStmt stmt) {
                            usedAsObject = stmt.getOp() == l && isObject(body.getMethod().getReturnType());
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }

                        @Override
                        public void caseThrowStmt(ThrowStmt stmt) {
                            usedAsObject = stmt.getOp() == l;
                            if (usedAsObject)
                                doBreak = true;
                            return;
                        }
                    });
                    if (doBreak)
                        break;
                }
                // for uses
                if (doBreak)
                    break;
            }
            if (// as soon as one def or use refers to an object
            doBreak)
                // be updated
                break;
        }
        // change values
        if (usedAsObject) {
            Set<Unit> defsOp1 = localDefs.collectDefinitionsWithAliases(twoIfLocals[0]);
            Set<Unit> defsOp2 = localDefs.collectDefinitionsWithAliases(twoIfLocals[1]);
            defsOp1.addAll(defsOp2);
            for (Unit u : defsOp1) {
                Stmt s = (Stmt) u;
                // If we have a[x] = 0 and a is an object, we may not conclude 0 -> null
                if (!s.containsArrayRef() || (!defsOp1.contains(s.getArrayRef().getBase()) && !defsOp2.contains(s.getArrayRef().getBase())))
                    replaceWithNull(u);
                Local l = (Local) ((DefinitionStmt) u).getLeftOp();
                for (Unit uuse : localDefs.getUsesOf(l)) {
                    Stmt use = (Stmt) uuse;
                    // If we have a[x] = 0 and a is an object, we may not conclude 0 -> null
                    if (!use.containsArrayRef() || (twoIfLocals[0] != use.getArrayRef().getBase()) && twoIfLocals[1] != use.getArrayRef().getBase())
                        replaceWithNull(use);
                }
            }
        }
    // end if
    }
// for if statements
}
Also used : ExitMonitorStmt(soot.jimple.ExitMonitorStmt) InvokeStmt(soot.jimple.InvokeStmt) AssignStmt(soot.jimple.AssignStmt) Unit(soot.Unit) InvokeStmt(soot.jimple.InvokeStmt) ThrowStmt(soot.jimple.ThrowStmt) IfStmt(soot.jimple.IfStmt) IdentityStmt(soot.jimple.IdentityStmt) EnterMonitorStmt(soot.jimple.EnterMonitorStmt) ReturnStmt(soot.jimple.ReturnStmt) ExitMonitorStmt(soot.jimple.ExitMonitorStmt) Stmt(soot.jimple.Stmt) AssignStmt(soot.jimple.AssignStmt) DefinitionStmt(soot.jimple.DefinitionStmt) ArrayRef(soot.jimple.ArrayRef) AbstractInvokeExpr(soot.jimple.internal.AbstractInvokeExpr) AbstractInstanceInvokeExpr(soot.jimple.internal.AbstractInstanceInvokeExpr) AbstractInvokeExpr(soot.jimple.internal.AbstractInvokeExpr) InvokeExpr(soot.jimple.InvokeExpr) AbstractInstanceInvokeExpr(soot.jimple.internal.AbstractInstanceInvokeExpr) CastExpr(soot.jimple.CastExpr) AbstractStmtSwitch(soot.jimple.AbstractStmtSwitch) InstanceFieldRef(soot.jimple.InstanceFieldRef) List(java.util.List) IdentityStmt(soot.jimple.IdentityStmt) EnterMonitorStmt(soot.jimple.EnterMonitorStmt) FieldRef(soot.jimple.FieldRef) InstanceFieldRef(soot.jimple.InstanceFieldRef) StaticFieldRef(soot.jimple.StaticFieldRef) SootMethodRef(soot.SootMethodRef) LengthExpr(soot.jimple.LengthExpr) Local(soot.Local) StaticFieldRef(soot.jimple.StaticFieldRef) UnknownType(soot.UnknownType) UnknownType(soot.UnknownType) Type(soot.Type) IfStmt(soot.jimple.IfStmt) NewArrayExpr(soot.jimple.NewArrayExpr) ConditionExpr(soot.jimple.ConditionExpr) Value(soot.Value) NewExpr(soot.jimple.NewExpr) StringConstant(soot.jimple.StringConstant) DefinitionStmt(soot.jimple.DefinitionStmt) ReturnStmt(soot.jimple.ReturnStmt) ThrowStmt(soot.jimple.ThrowStmt) BinopExpr(soot.jimple.BinopExpr)

Example 28 with InstanceFieldRef

use of soot.jimple.InstanceFieldRef in project soot by Sable.

the class IgetInstruction method jimplify.

@Override
public void jimplify(DexBody body) {
    TwoRegisterInstruction i = (TwoRegisterInstruction) instruction;
    int dest = i.getRegisterA();
    int object = i.getRegisterB();
    FieldReference f = (FieldReference) ((ReferenceInstruction) instruction).getReference();
    final Jimple jimple = Jimple.v();
    InstanceFieldRef r = jimple.newInstanceFieldRef(body.getRegisterLocal(object), getSootFieldRef(f));
    AssignStmt assign = jimple.newAssignStmt(body.getRegisterLocal(dest), r);
    setUnit(assign);
    addTags(assign);
    body.add(assign);
    if (IDalvikTyper.ENABLE_DVKTYPER) {
        DalvikTyper.v().setType(assign.getLeftOpBox(), r.getType(), false);
    }
}
Also used : FieldReference(org.jf.dexlib2.iface.reference.FieldReference) AssignStmt(soot.jimple.AssignStmt) InstanceFieldRef(soot.jimple.InstanceFieldRef) TwoRegisterInstruction(org.jf.dexlib2.iface.instruction.TwoRegisterInstruction) Jimple(soot.jimple.Jimple)

Example 29 with InstanceFieldRef

use of soot.jimple.InstanceFieldRef in project soot by Sable.

the class EvalResults method checkAliasAnalysis.

/**
 * Count how many aliased base pointers appeared in all user's functions.
 */
public void checkAliasAnalysis() {
    Set<IVarAbstraction> access_expr = new HashSet<IVarAbstraction>();
    ArrayList<IVarAbstraction> al = new ArrayList<IVarAbstraction>();
    Value[] values = new Value[2];
    for (SootMethod sm : ptsProvider.getAllReachableMethods()) {
        if (sm.isJavaLibraryMethod())
            continue;
        if (!sm.isConcrete())
            continue;
        if (!sm.hasActiveBody()) {
            sm.retrieveActiveBody();
        }
        if (!ptsProvider.isValidMethod(sm))
            continue;
        // access_expr.clear();
        for (Iterator<Unit> stmts = sm.getActiveBody().getUnits().iterator(); stmts.hasNext(); ) {
            Stmt st = (Stmt) stmts.next();
            if (st instanceof AssignStmt) {
                AssignStmt a = (AssignStmt) st;
                values[0] = a.getLeftOp();
                values[1] = a.getRightOp();
                for (Value v : values) {
                    // expression: p.f
                    if (v instanceof InstanceFieldRef) {
                        InstanceFieldRef ifr = (InstanceFieldRef) v;
                        final SootField field = ifr.getField();
                        if (!(field.getType() instanceof RefType))
                            continue;
                        LocalVarNode vn = ptsProvider.findLocalVarNode((Local) ifr.getBase());
                        if (vn == null)
                            continue;
                        if (ptsProvider.isExceptionPointer(vn))
                            continue;
                        IVarAbstraction pn = ptsProvider.findInternalNode(vn);
                        if (pn == null)
                            continue;
                        pn = pn.getRepresentative();
                        if (pn.hasPTResult())
                            access_expr.add(pn);
                    }
                }
            }
        }
    }
    access_expr.remove(null);
    al.addAll(access_expr);
    access_expr = null;
    // Next, we pair up all the pointers
    Date begin = new Date();
    int size = al.size();
    for (int i = 0; i < size; ++i) {
        IVarAbstraction pn = al.get(i);
        VarNode n1 = (VarNode) pn.getWrappedNode();
        for (int j = i + 1; j < size; ++j) {
            IVarAbstraction qn = al.get(j);
            VarNode n2 = (VarNode) qn.getWrappedNode();
            if (pn.heap_sensitive_intersection(qn))
                evalRes.n_hs_alias++;
            // We directly use the SPARK points-to sets
            if (n1.getP2Set().hasNonEmptyIntersection(n2.getP2Set()))
                evalRes.n_hi_alias++;
        }
    }
    evalRes.n_alias_pairs = size * (size - 1) / 2;
    Date end = new Date();
    ptsProvider.ps.println();
    ptsProvider.ps.println("--------> Alias Pairs Evaluation <---------");
    ptsProvider.ps.println("Number of pointer pairs in app code: " + evalRes.n_alias_pairs);
    ptsProvider.ps.printf("Heap sensitive alias pairs (by Geom): %d, Percentage = %.3f%%\n", evalRes.n_hs_alias, (double) evalRes.n_hs_alias / evalRes.n_alias_pairs * 100);
    ptsProvider.ps.printf("Heap insensitive alias pairs (by SPARK): %d, Percentage = %.3f%%\n", evalRes.n_hi_alias, (double) evalRes.n_hi_alias / evalRes.n_alias_pairs * 100);
    ptsProvider.ps.printf("Using time: %dms \n", end.getTime() - begin.getTime());
    ptsProvider.ps.println();
}
Also used : LocalVarNode(soot.jimple.spark.pag.LocalVarNode) VarNode(soot.jimple.spark.pag.VarNode) AssignStmt(soot.jimple.AssignStmt) ArrayList(java.util.ArrayList) Unit(soot.Unit) Date(java.util.Date) Stmt(soot.jimple.Stmt) AssignStmt(soot.jimple.AssignStmt) RefType(soot.RefType) IVarAbstraction(soot.jimple.spark.geom.geomPA.IVarAbstraction) Value(soot.Value) InstanceFieldRef(soot.jimple.InstanceFieldRef) SootMethod(soot.SootMethod) SootField(soot.SootField) LocalVarNode(soot.jimple.spark.pag.LocalVarNode) HashSet(java.util.HashSet)

Example 30 with InstanceFieldRef

use of soot.jimple.InstanceFieldRef in project soot by Sable.

the class EvalResults method estimateHeapDefuseGraph.

/**
 * Estimate the size of the def-use graph for the heap memory. The heap
 * graph is estimated without context information.
 */
public void estimateHeapDefuseGraph() {
    final Map<IVarAbstraction, int[]> defUseCounterForGeom = new HashMap<IVarAbstraction, int[]>();
    final Map<AllocDotField, int[]> defUseCounterForSpark = new HashMap<AllocDotField, int[]>();
    Date begin = new Date();
    for (SootMethod sm : ptsProvider.getAllReachableMethods()) {
        if (sm.isJavaLibraryMethod())
            continue;
        if (!sm.isConcrete())
            continue;
        if (!sm.hasActiveBody()) {
            sm.retrieveActiveBody();
        }
        if (!ptsProvider.isValidMethod(sm))
            continue;
        // We first gather all the memory access expressions
        for (Iterator<Unit> stmts = sm.getActiveBody().getUnits().iterator(); stmts.hasNext(); ) {
            Stmt st = (Stmt) stmts.next();
            if (!(st instanceof AssignStmt))
                continue;
            AssignStmt a = (AssignStmt) st;
            final Value lValue = a.getLeftOp();
            final Value rValue = a.getRightOp();
            InstanceFieldRef ifr = null;
            if (lValue instanceof InstanceFieldRef) {
                // Def statement
                ifr = (InstanceFieldRef) lValue;
            } else if (rValue instanceof InstanceFieldRef) {
                // Use statement
                ifr = (InstanceFieldRef) rValue;
            }
            if (ifr != null) {
                final SootField field = ifr.getField();
                LocalVarNode vn = ptsProvider.findLocalVarNode((Local) ifr.getBase());
                if (vn == null)
                    continue;
                IVarAbstraction pn = ptsProvider.findInternalNode(vn);
                if (pn == null)
                    continue;
                pn = pn.getRepresentative();
                if (!pn.hasPTResult())
                    continue;
                // Spark
                vn.getP2Set().forall(new P2SetVisitor() {

                    @Override
                    public void visit(Node n) {
                        IVarAbstraction padf = ptsProvider.findAndInsertInstanceField((AllocNode) n, field);
                        AllocDotField adf = (AllocDotField) padf.getWrappedNode();
                        int[] defUseUnit = defUseCounterForSpark.get(adf);
                        if (defUseUnit == null) {
                            defUseUnit = new int[2];
                            defUseCounterForSpark.put(adf, defUseUnit);
                        }
                        if (lValue instanceof InstanceFieldRef) {
                            defUseUnit[0]++;
                        } else {
                            defUseUnit[1]++;
                        }
                    }
                });
                // Geom
                Set<AllocNode> objsSet = pn.get_all_points_to_objects();
                for (AllocNode obj : objsSet) {
                    /*
						 * We will create a lot of instance fields. Because in
						 * points-to analysis, we concern only the reference
						 * type fields. But here, we concern all the fields read
						 * write including the primitive type fields.
						 */
                    IVarAbstraction padf = ptsProvider.findAndInsertInstanceField(obj, field);
                    int[] defUseUnit = defUseCounterForGeom.get(padf);
                    if (defUseUnit == null) {
                        defUseUnit = new int[2];
                        defUseCounterForGeom.put(padf, defUseUnit);
                    }
                    if (lValue instanceof InstanceFieldRef) {
                        defUseUnit[0]++;
                    } else {
                        defUseUnit[1]++;
                    }
                }
            }
        }
    }
    for (int[] defUseUnit : defUseCounterForSpark.values()) {
        evalRes.n_spark_du_pairs += ((long) defUseUnit[0]) * defUseUnit[1];
    }
    for (int[] defUseUnit : defUseCounterForGeom.values()) {
        evalRes.n_geom_du_pairs += ((long) defUseUnit[0]) * defUseUnit[1];
    }
    Date end = new Date();
    ptsProvider.ps.println();
    ptsProvider.ps.println("-----------> Heap Def Use Graph Evaluation <------------");
    ptsProvider.ps.println("The edges in the heap def-use graph is (by Geom): " + evalRes.n_geom_du_pairs);
    ptsProvider.ps.println("The edges in the heap def-use graph is (by Spark): " + evalRes.n_spark_du_pairs);
    ptsProvider.ps.printf("Using time: %dms \n", end.getTime() - begin.getTime());
    ptsProvider.ps.println();
}
Also used : AllocDotField(soot.jimple.spark.pag.AllocDotField) HashMap(java.util.HashMap) AssignStmt(soot.jimple.AssignStmt) LocalVarNode(soot.jimple.spark.pag.LocalVarNode) Node(soot.jimple.spark.pag.Node) VarNode(soot.jimple.spark.pag.VarNode) AllocNode(soot.jimple.spark.pag.AllocNode) Unit(soot.Unit) Date(java.util.Date) Stmt(soot.jimple.Stmt) AssignStmt(soot.jimple.AssignStmt) AllocNode(soot.jimple.spark.pag.AllocNode) IVarAbstraction(soot.jimple.spark.geom.geomPA.IVarAbstraction) Value(soot.Value) InstanceFieldRef(soot.jimple.InstanceFieldRef) SootMethod(soot.SootMethod) SootField(soot.SootField) LocalVarNode(soot.jimple.spark.pag.LocalVarNode) P2SetVisitor(soot.jimple.spark.sets.P2SetVisitor)

Aggregations

InstanceFieldRef (soot.jimple.InstanceFieldRef)31 Value (soot.Value)22 Local (soot.Local)20 ArrayRef (soot.jimple.ArrayRef)16 StaticFieldRef (soot.jimple.StaticFieldRef)15 Stmt (soot.jimple.Stmt)15 Type (soot.Type)14 InvokeExpr (soot.jimple.InvokeExpr)13 AssignStmt (soot.jimple.AssignStmt)12 Unit (soot.Unit)11 RefType (soot.RefType)10 BinopExpr (soot.jimple.BinopExpr)10 ArrayType (soot.ArrayType)9 SootClass (soot.SootClass)9 NewArrayExpr (soot.jimple.NewArrayExpr)9 ArrayList (java.util.ArrayList)8 CastExpr (soot.jimple.CastExpr)8 FieldRef (soot.jimple.FieldRef)8 LengthExpr (soot.jimple.LengthExpr)8 NewExpr (soot.jimple.NewExpr)8