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 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 __ ret(0); | 473 __ ret(0); |
474 } | 474 } |
475 | 475 |
476 | 476 |
477 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { | 477 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
478 // We don't allow a GC during a store buffer overflow so there is no need to | 478 // We don't allow a GC during a store buffer overflow so there is no need to |
479 // store the registers in any particular way, but we do have to store and | 479 // store the registers in any particular way, but we do have to store and |
480 // restore them. | 480 // restore them. |
481 __ pushad(); | 481 __ pushad(); |
482 if (save_doubles_ == kSaveFPRegs) { | 482 if (save_doubles_ == kSaveFPRegs) { |
483 __ sub(esp, Immediate(kDoubleSize * XMMRegister::kNumRegisters)); | 483 __ sub(esp, Immediate(kDoubleSize * XMMRegister::kMaxNumRegisters)); |
484 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | 484 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) { |
485 XMMRegister reg = XMMRegister::from_code(i); | 485 XMMRegister reg = XMMRegister::from_code(i); |
486 __ movsd(Operand(esp, i * kDoubleSize), reg); | 486 __ movsd(Operand(esp, i * kDoubleSize), reg); |
487 } | 487 } |
488 } | 488 } |
489 const int argument_count = 1; | 489 const int argument_count = 1; |
490 | 490 |
491 AllowExternalCallThatCantCauseGC scope(masm); | 491 AllowExternalCallThatCantCauseGC scope(masm); |
492 __ PrepareCallCFunction(argument_count, ecx); | 492 __ PrepareCallCFunction(argument_count, ecx); |
493 __ mov(Operand(esp, 0 * kPointerSize), | 493 __ mov(Operand(esp, 0 * kPointerSize), |
494 Immediate(ExternalReference::isolate_address(isolate()))); | 494 Immediate(ExternalReference::isolate_address(isolate()))); |
495 __ CallCFunction( | 495 __ CallCFunction( |
496 ExternalReference::store_buffer_overflow_function(isolate()), | 496 ExternalReference::store_buffer_overflow_function(isolate()), |
497 argument_count); | 497 argument_count); |
498 if (save_doubles_ == kSaveFPRegs) { | 498 if (save_doubles_ == kSaveFPRegs) { |
499 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | 499 for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) { |
500 XMMRegister reg = XMMRegister::from_code(i); | 500 XMMRegister reg = XMMRegister::from_code(i); |
501 __ movsd(reg, Operand(esp, i * kDoubleSize)); | 501 __ movsd(reg, Operand(esp, i * kDoubleSize)); |
502 } | 502 } |
503 __ add(esp, Immediate(kDoubleSize * XMMRegister::kNumRegisters)); | 503 __ add(esp, Immediate(kDoubleSize * XMMRegister::kMaxNumRegisters)); |
504 } | 504 } |
505 __ popad(); | 505 __ popad(); |
506 __ ret(0); | 506 __ ret(0); |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 class FloatingPointHelper : public AllStatic { | 510 class FloatingPointHelper : public AllStatic { |
511 public: | 511 public: |
512 enum ArgLocation { | 512 enum ArgLocation { |
513 ARGS_ON_STACK, | 513 ARGS_ON_STACK, |
(...skipping 4561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5075 Operand(ebp, 7 * kPointerSize), | 5075 Operand(ebp, 7 * kPointerSize), |
5076 NULL); | 5076 NULL); |
5077 } | 5077 } |
5078 | 5078 |
5079 | 5079 |
5080 #undef __ | 5080 #undef __ |
5081 | 5081 |
5082 } } // namespace v8::internal | 5082 } } // namespace v8::internal |
5083 | 5083 |
5084 #endif // V8_TARGET_ARCH_IA32 | 5084 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |