Index: runtime/vm/stub_code_arm.cc |
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc |
index 4faf29e0107c2a425bdbda29bffb431a3af1838c..82c50a1efc8063ec95d161602081438133cfa4cc 100644 |
--- a/runtime/vm/stub_code_arm.cc |
+++ b/runtime/vm/stub_code_arm.cc |
@@ -2123,6 +2123,48 @@ void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) { |
} |
+// Called from switchable IC calls. |
+// R0: receiver |
+// R9: SingleTargetCache |
+// Passed to target: |
+// CODE_REG: target Code object |
+void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
+ Label miss; |
+ |
+ __ LoadClassIdMayBeSmi(R1, R0); |
+ __ ldrh(R2, FieldAddress(R9, SingleTargetCache::lower_limit_offset())); |
+ __ ldrh(R3, FieldAddress(R9, SingleTargetCache::upper_limit_offset())); |
+ |
+ __ cmp(R1, Operand(R2)); |
+ __ b(&miss, LT); |
+ __ cmp(R1, Operand(R3)); |
+ __ b(&miss, GT); |
+ |
+ __ ldr(R1, FieldAddress(R9, SingleTargetCache::entry_point_offset())); |
+ __ ldr(CODE_REG, FieldAddress(R9, SingleTargetCache::target_offset())); |
+ __ bx(R1); |
+ |
+ __ Bind(&miss); |
+ __ EnterStubFrame(); |
+ __ Push(R0); // Preserve receiver. |
+ |
+ __ PushObject(Object::null_object()); // Result. |
+ __ Push(R0); // Arg0: Receiver |
+ __ CallRuntime(kSingleTargetMissRuntimeEntry, 1); |
+ __ Drop(1); |
+ __ Pop(R9); // result = IC |
+ |
+ __ Pop(R0); // Restore receiver. |
+ __ LeaveStubFrame(); |
+ |
+ __ ldr(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); |
+ __ ldr(R1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
+ __ bx(R1); |
+} |
+ |
+ |
// Called from the monomorphic checked entry. |
// R0: receiver |
void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { |