| Index: runtime/vm/flow_graph_compiler_arm64.cc
|
| diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
|
| index 5dd2308580d4db556a76e8adddb9f7df989ae81c..c7a544f51894b8c970b75f95d6f634bdee0cc2ca 100644
|
| --- a/runtime/vm/flow_graph_compiler_arm64.cc
|
| +++ b/runtime/vm/flow_graph_compiler_arm64.cc
|
| @@ -382,11 +382,8 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| } else {
|
| __ b(is_not_instance_lbl, EQ);
|
| }
|
| - // Compare if the classes are equal.
|
| const Register kClassIdReg = R2;
|
| __ LoadClassId(kClassIdReg, kInstanceReg);
|
| - __ CompareImmediate(kClassIdReg, type_class.id());
|
| - __ b(is_instance_lbl, EQ);
|
| // See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted
|
| // interfaces.
|
| // Bool interface can be implemented only by core class Bool.
|
| @@ -396,11 +393,6 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| __ b(is_not_instance_lbl);
|
| return false;
|
| }
|
| - if (type.IsDartFunctionType()) {
|
| - // Check if instance is a closure.
|
| - __ CompareImmediate(kClassIdReg, kClosureCid);
|
| - __ b(is_instance_lbl, EQ);
|
| - }
|
| // Custom checking for numbers (Smi, Mint, Bigint and Double).
|
| // Note that instance is not Smi (checked above).
|
| if (type.IsSubtypeOf(
|
| @@ -413,6 +405,17 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
|
| return false;
|
| }
|
| + if (type.IsDartFunctionType()) {
|
| + // Check if instance is a closure.
|
| + __ CompareImmediate(kClassIdReg, kClosureCid);
|
| + __ b(is_instance_lbl, EQ);
|
| + return true; // Fall through
|
| + }
|
| + // Compare if the classes are equal.
|
| + if (!type_class.is_abstract()) {
|
| + __ CompareImmediate(kClassIdReg, type_class.id());
|
| + __ b(is_instance_lbl, EQ);
|
| + }
|
| // Otherwise fallthrough.
|
| return true;
|
| }
|
|
|