Author: [email protected]
Date: Mon Jul  6 08:11:39 2009
New Revision: 5668

Modified:
    trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
     
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java
     
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
    trunk/dev/core/src/com/google/gwt/core/linker/SymbolMapsLinker.java
    trunk/dev/core/src/com/google/gwt/dev/PermutationResult.java
    trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java

Log:
Adds permutation number to symbol maps.  This permutation number is  
currently used by SOYC to retrieve information about each permutation's  
properties.



Modified:  
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java
==============================================================================
---  
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java        
 
(original)
+++  
trunk/dev/core/src/com/google/gwt/core/ext/linker/CompilationResult.java        
 
Mon Jul  6 08:11:39 2009
@@ -42,6 +42,11 @@
    public abstract String[] getJavaScript();

    /**
+   * Returns the permutation ID
+   */
+  public abstract int getPermutationId();
+
+  /**
     * Provides values for {...@link SelectionProperty} instances that are not
     * explicitly set during the compilation phase. This method will return
     * multiple mappings, one for each permutation that resulted in the

Modified:  
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java
==============================================================================
---  
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java
    
(original)
+++  
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardCompilationResult.java
    
Mon Jul  6 08:11:39 2009
@@ -71,6 +71,8 @@
    private static final DiskCache diskCache = new DiskCache();

    private final long jsToken[];
+
+  private final int permutationId;

    private final SortedSet<SortedMap<SelectionProperty, String>>  
propertyValues = new TreeSet<SortedMap<SelectionProperty, String>>(
        MAP_COMPARATOR);
@@ -82,7 +84,7 @@
    private final long symbolToken;

    public StandardCompilationResult(String strongName, byte[][] js,
-      byte[] serializedSymbolMap, StatementRanges[] statementRanges) {
+      byte[] serializedSymbolMap, StatementRanges[] statementRanges, int  
permutationId) {
      super(StandardLinkerContext.class);
      this.strongName = strongName;
      jsToken = new long[js.length];
@@ -91,6 +93,7 @@
      }
      symbolToken = diskCache.writeByteArray(serializedSymbolMap);
      this.statementRanges = statementRanges;
+    this.permutationId = permutationId;
    }

    /**
@@ -113,6 +116,11 @@
      return js;
    }

+  @Override
+  public int getPermutationId() {
+    return permutationId;
+  }
+
    @Override
    public SortedSet<SortedMap<SelectionProperty, String>> getPropertyMap() {
      return Collections.unmodifiableSortedSet(propertyValues);

Modified:  
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
==============================================================================
---  
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
        
(original)
+++  
trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/StandardLinkerContext.java
        
Mon Jul  6 08:11:39 2009
@@ -351,7 +351,7 @@
      if (result == null) {
        result = new StandardCompilationResult(strongName, js,
            permutationResult.getSerializedSymbolMap(),
-          permutationResult.getStatementRanges());
+          permutationResult.getStatementRanges(),  
permutationResult.getPermutationId());
        resultsByStrongName.put(result.getStrongName(), result);
        artifacts.add(result);


Modified:  
trunk/dev/core/src/com/google/gwt/core/linker/SymbolMapsLinker.java
==============================================================================
--- trunk/dev/core/src/com/google/gwt/core/linker/SymbolMapsLinker.java  
(original)
+++ trunk/dev/core/src/com/google/gwt/core/linker/SymbolMapsLinker.java Mon  
Jul  6 08:11:39 2009
@@ -89,6 +89,9 @@
     */
    protected void doWriteSymbolMap(TreeLogger logger, CompilationResult  
result,
        PrintWriter pw) throws UnableToCompleteException {
+
+    pw.println("# { " + result.getPermutationId() + " }");
+
      for (SortedMap<SelectionProperty, String> map :  
result.getPropertyMap()) {
        pw.print("# { ");


Modified: trunk/dev/core/src/com/google/gwt/dev/PermutationResult.java
==============================================================================
--- trunk/dev/core/src/com/google/gwt/dev/PermutationResult.java        
(original)
+++ trunk/dev/core/src/com/google/gwt/dev/PermutationResult.java        Mon Jul 
 6  
08:11:39 2009
@@ -36,6 +36,11 @@
    byte[][] getJs();

    /**
+   * The ID of the permutation.
+   */
+  int getPermutationId();
+
+  /**
     * The symbol map for the permutation.
     */
    byte[] getSerializedSymbolMap();

Modified:  
trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
==============================================================================
--- trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java     
 
(original)
+++ trunk/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java     
 
Mon Jul  6 08:11:39 2009
@@ -137,9 +137,10 @@
      private final byte[][] js;
      private final byte[] serializedSymbolMap;
      private final StatementRanges[] statementRanges;
-
+    private final int permutationId;
+
      public PermutationResultImpl(String[] js, SymbolData[] symbolMap,
-        StatementRanges[] statementRanges) {
+        StatementRanges[] statementRanges, int permutationId) {
        byte[][] bytes = new byte[js.length][];
        for (int i = 0; i < js.length; ++i) {
          bytes[i] = Util.getBytes(js[i]);
@@ -154,6 +155,7 @@
              e);
        }
        this.statementRanges = statementRanges;
+      this.permutationId = permutationId;
      }

      public ArtifactSet getArtifacts() {
@@ -163,6 +165,10 @@
      public byte[][] getJs() {
        return js;
      }
+
+    public int getPermutationId() {
+      return permutationId;
+    }

      public byte[] getSerializedSymbolMap() {
        return serializedSymbolMap;
@@ -322,7 +328,7 @@
        }

        PermutationResult toReturn = new PermutationResultImpl(js,
-          makeSymbolMap(symbolTable), ranges);
+          makeSymbolMap(symbolTable), ranges, permutationId);

        toReturn.getArtifacts().add(
            makeSoycArtifact(logger, permutationId, jprogram, js,  
sourceInfoMaps));

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to