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

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

Issue 23012003: Add Null class to dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Marked test failing due to new dart2js mirror bug. Created 7 years, 4 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: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index 2b0107718edb420e00e079a85d8aab397837d2d9..9460e6b05a8b3c10bef69fdb36d36b6ba823a8cd 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -583,7 +583,8 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
// raw type.
} else if (!RuntimeTypes.hasTypeArguments(type)) {
TypeMask expressionMask = expressionType.computeMask(compiler);
- TypeMask typeMask = new TypeMask.nonNullSubtype(type);
+ TypeMask typeMask = (element == compiler.nullClass)
+ ? new TypeMask.subtype(type) : new TypeMask.nonNullSubtype(type);
if (expressionMask.union(typeMask, compiler) == typeMask) {
return graph.addConstantBool(true, compiler);
} else if (expressionMask.intersection(typeMask, compiler).isEmpty) {

Powered by Google App Engine
This is Rietveld 408576698