Index: runtime/vm/stub_code_mips.cc |
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc |
index f40dd22009dbceabcbe0842aa547a9253d6512e2..dc5788bb928be504734e2f5c39495f044c027064 100644 |
--- a/runtime/vm/stub_code_mips.cc |
+++ b/runtime/vm/stub_code_mips.cc |
@@ -2150,10 +2150,10 @@ void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( |
// T0: receiver |
// S5: MegamorphicCache (preserved) |
// Result: |
-// T1: target entry point |
-// CODE_REG: target Code |
// S4: arguments descriptor |
void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
__ LoadTaggedClassIdMayBeSmi(T0, T0); |
// T0: class ID of the receiver (smi). |
__ lw(S4, FieldAddress(S5, MegamorphicCache::arguments_descriptor_offset())); |
@@ -2194,7 +2194,7 @@ void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
__ lw(T1, FieldAddress(T0, Function::entry_point_offset())); |
__ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
- __ Ret(); |
+ __ jr(T1); |
} |
@@ -2202,10 +2202,11 @@ void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
// T0: receiver |
// S5: ICData (preserved) |
// Result: |
-// T1: target entry point |
// CODE_REG: target Code object |
// S4: arguments descriptor |
void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
Label loop, found, miss; |
__ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); |
__ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
@@ -2229,17 +2230,19 @@ void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { |
__ lw(T0, Address(T6, target_offset)); |
__ lw(T1, FieldAddress(T0, Function::entry_point_offset())); |
__ lw(CODE_REG, FieldAddress(T0, Function::code_offset())); |
- __ Ret(); |
+ __ jr(T1); |
__ Bind(&miss); |
__ LoadIsolate(T2); |
__ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); |
__ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
- __ Ret(); |
+ __ jr(T1); |
} |
void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { |
+ __ NoMonomorphicCheckedEntry(); |
+ |
Label loop, found, miss; |
__ lw(T6, FieldAddress(S5, ICData::ic_data_offset())); |
__ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
@@ -2263,13 +2266,34 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { |
const intptr_t entry_offset = ICData::EntryPointIndexFor(1) * kWordSize; |
__ lw(T1, Address(T6, entry_offset)); |
__ lw(CODE_REG, Address(T6, code_offset)); |
- __ Ret(); |
+ __ jr(T1); |
__ Bind(&miss); |
__ LoadIsolate(T2); |
__ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset())); |
__ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
- __ Ret(); |
+ __ jr(T1); |
+} |
+ |
+ |
+// Called from the monomorphic checked entry. |
+// T0: receiver |
+void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) { |
+ __ EnterStubFrame(); |
+ __ Push(T0); // Preserve receiver. |
+ |
+ __ PushObject(Object::null_object()); // Result. |
+ __ Push(T0); // Arg0: Receiver |
+ __ CallRuntime(kMonomorphicMissRuntimeEntry, 1); |
+ __ Drop(1); |
+ __ Pop(S5); // result = IC |
+ |
+ __ Pop(T0); // Restore receiver. |
+ __ LeaveStubFrame(); |
+ |
+ __ lw(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset())); |
+ __ lw(T1, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
+ __ jr(T1); |
} |