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

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

Issue 1845463003: Remove usages of Heap::NewSpaceStart and its external reference (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do not access mementos when the array is allocated on a page boundary Created 4 years, 8 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 | « no previous file | src/arm64/macro-assembler-arm64.cc » ('j') | src/mips/macro-assembler-mips.cc » ('J')
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 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after
3757 // Second chance, the object may be using the empty slow element dictionary. 3757 // Second chance, the object may be using the empty slow element dictionary.
3758 CompareRoot(r2, Heap::kEmptySlowElementDictionaryRootIndex); 3758 CompareRoot(r2, Heap::kEmptySlowElementDictionaryRootIndex);
3759 b(ne, call_runtime); 3759 b(ne, call_runtime);
3760 3760
3761 bind(&no_elements); 3761 bind(&no_elements);
3762 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); 3762 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset));
3763 cmp(r2, null_value); 3763 cmp(r2, null_value);
3764 b(ne, &next); 3764 b(ne, &next);
3765 } 3765 }
3766 3766
3767
3768 void MacroAssembler::TestJSArrayForAllocationMemento( 3767 void MacroAssembler::TestJSArrayForAllocationMemento(
3769 Register receiver_reg, 3768 Register receiver_reg,
3770 Register scratch_reg, 3769 Register scratch_reg,
3771 Label* no_memento_found) { 3770 Label* no_memento_found) {
3772 ExternalReference new_space_start = 3771 Label map_check;
3773 ExternalReference::new_space_start(isolate());
3774 ExternalReference new_space_allocation_top = 3772 ExternalReference new_space_allocation_top =
3775 ExternalReference::new_space_allocation_top_address(isolate()); 3773 ExternalReference::new_space_allocation_top_address(isolate());
3776 add(scratch_reg, receiver_reg, 3774 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag;
3777 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); 3775 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize;
3778 cmp(scratch_reg, Operand(new_space_start)); 3776
3779 b(lt, no_memento_found); 3777 // Bail out if the object sits on the page boundary as no memento can follow
3780 mov(ip, Operand(new_space_allocation_top)); 3778 // and we cannot touch the memory following it.
3781 ldr(ip, MemOperand(ip)); 3779 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
3782 cmp(scratch_reg, ip); 3780 eor(scratch_reg, scratch_reg, Operand(receiver_reg));
3781 cmp(scratch_reg, Operand(Page::kPageSize));
3783 b(gt, no_memento_found); 3782 b(gt, no_memento_found);
3784 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); 3783 // Bail out if the object is not in new space.
3785 cmp(scratch_reg, 3784 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
3786 Operand(isolate()->factory()->allocation_memento_map())); 3785 JumpIfNotInNewSpace(scratch_reg, scratch_reg, no_memento_found);
3786 // If the object is in new space, we need to check whether it is on the same
3787 // page as the current top.
3788 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
3789 eor(scratch_reg, scratch_reg, Operand(new_space_allocation_top));
3790 tst(scratch_reg, Operand(~Page::kPageAlignmentMask));
3791 b(ne, &map_check);
3792 // Otherwise, we have to check whether we are still below top, to ensure that
3793 // we are not checking against a stale memento.
3794 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
3795 cmp(scratch_reg, Operand(new_space_allocation_top));
3796 b(gt, no_memento_found);
3797 bind(&map_check);
3798 ldr(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset));
3799 cmp(scratch_reg, Operand(isolate()->factory()->allocation_memento_map()));
3787 } 3800 }
3788 3801
3789
3790 Register GetRegisterThatIsNotOneOf(Register reg1, 3802 Register GetRegisterThatIsNotOneOf(Register reg1,
3791 Register reg2, 3803 Register reg2,
3792 Register reg3, 3804 Register reg3,
3793 Register reg4, 3805 Register reg4,
3794 Register reg5, 3806 Register reg5,
3795 Register reg6) { 3807 Register reg6) {
3796 RegList regs = 0; 3808 RegList regs = 0;
3797 if (reg1.is_valid()) regs |= reg1.bit(); 3809 if (reg1.is_valid()) regs |= reg1.bit();
3798 if (reg2.is_valid()) regs |= reg2.bit(); 3810 if (reg2.is_valid()) regs |= reg2.bit();
3799 if (reg3.is_valid()) regs |= reg3.bit(); 3811 if (reg3.is_valid()) regs |= reg3.bit();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
3942 } 3954 }
3943 } 3955 }
3944 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 3956 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
3945 add(result, result, Operand(dividend, LSR, 31)); 3957 add(result, result, Operand(dividend, LSR, 31));
3946 } 3958 }
3947 3959
3948 } // namespace internal 3960 } // namespace internal
3949 } // namespace v8 3961 } // namespace v8
3950 3962
3951 #endif // V8_TARGET_ARCH_ARM 3963 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/macro-assembler-arm64.cc » ('j') | src/mips/macro-assembler-mips.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698