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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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 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);
}
« 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