Package dk.brics.string.intermediate

Examples of dk.brics.string.intermediate.Application


        //
        //  Create intermediate code
        //
        jt = new Jimple2Intermediate(new Jimple2IntermediateFactoryImpl(externallyVisible, taintAnalysisStrategy, staticStringTypes, resolvers));
        Application app = jt.translateApplicationClasses(hotspots);
        Map<ValueBox, Statement> m1 = jt.getTranslationMap();
        num_exps = m1.size() + jt.getNumberOfExpsSkipped();
       
        // release memory
        if (releaseSoot) {
          G.reset();
        }
       
        //
        //  Analyze the intermediate code
        //
        log.info("Performing field usage analysis...");
        FieldUsageAnalysis fieldUsage = new FieldUsageAnalysis(app.getMethods());
        log.info("Performing liveness analysis...");
        LivenessAnalysis liveness = new LivenessAnalysis(app);
        log.info("Performing alias assertion analysis...");
        AliasAssertionAnalysis aliasAssertions = new AliasAssertionAnalysis(app);
        log.info("Performing alias analysis...");
        AliasAnalysis alias = new AliasAnalysis(app, liveness, fieldUsage, aliasAssertions);
        log.info("Performing reaching definitions analysis...");
        ReachingDefinitions reachingDefinitions = new ReachingDefinitions(app, liveness, alias);
       
        // if no hotspots were specified, make every expression a hotspot by default
        if (hotspots == null) {
            hotspots = m1.keySet(); // take everything by default
        }

        // get the intermediate statements corresponding to each hotspot
        Set<Statement> hotspot_statements = new HashSet<Statement>();
        for (ValueBox b : hotspots) {
            Statement stm = m1.get(b);
            if (stm == null) {
                log.info("Invalid hotspot");
                continue;
            }
            hotspot_statements.add(stm);
        }
       
        // find invalid assertion statements
        OperationAssertionAnalysis assertions = new OperationAssertionAnalysis(app, reachingDefinitions);
       
        if (log.isDebugEnabled()) {
            log.debug(app.toDot(reachingDefinitions, alias, assertions, hotspot_statements));
        }
       
        // End of intermediate creation. Notify diagnostics.
        diagnostics.intermediateCompleted(new IntermediateCompletedEvent(app, liveness, alias, reachingDefinitions, assertions,
        hotspot_statements));
View Full Code Here


            if (!clazz.isPhantom() && !clazz.isPhantomClass()) {// no idea what the difference between these two are
                applicationClasses.add(clazz);
            }
        }
       
        this.application = new Application();
        this.variableManager = new VariableManager(application, this);
        log.info("Translating classes to intermediate form...");
        this.hotspots = hotspots;
       
        // load ALL classes we might need before creating the hierarchy!!
View Full Code Here

TOP

Related Classes of dk.brics.string.intermediate.Application

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.