Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1796)

Side by Side Diff: src/arm/code-stubs-arm.h

Issue 14246032: RecordWriteStubs on ARM need to save FP registers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review from Ulan Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // Number of d-regs not known at snapshot time. 472 masm->SaveFPRegs(sp, scratch0_);
473 ASSERT(!Serializer::enabled());
474 masm->sub(sp,
475 sp,
476 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1)));
477 // Save all VFP registers except d0.
478 // TODO(hans): We should probably save d0 too. And maybe use vstm.
479 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) {
480 DwVfpRegister reg = DwVfpRegister::from_code(i);
481 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize));
482 }
483 } 473 }
484 } 474 }
485 475
486 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, 476 inline void RestoreCallerSaveRegisters(MacroAssembler*masm,
487 SaveFPRegsMode mode) { 477 SaveFPRegsMode mode) {
488 if (mode == kSaveFPRegs) { 478 if (mode == kSaveFPRegs) {
489 // Number of d-regs not known at snapshot time. 479 masm->RestoreFPRegs(sp, scratch0_);
490 ASSERT(!Serializer::enabled());
491 // Restore all VFP registers except d0.
492 // TODO(hans): We should probably restore d0 too. And maybe use vldm.
493 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) {
494 DwVfpRegister reg = DwVfpRegister::from_code(i);
495 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize));
496 }
497 masm->add(sp,
498 sp,
499 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1)));
500 } 480 }
501 masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); 481 masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit());
502 } 482 }
503 483
504 inline Register object() { return object_; } 484 inline Register object() { return object_; }
505 inline Register address() { return address_; } 485 inline Register address() { return address_; }
506 inline Register scratch0() { return scratch0_; } 486 inline Register scratch0() { return scratch0_; }
507 inline Register scratch1() { return scratch1_; } 487 inline Register scratch1() { return scratch1_; }
508 488
509 private: 489 private:
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 770
791 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 771 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
792 772
793 LookupMode mode_; 773 LookupMode mode_;
794 }; 774 };
795 775
796 776
797 } } // namespace v8::internal 777 } } // namespace v8::internal
798 778
799 #endif // V8_ARM_CODE_STUBS_ARM_H_ 779 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698