Package soot

Examples of soot.SootField


            }

            // System.out.println("creating new field");
            // Create a new field for the attribute, and initialize
            // it to the the attribute above.
            SootField field = SootUtilities.createAndSetFieldFromLocal(body,
                    local, theClass, attributeType, fieldName);
            field.addTag(new ValueTag(attribute));

            createAttributes(body, context, contextLocal, attribute, local,
                    theClass, objectNameToCreatorName);
        }
    }
View Full Code Here


                                        PtolemyUtilities.portSetTypeMethod
                                                .makeRef(), typeLocal)));
            }

            if (!theClass.declaresFieldByName(fieldName)) {
                SootField field = SootUtilities.createAndSetFieldFromLocal(
                        body, portLocal, theClass, RefType.v(className),
                        fieldName);
                field.addTag(new ValueTag(port));
            }

            createAttributes(body, context, contextLocal, port, portLocal,
                    theClass, objectNameToCreatorName);
        }
View Full Code Here

                        Jimple.v().newAssignStmt(
                                local,
                                Jimple.v().newCastExpr(entityLocal,
                                        PtolemyUtilities.componentEntityType)));

                SootField field = SootUtilities.createAndSetFieldFromLocal(
                        body, local, modelClass, RefType.v(className),
                        entityFieldName);
                field.addTag(new ValueTag(entity));

                _ports(body, thisLocal, composite, local, entity, modelClass,
                        objectNameToCreatorName, false);
            } else {
                //  System.out.println("Creating new!");
                // Create a new local variable.  The name of the local is
                // determined automatically.  The name of the NamedObj is
                // the same as in the model.  (Note that this might not be
                // a valid Java identifier.)
                local = PtolemyUtilities.createNamedObjAndLocal(body,
                        className, thisLocal, entity.getName());

                //Entity classEntity = (Entity) _findDeferredInstance(entity);

                // This class assumes that any entity that is created creates
                // all stuff inside it.
                updateCreatedSet(composite.getFullName() + "."
                        + entity.getName(), entity, entity,
                        objectNameToCreatorName);

                SootField field = SootUtilities.createAndSetFieldFromLocal(
                        body, local, modelClass, RefType.v(className),
                        entityFieldName);
                field.addTag(new ValueTag(entity));

                _ports(body, containerLocal, container, local, entity,
                        modelClass, objectNameToCreatorName, false);

                //   }
View Full Code Here

            _portLocalMap.put(port, portLocal);

            if (createFieldsInClass
                    && !modelClass.declaresFieldByName(fieldName)) {
                SootField field = SootUtilities.createAndSetFieldFromLocal(
                        body, portLocal, modelClass, portType, fieldName);
                field.addTag(new ValueTag(port));
            }
        }
    }
View Full Code Here

        for (Iterator relations = port.linkedRelationList().iterator(); relations
                .hasNext();) {
            TypedIORelation relation = (TypedIORelation) relations.next();

            for (int i = 0; i < relation.getWidth(); i++, channel++) {
                SootField arrayField = _modelClass
                        .getFieldByName(InlinePortTransformer
                                .getBufferFieldName(relation, i, port.getType()));

                // assign the value.
                body.getUnits().insertBefore(
                        Jimple.v().newAssignStmt(
                                Jimple.v().newStaticFieldRef(
                                        arrayField.makeRef()), expr.getArg(0)),
                        stmt);
            }
        }

        // blow away the send.
View Full Code Here

                PtolemyUtilities.tokenType);
        body.getLocals().add(returnLocal);

        Value channelValue = expr.getArg(0);

        SootField field = _getBufferField(_modelClass, port, port.getType(),
                channelValue, false);

        // assign the value.
        body.getUnits().insertBefore(
                Jimple.v().newAssignStmt(returnLocal,
                        Jimple.v().newStaticFieldRef(field.makeRef())), stmt);

        // We may be calling get without setting the return value
        // to anything.
        if (stmt instanceof DefinitionStmt) {
            // Replace the get() with an array read.
View Full Code Here

                PtolemyUtilities.tokenType);
        body.getLocals().add(returnLocal);

        Value channelValue = expr.getArg(0);

        SootField field = _getBufferField(_modelClass, port, port.getType(),
                channelValue, true);

        // assign the value.
        body.getUnits().insertBefore(
                Jimple.v().newAssignStmt(returnLocal,
                        Jimple.v().newStaticFieldRef(field.makeRef())), stmt);

        // We may be calling get without setting the return value
        // to anything.
        if (stmt instanceof DefinitionStmt) {
            // Replace the get() with an array read.
View Full Code Here

            throw new RuntimeException("multirate send not supported.");
        }

        Value channelValue = expr.getArg(0);

        SootField field = _getBufferField(_modelClass, port, port.getType(),
                channelValue, false);

        // assign the value.
        body.getUnits().insertBefore(
                Jimple.v().newAssignStmt(
                        Jimple.v().newStaticFieldRef(field.makeRef()),
                        expr.getArg(1)), stmt);
        body.getUnits().remove(stmt);
    }
View Full Code Here

                            + port.getFullName() + ".");
        }

        Value channelValue = expr.getArg(0);

        SootField field = _getBufferField(_modelClass, port, port.getType(),
                channelValue, true);

        // assign the value.
        body.getUnits().insertBefore(
                Jimple.v().newAssignStmt(
                        Jimple.v().newStaticFieldRef(field.makeRef()),
                        expr.getArg(1)), stmt);
        body.getUnits().remove(stmt);
    }
View Full Code Here

                String fieldName = relation.getName() + "_bufferLocal";
                Local arrayLocal = Jimple.v().newLocal(fieldName, tokenType);
                clinitBody.getLocals().add(arrayLocal);

                for (int i = 0; i < relation.getWidth(); i++) {
                    SootField field = new SootField(InlinePortTransformer
                            .getBufferFieldName(relation, i, type), tokenType,
                            Modifier.PUBLIC | Modifier.STATIC);
                    _modelClass.addField(field);

                    // Tag the field with the type.
                    field.addTag(new TypeTag(type));

                    // Note: reverse order!
                    clinitUnits.addFirst(Jimple.v().newAssignStmt(
                            Jimple.v().newStaticFieldRef(field.makeRef()),
                            NullConstant.v()));
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of soot.SootField

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.