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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 10820053: Fix kStoreBufferBlockProcessRuntimeEntry call sequence. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove meaningless assertion Created 8 years, 5 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/assembler_x64.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index ccc142f41aa907c621872d41a70dd0aaa33f7047..10e3d8fda23bb7223c66b54e58cfe85a40f25770 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -1674,33 +1674,38 @@ void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
}
-void Assembler::PreserveCallerSavedRegisters() {
- // Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4
- pushq(RAX);
- pushq(RCX);
- pushq(RDX);
- pushq(RSI);
- pushq(RDI);
- pushq(R8);
- pushq(R9);
- pushq(R10);
- pushq(R11);
- // TODO(srdjan): Add XMM registers once they are used by the compiler.
-}
-
-
-void Assembler::RestoreCallerSavedRegisters() {
- // Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4
- // TODO(srdjan): Add XMM registers once they are used by the compiler.
- popq(R11);
- popq(R10);
- popq(R9);
- popq(R8);
- popq(RDI);
- popq(RSI);
- popq(RDX);
- popq(RCX);
- popq(RAX);
+// TODO(srdjan): Add XMM registers once they are used by the compiler.
+// Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4
+static const intptr_t kNumberOfVolatileCpuRegisters = 9;
+static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = {
+ RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11
+};
+
+
+void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
+ enter(Immediate(0));
+
+ // Preserve volatile registers.
+ for (intptr_t i = 0; i < kNumberOfVolatileCpuRegisters; i++) {
+ pushq(volatile_cpu_registers[i]);
+ }
+
+ ReserveAlignedFrameSpace(frame_space);
+}
+
+
+void Assembler::LeaveCallRuntimeFrame() {
+ // RSP might have been modified to reserve space for arguments
+ // and ensure proper alignment of the stack frame.
+ // We need to restore it before restoring registers.
+ leaq(RSP, Address(RBP, -kNumberOfVolatileCpuRegisters * kWordSize));
+
+ // Restore volatile registers.
+ for (intptr_t i = kNumberOfVolatileCpuRegisters - 1; i >= 0; i--) {
+ popq(volatile_cpu_registers[i]);
+ }
+
+ leave();
}
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698