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

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

Issue 10700122: Generalize the use of type information for setters and initializers (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/compiler.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 b3aceba4e9901c910610a4fcd154d78308566fb4..93ff1af2d086ae10a4dd663a9c4ce9d4937dccb5 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -1218,32 +1218,31 @@ class SsaProcessRecompileCandidates
HFieldGet left = node.left;
HConstant right = node.right;
if (left.element != null && left.element.enclosingElement.isClass()) {
+ // Calculate the field type from the information available.
+ HType type =
+ backend.fieldSettersTypeSoFar(left.element).union(
+ backend.typeFromInitializersSoFar(left.element));
switch (compiler.phase) {
case Compiler.PHASE_COMPILING:
- if ((backend.fieldSettersTypeSoFar(left.element).isUnknown() ||
- backend.fieldSettersTypeSoFar(left.element).isInteger()) &&
- backend.couldHaveFieldSingleTypeInitializers(
- left.element, HType.INTEGER)) {
+ if (!type.isConflicting()) {
compiler.enqueuer.codegen.registerRecompilationCandidate(
work.element);
}
break;
case Compiler.PHASE_RECOMPILING:
- if (backend.fieldSettersTypeSoFar(left.element).isInteger() &&
- backend.hasFieldSingleTypeInitializers(
- left.element, HType.INTEGER)) {
+ if (!type.isConflicting()) {
if (compiler.codegenWorld.hasInvokedSetter(left.element,
compiler)) {
// If there are invoked setters we don't know for sure that the
- // field will hold an integer, but the fact that the class
- // itself always sets an integer in the fiels is still a strong
+ // field will hold the calculated, but the fact that the class
+ // itself stick to this type in the field is still a strong
// signal to indiate the expected type of the field.
floitsch 2012/07/06 09:06:51 indicate
- left.propagatedType = HType.INTEGER;
+ left.propagatedType = type;
ngeoffray 2012/07/11 12:48:43 Isn't that covered by visitFieldGet already?
graph.highTypeLikelyhood = true;
} else {
// If there are no invoked setters we know the type of this
// field for sure.
- left.guaranteedType = HType.INTEGER;
+ left.guaranteedType = type;
ngeoffray 2012/07/11 12:48:43 ditto?
}
}
break;
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698