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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 2718513002: Void is not required to be `null` anymore. (Closed)
Patch Set: Fix more places in the VM. Created 3 years, 10 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: runtime/vm/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index e0d5846f99a04d547e358cd1c7c25a0eba30be05..f0fa1d3749dc3916c9c6c39d2915c74102d6404b 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -516,11 +516,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
Label* is_instance_lbl,
Label* is_not_instance_lbl) {
__ Comment("InlineInstanceof");
- if (type.IsVoidType()) {
- // A non-null value is returned from a void function, which will result in a
- // type error. A null value is handled prior to executing this inline code.
- return SubtypeTestCache::null();
- }
if (type.IsInstantiated()) {
const Class& type_class = Class::ZoneHandle(zone(), type.type_class());
// A class equality check is only applicable with a dst type (not a
@@ -564,7 +559,7 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos,
bool negate_result,
LocationSummary* locs) {
ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded());
- ASSERT(!type.IsObjectType() && !type.IsDynamicType());
+ ASSERT(!type.IsObjectType() && !type.IsDynamicType() && !type.IsVoidType());
const Immediate& raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
@@ -647,7 +642,8 @@ void FlowGraphCompiler::GenerateAssertAssignable(TokenPosition token_pos,
ASSERT(dst_type.IsFinalized());
// Assignable check is skipped in FlowGraphBuilder, not here.
ASSERT(dst_type.IsMalformedOrMalbounded() ||
- (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
+ (!dst_type.IsDynamicType() && !dst_type.IsObjectType() &&
+ !dst_type.IsVoidType()));
__ pushl(EDX); // Store instantiator type arguments.
// A null object is always assignable and is returned as result.
const Immediate& raw_null =

Powered by Google App Engine
This is Rietveld 408576698