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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 CpuFeatures::Scope scope(VFP2); | 472 CpuFeatures::Scope scope(VFP2); |
473 masm->sub(sp, | 473 masm->sub(sp, |
474 sp, | 474 sp, |
475 Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1))); | 475 Operand(kDoubleSize * (DwVfpRegister::NumAvailableRegisters() - 1))); |
476 // Save all VFP registers except d0. | 476 // Save all VFP registers except d0. |
477 for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) { | 477 // XXX: Why is d0 special? It's not the scratch register.. |
Rodolph Perfetta
2012/12/05 00:42:10
A long time ago, d0 was the scratch register, so t
hans
2012/12/05 14:12:58
So I guess what we want here is to save d0--d7, an
| |
478 for (int i = DwVfpRegister::NumAvailableRegisters() - 1; i > 0; i--) { | |
478 DwVfpRegister reg = DwVfpRegister::from_code(i); | 479 DwVfpRegister reg = DwVfpRegister::from_code(i); |
479 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 480 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
480 } | 481 } |
481 } | 482 } |
482 } | 483 } |
483 | 484 |
484 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, | 485 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, |
485 SaveFPRegsMode mode) { | 486 SaveFPRegsMode mode) { |
486 if (mode == kSaveFPRegs) { | 487 if (mode == kSaveFPRegs) { |
487 CpuFeatures::Scope scope(VFP2); | 488 CpuFeatures::Scope scope(VFP2); |
488 // Restore all VFP registers except d0. | 489 // Restore all VFP registers except d0. |
489 for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) { | 490 // XXX: Why is d0 special? It's not the scratch register.. |
Rodolph Perfetta
2012/12/05 00:42:10
Ditto.
| |
491 for (int i = DwVfpRegister::NumAvailableRegisters() - 1; i > 0; i--) { | |
490 DwVfpRegister reg = DwVfpRegister::from_code(i); | 492 DwVfpRegister reg = DwVfpRegister::from_code(i); |
491 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 493 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
492 } | 494 } |
493 masm->add(sp, | 495 masm->add(sp, |
494 sp, | 496 sp, |
495 Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1))); | 497 Operand(kDoubleSize * (DwVfpRegister::NumAvailableRegisters() - 1))); |
496 } | 498 } |
497 masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); | 499 masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); |
498 } | 500 } |
499 | 501 |
500 inline Register object() { return object_; } | 502 inline Register object() { return object_; } |
501 inline Register address() { return address_; } | 503 inline Register address() { return address_; } |
502 inline Register scratch0() { return scratch0_; } | 504 inline Register scratch0() { return scratch0_; } |
503 inline Register scratch1() { return scratch1_; } | 505 inline Register scratch1() { return scratch1_; } |
504 | 506 |
505 private: | 507 private: |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 | 787 |
786 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 788 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
787 | 789 |
788 LookupMode mode_; | 790 LookupMode mode_; |
789 }; | 791 }; |
790 | 792 |
791 | 793 |
792 } } // namespace v8::internal | 794 } } // namespace v8::internal |
793 | 795 |
794 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 796 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |