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

Unified Diff: runtime/vm/assembler_ia32.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_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index 2aebb55e71282f497c8cd512d22c7d23146fdf77..9eb23d6151c38727a4a75710111038cc7fbd500f 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -1525,17 +1525,37 @@ void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
}
-void Assembler::PreserveCallerSavedRegisters() {
- pushl(EAX);
- pushl(ECX);
- pushl(EDX);
+// TODO(srdjan): Add XMM registers once they are used by the compiler.
+static const intptr_t kNumberOfVolatileCpuRegisters = 3;
+static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = {
+ EAX, ECX, EDX
+};
+
+
+void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
+ enter(Immediate(0));
+
+ // Preserve volatile registers.
+ for (intptr_t i = 0; i < kNumberOfVolatileCpuRegisters; i++) {
+ pushl(volatile_cpu_registers[i]);
+ }
+
+ ReserveAlignedFrameSpace(frame_space);
}
-void Assembler::RestoreCallerSavedRegisters() {
- popl(EDX);
- popl(ECX);
- popl(EAX);
+void Assembler::LeaveCallRuntimeFrame() {
+ // ESP 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.
+ leal(ESP, Address(EBP, -kNumberOfVolatileCpuRegisters * kWordSize));
+
+ // Restore volatile registers.
+ for (intptr_t i = kNumberOfVolatileCpuRegisters - 1; i >= 0; i--) {
+ popl(volatile_cpu_registers[i]);
+ }
+
+ leave();
}
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698