| 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/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
| 9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
| 10 #include "src/register-configuration.h" | 10 #include "src/register-configuration.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const int kNumberOfRegisters = Register::kNumRegisters; | 140 const int kNumberOfRegisters = Register::kNumRegisters; |
| 141 | 141 |
| 142 const int kDoubleRegsSize = kDoubleSize * XMMRegister::kMaxNumRegisters; | 142 const int kDoubleRegsSize = kDoubleSize * XMMRegister::kMaxNumRegisters; |
| 143 __ subp(rsp, Immediate(kDoubleRegsSize)); | 143 __ subp(rsp, Immediate(kDoubleRegsSize)); |
| 144 | 144 |
| 145 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); | 145 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); |
| 146 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 146 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
| 147 int code = config->GetAllocatableDoubleCode(i); | 147 int code = config->GetAllocatableDoubleCode(i); |
| 148 XMMRegister xmm_reg = XMMRegister::from_code(code); | 148 XMMRegister xmm_reg = XMMRegister::from_code(code); |
| 149 int offset = code * kDoubleSize; | 149 int offset = code * kDoubleSize; |
| 150 __ movsd(Operand(rsp, offset), xmm_reg); | 150 __ Movsd(Operand(rsp, offset), xmm_reg); |
| 151 } | 151 } |
| 152 | 152 |
| 153 // We push all registers onto the stack, even though we do not need | 153 // We push all registers onto the stack, even though we do not need |
| 154 // to restore all later. | 154 // to restore all later. |
| 155 for (int i = 0; i < kNumberOfRegisters; i++) { | 155 for (int i = 0; i < kNumberOfRegisters; i++) { |
| 156 Register r = Register::from_code(i); | 156 Register r = Register::from_code(i); |
| 157 __ pushq(r); | 157 __ pushq(r); |
| 158 } | 158 } |
| 159 | 159 |
| 160 const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize + | 160 const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize + |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 __ j(not_zero, &inner_push_loop); | 273 __ j(not_zero, &inner_push_loop); |
| 274 __ addp(rax, Immediate(kPointerSize)); | 274 __ addp(rax, Immediate(kPointerSize)); |
| 275 __ bind(&outer_loop_header); | 275 __ bind(&outer_loop_header); |
| 276 __ cmpp(rax, rdx); | 276 __ cmpp(rax, rdx); |
| 277 __ j(below, &outer_push_loop); | 277 __ j(below, &outer_push_loop); |
| 278 | 278 |
| 279 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 279 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
| 280 int code = config->GetAllocatableDoubleCode(i); | 280 int code = config->GetAllocatableDoubleCode(i); |
| 281 XMMRegister xmm_reg = XMMRegister::from_code(code); | 281 XMMRegister xmm_reg = XMMRegister::from_code(code); |
| 282 int src_offset = code * kDoubleSize + double_regs_offset; | 282 int src_offset = code * kDoubleSize + double_regs_offset; |
| 283 __ movsd(xmm_reg, Operand(rbx, src_offset)); | 283 __ Movsd(xmm_reg, Operand(rbx, src_offset)); |
| 284 } | 284 } |
| 285 | 285 |
| 286 // Push state, pc, and continuation from the last output frame. | 286 // Push state, pc, and continuation from the last output frame. |
| 287 __ Push(Operand(rbx, FrameDescription::state_offset())); | 287 __ Push(Operand(rbx, FrameDescription::state_offset())); |
| 288 __ PushQuad(Operand(rbx, FrameDescription::pc_offset())); | 288 __ PushQuad(Operand(rbx, FrameDescription::pc_offset())); |
| 289 __ PushQuad(Operand(rbx, FrameDescription::continuation_offset())); | 289 __ PushQuad(Operand(rbx, FrameDescription::continuation_offset())); |
| 290 | 290 |
| 291 // Push the registers from the last output frame. | 291 // Push the registers from the last output frame. |
| 292 for (int i = 0; i < kNumberOfRegisters; i++) { | 292 for (int i = 0; i < kNumberOfRegisters; i++) { |
| 293 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 293 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 352 } |
| 353 | 353 |
| 354 | 354 |
| 355 #undef __ | 355 #undef __ |
| 356 | 356 |
| 357 | 357 |
| 358 } // namespace internal | 358 } // namespace internal |
| 359 } // namespace v8 | 359 } // namespace v8 |
| 360 | 360 |
| 361 #endif // V8_TARGET_ARCH_X64 | 361 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |