| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 void Assembler::LeaveFrame() { | 2295 void Assembler::LeaveFrame() { |
| 2296 movq(RSP, RBP); | 2296 movq(RSP, RBP); |
| 2297 popq(RBP); | 2297 popq(RBP); |
| 2298 } | 2298 } |
| 2299 | 2299 |
| 2300 | 2300 |
| 2301 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { | 2301 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { |
| 2302 // Reserve space for arguments and align frame before entering | 2302 // Reserve space for arguments and align frame before entering |
| 2303 // the C++ world. | 2303 // the C++ world. |
| 2304 AddImmediate(RSP, Immediate(-frame_space)); | 2304 AddImmediate(RSP, Immediate(-frame_space)); |
| 2305 if (OS::ActivationFrameAlignment() > 0) { | 2305 if (OS::ActivationFrameAlignment() > 1) { |
| 2306 andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 2306 andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 2307 } | 2307 } |
| 2308 } | 2308 } |
| 2309 | 2309 |
| 2310 | 2310 |
| 2311 // TODO(srdjan): Add XMM registers once they are used by the compiler. | 2311 // TODO(srdjan): Add XMM registers once they are used by the compiler. |
| 2312 // Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4 | 2312 // Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4 |
| 2313 static const intptr_t kNumberOfVolatileCpuRegisters = 9; | 2313 static const intptr_t kNumberOfVolatileCpuRegisters = 9; |
| 2314 static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = { | 2314 static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = { |
| 2315 RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11 | 2315 RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 | 2644 |
| 2645 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 2645 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 2646 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2646 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 2647 return xmm_reg_names[reg]; | 2647 return xmm_reg_names[reg]; |
| 2648 } | 2648 } |
| 2649 | 2649 |
| 2650 | 2650 |
| 2651 } // namespace dart | 2651 } // namespace dart |
| 2652 | 2652 |
| 2653 #endif // defined TARGET_ARCH_X64 | 2653 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |