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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 Major MajorKey() { return TranscendentalCache; } | 55 Major MajorKey() { return TranscendentalCache; } |
56 int MinorKey() { return type_ | argument_type_; } | 56 int MinorKey() { return type_ | argument_type_; } |
57 Runtime::FunctionId RuntimeFunction(); | 57 Runtime::FunctionId RuntimeFunction(); |
58 }; | 58 }; |
59 | 59 |
60 | 60 |
61 class StoreBufferOverflowStub: public PlatformCodeStub { | 61 class StoreBufferOverflowStub: public PlatformCodeStub { |
62 public: | 62 public: |
63 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) | 63 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) |
64 : save_doubles_(save_fp) { | 64 : save_doubles_(save_fp) {} |
65 ASSERT(CpuFeatures::IsSafeForSnapshot(VFP2) || save_fp == kDontSaveFPRegs); | |
66 } | |
67 | 65 |
68 void Generate(MacroAssembler* masm); | 66 void Generate(MacroAssembler* masm); |
69 | 67 |
70 virtual bool IsPregenerated() { return true; } | 68 virtual bool IsPregenerated() { return true; } |
71 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 69 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
72 virtual bool SometimesSetsUpAFrame() { return false; } | 70 virtual bool SometimesSetsUpAFrame() { return false; } |
73 | 71 |
74 private: | 72 private: |
75 SaveFPRegsMode save_doubles_; | 73 SaveFPRegsMode save_doubles_; |
76 | 74 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 } | 464 } |
467 | 465 |
468 // 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- |
469 // saved registers that were not already preserved. The scratch registers | 467 // saved registers that were not already preserved. The scratch registers |
470 // 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. |
471 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { | 469 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { |
472 masm->stm(db_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); | 470 masm->stm(db_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); |
473 if (mode == kSaveFPRegs) { | 471 if (mode == kSaveFPRegs) { |
474 // Number of d-regs not known at snapshot time. | 472 // Number of d-regs not known at snapshot time. |
475 ASSERT(!Serializer::enabled()); | 473 ASSERT(!Serializer::enabled()); |
476 CpuFeatureScope scope(masm, VFP2); | |
477 masm->sub(sp, | 474 masm->sub(sp, |
478 sp, | 475 sp, |
479 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); | 476 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); |
480 // Save all VFP registers except d0. | 477 // Save all VFP registers except d0. |
481 // 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. |
482 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { | 479 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { |
483 DwVfpRegister reg = DwVfpRegister::from_code(i); | 480 DwVfpRegister reg = DwVfpRegister::from_code(i); |
484 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 481 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
485 } | 482 } |
486 } | 483 } |
487 } | 484 } |
488 | 485 |
489 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, | 486 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, |
490 SaveFPRegsMode mode) { | 487 SaveFPRegsMode mode) { |
491 if (mode == kSaveFPRegs) { | 488 if (mode == kSaveFPRegs) { |
492 // Number of d-regs not known at snapshot time. | 489 // Number of d-regs not known at snapshot time. |
493 ASSERT(!Serializer::enabled()); | 490 ASSERT(!Serializer::enabled()); |
494 CpuFeatureScope scope(masm, VFP2); | |
495 // Restore all VFP registers except d0. | 491 // Restore all VFP registers except d0. |
496 // 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. |
497 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { | 493 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { |
498 DwVfpRegister reg = DwVfpRegister::from_code(i); | 494 DwVfpRegister reg = DwVfpRegister::from_code(i); |
499 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); | 495 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
500 } | 496 } |
501 masm->add(sp, | 497 masm->add(sp, |
502 sp, | 498 sp, |
503 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); | 499 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); |
504 } | 500 } |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 790 |
795 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 791 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
796 | 792 |
797 LookupMode mode_; | 793 LookupMode mode_; |
798 }; | 794 }; |
799 | 795 |
800 | 796 |
801 } } // namespace v8::internal | 797 } } // namespace v8::internal |
802 | 798 |
803 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 799 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |