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

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

Issue 10389063: Implement PrimitiveOrNull types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 7482)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -548,9 +548,12 @@
HInstruction visitTypeConversion(HTypeConversion node) {
HInstruction value = node.inputs[0];
- // If the union of the types is still the input type then
- // no conversion is required.
- HType combinedType = value.propagatedType.union(node.propagatedType);
+ Type type = node.propagatedType.computeType(compiler);
+ if (type.element === compiler.dynamicClass
+ || type.element === compiler.objectClass) {
+ return value;
+ }
+ HType combinedType = value.propagatedType.intersection(node.propagatedType);
return (combinedType == value.propagatedType) ? value : node;
}
@@ -1075,7 +1078,6 @@
HInstruction input = instruction.expression;
HType convertedType =
new HType.fromBoundedType(instruction.typeExpression, compiler);
- if (convertedType === null) return;
List<HInstruction> ifUsers = <HInstruction>[];
List<HInstruction> notIfUsers = <HInstruction>[];

Powered by Google App Engine
This is Rietveld 408576698