Chromium Code Reviews| 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. |