Revision: 10260
Author: sco...@google.com
Date: Wed Jun 1 11:03:46 2011
Log: Clarify some confusing code in TypeTightener.
http://gwt-code-reviews.appspot.com/1446814/
Review by: zun...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=10260
Modified:
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java Fri
May 27 07:39:55 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java Wed
Jun 1 11:03:46 2011
@@ -557,8 +557,11 @@
x = newCall;
}
- if (x.canBePolymorphic()) {
- // See if we can remove virtualization from this call.
+ /*
+ * Mark a call as non-polymorphic if the targeted method is the only
+ * possible dispatch, given the qualifying instance type.
+ */
+ if (x.canBePolymorphic() && !target.isAbstract()) {
JExpression instance = x.getInstance();
assert (instance != null);
JReferenceType instanceType = (JReferenceType) instance.getType();
@@ -572,6 +575,7 @@
return;
}
}
+ // The instance type is incompatible with all overrides.
}
x.setCannotBePolymorphic();
madeChanges();
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors