OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4477 #ifdef _WIN64 | 4477 #ifdef _WIN64 |
4478 const int kShadowSpace = 4; | 4478 const int kShadowSpace = 4; |
4479 arg_stack_space += kShadowSpace; | 4479 arg_stack_space += kShadowSpace; |
4480 #endif | 4480 #endif |
4481 // Optionally save all XMM registers. | 4481 // Optionally save all XMM registers. |
4482 if (save_doubles) { | 4482 if (save_doubles) { |
4483 int space = XMMRegister::kMaxNumRegisters * kDoubleSize + | 4483 int space = XMMRegister::kMaxNumRegisters * kDoubleSize + |
4484 arg_stack_space * kRegisterSize; | 4484 arg_stack_space * kRegisterSize; |
4485 subp(rsp, Immediate(space)); | 4485 subp(rsp, Immediate(space)); |
4486 int offset = -ExitFrameConstants::kFixedFrameSizeFromFp; | 4486 int offset = -ExitFrameConstants::kFixedFrameSizeFromFp; |
4487 const RegisterConfiguration* config = | 4487 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft(); |
4488 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT); | |
4489 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 4488 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
4490 DoubleRegister reg = | 4489 DoubleRegister reg = |
4491 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); | 4490 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); |
4492 Movsd(Operand(rbp, offset - ((i + 1) * kDoubleSize)), reg); | 4491 Movsd(Operand(rbp, offset - ((i + 1) * kDoubleSize)), reg); |
4493 } | 4492 } |
4494 } else if (arg_stack_space > 0) { | 4493 } else if (arg_stack_space > 0) { |
4495 subp(rsp, Immediate(arg_stack_space * kRegisterSize)); | 4494 subp(rsp, Immediate(arg_stack_space * kRegisterSize)); |
4496 } | 4495 } |
4497 | 4496 |
4498 // Get the required frame alignment for the OS. | 4497 // Get the required frame alignment for the OS. |
(...skipping 25 matching lines...) Expand all Loading... |
4524 EnterExitFramePrologue(false); | 4523 EnterExitFramePrologue(false); |
4525 EnterExitFrameEpilogue(arg_stack_space, false); | 4524 EnterExitFrameEpilogue(arg_stack_space, false); |
4526 } | 4525 } |
4527 | 4526 |
4528 | 4527 |
4529 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { | 4528 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { |
4530 // Registers: | 4529 // Registers: |
4531 // r15 : argv | 4530 // r15 : argv |
4532 if (save_doubles) { | 4531 if (save_doubles) { |
4533 int offset = -ExitFrameConstants::kFixedFrameSizeFromFp; | 4532 int offset = -ExitFrameConstants::kFixedFrameSizeFromFp; |
4534 const RegisterConfiguration* config = | 4533 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft(); |
4535 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT); | |
4536 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 4534 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
4537 DoubleRegister reg = | 4535 DoubleRegister reg = |
4538 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); | 4536 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); |
4539 Movsd(reg, Operand(rbp, offset - ((i + 1) * kDoubleSize))); | 4537 Movsd(reg, Operand(rbp, offset - ((i + 1) * kDoubleSize))); |
4540 } | 4538 } |
4541 } | 4539 } |
4542 | 4540 |
4543 if (pop_arguments) { | 4541 if (pop_arguments) { |
4544 // Get the return address from the stack and restore the frame pointer. | 4542 // Get the return address from the stack and restore the frame pointer. |
4545 movp(rcx, Operand(rbp, kFPOnStackSize)); | 4543 movp(rcx, Operand(rbp, kFPOnStackSize)); |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5722 movl(rax, dividend); | 5720 movl(rax, dividend); |
5723 shrl(rax, Immediate(31)); | 5721 shrl(rax, Immediate(31)); |
5724 addl(rdx, rax); | 5722 addl(rdx, rax); |
5725 } | 5723 } |
5726 | 5724 |
5727 | 5725 |
5728 } // namespace internal | 5726 } // namespace internal |
5729 } // namespace v8 | 5727 } // namespace v8 |
5730 | 5728 |
5731 #endif // V8_TARGET_ARCH_X64 | 5729 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |