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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 1405673003: provides a mechanism for optimizing compilers to select the different Register configuration. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add the TODO comments. Created 5 years, 2 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
« no previous file with comments | « src/x64/deoptimizer-x64.cc ('k') | test/cctest/cctest.status » ('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 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 4024 matching lines...) Expand 10 before | Expand all | Expand 10 after
4035 #ifdef _WIN64 4035 #ifdef _WIN64
4036 const int kShadowSpace = 4; 4036 const int kShadowSpace = 4;
4037 arg_stack_space += kShadowSpace; 4037 arg_stack_space += kShadowSpace;
4038 #endif 4038 #endif
4039 // Optionally save all XMM registers. 4039 // Optionally save all XMM registers.
4040 if (save_doubles) { 4040 if (save_doubles) {
4041 int space = XMMRegister::kMaxNumRegisters * kDoubleSize + 4041 int space = XMMRegister::kMaxNumRegisters * kDoubleSize +
4042 arg_stack_space * kRegisterSize; 4042 arg_stack_space * kRegisterSize;
4043 subp(rsp, Immediate(space)); 4043 subp(rsp, Immediate(space));
4044 int offset = -2 * kPointerSize; 4044 int offset = -2 * kPointerSize;
4045 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); 4045 const RegisterConfiguration* config =
4046 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT);
4046 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { 4047 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
4047 DoubleRegister reg = 4048 DoubleRegister reg =
4048 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); 4049 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i));
4049 Movsd(Operand(rbp, offset - ((i + 1) * kDoubleSize)), reg); 4050 Movsd(Operand(rbp, offset - ((i + 1) * kDoubleSize)), reg);
4050 } 4051 }
4051 } else if (arg_stack_space > 0) { 4052 } else if (arg_stack_space > 0) {
4052 subp(rsp, Immediate(arg_stack_space * kRegisterSize)); 4053 subp(rsp, Immediate(arg_stack_space * kRegisterSize));
4053 } 4054 }
4054 4055
4055 // Get the required frame alignment for the OS. 4056 // Get the required frame alignment for the OS.
(...skipping 25 matching lines...) Expand all
4081 EnterExitFramePrologue(false); 4082 EnterExitFramePrologue(false);
4082 EnterExitFrameEpilogue(arg_stack_space, false); 4083 EnterExitFrameEpilogue(arg_stack_space, false);
4083 } 4084 }
4084 4085
4085 4086
4086 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) { 4087 void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) {
4087 // Registers: 4088 // Registers:
4088 // r15 : argv 4089 // r15 : argv
4089 if (save_doubles) { 4090 if (save_doubles) {
4090 int offset = -2 * kPointerSize; 4091 int offset = -2 * kPointerSize;
4091 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); 4092 const RegisterConfiguration* config =
4093 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT);
4092 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { 4094 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
4093 DoubleRegister reg = 4095 DoubleRegister reg =
4094 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); 4096 DoubleRegister::from_code(config->GetAllocatableDoubleCode(i));
4095 Movsd(reg, Operand(rbp, offset - ((i + 1) * kDoubleSize))); 4097 Movsd(reg, Operand(rbp, offset - ((i + 1) * kDoubleSize)));
4096 } 4098 }
4097 } 4099 }
4098 4100
4099 if (pop_arguments) { 4101 if (pop_arguments) {
4100 // Get the return address from the stack and restore the frame pointer. 4102 // Get the return address from the stack and restore the frame pointer.
4101 movp(rcx, Operand(rbp, kFPOnStackSize)); 4103 movp(rcx, Operand(rbp, kFPOnStackSize));
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
5327 movl(rax, dividend); 5329 movl(rax, dividend);
5328 shrl(rax, Immediate(31)); 5330 shrl(rax, Immediate(31));
5329 addl(rdx, rax); 5331 addl(rdx, rax);
5330 } 5332 }
5331 5333
5332 5334
5333 } // namespace internal 5335 } // namespace internal
5334 } // namespace v8 5336 } // namespace v8
5335 5337
5336 #endif // V8_TARGET_ARCH_X64 5338 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/deoptimizer-x64.cc ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698