Index: runtime/vm/stub_code_arm64.cc |
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc |
index 0585653727bc98d660d1a490da6bc5cd849d0b05..5db34dc840779cba306a954ea4be3d39145ccabb 100644 |
--- a/runtime/vm/stub_code_arm64.cc |
+++ b/runtime/vm/stub_code_arm64.cc |
@@ -1865,9 +1865,13 @@ static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { |
// R3: instance class id. |
// R4: instance type arguments. |
__ SmiTag(R3); |
+ __ CompareImmediate(R3, Smi::RawValue(kClosureCid)); |
+ __ b(&loop, NE); |
+ __ LoadFieldFromOffset(R3, R0, Closure::function_offset()); |
+ // R3: instance class id as Smi or function. |
__ Bind(&loop); |
__ LoadFromOffset( |
- R5, R2, kWordSize * SubtypeTestCache::kInstanceClassId); |
+ R5, R2, kWordSize * SubtypeTestCache::kInstanceClassIdOrFunction); |
__ CompareObject(R5, Object::null_object()); |
__ b(¬_found, EQ); |
__ CompareRegisters(R5, R3); |