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

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

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