Package soot

Examples of soot.SootMethod


        // User-defined compulsory methods.
        compulsoryNodes.addAll(_getForcedCompulsoryMethods());

        // Add java.lang.String.String(char[]). Initializer
        SootClass source = Scene.v().getSootClass("java.lang.String");
        SootMethod method = source.getMethod("void <init>(char[])");
        compulsoryNodes.add(method);

        // Add java.lang.String.<clinit>.
        method = source.getMethodByName("<clinit>");
        compulsoryNodes.add(method);
View Full Code Here


            if (!source.isInterface()) {
                allParents.addAll(hierarchy.getSuperclassesOf(source));
            }

            while (methods.hasNext()) {
                SootMethod method = (SootMethod) methods.next();
                String subSignature = method.getSubSignature();

                if (source.declaresMethod(subSignature)
                        && allParents.contains(method.getDeclaringClass())) {
                    requiredMethodSet.add(source.getMethod(subSignature));
                }
            }
        }
View Full Code Here

                        nodes.add(field);
                    }

                    // Add directly called methods.
                    if (!leaf && stmt.containsInvokeExpr()) {
                        SootMethod m = stmt.getInvokeExpr().getMethod();
                        nodes.add(m);
                        nodes.add(m.getDeclaringClass());
                    }
                }

                // Get all classes used in all "instanceof" expressions.
                Iterator boxes = unit.getUseAndDefBoxes().iterator();
View Full Code Here

            CallGraph callGraph = Scene.v().getCallGraph();
            Iterator outEdges = callGraph.edgesOutOf(method);

            while (outEdges.hasNext()) {
                Edge edge = (Edge) outEdges.next();
                SootMethod targetMethod = edge.tgt();
                _add(targetMethod);
            }

            // Add the nodes called in the body of the method.
            _add(_getNodesAccessedInBodyOf(method));
View Full Code Here

                    + names[i].substring(classNameEndIndex + 1);

            className = names[i].substring(spaceIndex + 1, classNameEndIndex);

            SootClass source = Scene.v().getSootClass(className);
            SootMethod method = source.getMethod(subSignature);
            methods.add(method);
        }

        return methods;
    }
View Full Code Here

                    field.addTag(new TypeTag(type));

                    // Add initialization code to each constructor
                    for (Iterator methods = _modelClass.getMethods().iterator(); methods
                            .hasNext();) {
                        SootMethod initMethod = (SootMethod) methods.next();

                        // Only look at constructors.
                        if (!initMethod.getName().equals("<init>")) {
                            continue;
                        }

                        JimpleBody initBody = (JimpleBody) initMethod
                                .getActiveBody();
                        Chain initUnits = initBody.getUnits();
                        Local arrayLocal = Jimple.v().newLocal(fieldName,
                                arrayType);
                        initBody.getLocals().add(arrayLocal);
View Full Code Here

                _portToIndexArrayField.put(port, indexArrayField);

                // Initialize the index fields.
                for (Iterator methods = entityClass.getMethods().iterator(); methods
                        .hasNext();) {
                    SootMethod method = (SootMethod) methods.next();
                    JimpleBody body = (JimpleBody) method.retrieveActiveBody();
                    Object insertPoint = body.getUnits().getLast();

                    // Insert code into all the init methods.
                    if (!method.getName().equals("<init>")) {
                        continue;
                    }

                    Local indexesLocal = Jimple.v().newLocal("indexes",
                            ArrayType.v(IntType.v(), 1));
View Full Code Here

        bufferField.addTag(new TypeTag(type));

        // Create references to the buffer for each port channel
        for (Iterator methods = entityClass.getMethods().iterator(); methods
                .hasNext();) {
            SootMethod method = (SootMethod) methods.next();
            JimpleBody body = (JimpleBody) method.retrieveActiveBody();
            Stmt insertPoint = (Stmt) body.getUnits().getLast();

            // Insert code into all the init methods.
            if (!method.getName().equals("<init>")) {
                continue;
            }

            //             <body@insertPoint,
            //                     $tokenType[] buffer;  // RefType
View Full Code Here

                _portToInsideIndexArrayField.put(port, indexArrayField);

                // Initialize the index fields.
                for (Iterator methods = _modelClass.getMethods().iterator(); methods
                        .hasNext();) {
                    SootMethod method = (SootMethod) methods.next();
                    JimpleBody body = (JimpleBody) method.retrieveActiveBody();
                    Object insertPoint = body.getUnits().getLast();

                    // Insert code into all the init methods.
                    if (!method.getName().equals("<init>")) {
                        continue;
                    }

                    Local indexesLocal = Jimple.v().newLocal("indexes",
                            ArrayType.v(IntType.v(), 1));
View Full Code Here

        bufferField.addTag(new TypeTag(type));

        // Create references to the buffer for each port channel
        for (Iterator methods = modelClass.getMethods().iterator(); methods
                .hasNext();) {
            SootMethod method = (SootMethod) methods.next();
            JimpleBody body = (JimpleBody) method.retrieveActiveBody();
            Stmt insertPoint = (Stmt) body.getUnits().getLast();

            // Insert code into all the init methods.
            if (!method.getName().equals("<init>")) {
                continue;
            }

            Local bufferLocal = Jimple.v().newLocal("buffer",
                    ArrayType.v(tokenType, 1));
View Full Code Here

TOP

Related Classes of soot.SootMethod

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.