Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(841)

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 1799793002: Precompilation: Have instances calls load the entry point and Code object from the ic data array in… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index b4965c3363d5d2da0075e5e22de1eea338460867..1a13f74a06a1b32f99309fc31865d76c6fb1318e 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -2278,7 +2278,7 @@ void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
// T1: target entry point
// CODE_REG: target Code object
// S4: arguments descriptor
-void StubCode::GenerateICLookupStub(Assembler* assembler) {
+void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) {
Label loop, found, miss;
__ lw(T6, FieldAddress(S5, ICData::ic_data_offset()));
__ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset()));
@@ -2311,6 +2311,40 @@ void StubCode::GenerateICLookupStub(Assembler* assembler) {
__ Ret();
}
+
+void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) {
+ Label loop, found, miss;
+ __ lw(T6, FieldAddress(S5, ICData::ic_data_offset()));
+ __ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset()));
+ __ AddImmediate(T6, T6, Array::data_offset() - kHeapObjectTag);
+ // T6: first IC entry.
+ __ LoadTaggedClassIdMayBeSmi(T1, T0);
+ // T1: receiver cid as Smi
+
+ __ Bind(&loop);
+ __ lw(T2, Address(T6, 0));
+ __ beq(T1, T2, &found);
+ ASSERT(Smi::RawValue(kIllegalCid) == 0);
+ __ beq(T2, ZR, &miss);
+
+ const intptr_t entry_length = ICData::TestEntryLengthFor(1) * kWordSize;
+ __ AddImmediate(T6, entry_length); // Next entry.
+ __ b(&loop);
+
+ __ Bind(&found);
+ const intptr_t code_offset = ICData::CodeIndexFor(1) * kWordSize;
+ const intptr_t entry_offset = ICData::EntryPointIndexFor(1) * kWordSize;
+ __ lw(T1, Address(T6, entry_offset));
+ __ lw(CODE_REG, Address(T6, code_offset));
+ __ Ret();
+
+ __ Bind(&miss);
+ __ LoadIsolate(T2);
+ __ lw(CODE_REG, Address(T2, Isolate::ic_miss_code_offset()));
+ __ lw(T1, FieldAddress(CODE_REG, Code::entry_point_offset()));
+ __ Ret();
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_MIPS
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698