Reviewers: jbrosenberg, zundel,
http://gwt-code-reviews.appspot.com/1452802/diff/1/dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java
File dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java (right):
http://gwt-code-reviews.appspot.com/1452802/diff/1/dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java#newcode40
dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java:40: if (ctor
instanceof JConstructor) {
All methods have their params frozen as soon as construction is done.
Probably it would be better to simply require params to be provided at
construction time instead of making it stateful, but that's how it was
written.
The reason to check for original params is that we're looking for a
specific signature. If some non-default constructor theoretically had
its params removed prior to this, we wouldn't want to call the wrong
one.
Practically speaking, it doesn't matter since opts don't run before
GWT.creates() are replaced, but this is more correct.
http://gwt-code-reviews.appspot.com/1452802/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/ImplementClassLiteralsAsFields.java
File
dev/core/src/com/google/gwt/dev/jjs/impl/ImplementClassLiteralsAsFields.java
(right):
http://gwt-code-reviews.appspot.com/1452802/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/ImplementClassLiteralsAsFields.java#newcode220
dev/core/src/com/google/gwt/dev/jjs/impl/ImplementClassLiteralsAsFields.java:220:
for (JMethod methodIt : enumType.getMethods()) {
Probably so. Will fix, or maybe just compare method signature.
http://gwt-code-reviews.appspot.com/1452802/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
File dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
(right):
http://gwt-code-reviews.appspot.com/1452802/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java#newcode157
dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java:157:
JMethod clinit =
I *think* that the currently-being-compiled-unit will want to encode a
reference from its own clinit to its super clinit, which will generally
be an external type from another unit. There needs to be a placeholder
to target so that it can be resolved later. I suppose it could be
written such that GwtAstBuilder does not insert the super clinit call
and leaves it to UnifyAst (the code I'm working on) to do so later.
But even if it didn't make a practical difference, there's a hard-baked
assumption in lots of places that method 0 of any class is always the
clinit. This isn't necessarily a great formulation, there's probably
better ways we could have modeled it, but there you have it. To not
have a placeholder method would risk introducing subtle bugs.
Please review this at http://gwt-code-reviews.appspot.com/1452802/
Affected files:
M dev/core/src/com/google/gwt/dev/jjs/ast/JClassType.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JConstructor.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JField.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JFieldRef.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JInterfaceType.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JStringLiteral.java
M dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java
M dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
M
dev/core/src/com/google/gwt/dev/jjs/impl/ImplementClassLiteralsAsFields.java
M dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java
M dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
M dev/core/src/com/google/gwt/dev/util/collect/Lists.java
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors