Package com.google.gwt.dev.generator.ast

Examples of com.google.gwt.dev.generator.ast.StatementsList


   * @return The set of Statements containing the benchmark code along with the
   *         wrapped <code>stmts</code>
   */
  private Statements benchmark(Statements stmts, String timeMillisName,
      long bound, Statements recordCode, Statements breakCode) {
    Statements benchmarkCode = new StatementsList();
    List<Statements> benchStatements = benchmarkCode.getStatements();

    ForLoop loop = new ForLoop("int numLoops = 1", "true", "");
    benchStatements.add(loop);
    List<Statements> loopStatements = loop.getStatements();

View Full Code Here


    return true;
  }

  private Statements genBenchTarget(JMethod beginMethod, JMethod endMethod,
      List<String> paramNames, Statements test) {
    Statements statements = new StatementsList();
    List<Statements> statementsList = statements.getStatements();

    if (beginMethod != null) {
      statementsList.add(new Statement(new MethodCall(beginMethod.getName(),
          paramNames)));
    }
View Full Code Here

      Statements breakCode = new Statement("  permutationIt.skipCurrentRange()");
      setupBench = benchmark(setupBench, setupTimingName, 0, null, breakCode);
      testBench = benchmark(testBench, testTimingName, bound.value, recordCode,
          breakCode);

      Statements testAndSetup = new StatementsList();
      testAndSetup.getStatements().addAll(setupBench.getStatements());
      testAndSetup.getStatements().addAll(testBench.getStatements());

      sw.println(testAndSetup.toString());

      sw.println("      return true;\n" + "    }\n"
          + "    privateFinishTest();\n" + "    return false;\n" + "  }\n"
          + "} );\n");
View Full Code Here

      Statements setupBench = genBenchTarget(beginMethod, endMethod,
          Collections.<String> emptyList(), new Statement(new MethodCall(
              EMPTY_FUNC, null)));

      StatementsList testStatements = new StatementsList();
      testStatements.getStatements().add(
          new Statement(new MethodCall("super." + method.getName(), null)));
      Statements testBench = genBenchTarget(beginMethod, endMethod,
          Collections.<String> emptyList(), testStatements);

      String recordResultsCode = BENCHMARK_RESULTS_CLASS
View Full Code Here

   * @return The set of Statements containing the benchmark code along with the
   *         wrapped <code>stmts</code>
   */
  private Statements benchmark(Statements stmts, String timeMillisName,
      boolean generateEscape, Statements recordCode, Statements breakCode) {
    Statements benchmarkCode = new StatementsList();
    List benchStatements = benchmarkCode.getStatements();

    ForLoop loop = new ForLoop("int numLoops = 1", "true", "");
    benchStatements.add(loop);
    List loopStatements = loop.getStatements();

View Full Code Here

   *
   * @return the generated code
   */
  private Statements executeForAllValues(JParameter[] methodParams, Map params,
      Statements statements) {
    Statements root = new StatementsList();
    Statements currentContext = root;

    // Profile the setup and teardown costs for this test method
    // but only if 1 of them exists.
    for (int i = 0; i < methodParams.length; ++i) {
View Full Code Here

    return root;
  }

  private Statements genBenchTarget(JMethod beginMethod, JMethod endMethod,
      List paramNames, Statements test) {
    Statements statements = new StatementsList();
    List statementsList = statements.getStatements();

    if (beginMethod != null) {
      statementsList.add(
          new Statement(new MethodCall(beginMethod.getName(), paramNames)));
    }
View Full Code Here

      Statements breakCode = new Statement( "  permutationIt.skipCurrentRange()" );
      setupBench = benchmark(setupBench, setupTimingName, false, null, breakCode);
      testBench = benchmark(testBench, testTimingName, isBounded.value, recordCode, breakCode);

      Statements testAndSetup = new StatementsList();
      testAndSetup.getStatements().addAll(setupBench.getStatements());
      testAndSetup.getStatements().addAll(testBench.getStatements());

      sw.println( testAndSetup.toString() );

      sw.println(
          "      return true;\n" +
          "    }\n" +
          "    privateFinishTest();\n" +
View Full Code Here

      Statements setupBench = genBenchTarget(beginMethod, endMethod,
          Collections.EMPTY_LIST,
          new Statement(new MethodCall(EMPTY_FUNC, null)));

      StatementsList testStatements = new StatementsList();
      testStatements.getStatements().add(
          new Statement(new MethodCall("super." + method.getName(), null)));
      Statements testBench = genBenchTarget(beginMethod, endMethod,
          Collections.EMPTY_LIST, testStatements);

      String recordResultsCode =
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.generator.ast.StatementsList

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.