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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 23480098: Setup the pool pointer when entering Dart from C++ so the intrinsic functions may rely on it being … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
« runtime/vm/intrinsifier_x64.cc ('K') | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | 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 a9d37774359b79ddd33f53a1694a47713f6be9bc..09286ed9ac356c4e9c12e5c75b6a1b13ba17126b 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -765,12 +765,15 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
// RCX : new context containing the current isolate pointer.
void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// Save frame pointer coming in.
- __ EnterStubFrame();
+ __ EnterStubFrameWithPP();
+
+ // The old frame pointer, the return address, the old R15 (for PP).
+ const intptr_t kInitiallyPushedSlots = 3;
siva 2013/09/19 00:45:37 Not sure if kInitiallyPushedSlots is a good name,
zra 2013/09/19 00:55:22 +1
rmacnak 2013/09/19 16:57:36 This stack looks upside down to me. __ EnterStu
// Save arguments descriptor array and new context.
- const intptr_t kArgumentsDescOffset = -2 * kWordSize;
+ const intptr_t kArgumentsDescOffset = -(kInitiallyPushedSlots) * kWordSize;
__ pushq(RSI);
- const intptr_t kNewContextOffset = -3 * kWordSize;
+ const intptr_t kNewContextOffset = -(kInitiallyPushedSlots + 1) * kWordSize;
__ pushq(RCX);
// Save C++ ABI callee-saved registers.
@@ -778,7 +781,8 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ pushq(R12);
__ pushq(R13);
__ pushq(R14);
- __ pushq(R15);
+ // R15 is already saved above by EnterStubFrameWithPP.
rmacnak 2013/09/18 21:04:24 Actually, we MUST not save R15 again, because it c
siva 2013/09/19 00:45:37 True, the comment is to make sure we document that
+
// The new Context structure contains a pointer to the current Isolate
// structure. Cache the Context pointer in the CTX register so that it is
@@ -866,14 +870,14 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), RDX);
// Restore C++ ABI callee-saved registers.
- __ popq(R15);
+ // R15 will be restored below by LeaveFrameWithPP.
__ popq(R14);
__ popq(R13);
__ popq(R12);
__ popq(RBX);
// Restore the frame pointer.
- __ LeaveFrame();
+ __ LeaveFrameWithPP();
__ ret();
}
« runtime/vm/intrinsifier_x64.cc ('K') | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698