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

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

Issue 1365073002: Revert of 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/cpu-profiler.h" 13 #include "src/cpu-profiler.h"
14 #include "src/debug/debug.h" 14 #include "src/debug/debug.h"
15 #include "src/register-configuration.h"
16 #include "src/runtime/runtime.h" 15 #include "src/runtime/runtime.h"
17 16
18 #include "src/arm/macro-assembler-arm.h" 17 #include "src/arm/macro-assembler-arm.h"
19 18
20 namespace v8 { 19 namespace v8 {
21 namespace internal { 20 namespace internal {
22 21
23 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) 22 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
24 : Assembler(arg_isolate, buffer, size), 23 : Assembler(arg_isolate, buffer, size),
25 generating_stub_(false), 24 generating_stub_(false),
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 753
755 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { 754 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) {
756 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); 755 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
757 } 756 }
758 757
759 758
760 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { 759 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
761 // Number of d-regs not known at snapshot time. 760 // Number of d-regs not known at snapshot time.
762 DCHECK(!serializer_enabled()); 761 DCHECK(!serializer_enabled());
763 // General purpose registers are pushed last on the stack. 762 // General purpose registers are pushed last on the stack.
764 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); 763 int doubles_size = DwVfpRegister::NumAllocatableRegisters() * kDoubleSize;
765 int doubles_size = config->num_allocatable_double_registers() * kDoubleSize;
766 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize; 764 int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize;
767 return MemOperand(sp, doubles_size + register_offset); 765 return MemOperand(sp, doubles_size + register_offset);
768 } 766 }
769 767
770 768
771 void MacroAssembler::Ldrd(Register dst1, Register dst2, 769 void MacroAssembler::Ldrd(Register dst1, Register dst2,
772 const MemOperand& src, Condition cond) { 770 const MemOperand& src, Condition cond) {
773 DCHECK(src.rm().is(no_reg)); 771 DCHECK(src.rm().is(no_reg));
774 DCHECK(!dst1.is(lr)); // r14. 772 DCHECK(!dst1.is(lr)); // r14.
775 773
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after
3566 Register reg5, 3564 Register reg5,
3567 Register reg6) { 3565 Register reg6) {
3568 RegList regs = 0; 3566 RegList regs = 0;
3569 if (reg1.is_valid()) regs |= reg1.bit(); 3567 if (reg1.is_valid()) regs |= reg1.bit();
3570 if (reg2.is_valid()) regs |= reg2.bit(); 3568 if (reg2.is_valid()) regs |= reg2.bit();
3571 if (reg3.is_valid()) regs |= reg3.bit(); 3569 if (reg3.is_valid()) regs |= reg3.bit();
3572 if (reg4.is_valid()) regs |= reg4.bit(); 3570 if (reg4.is_valid()) regs |= reg4.bit();
3573 if (reg5.is_valid()) regs |= reg5.bit(); 3571 if (reg5.is_valid()) regs |= reg5.bit();
3574 if (reg6.is_valid()) regs |= reg6.bit(); 3572 if (reg6.is_valid()) regs |= reg6.bit();
3575 3573
3576 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); 3574 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) {
3577 for (int i = 0; i < config->num_allocatable_general_registers(); ++i) { 3575 Register candidate = Register::FromAllocationIndex(i);
3578 int code = config->GetAllocatableGeneralCode(i);
3579 Register candidate = Register::from_code(code);
3580 if (regs & candidate.bit()) continue; 3576 if (regs & candidate.bit()) continue;
3581 return candidate; 3577 return candidate;
3582 } 3578 }
3583 UNREACHABLE(); 3579 UNREACHABLE();
3584 return no_reg; 3580 return no_reg;
3585 } 3581 }
3586 3582
3587 3583
3588 void MacroAssembler::JumpIfDictionaryInPrototypeChain( 3584 void MacroAssembler::JumpIfDictionaryInPrototypeChain(
3589 Register object, 3585 Register object,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3714 } 3710 }
3715 } 3711 }
3716 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 3712 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
3717 add(result, result, Operand(dividend, LSR, 31)); 3713 add(result, result, Operand(dividend, LSR, 31));
3718 } 3714 }
3719 3715
3720 } // namespace internal 3716 } // namespace internal
3721 } // namespace v8 3717 } // namespace v8
3722 3718
3723 #endif // V8_TARGET_ARCH_ARM 3719 #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