From the point of view of saving memory & cpu, a white list makes sense
to me.


http://gwt-code-reviews.appspot.com/134810/diff/1/3
File dev/core/src/com/google/gwt/dev/jjs/ast/JAnnotation.java (right):

http://gwt-code-reviews.appspot.com/134810/diff/1/3#newcode62
Line 62: * Returns a mutable list.
Why mutable?  Seems like this should use the memory-light collections,
which may very well be immutable.

http://gwt-code-reviews.appspot.com/134810/diff/1/3#newcode70
Line 70: // Do nothing else
Why aren't the values visited?

http://gwt-code-reviews.appspot.com/134810/diff/1/3#newcode231
Line 231: return Collections.unmodifiableList(properties);
Lists.normalizeUnmodifiable()?

http://gwt-code-reviews.appspot.com/134810/diff/1/4
File dev/core/src/com/google/gwt/dev/jjs/ast/JDeclaredType.java (right):

http://gwt-code-reviews.appspot.com/134810/diff/1/4#newcode142
Line 142: return Collections.unmodifiableList(annotations);
Again, Lists.normalizeUnmodifiable is my suggestion, and so on
throughout this patch.

http://gwt-code-reviews.appspot.com/134810/diff/1/5
File dev/core/src/com/google/gwt/dev/jjs/ast/JExternalType.java (right):

http://gwt-code-reviews.appspot.com/134810/diff/1/5#newcode24
Line 24: public class JExternalType extends JClassType {
What if the external type is an interface?

http://gwt-code-reviews.appspot.com/134810/diff/1/8
File dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java (right):

http://gwt-code-reviews.appspot.com/134810/diff/1/8#newcode266
Line 266: annotations = visitor.acceptImmutable(annotations);
If fields and methods traverse() their annotations, shouldn't all the
concrete subclasses of JDeclaredType do so also?

http://gwt-code-reviews.appspot.com/134810/diff/1/13
File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
(right):

http://gwt-code-reviews.appspot.com/134810/diff/1/13#newcode622
Line 622: SourceInfo info = currentMethod == null ?
currentClass.getSourceInfo()
Wouldn't the current annotation have its own source info?

http://gwt-code-reviews.appspot.com/134810/diff/1/13#newcode2711
Line 2711: JInterfaceType annotationType = (JInterfaceType)
typeMap.tryGet(binding);
This may all get redone soon to support independently-compiled,
lazily-linked classes, so I'm not feeling very particular about this.

http://gwt-code-reviews.appspot.com/134810/diff/1/13#newcode3120
Line 3120: "com.google.gwt.dev.jjs", "test"));
It would save memory & processing to just ignore annotations we don't
care about.

However, this this ought to be in JProgram with the indexed types and
code gen type lists.

http://gwt-code-reviews.appspot.com/134810

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

Reply via email to