Package soot

Examples of soot.Type


                .getReturnType());

        for (Iterator args = method.getParameterTypes().iterator(); args
                .hasNext()
                && !isInlineableTokenMethod;) {
            Type argType = (Type) args.next();
            isInlineableTokenMethod = _isInlineableTokenType(argType);
        }

        return isInlineableTokenMethod;
    }
View Full Code Here


    // Return true if the given local is a token, and its specialized type
    // according to the given analysis is a type with the given depth.
    private static boolean _isLocalTokenTypeWithDepth(Local local,
            TypeSpecializerAnalysis typeAnalysis, Set unsafeLocalSet,
            int depth, boolean debug) {
        Type baseType = local.getType();

        // If we are invoking a method on a Token
        // or Type, and the token is not unsafe.
        if (_isInlineableTokenType(baseType) && !unsafeLocalSet.contains(local)) {
            // If it is a token, then check to
View Full Code Here

        // Grab the types of all fields.
        for (Iterator fields = theClass.getFields().iterator(); fields
                .hasNext();) {
            SootField field = (SootField) fields.next();
            Type type = field.getType();

            if (type instanceof RefType) {
                _addClass(((RefType) type).getSootClass());
            }
        }

        for (Iterator methods = theClass.getMethods().iterator(); methods
                .hasNext();) {
            SootMethod method = (SootMethod) methods.next();

            System.out.println("processing method = " + method);
            // Grab the classes of all arguments.
            for (Iterator types = method.getParameterTypes().iterator(); types
                    .hasNext();) {
                Type type = (Type) types.next();

                if (type instanceof RefType) {
                    _addClass(((RefType) type).getSootClass());
                }
            }
            // Grab the method return types.
            {
                Type type = method.getReturnType();

                if (type instanceof RefType) {
                    _addClass(((RefType) type).getSootClass());
                }
            }
View Full Code Here

                if (value instanceof CastExpr) {
                    // If the cast is to the same type as the
                    // operand already is, then replace with
                    // simple assignment.
                    CastExpr expr = (CastExpr) value;
                    Type castType = expr.getCastType();
                    Value op = expr.getOp();
                    Type opType = op.getType();

                    //                     // Skip locals that are unsafe.
                    //                     if (castType.equals(opType) &&
                    //                             !unsafeLocalSet.contains(op)) {
                    //                         box.setValue(op);
                    //                     }
                    if (unsafeLocalSet.contains(op)) {
                        continue;
                    }

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

                    //   if (debug) System.out.println("checking cast in " + unit);
                    //                     if (debug) System.out.println("op = " + op);
                    //                     if (debug) System.out.println("opType = " + opType);
                    replaceCast(box, hierarchy, castType, op, opType, debug);
                } else if (value instanceof InstanceOfExpr) {
                    // If the operand of the expression is
                    // declared to be of a type that implies
                    // the instanceof is true, then replace
                    // with true.
                    InstanceOfExpr expr = (InstanceOfExpr) value;
                    Type checkType = expr.getCheckType();
                    Value op = expr.getOp();
                    Type opType = op.getType();

                    // Skip locals that are unsafe.
                    if (unsafeLocalSet.contains(op)) {
                        continue;
                    }
View Full Code Here

                }

                return;
            }

            Type checkBase = ((ArrayType) checkType).baseType;
            Type opBase = ((ArrayType) opType).baseType;

            if (checkBase instanceof RefType && opBase instanceof RefType) {
                checkRef = (RefType) checkBase;
                opRef = (RefType) opBase;
            } else {
View Full Code Here

            if (((ArrayType) checkType).numDimensions != ((ArrayType) opType).numDimensions) {
                // We know the cast is necessary
                return;
            }

            Type checkBase = ((ArrayType) checkType).baseType;
            Type opBase = ((ArrayType) opType).baseType;

            if (checkBase instanceof RefType && opBase instanceof RefType) {
                checkRef = (RefType) checkBase;
                opRef = (RefType) opBase;
            } else {
View Full Code Here

                // The return type is required.
                _updateRequiredTypes(method.getReturnType());

                // The type of the class that declares this method.
                Type declaringClassType = method.getDeclaringClass().getType();

                if (RequiredFileGenerator.isRequired(declaringClassType)) {
                    _updateRequiredTypes(declaringClassType);
                }
View Full Code Here

    public static LinkedList classesRequiredBy(SootField field) {
        LinkedList classes = new LinkedList();

        classes.add(field.getDeclaringClass());

        Type type = field.getType();

        // This goes down and gets the base elements of arrays,
        // including multidimensional arrays.
        while (type instanceof ArrayType) {
            type = ((ArrayType) type).getElementType();
View Full Code Here

        typeSet.add(method.getReturnType());

        Iterator types = typeSet.iterator();

        while (types.hasNext()) {
            Type type = (Type) types.next();

            if (type instanceof ArrayType) {
                type = ((ArrayType) type).getElementType();
            }
View Full Code Here

                        ValueBox box = (ValueBox) boxes.next();
                        Value value = box.getValue();

                        if (value instanceof CastExpr) {
                            CastExpr expr = (CastExpr) value;
                            Type castType = expr.getCastType();

                            if (castType instanceof RefType) {
                                SootClass castClass = ((RefType) castType)
                                        .getSootClass();

                                if (castClass.isInterface()) {
                                    necessaryClasses.add(castClass);
                                } else {
                                    necessaryClasses
                                            .addAll(hierarchy
                                                    .getSuperclassesOfIncluding(castClass));
                                }

                                _addAllInterfaces(necessaryClasses, castClass);
                            }
                        } else if (value instanceof InstanceOfExpr) {
                            InstanceOfExpr expr = (InstanceOfExpr) value;
                            Type checkType = expr.getCheckType();

                            if (checkType instanceof RefType) {
                                SootClass checkClass = ((RefType) checkType)
                                        .getSootClass();
View Full Code Here

TOP

Related Classes of soot.Type

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.