| Index: runtime/vm/flow_graph_compiler_x64.cc
|
| diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
|
| index 9118bb12d6e5b3b0ccbd968d7ba376858e670b7c..6cd1301c37b47bd4e7151b144aa0a23e80e765fd 100644
|
| --- a/runtime/vm/flow_graph_compiler_x64.cc
|
| +++ b/runtime/vm/flow_graph_compiler_x64.cc
|
| @@ -387,11 +387,8 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| } else {
|
| __ j(ZERO, is_not_instance_lbl);
|
| }
|
| - // Compare if the classes are equal.
|
| const Register kClassIdReg = R10;
|
| __ 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.
|
| @@ -401,11 +398,6 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| __ jmp(is_not_instance_lbl);
|
| return false;
|
| }
|
| - if (type.IsDartFunctionType()) {
|
| - // Check if instance is a closure.
|
| - __ cmpq(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(
|
| @@ -418,6 +410,17 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
|
| return false;
|
| }
|
| + if (type.IsDartFunctionType()) {
|
| + // Check if instance is a closure.
|
| + __ cmpq(kClassIdReg, Immediate(kClosureCid));
|
| + __ j(EQUAL, is_instance_lbl);
|
| + return true;
|
| + }
|
| + // 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;
|
| }
|
|
|