Index: runtime/vm/intrinsifier_mips.cc |
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc |
index ecf07e6b536ec97f1de3fdaab08c6f67f5b25985..305e1256c15899f02171b573245833e27b017540 100644 |
--- a/runtime/vm/intrinsifier_mips.cc |
+++ b/runtime/vm/intrinsifier_mips.cc |
@@ -1675,6 +1675,28 @@ void Intrinsifier::ObjectEquals(Assembler* assembler) { |
} |
+// Return type quickly for simple types (not parameterized and not signature). |
+void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
+ Label fall_through; |
+ __ lw(T0, Address(SP, 0 * kWordSize)); |
+ __ LoadClassIdMayBeSmi(T1, T0); |
+ __ LoadClassById(T2, T1); |
+ // T2: class of instance (T0). |
+ |
+ __ lw(T1, FieldAddress(T2, Class::signature_function_offset())); |
+ __ BranchNotEqual(T1, Object::null_object(), &fall_through); |
+ |
+ __ lhu(T1, FieldAddress(T2, Class::num_type_arguments_offset())); |
+ __ BranchNotEqual(T1, Immediate(0), &fall_through); |
+ |
+ __ lw(V0, FieldAddress(T2, Class::canonical_types_offset())); |
+ __ BranchEqual(V0, Object::null_object(), &fall_through); |
+ __ Ret(); |
+ |
+ __ Bind(&fall_through); |
+} |
+ |
+ |
void Intrinsifier::String_getHashCode(Assembler* assembler) { |
Label fall_through; |
__ lw(T0, Address(SP, 0 * kWordSize)); |