예제 #1
0
파일: Analyzer.java 프로젝트: BoAnd/tools
  public Analyzer(
      AnalysisSpecification spec) { // Why is this here ?? There is not ref to it in the project
    this.specification = spec;

    if (specification.getTypeOfAnalysisPerformed() != AnalysisType.ALLOCATIONS) {
      this.stackAnalyzer = new StackAnalyzer(specification.getJvmModel());
    }
  }
예제 #2
0
파일: Analyzer.java 프로젝트: BoAnd/tools
  public void start(Class<? extends ICostComputer<ICostResult>> costComputerType)
      throws InstantiationException, IllegalAccessException, IllegalArgumentException,
          WalaException, IOException, SecurityException, InvocationTargetException,
          NoSuchMethodException {
    this.costComputer =
        costComputerType
            .getDeclaredConstructor(JVMModel.class)
            .newInstance(specification.getJvmModel());

    LinkedList<CGNode> entryCGNodes = specification.getEntryPointCGNodes();

    for (CGNode entryNode : entryCGNodes) {
      // OutputPrinter.printInfo("Starting entry node " + entryNode.getMethod().toString());
      ICostResult results = new CGNodeAnalyzer(entryNode, costComputer).analyzeNode();
      // ICostResult results = new
      // CostComputerMemory(specification.getJvmModel()).dfsVisit(entryNode);
      // Test code
      CostResultMemory memRes = (CostResultMemory) results;
      OutputPrinter.printInfo(
          "Worst case allocation for "
              + entryNode.getMethod().toString()
              + ":\t"
              + results.getCostScalar());
      for (Entry<TypeName, Integer> i : memRes.aggregatedCountByTypename.entrySet()) {
        OutputPrinter.printInfo(
            "\t TYPE_NAME\t" + i.getKey().toString() + "\tCOUNT " + i.getValue());
      }
    }
    /* This is move to the program.
    if ( specification.getTypeOfAnalysisPerformed() != AnalysisType.ALLOCATIONS) {
    	stackAnalyzer.analyze();
    }

    if ( specification.getShouldGenerateAnalysisReports() == true) {
    	ReportGenerator gen = new ReportGenerator();
    	gen.Generate(AnalysisResults.getAnalysisResults().getReportEntries());
    }*/
  }
예제 #3
0
파일: Analyzer.java 프로젝트: BoAnd/tools
 private Analyzer() {
   this.specification = AnalysisSpecification.getAnalysisSpecification();
   this.stackAnalyzer = new StackAnalyzer(specification.getJvmModel());
 }