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

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

Issue 10694091: Collect the actual types for all field setters. (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 | « lib/compiler/implementation/ssa/codegen.dart ('k') | 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 664b62bd63cdcce93493fbe7bad40f8518d6e4bf..b3aceba4e9901c910610a4fcd154d78308566fb4 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -1188,12 +1188,15 @@ class SsaProcessRecompileCandidates
// body.
if (backend.hasConstructorBodyFieldSetter(field)) {
// There is at least one field setter from the constructor.
- // TODO(sgjesse): Collect the type for all the field setters so that
- // this could be a guarenteed type if all field setters have the
- // same type and there are no invoked setters.
- node.propagatedType = type;
+ if (!compiler.codegenWorld.hasInvokedSetter(field, compiler)) {
Mads Ager (google) 2012/07/05 13:55:19 Should this be the resolverWorld? Are you sure tha
Mads Ager (google) 2012/07/05 13:56:53 Ignore me, this is during recompilation so this is
+ node.guaranteedType =
+ type.union(backend.fieldSettersTypeSoFar(node.element));
+ } else {
+ node.propagatedType =
+ type.union(backend.fieldSettersTypeSoFar(node.element));
+ }
} else {
- // Optimistic type is based in field initializer list.
+ // Optimistic type is based on field initializer list.
if (!compiler.codegenWorld.hasFieldSetter(field, compiler) &&
!compiler.codegenWorld.hasInvokedSetter(field, compiler)) {
node.guaranteedType = type;
@@ -1217,7 +1220,8 @@ class SsaProcessRecompileCandidates
if (left.element != null && left.element.enclosingElement.isClass()) {
switch (compiler.phase) {
case Compiler.PHASE_COMPILING:
- if (backend.onlyFieldIntegerSettersSoFar(left.element) &&
+ if ((backend.fieldSettersTypeSoFar(left.element).isUnknown() ||
Mads Ager (google) 2012/07/05 13:42:53 We should probably generalize these things as well
Søren Gjesse 2012/07/06 04:10:32 Will do.
+ backend.fieldSettersTypeSoFar(left.element).isInteger()) &&
backend.couldHaveFieldSingleTypeInitializers(
left.element, HType.INTEGER)) {
compiler.enqueuer.codegen.registerRecompilationCandidate(
@@ -1225,7 +1229,7 @@ class SsaProcessRecompileCandidates
}
break;
case Compiler.PHASE_RECOMPILING:
- if (backend.onlyFieldIntegerSettersSoFar(left.element) &&
+ if (backend.fieldSettersTypeSoFar(left.element).isInteger() &&
backend.hasFieldSingleTypeInitializers(
left.element, HType.INTEGER)) {
if (compiler.codegenWorld.hasInvokedSetter(left.element,
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698