Package com.google.gwt.dev.cfg

Examples of com.google.gwt.dev.cfg.PropertyPermutations


   * @return the precompilation
   */
  public static Precompilation precompile(TreeLogger logger,
      JJSOptions jjsOptions, ModuleDef module, File genDir,
      File generatorResourcesDir, File dumpSignatureFile) {
    PropertyPermutations allPermutations = new PropertyPermutations(
        module.getProperties());
    return precompile(logger, jjsOptions, module, 0, allPermutations, genDir,
        generatorResourcesDir, dumpSignatureFile);
  }
View Full Code Here


      }

      ArtifactSet generatorArtifacts = new ArtifactSet();
      DistillerRebindPermutationOracle rpo = new DistillerRebindPermutationOracle(
          module, compilationState, generatorArtifacts,
          new PropertyPermutations(module.getProperties()), genDir,
          generatorResourcesDir);
      // Allow GC later.
      compilationState = null;
      if (dumpSignatureFile != null) {
        // Dump early to avoid generated types.
View Full Code Here

        }
        branch.log(TreeLogger.INFO, "Validation succeeded");
      } else {
        TreeLogger branch = logger.branch(TreeLogger.INFO,
            "Precompiling module " + module.getName());
        PropertyPermutations allPermutations = new PropertyPermutations(
            module.getProperties());
        int potentialPermutations = allPermutations.size();
        int permutationsPerIteration = options.getMaxPermsPerPrecompile();

        if (permutationsPerIteration <= 0) {
          permutationsPerIteration = potentialPermutations;
        }
        /*
         * The potential number of permutations to precompile >= the actual
         * number of permutations that end up being precompiled, because some of
         * the permutations might collapse due to identical rebind results. So
         * we have to track these two counts and ids separately.
         */
        int actualPermutations = 0;
        for (int potentialFirstPerm = 0; potentialFirstPerm < potentialPermutations; potentialFirstPerm += permutationsPerIteration) {
          int numPermsToPrecompile = Math.min(potentialPermutations
              - potentialFirstPerm, permutationsPerIteration);

          // Select only the range of property permutations that we want
          PropertyPermutations localPermutations = new PropertyPermutations(
              allPermutations, potentialFirstPerm, numPermsToPrecompile);

          Precompilation precompilation = precompile(branch, options, module,
              actualPermutations, localPermutations, options.getGenDir(),
              compilerWorkDir, options.getDumpSignatureFile());
View Full Code Here

   * @return the precompilation
   */
  public static Precompilation precompile(TreeLogger logger,
      JJSOptions jjsOptions, ModuleDef module, File genDir,
      File generatorResourcesDir, File dumpSignatureFile) {
    PropertyPermutations allPermutations = new PropertyPermutations(
        module.getProperties());
    return precompile(logger, jjsOptions, module, 0, allPermutations, genDir,
        generatorResourcesDir, dumpSignatureFile);
  }
View Full Code Here

      }

      ArtifactSet generatorArtifacts = new ArtifactSet();
      DistillerRebindPermutationOracle rpo = new DistillerRebindPermutationOracle(
          module, compilationState, generatorArtifacts,
          new PropertyPermutations(module.getProperties()), genDir,
          generatorResourcesDir);
      // Never optimize on a validation run.
      jjsOptions.setOptimizePrecompile(false);
      getCompiler(module).precompile(logger, module, rpo, declEntryPts,
          additionalRootTypes, jjsOptions, true);
View Full Code Here

    precompilationOptions.setOptimizePrecompile(false);
    precompilationOptions.setCompilationStateRetained(true);
    precompilationOptions.setGenDir(null);

    ModuleDef module = ModuleDefLoader.loadFromClassPath(logger, moduleName);
    PropertyPermutations allPermutations = new PropertyPermutations(
        module.getProperties());
    int[] perms = options.getPermsToCompile();
    if (perms == null) {
      perms = new int[allPermutations.size()];
      for (int i = 0; i < perms.length; ++i) {
        perms[i] = i;
      }
    }

    logger = logger.branch(TreeLogger.INFO, "Compiling " + perms.length
        + " permutation" + (perms.length > 1 ? "s" : ""));
    for (int permId : perms) {
      /*
       * TODO(spoon,scottb): move Precompile out of the loop to run only once
       * per shard. We'll need a new PropertyPermutations constructor that can
       * take a precise list. Then figure out a way to avoid copying the
       * generated artifacts into every perm result on a shard.
       */
      module.getCompilationState(logger).refresh(logger);
      PropertyPermutations onePerm = new PropertyPermutations(allPermutations,
          permId, 1);

      assert (precompilationOptions.getDumpSignatureFile() == null);
      Precompilation precompilation = Precompile.precompile(logger,
          precompilationOptions, module, permId, onePerm,
View Full Code Here

    typeOracle = module.getTypeOracle(logger);
    sourceOracle = new StandardSourceOracle(typeOracle);
    declEntryPts = module.getEntryPointTypeNames();
    rebindPermOracle = new DistillerRebindPermutationOracle();
    properties = module.getProperties();
    perms = new PropertyPermutations(properties);
    WebModeCompilerFrontEnd frontEnd = new WebModeCompilerFrontEnd(
        sourceOracle, rebindPermOracle);
    jjs = new JavaToJavaScriptCompiler(logger, frontEnd, declEntryPts,
        obfuscate, prettyNames);
    initCompilations(logger);
View Full Code Here

    }

    ArtifactSet generatorArtifacts = new ArtifactSet();
    rebindPermOracle = new DistillerRebindPermutationOracle(generatorArtifacts);
    properties = module.getProperties();
    perms = new PropertyPermutations(properties);
    WebModeCompilerFrontEnd frontEnd = new WebModeCompilerFrontEnd(
        compilationState, rebindPermOracle);
    jjs = new JavaToJavaScriptCompiler(logger, frontEnd, declEntryPts,
        jjsOptions);
View Full Code Here

      prop.addDefinedValue(new ConditionWhenPropertyIs("A", "a3"), "b3");
    }

    try {
      new PropertyPermutations(props, md.getActiveLinkerNames());
      fail();
    } catch (IllegalStateException e) {
      // OK
    }
  }
View Full Code Here

      prop.addDefinedValue(prop.getRootCondition(), "true");
    }

    // Permutations and their values are in stable alphabetical order.
    //
    PropertyPermutations perms = new PropertyPermutations(md.getProperties(),
        md.getActiveLinkerNames());
    String[] perm;
    Iterator<String[]> iter = perms.iterator();

    assertTrue(iter.hasNext());
    perm = iter.next();
    assertEquals("false", perm[0]);
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.cfg.PropertyPermutations

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.