| OLD | NEW |
| 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 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3811 cmp(r2, null_value); | 3811 cmp(r2, null_value); |
| 3812 b(ne, &next); | 3812 b(ne, &next); |
| 3813 } | 3813 } |
| 3814 | 3814 |
| 3815 void MacroAssembler::TestJSArrayForAllocationMemento( | 3815 void MacroAssembler::TestJSArrayForAllocationMemento( |
| 3816 Register receiver_reg, | 3816 Register receiver_reg, |
| 3817 Register scratch_reg, | 3817 Register scratch_reg, |
| 3818 Label* no_memento_found) { | 3818 Label* no_memento_found) { |
| 3819 Label map_check; | 3819 Label map_check; |
| 3820 Label top_check; | 3820 Label top_check; |
| 3821 ExternalReference new_space_allocation_top = | 3821 ExternalReference new_space_allocation_top_adr = |
| 3822 ExternalReference::new_space_allocation_top_address(isolate()); | 3822 ExternalReference::new_space_allocation_top_address(isolate()); |
| 3823 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 3823 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
| 3824 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 3824 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
| 3825 | 3825 |
| 3826 // Bail out if the object is not in new space. | 3826 // Bail out if the object is not in new space. |
| 3827 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 3827 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
| 3828 // If the object is in new space, we need to check whether it is on the same | 3828 // If the object is in new space, we need to check whether it is on the same |
| 3829 // page as the current top. | 3829 // page as the current top. |
| 3830 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3830 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 3831 eor(scratch_reg, scratch_reg, Operand(new_space_allocation_top)); | 3831 mov(ip, Operand(new_space_allocation_top_adr)); |
| 3832 ldr(ip, MemOperand(ip)); |
| 3833 eor(scratch_reg, scratch_reg, Operand(ip)); |
| 3832 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); | 3834 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 3833 b(eq, &top_check); | 3835 b(eq, &top_check); |
| 3834 // The object is on a different page than allocation top. Bail out if the | 3836 // The object is on a different page than allocation top. Bail out if the |
| 3835 // object sits on the page boundary as no memento can follow and we cannot | 3837 // object sits on the page boundary as no memento can follow and we cannot |
| 3836 // touch the memory following it. | 3838 // touch the memory following it. |
| 3837 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3839 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 3838 eor(scratch_reg, scratch_reg, Operand(receiver_reg)); | 3840 eor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
| 3839 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); | 3841 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 3840 b(ne, no_memento_found); | 3842 b(ne, no_memento_found); |
| 3841 // Continue with the actual map check. | 3843 // Continue with the actual map check. |
| 3842 jmp(&map_check); | 3844 jmp(&map_check); |
| 3843 // If top is on the same page as the current object, we need to check whether | 3845 // If top is on the same page as the current object, we need to check whether |
| 3844 // we are below top. | 3846 // we are below top. |
| 3845 bind(&top_check); | 3847 bind(&top_check); |
| 3846 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3848 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 3847 cmp(scratch_reg, Operand(new_space_allocation_top)); | 3849 mov(ip, Operand(new_space_allocation_top_adr)); |
| 3850 ldr(ip, MemOperand(ip)); |
| 3851 cmp(scratch_reg, ip); |
| 3848 b(gt, no_memento_found); | 3852 b(gt, no_memento_found); |
| 3849 // Memento map check. | 3853 // Memento map check. |
| 3850 bind(&map_check); | 3854 bind(&map_check); |
| 3851 ldr(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 3855 ldr(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
| 3852 cmp(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); | 3856 cmp(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); |
| 3853 } | 3857 } |
| 3854 | 3858 |
| 3855 Register GetRegisterThatIsNotOneOf(Register reg1, | 3859 Register GetRegisterThatIsNotOneOf(Register reg1, |
| 3856 Register reg2, | 3860 Register reg2, |
| 3857 Register reg3, | 3861 Register reg3, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4007 } | 4011 } |
| 4008 } | 4012 } |
| 4009 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4013 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 4010 add(result, result, Operand(dividend, LSR, 31)); | 4014 add(result, result, Operand(dividend, LSR, 31)); |
| 4011 } | 4015 } |
| 4012 | 4016 |
| 4013 } // namespace internal | 4017 } // namespace internal |
| 4014 } // namespace v8 | 4018 } // namespace v8 |
| 4015 | 4019 |
| 4016 #endif // V8_TARGET_ARCH_ARM | 4020 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |