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

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

Issue 1287383003: Re-reland: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix MIPS tests again Created 5 years, 2 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/macro-assembler-arm.h ('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"
11 #include "src/bootstrapper.h" 11 #include "src/bootstrapper.h"
12 #include "src/codegen.h" 12 #include "src/codegen.h"
13 #include "src/debug/debug.h" 13 #include "src/debug/debug.h"
14 #include "src/register-configuration.h"
14 #include "src/runtime/runtime.h" 15 #include "src/runtime/runtime.h"
15 16
16 #include "src/arm/macro-assembler-arm.h" 17 #include "src/arm/macro-assembler-arm.h"
17 18
18 namespace v8 { 19 namespace v8 {
19 namespace internal { 20 namespace internal {
20 21
21 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) 22 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
22 : Assembler(arg_isolate, buffer, size), 23 : Assembler(arg_isolate, buffer, size),
23 generating_stub_(false), 24 generating_stub_(false),
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 753
753 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { 754 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) {
754 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); 755 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
755 } 756 }
756 757
757 758
758 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { 759 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
759 // Number of d-regs not known at snapshot time. 760 // Number of d-regs not known at snapshot time.
760 DCHECK(!serializer_enabled()); 761 DCHECK(!serializer_enabled());
761 // General purpose registers are pushed last on the stack. 762 // General purpose registers are pushed last on the stack.
762 int doubles_size = DwVfpRegister::NumAllocatableRegisters() * kDoubleSize; 763 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault();
764 int doubles_size = config->num_allocatable_double_registers() * kDoubleSize;
763 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize; 765 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize;
764 return MemOperand(sp, doubles_size + register_offset); 766 return MemOperand(sp, doubles_size + register_offset);
765 } 767 }
766 768
767 769
768 void MacroAssembler::Ldrd(Register dst1, Register dst2, 770 void MacroAssembler::Ldrd(Register dst1, Register dst2,
769 const MemOperand& src, Condition cond) { 771 const MemOperand& src, Condition cond) {
770 DCHECK(src.rm().is(no_reg)); 772 DCHECK(src.rm().is(no_reg));
771 DCHECK(!dst1.is(lr)); // r14. 773 DCHECK(!dst1.is(lr)); // r14.
772 774
(...skipping 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after
3571 Register reg5, 3573 Register reg5,
3572 Register reg6) { 3574 Register reg6) {
3573 RegList regs = 0; 3575 RegList regs = 0;
3574 if (reg1.is_valid()) regs |= reg1.bit(); 3576 if (reg1.is_valid()) regs |= reg1.bit();
3575 if (reg2.is_valid()) regs |= reg2.bit(); 3577 if (reg2.is_valid()) regs |= reg2.bit();
3576 if (reg3.is_valid()) regs |= reg3.bit(); 3578 if (reg3.is_valid()) regs |= reg3.bit();
3577 if (reg4.is_valid()) regs |= reg4.bit(); 3579 if (reg4.is_valid()) regs |= reg4.bit();
3578 if (reg5.is_valid()) regs |= reg5.bit(); 3580 if (reg5.is_valid()) regs |= reg5.bit();
3579 if (reg6.is_valid()) regs |= reg6.bit(); 3581 if (reg6.is_valid()) regs |= reg6.bit();
3580 3582
3581 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { 3583 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault();
3582 Register candidate = Register::FromAllocationIndex(i); 3584 for (int i = 0; i < config->num_allocatable_general_registers(); ++i) {
3585 int code = config->GetAllocatableGeneralCode(i);
3586 Register candidate = Register::from_code(code);
3583 if (regs & candidate.bit()) continue; 3587 if (regs & candidate.bit()) continue;
3584 return candidate; 3588 return candidate;
3585 } 3589 }
3586 UNREACHABLE(); 3590 UNREACHABLE();
3587 return no_reg; 3591 return no_reg;
3588 } 3592 }
3589 3593
3590 3594
3591 void MacroAssembler::JumpIfDictionaryInPrototypeChain( 3595 void MacroAssembler::JumpIfDictionaryInPrototypeChain(
3592 Register object, 3596 Register object,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3717 } 3721 }
3718 } 3722 }
3719 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 3723 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
3720 add(result, result, Operand(dividend, LSR, 31)); 3724 add(result, result, Operand(dividend, LSR, 31));
3721 } 3725 }
3722 3726
3723 } // namespace internal 3727 } // namespace internal
3724 } // namespace v8 3728 } // namespace v8
3725 3729
3726 #endif // V8_TARGET_ARCH_ARM 3730 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698