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

Unified Diff: runtime/vm/object.cc

Issue 10828319: Cleanup handling of NullType in type propagation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 10694)
+++ runtime/vm/object.cc (working copy)
@@ -1828,7 +1828,12 @@
// Check for NullType, which is not a subtype of any type, but is more
// specific than any type.
if (IsNullClass()) {
- return test_kind == kIsMoreSpecificThan;
+ // User code cannot refer to class Null, therefore, we can only encounter
+ // NullType here as the type of the null constant, which must be treated
+ // separately in 'instance of' checks. Therefore, the NullType can only
+ // be encountered here during optimizations in 'more specific than' tests.
+ ASSERT(test_kind == kIsMoreSpecificThan);
+ return true;
}
// Check for reflexivity.
if (raw() == other.raw()) {
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698