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

Unified Diff: sdk/lib/_internal/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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 14515)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -146,7 +146,7 @@
// If we can replace [instruction] with [replacement], then
// [replacement]'s type can be narrowed.
types[replacement] =
- types[replacement].intersection(types[instruction], compiler);
+ types[replacement].intersection(types[instruction], compiler);
// If the replacement instruction does not know its
// source element, use the source element of the
@@ -401,7 +401,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);
}
@@ -623,7 +623,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;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698