Package soot

Examples of soot.Hierarchy


     * inlining the super class method.
     */
    public static void foldClass(SootClass theClass) {
        SootClass superClass = theClass.getSuperclass();
        System.out.println("folding " + theClass + " into " + superClass);
        Scene.v().setActiveHierarchy(new Hierarchy());

        // First resolve all the FieldRefs and MethodRefs, so we know what
        // they are currently pointing to.
        //         for (Iterator methods = superClass.getMethods().iterator(); methods
        //                 .hasNext();) {
View Full Code Here


                if (expr instanceof InvokeExpr) {
                    SootMethod invokedMethod = ((InvokeExpr) expr).getMethod();

                    // It appears that soot does not automatically
                    // release the hierarchy.
                    Hierarchy hierarchy = Scene.v().getActiveHierarchy();

                    if (expr instanceof SpecialInvokeExpr) {
                        SootMethod target = hierarchy.resolveSpecialDispatch(
                                (SpecialInvokeExpr) expr, invokedMethod);
                        Scene.v().releaseActiveHierarchy();
                        _mergeFlow(out, target);
                    } else if (expr instanceof InstanceInvokeExpr) {
                        Type baseType = ((InstanceInvokeExpr) expr).getBase()
                                .getType();

                        if (!(baseType instanceof RefType)) {
                            // We can invoke methods on arrays...
                            // Ignore them here.
                            continue;
                        }

                        List list = hierarchy.resolveAbstractDispatch(
                                ((RefType) baseType).getSootClass(),
                                invokedMethod);
                        Scene.v().releaseActiveHierarchy();
                        for (Iterator targets = list.iterator(); targets
                                .hasNext();) {
View Full Code Here

        }

        implementExecutableInterface(entityInstanceClass);

        // Reinitialize the hierarchy, since we've added classes.
        Scene.v().setActiveHierarchy(new Hierarchy());
        Scene.v().setFastHierarchy(new FastHierarchy());

        {
            Set locallyModifiedAttributeSet = _constAnalysis
                    .getVariablesWithChangeContext(entity);
View Full Code Here

        System.out.println("TypeSpecializer.internalTransform(" + phaseName
                + ", " + options + ")");

        boolean debug = PhaseOptions.getBoolean(options, "debug");

        Scene.v().setActiveHierarchy(new Hierarchy());
        Scene.v().setFastHierarchy(new FastHierarchy());

        //Hierarchy h = Scene.v().getActiveHierarchy();

        for (Iterator entities = _model.deepEntityList().iterator(); entities
View Full Code Here

        //             LocalNameStandardizer.v().transform(body, "at.lns");
        //             LocalSplitter.v().transform(body, "at.ls");
        //         }
        // Reinitialize the hierarchy, since we've added classes.
        try {
            Scene.v().setActiveHierarchy(new Hierarchy());
        } catch (Error ex) {
            ex.printStackTrace(System.out);
        }

        try {
View Full Code Here

        return instance;
    }

    protected void internalTransform(Body body, String phaseName, Map options) {
        // Assume that all classes we care about have been loaded...
        Hierarchy hierarchy = Scene.v().getActiveHierarchy();
        Set set = new HashSet();

        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.tokenClass));
        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.baseTypeClass));
        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.arrayTypeClass));
        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.recordTypeClass));
        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.matrixTypeClass));
        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.attributeClass));
        set.addAll(hierarchy
                .getSubclassesOfIncluding(PtolemyUtilities.ptParserClass));

        _removeDeadObjectCreation(body, set);
    }
View Full Code Here

                    //                     }
                    if (unsafeLocalSet.contains(op)) {
                        continue;
                    }

                    Hierarchy hierarchy = Scene.v().getActiveHierarchy();

                    if (debug) {
                        System.out.println("opType = " + opType);
                    }
View Full Code Here

        // FIXME: This would be nice to do by inlining instead of
        // special casing.
        ModelTransformer.implementExecutableInterface(entityInstanceClass);

        // Reinitialize the hierarchy, since we've added classes.
        Scene.v().setActiveHierarchy(new Hierarchy());
        Scene.v().setFastHierarchy(new FastHierarchy());

        // Inline all methods in the class that are called from
        // within the class.
        ModelTransformer.inlineLocalCalls(entityInstanceClass);
View Full Code Here

                }
            }
        }

        // Reset the hierarchy, since we've changed superclasses and such.
        Scene.v().setActiveHierarchy(new Hierarchy());
        Scene.v().setFastHierarchy(new FastHierarchy());
    }
View Full Code Here

                }
            }
        }

        // Reset the hierarchy, since we've changed superclasses and such.
        Scene.v().setActiveHierarchy(new Hierarchy());
        Scene.v().setFastHierarchy(new FastHierarchy());

        // Fix the specialInvokes.
        for (Iterator i = Scene.v().getApplicationClasses().iterator(); i
                .hasNext();) {
View Full Code Here

TOP

Related Classes of soot.Hierarchy

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.