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

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

Issue 11361060: Support checked mode for return type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 14460)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -398,7 +398,7 @@
assert(!leftType.isConflicting() && !rightType.isConflicting());
// We don't optimize on numbers to preserve the runtime semantics.
- if (!(left.isNumber(types) && right.isNumber(types)) &&
+ if (!(left.isNumberOrNull(types) && right.isNumberOrNull(types)) &&
leftType.intersection(rightType, compiler).isConflicting()) {
return graph.addConstantBool(false, constantSystem);
}
@@ -620,7 +620,9 @@
HInstruction value = node.inputs[1];
if (compiler.enableTypeAssertions) {
HInstruction other = value.convertType(
- compiler, field, HTypeConversion.CHECKED_MODE_CHECK);
+ compiler,
+ field.computeType(compiler),
+ HTypeConversion.CHECKED_MODE_CHECK);
if (other != value) {
node.block.addBefore(node, other);
value = other;

Powered by Google App Engine
This is Rietveld 408576698