| commit | d73470295a0cf2d3dfc10a014d18a6865e80fb37 | [log] [tgz] |
|---|---|---|
| author | scottb@google.com <scottb@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Wed Jun 01 18:03:46 2011 +0000 |
| committer | scottb@google.com <scottb@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Wed Jun 01 18:03:46 2011 +0000 |
| tree | 9d0a57fc0e509f4d1f5ba72a1f6df31c3a6f4bc4 | |
| parent | dc31eea2594f0d842cf8eca3d24a42e8ea528b8f [diff] |
Clarify some confusing code in TypeTightener. http://gwt-code-reviews.appspot.com/1446814/ Review by: zundel@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10260 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java b/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java index 016e0bf..16653db 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java
@@ -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();