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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 2608373002: Move Null type to the Bottom in the VM (fixes #28025). (Closed)
Patch Set: address comments and sync Created 3 years, 11 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/flow_graph_compiler_x64.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 9f96d7d7ca2beab4cbe7d49a62f7c7c6a9e9eef4..928c533f3b31e86b567cb95da10377cda995c6f9 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -604,7 +604,7 @@ bool CompileType::CanComputeIsInstanceOf(const AbstractType& type,
const AbstractType& compile_type = *ToAbstractType();
// The compile-type of a value should never be void. The result of a void
- // function must always be null, which wass checked to be null at the return
+ // function must always be null, which was checked to be null at the return
// statement inside the function.
ASSERT(!compile_type.IsVoidType());
@@ -612,13 +612,13 @@ bool CompileType::CanComputeIsInstanceOf(const AbstractType& type,
return false;
}
- // The Null type is only a subtype of Object and of dynamic.
+ // The null instance is an instance of Null, of Object, and of dynamic.
// Functions that do not explicitly return a value, implicitly return null,
// except generative constructors, which return the object being constructed.
// It is therefore acceptable for void functions to return null.
if (compile_type.IsNullType()) {
*is_instance = is_nullable || type.IsObjectType() || type.IsDynamicType() ||
- type.IsVoidType();
+ type.IsNullType() || type.IsVoidType();
return true;
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698