Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10696195: Simplify type handling for recompilation of field gets. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index c8ef7e5129f39271f2572ead4d3d76bbff06f9c1..d8150137da83a7d73ad5476085d756cbc3c168f6 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -1277,37 +1277,17 @@ class SsaRecompilationFieldTypePropagator
void handleFieldGet(HFieldGet field, HType type) {
assert(compiler.phase == Compiler.PHASE_RECOMPILING);
if (!type.isConflicting()) {
+ // If there are no invoked setters with this name, the union of
+ // the types of the initializers and the setters is guaranteed
+ // otherwise it is only speculative.
Element element = field.element;
- // Check if optimistic type is based on a setter in the
- // constructor body.
- if (backend.hasConstructorBodyFieldSetter(element)) {
- // If there are no other field setters then the one in
- // the constructor body, the type is guaranteed for this
- // field after construction.
- assert(!element.isGenerativeConstructorBody());
- if (!compiler.codegenWorld.hasInvokedSetter(element, compiler)) {
- field.guaranteedType =
- type.union(backend.fieldSettersTypeSoFar(element));
- } else {
- field.propagatedType =
- type.union(backend.fieldSettersTypeSoFar(element));
- }
+ assert(!element.isGenerativeConstructorBody());
+ if (!compiler.codegenWorld.hasInvokedSetter(element, compiler)) {
+ field.guaranteedType =
+ type.union(backend.fieldSettersTypeSoFar(element));
} else {
- // If there are no setters the initializer list type is
- // guaranteed to remain constant.
- //
- // TODO(ager): Why is this treated differently from the
- // case above? It seems to me that we could/should use
- // the union of the types for the field setters and the
- // initializer list here? It would give the same when
- // there are none and potentially better information for
- // more cases.
- if (!compiler.codegenWorld.hasFieldSetter(element, compiler) &&
- !compiler.codegenWorld.hasInvokedSetter(element, compiler)) {
- field.guaranteedType = type;
- } else {
- field.propagatedType = type;
- }
+ field.propagatedType =
+ type.union(backend.fieldSettersTypeSoFar(element));
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698