Index: runtime/vm/assembler_arm.cc |
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc |
index db7881d4c278a3abe36ef5e13d88bbff5fd56072..4d2dad63875faf08bb3b17a8061595794943aef8 100644 |
--- a/runtime/vm/assembler_arm.cc |
+++ b/runtime/vm/assembler_arm.cc |
@@ -3237,6 +3237,44 @@ void Assembler::LeaveStubFrame() { |
} |
+void Assembler::NoMonomorphicCheckedEntry() { |
+ buffer_.Reset(); |
+ bkpt(0); |
+ bkpt(0); |
+ bkpt(0); |
+ ASSERT(CodeSize() == Instructions::kCheckedEntryOffset); |
+} |
+ |
+ |
+// R0 receiver, R9 guarded cid as Smi |
+void Assembler::MonomorphicCheckedEntry() { |
+#if defined(TESTING) || defined(DEBUG) |
+ bool saved_use_far_branches = use_far_branches(); |
+ set_use_far_branches(false); |
+#endif |
+ |
+ Label miss; |
+ Bind(&miss); |
+ ldr(CODE_REG, Address(THR, Thread::monomorphic_miss_stub_offset())); |
+ ldr(IP, FieldAddress(CODE_REG, Code::entry_point_offset())); |
+ bx(IP); |
+ |
+ Comment("MonomorphicCheckedEntry"); |
+ ASSERT(CodeSize() == Instructions::kCheckedEntryOffset); |
+ LoadClassIdMayBeSmi(R4, R0); |
+ SmiUntag(R9); |
+ cmp(R4, Operand(R9)); |
+ b(&miss, NE); |
+ |
+ // Fall through to unchecked entry. |
+ ASSERT(CodeSize() == Instructions::kUncheckedEntryOffset); |
+ |
+#if defined(TESTING) || defined(DEBUG) |
+ set_use_far_branches(saved_use_far_branches); |
+#endif |
+} |
+ |
+ |
#ifndef PRODUCT |
void Assembler::MaybeTraceAllocation(intptr_t cid, |
Register temp_reg, |