Index: runtime/vm/stub_code_arm.cc |
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc |
index 370711b2813f9a8e45e0a84346426875585c5de2..59bd06f30f5af1b8b049ee151b88379cf635bdf6 100644 |
--- a/runtime/vm/stub_code_arm.cc |
+++ b/runtime/vm/stub_code_arm.cc |
@@ -1990,10 +1990,11 @@ void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( |
// R0: receiver |
// R9: MegamorphicCache (preserved) |
// Result: |
-// R1: target entry point |
// CODE_REG: target Code |
// R4: arguments descriptor |
void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
__ LoadTaggedClassIdMayBeSmi(R0, R0); |
// R0: receiver cid as Smi. |
__ ldr(R2, FieldAddress(R9, MegamorphicCache::buckets_offset())); |
@@ -2028,7 +2029,7 @@ void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
__ ldr(R4, FieldAddress(R9, MegamorphicCache::arguments_descriptor_offset())); |
__ ldr(R1, FieldAddress(R0, Function::entry_point_offset())); |
__ ldr(CODE_REG, FieldAddress(R0, Function::code_offset())); |
- __ Ret(); |
+ __ bx(R1); |
// Probe failed, check if it is a miss. |
__ Bind(&probe_failed); |
@@ -2046,10 +2047,11 @@ void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
// R0: receiver |
// R9: ICData (preserved) |
// Result: |
-// R1: target entry point |
// CODE_REG: target Code object |
// R4: arguments descriptor |
void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
Label loop, found, miss; |
__ ldr(R4, FieldAddress(R9, ICData::arguments_descriptor_offset())); |
__ ldr(R8, FieldAddress(R9, ICData::ic_data_offset())); |
@@ -2074,17 +2076,19 @@ void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { |
__ LoadFromOffset(kWord, R0, R8, target_offset); |
__ ldr(R1, FieldAddress(R0, Function::entry_point_offset())); |
__ ldr(CODE_REG, FieldAddress(R0, Function::code_offset())); |
- __ Ret(); |
+ __ bx(R1); |
__ Bind(&miss); |
__ LoadIsolate(R2); |
__ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); |
__ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
- __ Ret(); |
+ __ bx(R1); |
} |
void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
Label loop, found, miss; |
__ ldr(R4, FieldAddress(R9, ICData::arguments_descriptor_offset())); |
__ ldr(R8, FieldAddress(R9, ICData::ic_data_offset())); |
@@ -2109,13 +2113,34 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { |
const intptr_t entry_offset = ICData::EntryPointIndexFor(1) * kWordSize; |
__ ldr(R1, Address(R8, entry_offset)); |
__ ldr(CODE_REG, Address(R8, code_offset)); |
- __ Ret(); |
+ __ bx(R1); |
__ Bind(&miss); |
__ LoadIsolate(R2); |
__ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); |
__ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
- __ Ret(); |
+ __ bx(R1); |
+} |
+ |
+ |
+// Called from the monomorphic checked entry. |
+// R0: receiver |
+void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { |
+ __ EnterStubFrame(); |
+ __ Push(R0); // Preserve receiver. |
+ |
+ __ PushObject(Object::null_object()); // Result. |
+ __ Push(R0); // Arg0: Receiver |
+ __ CallRuntime(kMonomorphicMissRuntimeEntry, 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); |
} |