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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
462 void Restore(MacroAssembler* masm) { | 462 void Restore(MacroAssembler* masm) { |
463 masm->pop(scratch1_); | 463 masm->pop(scratch1_); |
464 } | 464 } |
465 | 465 |
466 // If we have to call into C then we need to save and restore all caller- | 466 // If we have to call into C then we need to save and restore all caller- |
467 // saved registers that were not already preserved. The scratch registers | 467 // saved registers that were not already preserved. The scratch registers |
468 // will be restored by other means so we don't bother pushing them here. | 468 // will be restored by other means so we don't bother pushing them here. |
469 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { | 469 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { |
470 masm->stm(db_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); | 470 masm->stm(db_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); |
471 if (mode == kSaveFPRegs) { | 471 if (mode == kSaveFPRegs) { |
472 // Nbr of d-regs not known at snapshot time. | |
ulan
2012/12/17 10:44:52
Nbr => Number
hans
2012/12/17 12:31:44
Done.
ulan
2012/12/17 13:03:36
Thanks, there few other places with the same comme
hans
2012/12/17 13:53:21
I've changed them all now.
| |
473 ASSERT(!Serializer::enabled()); | |
472 CpuFeatures::Scope scope(VFP2); | 474 CpuFeatures::Scope scope(VFP2); |
473 masm->sub(sp, | 475 masm->sub(sp, |
474 sp, | 476 sp, |
475 Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1))); | 477 Operand(kDoubleSize * |
478 (DwVfpRegister::NumAvailableRegisters() - 1))); | |
476 // Save all VFP registers except d0. | 479 // Save all VFP registers except d0. |
477 for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) { | 480 // TODO(hans): We should probably save d0 too. And maybe use vstm. |
481 for (int i = DwVfpRegister::NumAvailableRegisters() - 1; i > 0; i--) { | |
478 DwVfpRegister reg = DwVfpRegister::from_code(i); | 482 DwVfpRegister reg = DwVfpRegister::from_code(i); |
479 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 483 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
480 } | 484 } |
481 } | 485 } |
482 } | 486 } |
483 | 487 |
484 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, | 488 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, |
485 SaveFPRegsMode mode) { | 489 SaveFPRegsMode mode) { |
486 if (mode == kSaveFPRegs) { | 490 if (mode == kSaveFPRegs) { |
491 // Nbr of d-regs not known at snapshot time. | |
492 ASSERT(!Serializer::enabled()); | |
487 CpuFeatures::Scope scope(VFP2); | 493 CpuFeatures::Scope scope(VFP2); |
488 // Restore all VFP registers except d0. | 494 // Restore all VFP registers except d0. |
489 for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) { | 495 // TODO(hans): We should probably restore d0 too. And maybe use vldm. |
496 for (int i = DwVfpRegister::NumAvailableRegisters() - 1; i > 0; i--) { | |
490 DwVfpRegister reg = DwVfpRegister::from_code(i); | 497 DwVfpRegister reg = DwVfpRegister::from_code(i); |
491 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 498 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
492 } | 499 } |
493 masm->add(sp, | 500 masm->add(sp, |
494 sp, | 501 sp, |
495 Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1))); | 502 Operand(kDoubleSize * |
503 (DwVfpRegister::NumAvailableRegisters() - 1))); | |
496 } | 504 } |
497 masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); | 505 masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); |
498 } | 506 } |
499 | 507 |
500 inline Register object() { return object_; } | 508 inline Register object() { return object_; } |
501 inline Register address() { return address_; } | 509 inline Register address() { return address_; } |
502 inline Register scratch0() { return scratch0_; } | 510 inline Register scratch0() { return scratch0_; } |
503 inline Register scratch1() { return scratch1_; } | 511 inline Register scratch1() { return scratch1_; } |
504 | 512 |
505 private: | 513 private: |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 | 793 |
786 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 794 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
787 | 795 |
788 LookupMode mode_; | 796 LookupMode mode_; |
789 }; | 797 }; |
790 | 798 |
791 | 799 |
792 } } // namespace v8::internal | 800 } } // namespace v8::internal |
793 | 801 |
794 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 802 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |