Roberto Lublinerman has posted comments on this change.
Change subject: Optimize initializing fields at the top scope.
......................................................................
Patch Set 6:
(2 comments)
....................................................
File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
Line 2326: public boolean visit(JMethod x, Context ctx) {
Add
// Check constructors and init method.
if (x.getName().equals("$$init") {
return true;
}
Line 2346: if (x.getTarget().isStatic() |
| !x.getTarget().getEnclosingType().replaces(currentClass)) {
I think this is still not safe. If we don't optimize for this case do we
leave out many opportunities?
The reason it is not safe is that the "this" reference might leak in many
ways e.g.
seeminglySafe(new UnrelatedClass(this));
To be safe either we need to check every potentially called method (as
Brian suggested); or allow methods that won't be able to observe this and
this case is subtle.
Let's leave this out for the moment, go ahead with the patch and see if we
miss too many opportunities.
--
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.