OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include "src/codegen.h" | 5 #include "src/codegen.h" |
6 #include "src/deoptimizer.h" | 6 #include "src/deoptimizer.h" |
7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/register-configuration.h" | 8 #include "src/register-configuration.h" |
9 #include "src/safepoint-table.h" | 9 #include "src/safepoint-table.h" |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kMaxNumRegisters; | 116 const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kMaxNumRegisters; |
117 | 117 |
118 // Save all FPU registers before messing with them. | 118 // Save all FPU registers before messing with them. |
119 __ Subu(sp, sp, Operand(kDoubleRegsSize)); | 119 __ Subu(sp, sp, Operand(kDoubleRegsSize)); |
120 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft(); | 120 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft(); |
121 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 121 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
122 int code = config->GetAllocatableDoubleCode(i); | 122 int code = config->GetAllocatableDoubleCode(i); |
123 const DoubleRegister fpu_reg = DoubleRegister::from_code(code); | 123 const DoubleRegister fpu_reg = DoubleRegister::from_code(code); |
124 int offset = code * kDoubleSize; | 124 int offset = code * kDoubleSize; |
125 __ sdc1(fpu_reg, MemOperand(sp, offset)); | 125 __ Sdc1(fpu_reg, MemOperand(sp, offset)); |
126 } | 126 } |
127 | 127 |
128 // Push saved_regs (needed to populate FrameDescription::registers_). | 128 // Push saved_regs (needed to populate FrameDescription::registers_). |
129 // Leave gaps for other registers. | 129 // Leave gaps for other registers. |
130 __ Subu(sp, sp, kNumberOfRegisters * kPointerSize); | 130 __ Subu(sp, sp, kNumberOfRegisters * kPointerSize); |
131 for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) { | 131 for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) { |
132 if ((saved_regs & (1 << i)) != 0) { | 132 if ((saved_regs & (1 << i)) != 0) { |
133 __ sw(ToRegister(i), MemOperand(sp, kPointerSize * i)); | 133 __ sw(ToRegister(i), MemOperand(sp, kPointerSize * i)); |
134 } | 134 } |
135 } | 135 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 int double_regs_offset = FrameDescription::double_registers_offset(); | 195 int double_regs_offset = FrameDescription::double_registers_offset(); |
196 // Copy FPU registers to | 196 // Copy FPU registers to |
197 // double_registers_[DoubleRegister::kNumAllocatableRegisters] | 197 // double_registers_[DoubleRegister::kNumAllocatableRegisters] |
198 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 198 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
199 int code = config->GetAllocatableDoubleCode(i); | 199 int code = config->GetAllocatableDoubleCode(i); |
200 int dst_offset = code * kDoubleSize + double_regs_offset; | 200 int dst_offset = code * kDoubleSize + double_regs_offset; |
201 int src_offset = code * kDoubleSize + kNumberOfRegisters * kPointerSize; | 201 int src_offset = code * kDoubleSize + kNumberOfRegisters * kPointerSize; |
202 __ ldc1(f0, MemOperand(sp, src_offset)); | 202 __ Ldc1(f0, MemOperand(sp, src_offset)); |
203 __ sdc1(f0, MemOperand(a1, dst_offset)); | 203 __ Sdc1(f0, MemOperand(a1, dst_offset)); |
204 } | 204 } |
205 | 205 |
206 // Remove the bailout id and the saved registers from the stack. | 206 // Remove the bailout id and the saved registers from the stack. |
207 __ Addu(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); | 207 __ Addu(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); |
208 | 208 |
209 // Compute a pointer to the unwinding limit in register a2; that is | 209 // Compute a pointer to the unwinding limit in register a2; that is |
210 // the first stack slot not part of the input frame. | 210 // the first stack slot not part of the input frame. |
211 __ lw(a2, MemOperand(a1, FrameDescription::frame_size_offset())); | 211 __ lw(a2, MemOperand(a1, FrameDescription::frame_size_offset())); |
212 __ Addu(a2, a2, sp); | 212 __ Addu(a2, a2, sp); |
213 | 213 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 __ Addu(t0, t0, Operand(kPointerSize)); | 264 __ Addu(t0, t0, Operand(kPointerSize)); |
265 __ bind(&outer_loop_header); | 265 __ bind(&outer_loop_header); |
266 __ BranchShort(&outer_push_loop, lt, t0, Operand(a1)); | 266 __ BranchShort(&outer_push_loop, lt, t0, Operand(a1)); |
267 | 267 |
268 __ lw(a1, MemOperand(a0, Deoptimizer::input_offset())); | 268 __ lw(a1, MemOperand(a0, Deoptimizer::input_offset())); |
269 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { | 269 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
270 int code = config->GetAllocatableDoubleCode(i); | 270 int code = config->GetAllocatableDoubleCode(i); |
271 const DoubleRegister fpu_reg = DoubleRegister::from_code(code); | 271 const DoubleRegister fpu_reg = DoubleRegister::from_code(code); |
272 int src_offset = code * kDoubleSize + double_regs_offset; | 272 int src_offset = code * kDoubleSize + double_regs_offset; |
273 __ ldc1(fpu_reg, MemOperand(a1, src_offset)); | 273 __ Ldc1(fpu_reg, MemOperand(a1, src_offset)); |
274 } | 274 } |
275 | 275 |
276 // Push state, pc, and continuation from the last output frame. | 276 // Push state, pc, and continuation from the last output frame. |
277 __ lw(t2, MemOperand(a2, FrameDescription::state_offset())); | 277 __ lw(t2, MemOperand(a2, FrameDescription::state_offset())); |
278 __ push(t2); | 278 __ push(t2); |
279 | 279 |
280 __ lw(t2, MemOperand(a2, FrameDescription::pc_offset())); | 280 __ lw(t2, MemOperand(a2, FrameDescription::pc_offset())); |
281 __ push(t2); | 281 __ push(t2); |
282 __ lw(t2, MemOperand(a2, FrameDescription::continuation_offset())); | 282 __ lw(t2, MemOperand(a2, FrameDescription::continuation_offset())); |
283 __ push(t2); | 283 __ push(t2); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // No embedded constant pool support. | 382 // No embedded constant pool support. |
383 UNREACHABLE(); | 383 UNREACHABLE(); |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 #undef __ | 387 #undef __ |
388 | 388 |
389 | 389 |
390 } // namespace internal | 390 } // namespace internal |
391 } // namespace v8 | 391 } // namespace v8 |
OLD | NEW |