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

Unified Diff: runtime/vm/stub_code_x64.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_mips.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 329d3f16bbc46d8f653386059bec9d8901c8ae92..daf1e5e411f763e6ace4e93af824902ea351cf13 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -2167,6 +2167,45 @@ void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) {
}
+// Called from switchable IC calls.
+// RDI: receiver
+// RBX: SingleTargetCache
+// Passed to target::
+// CODE_REG: target Code object
+void StubCode::GenerateSingleTargetCallStub(Assembler* assembler) {
+ __ NoMonomorphicCheckedEntry();
+
+ Label miss;
+ __ LoadClassIdMayBeSmi(RAX, RDI);
+ __ movl(R9, FieldAddress(RBX, SingleTargetCache::lower_limit_offset()));
+ __ movl(R10, FieldAddress(RBX, SingleTargetCache::upper_limit_offset()));
+ __ cmpq(RAX, R9);
+ __ j(LESS, &miss, Assembler::kNearJump);
+ __ cmpq(RAX, R10);
+ __ j(GREATER, &miss, Assembler::kNearJump);
+ __ movq(RCX, FieldAddress(RBX, SingleTargetCache::entry_point_offset()));
+ __ movq(CODE_REG, FieldAddress(RBX, SingleTargetCache::target_offset()));
+ __ jmp(RCX);
+
+ __ Bind(&miss);
+ __ EnterStubFrame();
+ __ pushq(RDI); // Preserve receiver.
+
+ __ PushObject(Object::null_object()); // Result.
+ __ pushq(RDI); // Arg0: Receiver
+ __ CallRuntime(kSingleTargetMissRuntimeEntry, 1);
+ __ popq(RBX);
+ __ popq(RBX); // result = IC
+
+ __ popq(RDI); // Restore receiver.
+ __ LeaveStubFrame();
+
+ __ movq(CODE_REG, Address(THR, Thread::ic_lookup_through_code_stub_offset()));
+ __ movq(RCX, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
+ __ jmp(RCX);
+}
+
+
// Called from the monomorphic checked entry.
// RDI: receiver
void StubCode::GenerateMonomorphicMissStub(Assembler* assembler) {
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698