Package soot

Examples of soot.RefType


        // Make sure that exactly one of AND, OR, XOR is set.
        _assert(node.isBitwiseAnd() ^ node.isBitwiseOr() ^ node.isBitwiseXor(),
                node, "Invalid operation");

        RefType bitwiseType = PtolemyUtilities
                .getSootTypeForTokenType(((ASTPtRootNode) node.jjtGetChild(0))
                        .getType());
        SootClass tokenClass = bitwiseType.getSootClass();

        Local tokenLocal = Jimple.v().newLocal("token", bitwiseType);
        _body.getLocals().add(tokenLocal);

        _units
View Full Code Here


        // Find the corresponding soot method.
        SootMethod sootMethod = SootUtilities.getSootMethodForMethod(method);

        //     System.out.println("generating code to invoke " + sootMethod);
        Local originalBaseLocal = (Local) _nodeToLocal.get(node.jjtGetChild(0));
        RefType baseType = RefType.v(sootMethod.getDeclaringClass());
        Local baseLocal = Jimple.v().newLocal("base", baseType);
        _body.getLocals().add(baseLocal);

        if (cachedMethod instanceof CachedMethod.BaseConvertCachedMethod) {
            /*RefType tempBaseType =*/PtolemyUtilities
 
View Full Code Here

                "The number of labels and values does not "
                        + "match in parsing a record expression.");

        String[] labels = (String[]) node.getFieldNames().toArray(
                new String[numChildren]);
        RefType stringType = RefType.v("java.lang.String");

        Local labelsLocal = Jimple.v().newLocal("labelArray",
                ArrayType.v(stringType, 1));
        _body.getLocals().add(labelsLocal);
        _units.insertBefore(Jimple.v().newAssignStmt(
View Full Code Here

  public String getBody() {
    if(m_type instanceof RefType == false){
      throw new RuntimeException("not supported yet");
    }
    RefType ref_type = (RefType) m_type;   
    List<NumberedType> type_list = getTypeList(ref_type.getSootClass());
   
    String ret = getDecl();
    ret += "{\n";
    ret += "  char * thisref_deref;\n";
    ret += "  GC_OBJ_TYPE_TYPE type;\n";
View Full Code Here

    Set<Type> types = RootbeerClassLoader.v().getDfsInfo().getDfsTypes();
    for(Type type : types){
      if(type instanceof RefType == false){
        continue;
      }
      RefType ref_type = (RefType) type;
      String curr = ref_type.getClassName();
      SootClass soot_class = Scene.v().getSootClass(curr);
      m_classToOffsetMap.put(soot_class, index);
      index += 4;
    }
    m_endIndex = index;
View Full Code Here

 
  private Set<String> getRefTypes(Set<Type> dfs_types){
    Set<String> ret = new HashSet<String>();
    for(Type type : dfs_types){
      if(type instanceof RefType){
        RefType ref_type = (RefType) type;
        String name = ref_type.getSootClass().getName();
        ret.add(name);
      }
    }
    return ret;
  }
View Full Code Here

    private static Set<String> mappedURLs;

    private static String createMakeURLSignature(List<Type> argList) {
        if (resolver == null)
            resolver = JwigResolver.get();
        final RefType urlType = resolver.getSootClass(URL.class).getType();
        final SootClass webContextType = resolver
                .getSootClass(WebContext.class);
        return SootMethod.getSignature(webContextType, "makeURL", argList,
                urlType);
    }
View Full Code Here

     * Creates a map from method signatures to numbers, the number corresponds
     * to the position of a String argument in the signature which should be
     * analyzed.
     */
    private static void createMakeURLSignatures() {
        RefType object = Scene.v().getSootClass(Object.class.getName())
                .getType();
        ArrayType objectArray = ArrayType.v(object, 1);
        RefType string = Scene.v().getSootClass(String.class.getName())
                .getType();
        Type booleanT = BooleanType.v();
        RefType classClass = Scene.v().getSootClass(Class.class.getName())
                .getType();
        RefType mapClass = Scene.v()
                .getSootClass(java.util.Map.class.getName()).getType();

        LinkedList<Type> nameArgs = new LinkedList<Type>();
        nameArgs.add(string);
        nameArgs.add(objectArray);
View Full Code Here

     * @param makeURLMethod
     *            as the method to analyze
     * @return the position of the parameter of type {@link Class}
     */
    public int findClassPositionInParameterList(SootMethod makeURLMethod) {
        RefType classType = Scene.v().getSootClass(Class.class.getName())
                .getType();
        int classParamPosition = -1;
        if (makeURLMethod.getParameterType(0).equals(classType)) {
            classParamPosition = 0;
        }
View Full Code Here

     */
    private Collection<Type> getInterestingTypes() {
        if (interestingTypes == null) {
            // TODO generalize SubmitHandler to AbstractHandler in this
            // collection?
            RefType XMLtype = Scene.v().getSootClass(ToXMLable.class.getName())
                    .getType();
            RefType URLtype = Scene.v().getSootClass(URL.class.getName())
                    .getType();
            RefType SubmitType = Scene.v()
                    .getSootClass(SubmitHandler.class.getName()).getType();

            List<SootClass> interestingClasses = new LinkedList<SootClass>();
            interestingClasses.addAll(getHiearchy().getImplementersOf(
                    XMLtype.getSootClass()));
            interestingClasses.addAll(getHiearchy().getSubclassesOfIncluding(
                    SubmitType.getSootClass()));
            interestingClasses.addAll(getHiearchy().getSubclassesOfIncluding(
                    URLtype.getSootClass()));

            interestingTypes = new LinkedList<Type>();
            for (SootClass cl : interestingClasses) {
View Full Code Here

TOP

Related Classes of soot.RefType

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.