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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { 1518 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
1519 // Reserve space for arguments and align frame before entering 1519 // Reserve space for arguments and align frame before entering
1520 // the C++ world. 1520 // the C++ world.
1521 AddImmediate(ESP, Immediate(-frame_space)); 1521 AddImmediate(ESP, Immediate(-frame_space));
1522 if (OS::ActivationFrameAlignment() > 0) { 1522 if (OS::ActivationFrameAlignment() > 0) {
1523 andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 1523 andl(ESP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
1524 } 1524 }
1525 } 1525 }
1526 1526
1527 1527
1528 void Assembler::PreserveCallerSavedRegisters() { 1528 // TODO(srdjan): Add XMM registers once they are used by the compiler.
1529 pushl(EAX); 1529 static const intptr_t kNumberOfVolatileCpuRegisters = 3;
1530 pushl(ECX); 1530 static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = {
1531 pushl(EDX); 1531 EAX, ECX, EDX
1532 };
1533
1534
1535 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
1536 enter(Immediate(0));
1537
1538 // Preserve volatile registers.
1539 for (intptr_t i = 0; i < kNumberOfVolatileCpuRegisters; i++) {
1540 pushl(volatile_cpu_registers[i]);
1541 }
1542
1543 ReserveAlignedFrameSpace(frame_space);
1532 } 1544 }
1533 1545
1534 1546
1535 void Assembler::RestoreCallerSavedRegisters() { 1547 void Assembler::LeaveCallRuntimeFrame() {
1536 popl(EDX); 1548 // ESP might have been modified to reserve space for arguments
1537 popl(ECX); 1549 // and ensure proper alignment of the stack frame.
1538 popl(EAX); 1550 // We need to restore it before restoring registers.
1551 leal(ESP, Address(EBP, -kNumberOfVolatileCpuRegisters * kWordSize));
1552
1553 // Restore volatile registers.
1554 for (intptr_t i = kNumberOfVolatileCpuRegisters - 1; i >= 0; i--) {
1555 popl(volatile_cpu_registers[i]);
1556 }
1557
1558 leave();
1539 } 1559 }
1540 1560
1541 1561
1542 void Assembler::CallRuntime(const RuntimeEntry& entry) { 1562 void Assembler::CallRuntime(const RuntimeEntry& entry) {
1543 entry.Call(this); 1563 entry.Call(this);
1544 } 1564 }
1545 1565
1546 1566
1547 void Assembler::Align(int alignment, int offset) { 1567 void Assembler::Align(int alignment, int offset) {
1548 ASSERT(Utils::IsPowerOfTwo(alignment)); 1568 ASSERT(Utils::IsPowerOfTwo(alignment));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 1785
1766 const char* Assembler::RegisterName(Register reg) { 1786 const char* Assembler::RegisterName(Register reg) {
1767 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); 1787 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters));
1768 return cpu_reg_names[reg]; 1788 return cpu_reg_names[reg];
1769 } 1789 }
1770 1790
1771 1791
1772 } // namespace dart 1792 } // namespace dart
1773 1793
1774 #endif // defined TARGET_ARCH_IA32 1794 #endif // defined TARGET_ARCH_IA32
OLDNEW
« 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