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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 2279563002: AOT: Single target stub. (Closed)
Patch Set: add offset assertions 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 e98ce2bebea5264191af297526f2b8666e97c3fc..6560d9f873d1e7bbcc30c6c3afc230253c83a1d0 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -2277,6 +2277,47 @@ void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) {
}
+
+// Called from switchable IC calls.
+// T0: receiver
+// S5: SingleTargetCache
+// Passed to target:
+// CODE_REG: target Code object
+void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
+ __ NoMonomorphicCheckedEntry();
+
+ Label miss;
+
+ __ LoadClassIdMayBeSmi(T1, T0);
+ __ lhu(T2, FieldAddress(S5, SingleTargetCache::lower_limit_offset()));
+ __ lhu(T3, FieldAddress(S5, SingleTargetCache::upper_limit_offset()));
+
+ __ BranchUnsignedLess(T1, T2, &miss);
+ __ BranchUnsignedGreater(T1, T3, &miss);
+
+ __ lw(T1, FieldAddress(S5, SingleTargetCache::entry_point_offset()));
+ __ lw(CODE_REG, FieldAddress(S5, SingleTargetCache::target_offset()));
+ __ jr(T1);
+
+ __ Bind(&miss);
+ __ EnterStubFrame();
+ __ Push(T0); // Preserve receiver.
+
+ __ PushObject(Object::null_object()); // Result.
+ __ Push(T0); // Arg0: Receiver
+ __ CallRuntime(kSingleTargetMissRuntimeEntry, 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);
+}
+
+
// Called from the monomorphic checked entry.
// T0: receiver
void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
« 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