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

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: Made VM not fail on x is Null tests. 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 3e072dcdaa8e59b0aca7c08a85d6521616705c4c..83b107df61d8e0c4da72838c372cf75d8ee020d4 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