| OLD | NEW |
| 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 Loading... |
| 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() { |
| 1529 pushl(EAX); |
| 1530 pushl(ECX); |
| 1531 pushl(EDX); |
| 1532 } |
| 1533 |
| 1534 |
| 1535 void Assembler::RestoreCallerSavedRegisters() { |
| 1536 popl(EDX); |
| 1537 popl(ECX); |
| 1538 popl(EAX); |
| 1539 } |
| 1540 |
| 1541 |
| 1528 void Assembler::CallRuntime(const RuntimeEntry& entry) { | 1542 void Assembler::CallRuntime(const RuntimeEntry& entry) { |
| 1529 entry.Call(this); | 1543 entry.Call(this); |
| 1530 } | 1544 } |
| 1531 | 1545 |
| 1532 | 1546 |
| 1533 void Assembler::Align(int alignment, int offset) { | 1547 void Assembler::Align(int alignment, int offset) { |
| 1534 ASSERT(Utils::IsPowerOfTwo(alignment)); | 1548 ASSERT(Utils::IsPowerOfTwo(alignment)); |
| 1535 int pos = offset + buffer_.GetPosition(); | 1549 int pos = offset + buffer_.GetPosition(); |
| 1536 int mod = pos & (alignment - 1); | 1550 int mod = pos & (alignment - 1); |
| 1537 if (mod == 0) { | 1551 if (mod == 0) { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 comments.SetCommentAt(i, comments_[i]->comment()); | 1754 comments.SetCommentAt(i, comments_[i]->comment()); |
| 1741 } | 1755 } |
| 1742 | 1756 |
| 1743 return comments; | 1757 return comments; |
| 1744 } | 1758 } |
| 1745 | 1759 |
| 1746 | 1760 |
| 1747 } // namespace dart | 1761 } // namespace dart |
| 1748 | 1762 |
| 1749 #endif // defined TARGET_ARCH_IA32 | 1763 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |