Index: runtime/vm/intrinsifier_arm64.cc |
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc |
index fedbe17236dfc543157c04634e21194abae71a56..92b65799dc43bc2a4d676bdf467367921b20217f 100644 |
--- a/runtime/vm/intrinsifier_arm64.cc |
+++ b/runtime/vm/intrinsifier_arm64.cc |
@@ -1646,6 +1646,30 @@ void Intrinsifier::ObjectEquals(Assembler* assembler) { |
} |
+// Return type quickly for simple types (not parameterized and not signature). |
+void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
+ Label fall_through; |
+ __ ldr(R0, Address(SP, 0 * kWordSize)); |
+ __ LoadClassIdMayBeSmi(R1, R0); |
+ __ LoadClassById(R2, R1, PP); |
+ // R2: class of instance (R0). |
+ __ ldr(R3, FieldAddress(R2, Class::signature_function_offset())); |
+ __ CompareObject(R3, Object::null_object(), PP); |
+ __ b(&fall_through, NE); |
+ |
+ __ ldr(R3, FieldAddress(R2, Class::num_type_arguments_offset()), kHalfword); |
+ __ CompareImmediate(R3, 0, kNoPP); |
+ __ b(&fall_through, NE); |
+ |
+ __ ldr(R0, FieldAddress(R2, Class::canonical_types_offset())); |
+ __ CompareObject(R0, Object::null_object(), PP); |
+ __ b(&fall_through, EQ); |
+ __ ret(); |
+ |
+ __ Bind(&fall_through); |
+} |
+ |
+ |
void Intrinsifier::String_getHashCode(Assembler* assembler) { |
Label fall_through; |
__ ldr(R0, Address(SP, 0 * kWordSize)); |