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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 2092413002: [RegisterConfiguration] Streamline access to arch defaults, simplify Registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile. Created 4 years, 5 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
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/arm/simulator-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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 855
856 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { 856 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) {
857 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); 857 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
858 } 858 }
859 859
860 860
861 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { 861 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
862 // Number of d-regs not known at snapshot time. 862 // Number of d-regs not known at snapshot time.
863 DCHECK(!serializer_enabled()); 863 DCHECK(!serializer_enabled());
864 // General purpose registers are pushed last on the stack. 864 // General purpose registers are pushed last on the stack.
865 const RegisterConfiguration* config = 865 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft();
866 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT);
867 int doubles_size = config->num_allocatable_double_registers() * kDoubleSize; 866 int doubles_size = config->num_allocatable_double_registers() * kDoubleSize;
868 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize; 867 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize;
869 return MemOperand(sp, doubles_size + register_offset); 868 return MemOperand(sp, doubles_size + register_offset);
870 } 869 }
871 870
872 871
873 void MacroAssembler::Ldrd(Register dst1, Register dst2, 872 void MacroAssembler::Ldrd(Register dst1, Register dst2,
874 const MemOperand& src, Condition cond) { 873 const MemOperand& src, Condition cond) {
875 DCHECK(src.rm().is(no_reg)); 874 DCHECK(src.rm().is(no_reg));
876 DCHECK(!dst1.is(lr)); // r14. 875 DCHECK(!dst1.is(lr)); // r14.
(...skipping 3007 matching lines...) Expand 10 before | Expand all | Expand 10 after
3884 Register reg5, 3883 Register reg5,
3885 Register reg6) { 3884 Register reg6) {
3886 RegList regs = 0; 3885 RegList regs = 0;
3887 if (reg1.is_valid()) regs |= reg1.bit(); 3886 if (reg1.is_valid()) regs |= reg1.bit();
3888 if (reg2.is_valid()) regs |= reg2.bit(); 3887 if (reg2.is_valid()) regs |= reg2.bit();
3889 if (reg3.is_valid()) regs |= reg3.bit(); 3888 if (reg3.is_valid()) regs |= reg3.bit();
3890 if (reg4.is_valid()) regs |= reg4.bit(); 3889 if (reg4.is_valid()) regs |= reg4.bit();
3891 if (reg5.is_valid()) regs |= reg5.bit(); 3890 if (reg5.is_valid()) regs |= reg5.bit();
3892 if (reg6.is_valid()) regs |= reg6.bit(); 3891 if (reg6.is_valid()) regs |= reg6.bit();
3893 3892
3894 const RegisterConfiguration* config = 3893 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft();
3895 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT);
3896 for (int i = 0; i < config->num_allocatable_general_registers(); ++i) { 3894 for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
3897 int code = config->GetAllocatableGeneralCode(i); 3895 int code = config->GetAllocatableGeneralCode(i);
3898 Register candidate = Register::from_code(code); 3896 Register candidate = Register::from_code(code);
3899 if (regs & candidate.bit()) continue; 3897 if (regs & candidate.bit()) continue;
3900 return candidate; 3898 return candidate;
3901 } 3899 }
3902 UNREACHABLE(); 3900 UNREACHABLE();
3903 return no_reg; 3901 return no_reg;
3904 } 3902 }
3905 3903
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 } 4034 }
4037 } 4035 }
4038 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 4036 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
4039 add(result, result, Operand(dividend, LSR, 31)); 4037 add(result, result, Operand(dividend, LSR, 31));
4040 } 4038 }
4041 4039
4042 } // namespace internal 4040 } // namespace internal
4043 } // namespace v8 4041 } // namespace v8
4044 4042
4045 #endif // V8_TARGET_ARCH_ARM 4043 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698