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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.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/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index f9d8e6a525590e71ee38d0f3de893208e8286dbc..0e592f366c91fde5b1f874009d654a3a8d8b0e32 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -2346,8 +2346,13 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
LibraryElement coreLibrary = compiler.coreLibrary;
ClassElement objectClass = compiler.objectClass;
Element element = type.element;
-
- if (identical(element, objectClass) || type.treatAsDynamic) {
+ if (element == compiler.nullClass) {
+ if (negative) {
+ checkNonNull(input);
+ } else {
+ checkNull(input);
+ }
+ } else if (identical(element, objectClass) || type.treatAsDynamic) {
// The constant folder also does this optimization, but we make
// it safe by assuming it may have not run.
push(newLiteralBool(!negative), node);

Powered by Google App Engine
This is Rietveld 408576698