OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { | 437 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { |
438 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->push(eax); | 438 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->push(eax); |
439 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->push(edx); | 439 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->push(edx); |
440 if (mode == kSaveFPRegs) { | 440 if (mode == kSaveFPRegs) { |
441 CpuFeatureScope scope(masm, SSE2); | 441 CpuFeatureScope scope(masm, SSE2); |
442 masm->sub(esp, | 442 masm->sub(esp, |
443 Immediate(kDoubleSize * (XMMRegister::kNumRegisters - 1))); | 443 Immediate(kDoubleSize * (XMMRegister::kNumRegisters - 1))); |
444 // Save all XMM registers except XMM0. | 444 // Save all XMM registers except XMM0. |
445 for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) { | 445 for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) { |
446 XMMRegister reg = XMMRegister::from_code(i); | 446 XMMRegister reg = XMMRegister::from_code(i); |
447 masm->movdbl(Operand(esp, (i - 1) * kDoubleSize), reg); | 447 masm->movsd(Operand(esp, (i - 1) * kDoubleSize), reg); |
448 } | 448 } |
449 } | 449 } |
450 } | 450 } |
451 | 451 |
452 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, | 452 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, |
453 SaveFPRegsMode mode) { | 453 SaveFPRegsMode mode) { |
454 if (mode == kSaveFPRegs) { | 454 if (mode == kSaveFPRegs) { |
455 CpuFeatureScope scope(masm, SSE2); | 455 CpuFeatureScope scope(masm, SSE2); |
456 // Restore all XMM registers except XMM0. | 456 // Restore all XMM registers except XMM0. |
457 for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) { | 457 for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) { |
458 XMMRegister reg = XMMRegister::from_code(i); | 458 XMMRegister reg = XMMRegister::from_code(i); |
459 masm->movdbl(reg, Operand(esp, (i - 1) * kDoubleSize)); | 459 masm->movsd(reg, Operand(esp, (i - 1) * kDoubleSize)); |
460 } | 460 } |
461 masm->add(esp, | 461 masm->add(esp, |
462 Immediate(kDoubleSize * (XMMRegister::kNumRegisters - 1))); | 462 Immediate(kDoubleSize * (XMMRegister::kNumRegisters - 1))); |
463 } | 463 } |
464 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->pop(edx); | 464 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->pop(edx); |
465 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->pop(eax); | 465 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->pop(eax); |
466 } | 466 } |
467 | 467 |
468 inline Register object() { return object_; } | 468 inline Register object() { return object_; } |
469 inline Register address() { return address_; } | 469 inline Register address() { return address_; } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 Register address_; | 535 Register address_; |
536 RememberedSetAction remembered_set_action_; | 536 RememberedSetAction remembered_set_action_; |
537 SaveFPRegsMode save_fp_regs_mode_; | 537 SaveFPRegsMode save_fp_regs_mode_; |
538 RegisterAllocation regs_; | 538 RegisterAllocation regs_; |
539 }; | 539 }; |
540 | 540 |
541 | 541 |
542 } } // namespace v8::internal | 542 } } // namespace v8::internal |
543 | 543 |
544 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 544 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
OLD | NEW |