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

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

Issue 11341041: Fix for dartbug.com/6036: the intersection of two different types is not always conflicting. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
Index: lib/compiler/implementation/ssa/types_propagation.dart
===================================================================
--- lib/compiler/implementation/ssa/types_propagation.dart (revision 14260)
+++ lib/compiler/implementation/ssa/types_propagation.dart (working copy)
@@ -21,7 +21,7 @@
HType computeType(HInstruction instruction) {
if (instruction.hasGuaranteedType()) return instruction.guaranteedType;
- return instruction.computeTypeFromInputTypes(types);
+ return instruction.computeTypeFromInputTypes(types, compiler);
}
// Re-compute and update the type of the instruction. Returns
@@ -172,7 +172,7 @@
HType desiredType = HType.UNKNOWN;
for (final user in instruction.usedBy) {
HType userType =
- user.computeDesiredTypeForInput(instruction, types);
+ user.computeDesiredTypeForInput(instruction, types, compiler);
// Mainly due to the "if (true)" added by hackAroundPossiblyAbortingBody
// in builder.dart uninitialized variables will propagate a type of null
// which will result in a conflicting type when combined with a primitive
@@ -180,7 +180,7 @@
// TODO(sgjesse): Reconcider this when hackAroundPossiblyAbortingBody
// has been removed.
if (desiredType.isPrimitive() && userType == HType.NULL) continue;
- desiredType = desiredType.intersection(userType);
+ desiredType = desiredType.intersection(userType, compiler);
// No need to continue if two users disagree on the type.
if (desiredType.isConflicting()) break;
}
@@ -203,7 +203,7 @@
// TODO(ngeoffray): Allow speculative optimizations on
// non-primitive types?
if (!desiredType.isPrimitive()) return newType;
- return newType.intersection(desiredType);
+ return newType.intersection(desiredType, compiler);
}
// Do not use speculative argument type optimization for now.

Powered by Google App Engine
This is Rietveld 408576698