Updated to handle casting between multi-dimensional arrays where one of
them is of an enum type.


http://gwt-code-reviews.appspot.com/1015801/diff/13001/14004
File dev/core/src/com/google/gwt/dev/jjs/impl/EnumOrdinalizer.java
(right):

http://gwt-code-reviews.appspot.com/1015801/diff/13001/14004#newcode349
dev/core/src/com/google/gwt/dev/jjs/impl/EnumOrdinalizer.java:349:
blackListIfEnum(x.getTarget().getEnclosingType());
Yeah, I thought about this, and did have a version working which would
allow ordinalization while an enum has user defined static
methods/fields.  The problem became, that the class would never get
pruned, and would repeatedly cause the 2nd & 3rd AST traversals to
happen in every subsequent optimize loop iteration.  I think there might
be more that can be done as a subsequent release (possibly convert the
class to be a non-enum class, if the only members remaining after
pruning are static methods), but would prefer to keep it out of this
initial version.  In practice, and in testing over large code bases, it
was only a small handful of classes that would be ordinalized with this
restriction lifted.
On 2010/10/26 07:59:40, cromwellian wrote:
Do we really need to blacklist other static methods?

http://gwt-code-reviews.appspot.com/1015801/diff/13001/14004#newcode757
dev/core/src/com/google/gwt/dev/jjs/impl/EnumOrdinalizer.java:757: //
Bail if we don't nkeyeed to do any ordinalization
On 2010/10/26 07:59:40, cromwellian wrote:
spelling

Done.

http://gwt-code-reviews.appspot.com/1015801/diff/13001/14004#newcode794
dev/core/src/com/google/gwt/dev/jjs/impl/EnumOrdinalizer.java:794: if
(type instanceof JArrayType) {
On 2010/10/26 07:59:40, cromwellian wrote:
Does this need to be recursive? What of Enum[][]?

Done.  Also added new test cases to test for multi-dimensional arrays.

http://gwt-code-reviews.appspot.com/1015801/show

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

Reply via email to