Package com.google.gwt.dev.jjs

Examples of com.google.gwt.dev.jjs.PermutationResult


   * Gets or creates a CompilationResult for the given JavaScript program.
   */
  public StandardCompilationResult getCompilation(TreeLogger logger,
      FileBackedObject<PermutationResult> resultFile)
      throws UnableToCompleteException {
    PermutationResult permutationResult = resultFile.newInstance(logger);

    byte[][] js = permutationResult.getJs();
    String strongName = Util.computeStrongName(js);
    StandardCompilationResult result = resultsByStrongName.get(strongName);
    if (result == null) {
      result = new StandardCompilationResult(strongName, js,
          permutationResult.getSerializedSymbolMap(),
          permutationResult.getStatementRanges(), permutationResult.getPermutationId());
      resultsByStrongName.put(result.getStrongName(), result);
      artifacts.add(result);

      // Add any other Permutations
      ArtifactSet otherArtifacts = permutationResult.getArtifacts();
      if (otherArtifacts != null) {
        artifacts.addAll(otherArtifacts);
      }
    }
    return result;
View Full Code Here


    logger.log(TreeLogger.SPAM, "Permutation read");

    Throwable caught = null;
    try {
      logger.log(TreeLogger.DEBUG, "Compiling");
      PermutationResult result = CompilePerms.compile(logger, p, ast);
      resultFile.set(logger, result);
      logger.log(TreeLogger.DEBUG, "Successfully compiled permutation");
    } catch (UnableToCompleteException e) {
      caught = e;
    } catch (Throwable e) {
View Full Code Here

    public void compile(TreeLogger logger, Permutation permutation,
        FileBackedObject<PermutationResult> resultFile)
        throws TransientWorkerException, UnableToCompleteException {
      try {
        PermutationResult result = CompilePerms.compile(logger, permutation,
            ast);
        resultFile.set(logger, result);
      } catch (OutOfMemoryError e) {
        logger.log(TreeLogger.ERROR,
            "OutOfMemoryError: Increase heap size or lower "
View Full Code Here

      StandardLinkerContext linkerContext, ArtifactSet generatedArtifacts,
      List<FileBackedObject<PermutationResult>> resultFiles)
      throws UnableToCompleteException {
    linkerContext.addOrReplaceArtifacts(generatedArtifacts);
    for (FileBackedObject<PermutationResult> resultFile : resultFiles) {
      PermutationResult result = resultFile.newInstance(logger);
      finishPermutation(logger, result.getPermutation(), result, linkerContext);
    }
    return linkerContext.invokeLink(logger);
  }
View Full Code Here

      // Choose which permutations go with this precompilation
      Permutation[] subPerms = selectPermutationsForPrecompilation(
          new int[] {permId}, precompilation);
      assert subPerms.length == 1;

      PermutationResult permResult = compile(logger, subPerms[0],
          precompilation.getUnifiedAst());
      FileBackedObject<PermutationResult> resultFile = new FileBackedObject<PermutationResult>(
          PermutationResult.class, makePermFilename(compilerWorkDir, permId));
      permResult.addArtifacts(precompilation.getGeneratedArtifacts());
      resultFile.set(logger, permResult);
    }

    logger.log(TreeLogger.INFO, "Compile of permutations succeeded");
    return true;
View Full Code Here

    try {
      TreeLogger branch = logger.branch(TreeLogger.DEBUG, "Compiling");
      CompilerContext compilerContext =
          new CompilerContext.Builder().options(ast.getOptions()).build();

      PermutationResult result =
          CompilePerms.compile(branch, compilerContext, permutation, ast);
      resultFile.set(logger, result);
      logger.log(TreeLogger.DEBUG, "Successfully compiled permutation");
    } catch (UnableToCompleteException e) {
      caught = e;
View Full Code Here

      // Choose which permutations go with this precompilation
      Permutation[] subPerms = selectPermutationsForPrecompilation(
          new int[]{permId}, precompilation);
      assert subPerms.length == 1;

      PermutationResult permResult =
          compile(logger, compilerContext, subPerms[0], precompilation.getUnifiedAst());
      Link.linkOnePermutationToJar(logger, compilerContext.getModule(),
          compilerContext.getPublicResourceOracle(), precompilation.getGeneratedArtifacts(),
          permResult, makePermFilename(compilerWorkDir, permId), compilerContext.getOptions());
    }
View Full Code Here

    // Choose the permutation that goes with this precompilation
    Permutation[] subPerms = CompilePerms.selectPermutationsForPrecompilation(
        new int[]{permId}, precompilation);
    assert subPerms.length == 1;

    PermutationResult permResult =
        precompilation.getUnifiedAst().compilePermutation(logger, compilerContext, subPerms[0]);
    Link.linkOnePermutationToJar(logger, module, compilerContext.getPublicResourceOracle(),
        precompilation.getGeneratedArtifacts(), permResult, makePermFilename(
            compilerWorkDir, permId), precompilationOptions);
    return true;
View Full Code Here

   */
  private static ArtifactSet finishPermutation(TreeLogger logger, Permutation perm,
      PersistenceBackedObject<PermutationResult> resultFile, Set<PermutationResult> libraries,
      StandardLinkerContext linkerContext, ArtifactSet generatedArtifacts)
      throws UnableToCompleteException {
    PermutationResult permResult = resultFile.newInstance(logger);
    StandardCompilationResult compilation =
        new StandardCompilationResult(permResult, libraries);
    addSelectionPermutations(compilation, perm, linkerContext);
    logScriptSize(logger, perm.getId(), compilation);

    ArtifactSet permArtifacts = new ArtifactSet(generatedArtifacts);
    permArtifacts.addAll(permResult.getArtifacts());
    permArtifacts.add(compilation);
    permArtifacts.freeze();
    return linkerContext.invokeLinkForOnePermutation(logger, compilation,
        permArtifacts);
  }
View Full Code Here

    @Override
    public void compile(TreeLogger logger, CompilerContext compilerContext, Permutation permutation,
        PersistenceBackedObject<PermutationResult> resultFile)
        throws TransientWorkerException, UnableToCompleteException {
      try {
        PermutationResult result = CompilePerms.compile(logger, compilerContext, permutation, ast);
        resultFile.set(logger, result);
      } catch (OutOfMemoryError e) {
        logger.log(TreeLogger.ERROR,
            "OutOfMemoryError: Increase heap size or lower "
                + MAX_THREADS_PROPERTY, e);
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.PermutationResult

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.