OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 const int kNumberOfRegisters = Register::kNumRegisters; | 243 const int kNumberOfRegisters = Register::kNumRegisters; |
244 | 244 |
245 const int kDoubleRegsSize = kDoubleSize * | 245 const int kDoubleRegsSize = kDoubleSize * |
246 XMMRegister::kNumAllocatableRegisters; | 246 XMMRegister::kNumAllocatableRegisters; |
247 __ sub(esp, Immediate(kDoubleRegsSize)); | 247 __ sub(esp, Immediate(kDoubleRegsSize)); |
248 if (CpuFeatures::IsSupported(SSE2)) { | 248 if (CpuFeatures::IsSupported(SSE2)) { |
249 CpuFeatureScope scope(masm(), SSE2); | 249 CpuFeatureScope scope(masm(), SSE2); |
250 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { | 250 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
251 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 251 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
252 int offset = i * kDoubleSize; | 252 int offset = i * kDoubleSize; |
253 __ movdbl(Operand(esp, offset), xmm_reg); | 253 __ movsd(Operand(esp, offset), xmm_reg); |
254 } | 254 } |
255 } | 255 } |
256 | 256 |
257 __ pushad(); | 257 __ pushad(); |
258 | 258 |
259 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + | 259 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + |
260 kDoubleRegsSize; | 260 kDoubleRegsSize; |
261 | 261 |
262 // Get the bailout id from the stack. | 262 // Get the bailout id from the stack. |
263 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); | 263 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 __ pop(Operand(ebx, offset)); | 295 __ pop(Operand(ebx, offset)); |
296 } | 296 } |
297 | 297 |
298 int double_regs_offset = FrameDescription::double_registers_offset(); | 298 int double_regs_offset = FrameDescription::double_registers_offset(); |
299 if (CpuFeatures::IsSupported(SSE2)) { | 299 if (CpuFeatures::IsSupported(SSE2)) { |
300 CpuFeatureScope scope(masm(), SSE2); | 300 CpuFeatureScope scope(masm(), SSE2); |
301 // Fill in the double input registers. | 301 // Fill in the double input registers. |
302 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { | 302 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
303 int dst_offset = i * kDoubleSize + double_regs_offset; | 303 int dst_offset = i * kDoubleSize + double_regs_offset; |
304 int src_offset = i * kDoubleSize; | 304 int src_offset = i * kDoubleSize; |
305 __ movdbl(xmm0, Operand(esp, src_offset)); | 305 __ movsd(xmm0, Operand(esp, src_offset)); |
306 __ movdbl(Operand(ebx, dst_offset), xmm0); | 306 __ movsd(Operand(ebx, dst_offset), xmm0); |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 // Clear FPU all exceptions. | 310 // Clear FPU all exceptions. |
311 // TODO(ulan): Find out why the TOP register is not zero here in some cases, | 311 // TODO(ulan): Find out why the TOP register is not zero here in some cases, |
312 // and check that the generated code never deoptimizes with unbalanced stack. | 312 // and check that the generated code never deoptimizes with unbalanced stack. |
313 __ fnclex(); | 313 __ fnclex(); |
314 | 314 |
315 // Remove the bailout id, return address and the double registers. | 315 // Remove the bailout id, return address and the double registers. |
316 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); | 316 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 __ bind(&outer_loop_header); | 381 __ bind(&outer_loop_header); |
382 __ cmp(eax, edx); | 382 __ cmp(eax, edx); |
383 __ j(below, &outer_push_loop); | 383 __ j(below, &outer_push_loop); |
384 | 384 |
385 // In case of a failed STUB, we have to restore the XMM registers. | 385 // In case of a failed STUB, we have to restore the XMM registers. |
386 if (CpuFeatures::IsSupported(SSE2)) { | 386 if (CpuFeatures::IsSupported(SSE2)) { |
387 CpuFeatureScope scope(masm(), SSE2); | 387 CpuFeatureScope scope(masm(), SSE2); |
388 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { | 388 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
389 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 389 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
390 int src_offset = i * kDoubleSize + double_regs_offset; | 390 int src_offset = i * kDoubleSize + double_regs_offset; |
391 __ movdbl(xmm_reg, Operand(ebx, src_offset)); | 391 __ movsd(xmm_reg, Operand(ebx, src_offset)); |
392 } | 392 } |
393 } | 393 } |
394 | 394 |
395 // Push state, pc, and continuation from the last output frame. | 395 // Push state, pc, and continuation from the last output frame. |
396 __ push(Operand(ebx, FrameDescription::state_offset())); | 396 __ push(Operand(ebx, FrameDescription::state_offset())); |
397 __ push(Operand(ebx, FrameDescription::pc_offset())); | 397 __ push(Operand(ebx, FrameDescription::pc_offset())); |
398 __ push(Operand(ebx, FrameDescription::continuation_offset())); | 398 __ push(Operand(ebx, FrameDescription::continuation_offset())); |
399 | 399 |
400 | 400 |
401 // Push the registers from the last output frame. | 401 // Push the registers from the last output frame. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 SetFrameSlot(offset, value); | 435 SetFrameSlot(offset, value); |
436 } | 436 } |
437 | 437 |
438 | 438 |
439 #undef __ | 439 #undef __ |
440 | 440 |
441 | 441 |
442 } } // namespace v8::internal | 442 } } // namespace v8::internal |
443 | 443 |
444 #endif // V8_TARGET_ARCH_IA32 | 444 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |