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

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

Issue 12391055: Cleaned up CpuFeature scope handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nits Created 7 years, 9 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 | « src/arm/assembler-arm.cc ('k') | 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 CpuFeatures::Scope scope(VFP2); 474 CpuFeatureScope scope(masm, VFP2);
475 masm->sub(sp, 475 masm->sub(sp,
476 sp, 476 sp,
477 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); 477 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1)));
478 // Save all VFP registers except d0. 478 // Save all VFP registers except d0.
479 // TODO(hans): We should probably save d0 too. And maybe use vstm. 479 // TODO(hans): We should probably save d0 too. And maybe use vstm.
480 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { 480 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) {
481 DwVfpRegister reg = DwVfpRegister::from_code(i); 481 DwVfpRegister reg = DwVfpRegister::from_code(i);
482 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); 482 masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize));
483 } 483 }
484 } 484 }
485 } 485 }
486 486
487 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, 487 inline void RestoreCallerSaveRegisters(MacroAssembler*masm,
488 SaveFPRegsMode mode) { 488 SaveFPRegsMode mode) {
489 if (mode == kSaveFPRegs) { 489 if (mode == kSaveFPRegs) {
490 // Number of d-regs not known at snapshot time. 490 // Number of d-regs not known at snapshot time.
491 ASSERT(!Serializer::enabled()); 491 ASSERT(!Serializer::enabled());
492 CpuFeatures::Scope scope(VFP2); 492 CpuFeatureScope scope(masm, VFP2);
493 // Restore all VFP registers except d0. 493 // Restore all VFP registers except d0.
494 // TODO(hans): We should probably restore d0 too. And maybe use vldm. 494 // TODO(hans): We should probably restore d0 too. And maybe use vldm.
495 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) { 495 for (int i = DwVfpRegister::NumRegisters() - 1; i > 0; i--) {
496 DwVfpRegister reg = DwVfpRegister::from_code(i); 496 DwVfpRegister reg = DwVfpRegister::from_code(i);
497 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); 497 masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize));
498 } 498 }
499 masm->add(sp, 499 masm->add(sp,
500 sp, 500 sp,
501 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1))); 501 Operand(kDoubleSize * (DwVfpRegister::NumRegisters() - 1)));
502 } 502 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 791
792 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 792 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
793 793
794 LookupMode mode_; 794 LookupMode mode_;
795 }; 795 };
796 796
797 797
798 } } // namespace v8::internal 798 } } // namespace v8::internal
799 799
800 #endif // V8_ARM_CODE_STUBS_ARM_H_ 800 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698