/** * Constructs an empty SootClass with the given name and modifiers. */ public SootClass(String name, int modifiers) { if (name.charAt(0) == '[') { throw new RuntimeException("Attempt to make a class whose name starts with ["); } setName(name); this.modifiers = modifiers; initializeRefType(name); if (Options.v().debug_resolver()) { logger.debug("created " + name + " with modifiers " + modifiers); } setResolvingLevel(BODIES); }
/** * Hierarchy - we know the hierarchy of the class and that's it requires at least Hierarchy for all supertypes and * enclosing types. */ protected void bringToHierarchy(SootClass sc) { if (sc.resolvingLevel() >= SootClass.HIERARCHY) { return; } if (Options.v().debug_resolver()) { logger.debug("bringing to HIERARCHY: " + sc); } sc.setResolvingLevel(SootClass.HIERARCHY); bringToHierarchyUnchecked(sc); }
public void reResolve(SootClass cl, int newResolvingLevel) { int resolvingLevel = cl.resolvingLevel(); if (resolvingLevel >= newResolvingLevel) { return; } reResolveHierarchy(cl, SootClass.HIERARCHY); cl.setResolvingLevel(newResolvingLevel); addToResolveWorklist(cl, resolvingLevel); processResolveWorklist(); }
/** * Signatures - we know the signatures of all methods and fields requires at least Hierarchy for all referred to types in * these signatures. */ protected void bringToSignatures(SootClass sc) { if (sc.resolvingLevel() >= SootClass.SIGNATURES) { return; } bringToHierarchy(sc); if (Options.v().debug_resolver()) { logger.debug("bringing to SIGNATURES: " + sc); } sc.setResolvingLevel(SootClass.SIGNATURES); bringToSignaturesUnchecked(sc); }
/** * Bodies - we can now start loading the bodies of methods for all referred to methods and fields in the bodies, requires * signatures for the method receiver and field container, and hierarchy for all other classes referenced in method * references. Current implementation does not distinguish between the receiver and other references. Therefore, it is * conservative and brings all of them to signatures. But this could/should be improved. */ protected void bringToBodies(SootClass sc) { if (sc.resolvingLevel() >= SootClass.BODIES) { return; } bringToSignatures(sc); if (Options.v().debug_resolver()) { logger.debug("bringing to BODIES: " + sc); } sc.setResolvingLevel(SootClass.BODIES); bringToBodiesUnchecked(sc); }
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:932 */ public void jimplify2() { super.jimplify2(); if (clinit != null) jimplify2clinit(); for (Iterator iter = nestedTypes().iterator(); iter.hasNext();) { TypeDecl typeDecl = (TypeDecl) iter.next(); typeDecl.jimplify2(); } // add inner class attribute ArrayList tags = new ArrayList(); for (Iterator iter = innerClassesAttributeEntries().iterator(); iter.hasNext();) { TypeDecl type = (TypeDecl) iter.next(); tags.add(new soot.tagkit.InnerClassTag(type.jvmName().replace('.', '/'), type.isMemberType() ? type.enclosingType().jvmName().replace('.', '/') : null, type.isAnonymous() ? null : type.name(), type.sootTypeModifiers())); } if (!tags.isEmpty()) getSootClassDecl().addTag(new soot.tagkit.InnerClassAttribute(tags)); addAttributes(); getSootClassDecl().setResolvingLevel(SootClass.BODIES); }
/** * Returns a (possibly not yet resolved) SootClass to be used in references to a class. If/when the class is resolved, it * will be resolved into this SootClass. */ public SootClass makeClassRef(String className) { if (Scene.v().containsClass(className)) { return Scene.v().getSootClass(className); } SootClass newClass; newClass = new SootClass(className); newClass.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(newClass); return newClass; }
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:186 */ public void jimplify1phase2() { SootClass sc = getSootClassDecl(); sc.setResolvingLevel(SootClass.DANGLING); sc.setModifiers(sootTypeModifiers()); sc.setApplicationClass(); SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath()); st.setAbsolutePath(compilationUnit().pathName()); sc.addTag(st); sc.setSuperclass(typeObject().getSootClassDecl()); for(Iterator iter = superinterfacesIterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(typeDecl != typeObject() && !sc.implementsInterface(typeDecl.getSootClassDecl().getName())) sc.addInterface(typeDecl.getSootClassDecl()); } if(isNestedType()) sc.setOuterClass(enclosingType().getSootClassDecl()); sc.setResolvingLevel(SootClass.HIERARCHY); super.jimplify1phase2(); sc.setResolvingLevel(SootClass.SIGNATURES); } /**
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:163 */ public void jimplify1phase2() { SootClass sc = getSootClassDecl(); sc.setResolvingLevel(SootClass.DANGLING); sc.setModifiers(sootTypeModifiers()); sc.setApplicationClass(); SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath()); st.setAbsolutePath(compilationUnit().pathName()); sc.addTag(st); if(hasSuperclass()) { sc.setSuperclass(superclass().getSootClassDecl()); } for(Iterator iter = interfacesIterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(!sc.implementsInterface(typeDecl.getSootClassDecl().getName())) sc.addInterface(typeDecl.getSootClassDecl()); } if(isNestedType()) sc.setOuterClass(enclosingType().getSootClassDecl()); sc.setResolvingLevel(SootClass.HIERARCHY); super.jimplify1phase2(); sc.setResolvingLevel(SootClass.SIGNATURES); } /**
mSootClass.setResolvingLevel(SootClass.BODIES); } else { if (!mSootClass.getName().equals(className)) {
mSootClass.setResolvingLevel(SootClass.SIGNATURES); } else { if (!className.equals(mSootClass.getName())) {
/** * @apilevel internal */ private SootClass sootClass_compute() { if(!Scene.v().isIncrementalBuild()) { return refined_EmitJimpleRefinements_ClassDecl_sootClass(); } if(Scene.v().containsClass(jvmName())) { Scene.v().removeClass(Scene.v().getSootClass(jvmName())); } SootClass sc = null; if(options().verbose()) System.out.println("Creating from source " + jvmName()); sc = new SootClass(jvmName()); sc.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(sc); return sc; } /**
System.out.println("Creating from source " + jvmName()); sc = new SootClass(jvmName()); sc.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(sc);
crt.setSootClass(applicationClass); applicationClass.setRefType(crt); applicationClass.setResolvingLevel(SootClass.BODIES);
clazz.setResolvingLevel(SootClass.BODIES); source.resolve(clazz); } finally {
public void reResolve(SootClass cl) { int resolvingLevel = cl.resolvingLevel(); if( resolvingLevel < SootClass.HIERARCHY ) return; reResolveHierarchy(cl); cl.setResolvingLevel(SootClass.HIERARCHY); addToResolveWorklist(cl, resolvingLevel); processResolveWorklist(); }
public void reResolve(SootClass cl) { int resolvingLevel = cl.resolvingLevel(); if( resolvingLevel < SootClass.HIERARCHY ) return; reResolveHierarchy(cl); cl.setResolvingLevel(SootClass.HIERARCHY); addToResolveWorklist(cl, resolvingLevel); processResolveWorklist(); }
/** Constructs an empty SootClass with the given name and modifiers. */ public SootClass(String name, int modifiers) { if( name.charAt(0) == '[' ) throw new RuntimeException( "Attempt to make a class whose name starts with [" ); setName( name); this.modifiers = modifiers; refType = RefType.v(name); refType.setSootClass(this); if(Options.v().debug_resolver()) G.v().out.println("created "+name+" with modifiers "+modifiers); setResolvingLevel(BODIES); Scene.v().getClassNumberer().add(this); }
/** Constructs an empty SootClass with the given name and modifiers. */ public SootClass(String name, int modifiers) { if( name.charAt(0) == '[' ) throw new RuntimeException( "Attempt to make a class whose name starts with [" ); setName( name); this.modifiers = modifiers; refType = RefType.v(name); refType.setSootClass(this); if(Options.v().debug_resolver()) G.v().out.println("created "+name+" with modifiers "+modifiers); setResolvingLevel(BODIES); Scene.v().getClassNumberer().add(this); }
/** Returns a (possibly not yet resolved) SootClass to be used in references * to a class. If/when the class is resolved, it will be resolved into this * SootClass. * */ public SootClass makeClassRef(String className) { if(Scene.v().containsClass(className)) return Scene.v().getSootClass(className); SootClass newClass; newClass = new SootClass(className); newClass.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(newClass); return newClass; }