Package soot.toolkits.scalar

Examples of soot.toolkits.scalar.SimpleLocalDefs


                }

                JimpleBody body = (JimpleBody) method.retrieveActiveBody();

                CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);
                SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
                SimpleLocalUses localUses = new SimpleLocalUses(unitGraph,
                        localDefs);

                //  TokenTypeAnalysis typeAnalysis =
                //    new TokenTypeAnalysis(method, unitGraph);
View Full Code Here


                SootMethod method = (SootMethod) methods.next();

                JimpleBody body = (JimpleBody) method.retrieveActiveBody();

                CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);
                SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
                SimpleLocalUses localUses = new SimpleLocalUses(unitGraph,
                        localDefs);

                //  TokenTypeAnalysis typeAnalysis =
                //    new TokenTypeAnalysis(method, unitGraph);
View Full Code Here

                // System.out.println("Inlining tokens iteration " + count++);
                CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

                // This will help us figure out where locals are defined.
                _localDefs = new SimpleLocalDefs(unitGraph);

                // Analyze and tokens that are constructed in this
                // method...  these will likely not have fields
                // for them.
                _tokenAnalysis = new TokenConstructorAnalysis(body, _localDefs);
View Full Code Here

                                + returnType);
                    }

                    // Reanalyze the locals... since this may have changed.
                    CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);
                    _localDefs = new SimpleLocalDefs(unitGraph);
                }
            }
        }

        return doneSomething;
View Full Code Here

            CallGraph callGraph, SideEffectAnalysis analysis) {
        Body body = method.retrieveActiveBody();
        CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

        // this will help us figure out where locals are defined.
        /*SimpleLocalDefs localDefs = */new SimpleLocalDefs(unitGraph);
        SimpleLiveLocals liveLocals = new SimpleLiveLocals(unitGraph);

        for (Iterator units = body.getUnits().snapshotIterator(); units
                .hasNext();) {
            Unit unit = (Unit) units.next();
View Full Code Here

        // FIXME this only traces through locals.  What if we set the
        // value to a field?
        CompleteUnitGraph unitGraph = new CompleteUnitGraph(containerBody);

        // this will help us figure out where locals are defined.
        SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
        SimpleLocalUses localUses = new SimpleLocalUses(unitGraph, localDefs);
        List useList = localUses.getUsesOf(newStmt);

        for (Iterator pairs = useList.iterator(); pairs.hasNext();) {
            UnitValueBoxPair pair = (UnitValueBoxPair) pairs.next();
View Full Code Here

        NamedObj referredObject = ModelTransformer.getObjectForClass(theClass);

        CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

        // this will help us figure out where locals are defined.
        SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
        SimpleLocalUses localUses = new SimpleLocalUses(unitGraph, localDefs);
        NamedObjAnalysis namedObjAnalysis = new NamedObjAnalysis(method,
                referredObject);

        for (Iterator units = body.getUnits().snapshotIterator(); units
View Full Code Here

        JimpleBody body = (JimpleBody) method.retrieveActiveBody();
        CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

        // this will help us figure out where locals are defined.
        SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
        SimpleLocalUses localUses = new SimpleLocalUses(unitGraph, localDefs);

        for (Iterator units = body.getUnits().snapshotIterator(); units
                .hasNext();) {
            Stmt stmt = (Stmt) units.next();
View Full Code Here

     */
    private static void _removeDeadObjectCreation(Body body, Set classSet) {
        CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

        // this will help us figure out where locals are defined.
        SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
        SimpleLiveLocals liveLocals = new SimpleLiveLocals(unitGraph);

        for (Iterator units = body.getUnits().snapshotIterator(); units
                .hasNext();) {
            Stmt stmt = (Stmt) units.next();

            if (!stmt.containsInvokeExpr()) {
                continue;
            }

            ValueBox box = stmt.getInvokeExprBox();
            Value value = box.getValue();

            if (value instanceof SpecialInvokeExpr) {
                SpecialInvokeExpr r = (SpecialInvokeExpr) value;

                //      System.out.println("compare " + r.getMethod().getDeclaringClass());
                //                 System.out.println("with " + theClass);
                if (classSet.contains(r.getMethod().getDeclaringClass())
                        && !liveLocals.getLiveLocalsAfter(stmt).contains(
                                r.getBase())) {
                    // Remove the initialization and the constructor.
                    // Note: This assumes a fairly tight coupling between
                    // the new and the object constructor.  This may
                    // not be true.
                    body.getUnits().remove(stmt);

                    for (Iterator defs = localDefs.getDefsOfAt(
                            (Local) r.getBase(), stmt).iterator(); defs
                            .hasNext();) {
                        Unit defUnit = (Unit) defs.next();

                        if (defUnit instanceof DefinitionStmt) {
View Full Code Here

            }

            CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

            // this will help us figure out where locals are defined.
            SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
            SimpleLocalUses localUses = new SimpleLocalUses(unitGraph,
                    localDefs);

            //   System.out.println("done computing aliases for " + method);
            for (Iterator locals = body.getLocals().iterator(); locals
View Full Code Here

TOP

Related Classes of soot.toolkits.scalar.SimpleLocalDefs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.