On Thu, Mar 3, 2011 at 6:49 PM, <[email protected]> wrote:
Can you explain the high-level of why the change everywhere away from HasEnclosingType to JNode? Is it just code cleanup, or does it have some functional component?
JsniRefCollector always used to return a JMethod or JField. In the case of class literals, it would return the class literal's implementation field in ClassLiteralHolder. HasEnclosingType was merely a common super interface of JMethod and JField, totally arbtrary. It could have been JNode before. Now, for class literals, JsniRefCollector returns a JType, because the field won't be defined yet. JType doesn't implement HasEnclosingType, so I had to move it up to the next common super type.
I assume also that, once the optimizations start, the expectation is that the behavior will be the same as before?
Yep, it just makes it easier to construct detached ASTs with no JProgram, and fill in the implementation fields later. http://gwt-code-reviews.appspot.com/1375801/diff/4002/dev/core/src/com/google/gwt/dev/jjs/ArtificialRescueRecorder.java File dev/core/src/com/google/gwt/dev/jjs/ArtificialRescueRecorder.java (right): http://gwt-code-reviews.appspot.com/1375801/diff/4002/dev/core/src/com/google/gwt/dev/jjs/ArtificialRescueRecorder.java#newcode112 dev/core/src/com/google/gwt/dev/jjs/ArtificialRescueRecorder.java:112: if (!(node instanceof JType)) { Yeah, sorry that's slightly confusing, will fix. http://gwt-code-reviews.appspot.com/1375801/diff/4002/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java (right): http://gwt-code-reviews.appspot.com/1375801/diff/4002/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java#newcode3035 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:3035: } Yes, before it returned a JField for class literals (the implementation field). Now it returns a JType, and we convert it into a JClassLiteral here. http://gwt-code-reviews.appspot.com/1375801/diff/4002/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java#newcode3049 dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java:3049: throw new InternalCompilerException(node, On 2011/03/03 23:49:42, jbrosenberg wrote:
Should the message here be updated to "...other than a field or method
or class
literal"?
Done. http://gwt-code-reviews.appspot.com/1375801/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
