Roberto Lublinerman has posted comments on this change.

Change subject: Optimize initializing fields at the top scope.
......................................................................


Patch Set 6:

(1 comment)

....................................................
File dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
Line 2346: if (x.getTarget().isStatic() | | !x.getTarget().getEnclosingType().replaces(currentClass)) { I think it is worth keeping in but still think there are some unsafe (incorrect) scenarios . You have to go very out of your way to reproduce those but I think we should be very careful still.

Say for example that you store the "this" reference in a field (possibly static) and then call a static function that accesses it and does a dynamic call. Then the optimization in that case is incorrect.

We have three choices:
(1) Leave it as it is now and assume that we are allowed our semantics to divert from java (as we do in some other limited circumstances).

(2) Don't optimize those cases.

(3) Add the necessary checks. i.e. that this is not leaked to a field. But we have to make sure that we cover all possible scenarios.


--
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 <stephen.haber...@gmail.com>
Gerrit-Reviewer: Brian Slesinsky <skybr...@google.com>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Matthew Dempsky <mdemp...@google.com>
Gerrit-Reviewer: Roberto Lublinerman <rlu...@google.com>
Gerrit-Reviewer: Stephen Haberman <stephen.haber...@gmail.com>
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 google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to