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

Side by Side Diff: src/ia32/deoptimizer-ia32.cc

Issue 2765323002: [deoptimizer] Fill the single precision registers in the deoptimizer entry stub. (Closed)
Patch Set: Created 3 years, 9 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
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_IA32 5 #if V8_TARGET_ARCH_IA32
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/ia32/frames-ia32.h" 10 #include "src/ia32/frames-ia32.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 const int kDoubleRegsSize = kDoubleSize * XMMRegister::kMaxNumRegisters; 197 const int kDoubleRegsSize = kDoubleSize * XMMRegister::kMaxNumRegisters;
198 __ sub(esp, Immediate(kDoubleRegsSize)); 198 __ sub(esp, Immediate(kDoubleRegsSize));
199 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft(); 199 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft();
200 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { 200 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
201 int code = config->GetAllocatableDoubleCode(i); 201 int code = config->GetAllocatableDoubleCode(i);
202 XMMRegister xmm_reg = XMMRegister::from_code(code); 202 XMMRegister xmm_reg = XMMRegister::from_code(code);
203 int offset = code * kDoubleSize; 203 int offset = code * kDoubleSize;
204 __ movsd(Operand(esp, offset), xmm_reg); 204 __ movsd(Operand(esp, offset), xmm_reg);
205 } 205 }
206 206
207 STATIC_ASSERT(kFloatSize == kPointerSize);
208 const int kFloatRegsSize = kFloatSize * XMMRegister::kMaxNumRegisters;
209 __ sub(esp, Immediate(kFloatRegsSize));
210 for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
211 int code = config->GetAllocatableFloatCode(i);
212 XMMRegister xmm_reg = XMMRegister::from_code(code);
213 int offset = code * kFloatSize;
214 __ movss(Operand(esp, offset), xmm_reg);
215 }
216
207 __ pushad(); 217 __ pushad();
208 218
209 ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate()); 219 ExternalReference c_entry_fp_address(Isolate::kCEntryFPAddress, isolate());
210 __ mov(Operand::StaticVariable(c_entry_fp_address), ebp); 220 __ mov(Operand::StaticVariable(c_entry_fp_address), ebp);
211 221
212 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + 222 const int kSavedRegistersAreaSize =
213 kDoubleRegsSize; 223 kNumberOfRegisters * kPointerSize + kDoubleRegsSize + kFloatRegsSize;
214 224
215 // Get the bailout id from the stack. 225 // Get the bailout id from the stack.
216 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); 226 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize));
217 227
218 // Get the address of the location in the code object 228 // Get the address of the location in the code object
219 // and compute the fp-to-sp delta in register edx. 229 // and compute the fp-to-sp delta in register edx.
220 __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize)); 230 __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize));
221 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize)); 231 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize));
222 232
223 __ sub(edx, ebp); 233 __ sub(edx, ebp);
(...skipping 22 matching lines...) Expand all
246 // Preserve deoptimizer object in register eax and get the input 256 // Preserve deoptimizer object in register eax and get the input
247 // frame descriptor pointer. 257 // frame descriptor pointer.
248 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); 258 __ mov(ebx, Operand(eax, Deoptimizer::input_offset()));
249 259
250 // Fill in the input registers. 260 // Fill in the input registers.
251 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { 261 for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
252 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 262 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
253 __ pop(Operand(ebx, offset)); 263 __ pop(Operand(ebx, offset));
254 } 264 }
255 265
266 int float_regs_offset = FrameDescription::float_registers_offset();
267 // Fill in the float input registers.
268 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) {
269 int dst_offset = i * kFloatSize + float_regs_offset;
270 __ pop(Operand(ebx, dst_offset));
271 }
272
256 int double_regs_offset = FrameDescription::double_registers_offset(); 273 int double_regs_offset = FrameDescription::double_registers_offset();
257 // Fill in the double input registers. 274 // Fill in the double input registers.
258 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { 275 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
259 int code = config->GetAllocatableDoubleCode(i); 276 int code = config->GetAllocatableDoubleCode(i);
260 int dst_offset = code * kDoubleSize + double_regs_offset; 277 int dst_offset = code * kDoubleSize + double_regs_offset;
261 int src_offset = code * kDoubleSize; 278 int src_offset = code * kDoubleSize;
262 __ movsd(xmm0, Operand(esp, src_offset)); 279 __ movsd(xmm0, Operand(esp, src_offset));
263 __ movsd(Operand(ebx, dst_offset), xmm0); 280 __ movsd(Operand(ebx, dst_offset), xmm0);
264 } 281 }
265 282
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 } 403 }
387 404
388 405
389 #undef __ 406 #undef __
390 407
391 408
392 } // namespace internal 409 } // namespace internal
393 } // namespace v8 410 } // namespace v8
394 411
395 #endif // V8_TARGET_ARCH_IA32 412 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698