| 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 fbfe34cbbe755e127a7cfb3bd583ea14aa56dbb4..5be0f085fad1ee22c11a1c9b213fb583b7504362 100644
|
| --- a/runtime/vm/flow_graph_compiler_ia32.cc
|
| +++ b/runtime/vm/flow_graph_compiler_ia32.cc
|
| @@ -390,11 +390,8 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| } else {
|
| __ j(ZERO, is_not_instance_lbl);
|
| }
|
| - // Compare if the classes are equal.
|
| const Register kClassIdReg = ECX;
|
| __ LoadClassId(kClassIdReg, kInstanceReg);
|
| - __ cmpl(kClassIdReg, Immediate(type_class.id()));
|
| - __ j(EQUAL, is_instance_lbl);
|
| // See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted
|
| // interfaces.
|
| // Bool interface can be implemented only by core class Bool.
|
| @@ -404,11 +401,6 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| __ jmp(is_not_instance_lbl);
|
| return false;
|
| }
|
| - if (type.IsDartFunctionType()) {
|
| - // Check if instance is a closure.
|
| - __ cmpl(kClassIdReg, Immediate(kClosureCid));
|
| - __ j(EQUAL, is_instance_lbl);
|
| - }
|
| // Custom checking for numbers (Smi, Mint, Bigint and Double).
|
| // Note that instance is not Smi (checked above).
|
| if (type.IsSubtypeOf(
|
| @@ -421,6 +413,17 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
|
| return false;
|
| }
|
| + if (type.IsDartFunctionType()) {
|
| + // Check if instance is a closure.
|
| + __ cmpl(kClassIdReg, Immediate(kClosureCid));
|
| + __ j(EQUAL, is_instance_lbl);
|
| + return true; // Fall through
|
| + }
|
| + // Compare if the classes are equal.
|
| + if (!type_class.is_abstract()) {
|
| + __ cmpl(kClassIdReg, Immediate(type_class.id()));
|
| + __ j(EQUAL, is_instance_lbl);
|
| + }
|
| // Otherwise fallthrough.
|
| return true;
|
| }
|
|
|