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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 23012003: Add Null class to dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed IsNullType. All tests succeede for VM now. 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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index f9c395cd0c2c224f935a90ec88a342ab2295b797..fc39e60a527469ec36bf2b741edc437de63521fd 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1176,11 +1176,12 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
const Class& cls = Class::Handle(literal_value.clazz());
ConstantInstr* result = NULL;
if (cls.IsNullClass()) {
rmacnak 2013/08/14 16:25:30 This doesn't need to be a special case. The else c
Lasse Reichstein Nielsen 2013/08/15 12:24:44 Done.
- // A null object is only an instance of Object and dynamic, which has
- // already been checked above (if the type is instantiated). So we can
- // return false here if the instance is null (and if the type is
+ // A null object is only an instance of Object, dynamic and Null, the
+ // first two of which has already been checked above (if the type is
// instantiated).
- result = new ConstantInstr(negate_result ? Bool::True() : Bool::False());
+ const bool is_type = type.IsNullType();
+ result = new ConstantInstr((is_type != negate_result) ? Bool::True()
+ : Bool::False());
} else {
Error& malformed_error = Error::Handle();
if (literal_value.IsInstanceOf(type,
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698