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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Number of d-regs not known at snapshot time. | 472 // Number of d-regs not known at snapshot time. |
473 ASSERT(!Serializer::enabled()); | 473 ASSERT(!Serializer::enabled()); |
474 CpuFeatureScope scope(masm, VFP2); | |
475 masm->sub(sp, | 474 masm->sub(sp, |
476 sp, | 475 sp, |
477 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); | 476 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); |
478 // Save all VFP registers except d0. | 477 // Save all VFP registers except d0. |
479 // TODO(hans): We should probably save d0 too. And maybe use vstm. | 478 // TODO(hans): We should probably save d0 too. And maybe use vstm. |
480 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { | 479 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { |
481 DwVfpRegister reg = DwVfpRegister::from_code(i); | 480 DwVfpRegister reg = DwVfpRegister::from_code(i); |
482 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 481 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
483 } | 482 } |
484 } | 483 } |
485 } | 484 } |
486 | 485 |
487 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, | 486 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, |
488 SaveFPRegsMode mode) { | 487 SaveFPRegsMode mode) { |
489 if (mode == kSaveFPRegs) { | 488 if (mode == kSaveFPRegs) { |
490 // Number of d-regs not known at snapshot time. | 489 // Number of d-regs not known at snapshot time. |
491 ASSERT(!Serializer::enabled()); | 490 ASSERT(!Serializer::enabled()); |
492 CpuFeatureScope scope(masm, VFP2); | |
493 // Restore all VFP registers except d0. | 491 // Restore all VFP registers except d0. |
494 // TODO(hans): We should probably restore d0 too. And maybe use vldm. | 492 // TODO(hans): We should probably restore d0 too. And maybe use vldm. |
495 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { | 493 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { |
496 DwVfpRegister reg = DwVfpRegister::from_code(i); | 494 DwVfpRegister reg = DwVfpRegister::from_code(i); |
497 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 495 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
498 } | 496 } |
499 masm->add(sp, | 497 masm->add(sp, |
500 sp, | 498 sp, |
501 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); | 499 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); |
502 } | 500 } |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 | 790 |
793 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 791 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
794 | 792 |
795 LookupMode mode_; | 793 LookupMode mode_; |
796 }; | 794 }; |
797 | 795 |
798 | 796 |
799 } } // namespace v8::internal | 797 } } // namespace v8::internal |
800 | 798 |
801 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 799 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |