Package soot

Examples of soot.SootClass.addMethod()


                // modify invocations of that constructor.
                modifiedConstructorClassList.add(theClass);

                // Dance so that indexes in the Scene are properly updated.
                theClass.removeMethod(method);
                theClass.addMethod(method);

                System.out.println("method = " + method);
                JimpleBody body = (JimpleBody) method.retrieveActiveBody();

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


            // Implement the run method.
            {
                SootMethod runMethod = new SootMethod(runInterface.getName(),
                        runInterface.getParameterTypes(), runInterface
                                .getReturnType(), Modifier.PUBLIC);
                taskClass.addMethod(runMethod);

                JimpleBody body = Jimple.v().newBody(runMethod);
                runMethod.setActiveBody(body);
                body.insertIdentityStmts();
View Full Code Here

                // Implement the run method.
                SootMethod driverRunMethod = new SootMethod(driverRunInterface
                        .getName(), driverRunInterface.getParameterTypes(),
                        driverRunInterface.getReturnType(), Modifier.PUBLIC);
                driverClass.addMethod(driverRunMethod);

                JimpleBody body = Jimple.v().newBody(driverRunMethod);
                driverRunMethod.setActiveBody(body);
                body.insertIdentityStmts();
View Full Code Here

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

            SootMethod newMethod = new SootMethod(oldMethod.getName(),
                    oldMethod.getParameterTypes(), oldMethod.getReturnType(),
                    oldMethod.getModifiers(), oldMethod.getExceptions());
            newClass.addMethod(newMethod);

            JimpleBody body = Jimple.v().newBody(newMethod);
            body.importBodyContentsFrom(oldMethod.retrieveActiveBody());
            newMethod.setActiveBody(body);
        }
View Full Code Here

            List argTypes = new LinkedList();

            SootMethod getNumberOfArgumentsMethod = new SootMethod(
                    "getNumberOfArguments", argTypes, IntType.v(),
                    Modifier.PUBLIC);
            functionClass.addMethod(getNumberOfArgumentsMethod);

            JimpleBody body = Jimple.v().newBody(getNumberOfArgumentsMethod);
            getNumberOfArgumentsMethod.setActiveBody(body);
            body.insertIdentityStmts();
            body.getUnits().add(
View Full Code Here

            List argTypes = new LinkedList();
            argTypes.add(RefType.v(PtolemyUtilities.functionInterface));

            SootMethod isCongruentMethod = new SootMethod("isCongruent",
                    argTypes, BooleanType.v(), Modifier.PUBLIC);
            functionClass.addMethod(isCongruentMethod);

            JimpleBody body = Jimple.v().newBody(isCongruentMethod);
            isCongruentMethod.setActiveBody(body);
            body.insertIdentityStmts();
View Full Code Here

        // Create the toString method.
        {
            SootMethod toStringMethod = new SootMethod("toString",
                    Collections.EMPTY_LIST, RefType.v("java.lang.String"),
                    Modifier.PUBLIC);
            functionClass.addMethod(toStringMethod);

            JimpleBody body = Jimple.v().newBody(toStringMethod);
            toStringMethod.setActiveBody(body);
            body.insertIdentityStmts();
View Full Code Here

                            method.setParameterTypes(typeList);

                            // Dance so that indexes in the Scene are properly
                            // updated.
                            theClass.removeMethod(method);
                            theClass.addMethod(method);

                            // Keep track of the modified constructor.
                            classToConstructorMap.put(theClass, method);

                            // Replace the parameter refs so THEY have
View Full Code Here

        // Create the constructor.  The constructor takes one argument
        // for every free variable of the function closure that is not
        // bound to a formal argument.
        SootMethod functionConstructor = new SootMethod("<init>",
                argumentSootTypes, VoidType.v(), Modifier.PUBLIC);
        functionClass.addMethod(functionConstructor);

        {
            JimpleBody body = Jimple.v().newBody(functionConstructor);
            functionConstructor.setActiveBody(body);
            body.insertIdentityStmts();
View Full Code Here

            List argTypes = new LinkedList();
            argTypes.add(ArrayType.v(PtolemyUtilities.tokenType, 1));

            SootMethod functionApplyMethod = new SootMethod("apply", argTypes,
                    PtolemyUtilities.tokenType, Modifier.PUBLIC);
            functionClass.addMethod(functionApplyMethod);

            JimpleBody body = Jimple.v().newBody(functionApplyMethod);
            functionApplyMethod.setActiveBody(body);
            body.insertIdentityStmts();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.