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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 10704216: Fix type checking of void type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
===================================================================
--- runtime/vm/flow_graph_compiler_ia32.cc (revision 9649)
+++ runtime/vm/flow_graph_compiler_ia32.cc (working copy)
@@ -421,6 +421,9 @@
const AbstractType& type,
Label* is_instance_lbl,
Label* is_not_instance_lbl) {
+ if (type.IsVoidType()) {
+ return SubtypeTestCache::null();
srdjan 2012/07/16 15:21:12 When can the type we check agains be void?
regis 2012/07/16 18:05:34 When we type check a value returned from a void fu
+ }
if (type.IsInstantiated()) {
const Class& type_class = Class::ZoneHandle(type.type_class());
// A Smi object cannot be the instance of a parameterized class.
@@ -433,26 +436,23 @@
is_instance_lbl,
is_not_instance_lbl);
// Fall through to runtime call.
- } else {
- GenerateInstantiatedTypeNoArgumentsTest(cid,
- token_pos,
- type,
- is_instance_lbl,
- is_not_instance_lbl);
- // If test non-conclusive so far, try the inlined type-test cache.
- // 'type' is known at compile time.
- return GenerateSubtype1TestCacheLookup(
- cid, token_pos, type_class,
- is_instance_lbl, is_not_instance_lbl);
}
- } else {
- return GenerateUninstantiatedTypeTest(cid,
- token_pos,
- type,
- is_instance_lbl,
- is_not_instance_lbl);
+ GenerateInstantiatedTypeNoArgumentsTest(cid,
+ token_pos,
+ type,
+ is_instance_lbl,
+ is_not_instance_lbl);
+ // If test non-conclusive so far, try the inlined type-test cache.
+ // 'type' is known at compile time.
+ return GenerateSubtype1TestCacheLookup(
+ cid, token_pos, type_class,
+ is_instance_lbl, is_not_instance_lbl);
}
- return SubtypeTestCache::null();
+ return GenerateUninstantiatedTypeTest(cid,
+ token_pos,
+ type,
+ is_instance_lbl,
+ is_not_instance_lbl);
}
@@ -561,7 +561,6 @@
// Assignable check is skipped in FlowGraphBuilder, not here.
ASSERT(dst_type.IsMalformed() ||
(!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
- ASSERT(!dst_type.IsVoidType());
__ pushl(ECX); // Store instantiator.
__ pushl(EDX); // Store instantiator type arguments.
// A null object is always assignable and is returned as result.

Powered by Google App Engine
This is Rietveld 408576698