http://gwt-code-reviews.appspot.com/1447821/diff/9006/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
File dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
(right):

http://gwt-code-reviews.appspot.com/1447821/diff/9006/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java#newcode996
dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java:996:

It can be run at the end of a CFA "pass", but it must be run before any
attempt to use the data from a CFA pass, this is somewhat difficult
since CFA is used in many places and there's no sort of "post-CFA" call
that's expected to be made to "commit" CFA results before you use them,
which is where I'd like to hook in.

I'll try moving it into CFA's visitor to do it incrementally.

On 2011/06/30 16:07:13, jbrosenberg wrote:
(Just copied over the same comments I had earlier from patch set 2)

This seems a bit expensive (iterating through all instantiated types).
 It looks
like it could be called many times per optimization pass?  For
instance,
traverseFrom() is called multiple times in a loop, in
traverseEntryMethods().
Is there any impact on execution time, for large projects?   It seems
like it
should only be called once per CFA pass, no?   Also, traverseFrom is
called in
many places external to this class, in tight loops iterating over
multiple
methods, etc.

http://gwt-code-reviews.appspot.com/1447821/diff/9006/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
(right):

http://gwt-code-reviews.appspot.com/1447821/diff/9006/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java#newcode1817
dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1817:
for (JMethod method : x.getMethods()) {
On 2011/06/30 16:07:13, jbrosenberg wrote:
Can you add a comment of explanation here, as discussed in patch set
2?

I added a comment. Basically, the compiler will insert the following,
even on empty classes:

public void init$() {}
public A() { super(); init$(); }

http://gwt-code-reviews.appspot.com/1447821/diff/9006/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java#newcode1822
dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java:1822:
if (JProgram.isClinit(method)) {
On 2011/06/30 16:07:13, jbrosenberg wrote:
Add an assert (as discussed in comment in patch set 2)?

Also can't assert emptyness. I added a comment. Any static fields
initialized by JSO Array or Object will yield a clinit() with code in
it. Also, if B extend A, then B's clinit will be non-empty and include
code that invokes A's clinit (which could be empty).

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

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

Reply via email to