| 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 3827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3838 cmp(r2, null_value); | 3838 cmp(r2, null_value); |
| 3839 b(ne, &next); | 3839 b(ne, &next); |
| 3840 } | 3840 } |
| 3841 | 3841 |
| 3842 void MacroAssembler::TestJSArrayForAllocationMemento( | 3842 void MacroAssembler::TestJSArrayForAllocationMemento( |
| 3843 Register receiver_reg, | 3843 Register receiver_reg, |
| 3844 Register scratch_reg, | 3844 Register scratch_reg, |
| 3845 Label* no_memento_found) { | 3845 Label* no_memento_found) { |
| 3846 Label map_check; | 3846 Label map_check; |
| 3847 Label top_check; | 3847 Label top_check; |
| 3848 ExternalReference new_space_allocation_top = | 3848 ExternalReference new_space_allocation_top_adr = |
| 3849 ExternalReference::new_space_allocation_top_address(isolate()); | 3849 ExternalReference::new_space_allocation_top_address(isolate()); |
| 3850 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 3850 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
| 3851 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 3851 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
| 3852 | 3852 |
| 3853 // Bail out if the object is not in new space. | 3853 // Bail out if the object is not in new space. |
| 3854 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 3854 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
| 3855 // If the object is in new space, we need to check whether it is on the same | 3855 // If the object is in new space, we need to check whether it is on the same |
| 3856 // page as the current top. | 3856 // page as the current top. |
| 3857 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3857 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 3858 eor(scratch_reg, scratch_reg, Operand(new_space_allocation_top)); | 3858 mov(ip, Operand(new_space_allocation_top_adr)); |
| 3859 ldr(ip, MemOperand(ip)); |
| 3860 eor(scratch_reg, scratch_reg, Operand(ip)); |
| 3859 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); | 3861 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 3860 b(eq, &top_check); | 3862 b(eq, &top_check); |
| 3861 // The object is on a different page than allocation top. Bail out if the | 3863 // The object is on a different page than allocation top. Bail out if the |
| 3862 // object sits on the page boundary as no memento can follow and we cannot | 3864 // object sits on the page boundary as no memento can follow and we cannot |
| 3863 // touch the memory following it. | 3865 // touch the memory following it. |
| 3864 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3866 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 3865 eor(scratch_reg, scratch_reg, Operand(receiver_reg)); | 3867 eor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
| 3866 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); | 3868 tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 3867 b(ne, no_memento_found); | 3869 b(ne, no_memento_found); |
| 3868 // Continue with the actual map check. | 3870 // Continue with the actual map check. |
| 3869 jmp(&map_check); | 3871 jmp(&map_check); |
| 3870 // If top is on the same page as the current object, we need to check whether | 3872 // If top is on the same page as the current object, we need to check whether |
| 3871 // we are below top. | 3873 // we are below top. |
| 3872 bind(&top_check); | 3874 bind(&top_check); |
| 3873 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3875 add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 3874 cmp(scratch_reg, Operand(new_space_allocation_top)); | 3876 mov(ip, Operand(new_space_allocation_top_adr)); |
| 3877 ldr(ip, MemOperand(ip)); |
| 3878 cmp(scratch_reg, ip); |
| 3875 b(gt, no_memento_found); | 3879 b(gt, no_memento_found); |
| 3876 // Memento map check. | 3880 // Memento map check. |
| 3877 bind(&map_check); | 3881 bind(&map_check); |
| 3878 ldr(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 3882 ldr(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
| 3879 cmp(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); | 3883 cmp(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); |
| 3880 } | 3884 } |
| 3881 | 3885 |
| 3882 Register GetRegisterThatIsNotOneOf(Register reg1, | 3886 Register GetRegisterThatIsNotOneOf(Register reg1, |
| 3883 Register reg2, | 3887 Register reg2, |
| 3884 Register reg3, | 3888 Register reg3, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4038 } | 4042 } |
| 4039 } | 4043 } |
| 4040 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4044 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 4041 add(result, result, Operand(dividend, LSR, 31)); | 4045 add(result, result, Operand(dividend, LSR, 31)); |
| 4042 } | 4046 } |
| 4043 | 4047 |
| 4044 } // namespace internal | 4048 } // namespace internal |
| 4045 } // namespace v8 | 4049 } // namespace v8 |
| 4046 | 4050 |
| 4047 #endif // V8_TARGET_ARCH_ARM | 4051 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |