Stephen Haberman has posted comments on this change.
Change subject: Optimize initializing fields at the top scope.
......................................................................
Patch Set 6:
(2 comments)
Thanks all, for continuing to vet the patch.
....................................................
File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
Line 2326: public boolean visit(JMethod x, Context ctx) {
Done
Line 2346: if (x.getTarget().isStatic() |
| !x.getTarget().getEnclosingType().replaces(currentClass)) {
I believe it's okay because the "new UnrelatedClass(this)" call is itself a
JMethodCall to the cstr, which would have leaked "this", and so caused the
current class to be marked (I actually saw this happen when debugging; I
forget which class it was for).
So--the current logic is "if you call any method on yourself, use the slow
way" or "if you call any static/other method that could pass you, also use
the slow way".
If I leave this check out, running CompilerTest, it goes from ~3 classes
using the slow way (Throwable, http.client.Request, and FieldInitOrderBase)
to ~20-25 classes using the slow way (including ArrayList due to the
c.toArray() method call).
So, I think this is worth keeping in?
--
To view, visit https://gwt-review.googlesource.com/3440
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I97a06eb36396a8b8659ce9a025b21a9cf93d0500
Gerrit-PatchSet: 6
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Stephen Haberman <[email protected]>
Gerrit-Reviewer: Brian Slesinsky <[email protected]>
Gerrit-Reviewer: Leeroy Jenkins <[email protected]>
Gerrit-Reviewer: Matthew Dempsky <[email protected]>
Gerrit-Reviewer: Roberto Lublinerman <[email protected]>
Gerrit-Reviewer: Stephen Haberman <[email protected]>
Gerrit-HasComments: Yes
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.