Package soot

Examples of soot.Type


        for (Iterator fields = entityClass.getFields().iterator(); fields
                .hasNext();) {
            SootField field = (SootField) fields.next();

            // Ignore things that aren't reference types.
            Type type = field.getType();
            _createInequalityTerm(debug, field, type, _objectToInequalityTerm);

            // If the field has been tagged with a more specific type, then
            // constrain the type more.
            TypeTag tag = (TypeTag) field.getTag("_CGType");
View Full Code Here


                if (_unsafeLocals.contains(local)) {
                    continue;
                }

                // Ignore things that aren't reference types.
                Type type = local.getType();
                _createInequalityTerm(debug, local, type,
                        _objectToInequalityTerm);
            }

            for (Iterator units = body.getUnits().iterator(); units.hasNext();) {
View Full Code Here

                return null;
            }
        } else if (value instanceof NewArrayExpr) {
            // Since arrays are aliasable, we must update their types.
            NewArrayExpr newExpr = (NewArrayExpr) value;
            Type type = newExpr.getBaseType();
            RefType tokenType = PtolemyUtilities.getBaseTokenType(type);

            if ((tokenType != null)
                    && (objectToInequalityTerm.get(newExpr) == null)) {
                InequalityTerm typeTerm = new VariableTerm(PtolemyUtilities
                        .getTokenTypeForSootType(tokenType), newExpr);

                // This is something we update, so put an entry
                // in the map used for updating
                objectToInequalityTerm.put(newExpr, typeTerm);

                // Then the value of the expression is the type of the
                // constructor.
                return typeTerm;
            }

            // Otherwise there is nothing to be done.
            return null;
        } else if (value instanceof NewMultiArrayExpr) {
            // Since arrays are aliasable, we must update their types.
            NewMultiArrayExpr newExpr = (NewMultiArrayExpr) value;
            Type type = newExpr.getBaseType();
            RefType tokenType = PtolemyUtilities.getBaseTokenType(type);

            if ((tokenType != null)
                    && (objectToInequalityTerm.get(newExpr) == null)) {
                InequalityTerm typeTerm = new VariableTerm(PtolemyUtilities
View Full Code Here

            Iterator inputPorts = entity.inputPortList().iterator();

            while (inputPorts.hasNext()) {
                TypedIOPort port = (TypedIOPort) (inputPorts.next());
                String name = port.getName(entity);
                Type type = PtolemyUtilities.tokenType;
                nameToType.put(name, port.getType());

                // PtolemyUtilities.getSootTypeForTokenType(
                //  port.getType());
                SootField field = new SootField(StringUtilities
View Full Code Here

            Local argLocal = _convertTokenArgToJavaArg(tokenLocal, argTypes[i],
                    conversions[i]);
            args.add(argLocal);
        }

        Type returnType = sootMethod.getReturnType();
        Local returnLocal = Jimple.v().newLocal("returnValue", returnType);
        _body.getLocals().add(returnLocal);

        // Actually invoke the method.
        _units.insertBefore(Jimple.v().newAssignStmt(returnLocal,
View Full Code Here

        for (Iterator freeVariables = freeVariableList.iterator(); freeVariables
                .hasNext();) {
            String freeVariable = (String) freeVariables.next();
            ptolemy.data.type.Type type = _scope.getType(freeVariable);
            Type sootType = PtolemyUtilities.getSootTypeForTokenType(type);
            SootField field = new SootField(freeVariable, sootType,
                    Modifier.PUBLIC);
            functionClass.addField(field);
            argumentSootTypes.add(sootType);
            nameToLocal.put(freeVariable, field);
View Full Code Here

            Local argLocal = _convertTokenArgToJavaArg(tokenLocal, argTypes[i],
                    conversions[i - 1]);
            args.add(argLocal);
        }

        Type returnType = sootMethod.getReturnType();
        Local returnLocal = Jimple.v().newLocal("returnValue", returnType);
        _body.getLocals().add(returnLocal);

        // Actually invoke the method.
        _units.insertBefore(Jimple.v().newAssignStmt(
View Full Code Here

        Token operator = (Token) node.getOperator();
        Local leftLocal = (Local) _nodeToLocal.get(node.jjtGetChild(0));
        Local rightLocal = (Local) _nodeToLocal.get(node.jjtGetChild(1));

        Type scalarType = RefType.v("ptolemy.data.ScalarToken");
        Local tokenLocal = Jimple.v().newLocal("token",
                PtolemyUtilities.tokenType);
        _body.getLocals().add(tokenLocal);

        Local leftScalarLocal = Jimple.v().newLocal("leftScalar", scalarType);
View Full Code Here

        _generateAllChildren(node);

        int numChildren = node.jjtGetNumChildren();
        _assert(numChildren == 2, node, "The number of child nodes must be two");

        Type scalarType = RefType.v("ptolemy.data.ScalarToken");
        Token operator = (Token) node.getOperator();
        Local tokenLocal = (Local) _nodeToLocal.get(node.jjtGetChild(0));
        Local bitsLocal = (Local) _nodeToLocal.get(node.jjtGetChild(1));
        Local resultLocal = Jimple.v().newLocal("tokenResult",
                PtolemyUtilities.tokenType);
View Full Code Here

                    resultLocal,
                    Jimple.v().newVirtualInvokeExpr(zeroLocal,
                            PtolemyUtilities.tokenSubtractMethod.makeRef(),
                            tokenLocal)), _insertPoint);
        } else if (node.isNot()) {
            Type booleanType = RefType.v("ptolemy.data.BooleanToken");
            Local booleanLocal = Jimple.v().newLocal("token", booleanType);
            _body.getLocals().add(booleanLocal);
            _units.insertBefore(Jimple.v().newAssignStmt(booleanLocal,
                    Jimple.v().newCastExpr(tokenLocal, booleanType)),
                    _insertPoint);

            _units.insertBefore(Jimple.v().newAssignStmt(
                    booleanLocal,
                    Jimple.v().newInterfaceInvokeExpr(booleanLocal,
                            PtolemyUtilities.tokenBitwiseNotMethod.makeRef())),
                    _insertPoint);

            _units.insertBefore(Jimple.v().newAssignStmt(
                    resultLocal,
                    Jimple.v().newCastExpr(booleanLocal,
                            PtolemyUtilities.tokenType)), _insertPoint);
        } else if (node.isBitwiseNot()) {
            Type bitwiseType = RefType.v("ptolemy.data.BitwiseOperationToken");
            Local bitwiseLocal = Jimple.v().newLocal("token", bitwiseType);
            _body.getLocals().add(bitwiseLocal);
            _units.insertBefore(Jimple.v().newAssignStmt(bitwiseLocal,
                    Jimple.v().newCastExpr(tokenLocal, bitwiseType)),
                    _insertPoint);
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.