OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 4680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4691 stfsu(src, mem); | 4691 stfsu(src, mem); |
4692 } | 4692 } |
4693 } | 4693 } |
4694 | 4694 |
4695 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, | 4695 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
4696 Register scratch_reg, | 4696 Register scratch_reg, |
4697 Register scratch2_reg, | 4697 Register scratch2_reg, |
4698 Label* no_memento_found) { | 4698 Label* no_memento_found) { |
4699 Label map_check; | 4699 Label map_check; |
4700 Label top_check; | 4700 Label top_check; |
4701 ExternalReference new_space_allocation_top = | 4701 ExternalReference new_space_allocation_top_adr = |
4702 ExternalReference::new_space_allocation_top_address(isolate()); | 4702 ExternalReference::new_space_allocation_top_address(isolate()); |
4703 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 4703 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
4704 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 4704 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
4705 Register mask = scratch2_reg; | 4705 Register mask = scratch2_reg; |
4706 | 4706 |
4707 DCHECK(!AreAliased(receiver_reg, scratch_reg, mask)); | 4707 DCHECK(!AreAliased(receiver_reg, scratch_reg, mask)); |
4708 | 4708 |
4709 // Bail out if the object is not in new space. | 4709 // Bail out if the object is not in new space. |
4710 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 4710 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
4711 | 4711 |
4712 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); | 4712 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); |
4713 lis(mask, Operand((~Page::kPageAlignmentMask >> 16))); | 4713 lis(mask, Operand((~Page::kPageAlignmentMask >> 16))); |
4714 addi(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 4714 addi(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
4715 | 4715 |
4716 // If the object is in new space, we need to check whether it is on the same | 4716 // If the object is in new space, we need to check whether it is on the same |
4717 // page as the current top. | 4717 // page as the current top. |
4718 Xor(r0, scratch_reg, Operand(new_space_allocation_top)); | 4718 mov(ip, Operand(new_space_allocation_top_adr)); |
| 4719 LoadP(ip, MemOperand(ip)); |
| 4720 Xor(r0, scratch_reg, Operand(ip)); |
4719 and_(r0, r0, mask, SetRC); | 4721 and_(r0, r0, mask, SetRC); |
4720 beq(&top_check, cr0); | 4722 beq(&top_check, cr0); |
4721 // The object is on a different page than allocation top. Bail out if the | 4723 // The object is on a different page than allocation top. Bail out if the |
4722 // object sits on the page boundary as no memento can follow and we cannot | 4724 // object sits on the page boundary as no memento can follow and we cannot |
4723 // touch the memory following it. | 4725 // touch the memory following it. |
4724 xor_(r0, scratch_reg, receiver_reg); | 4726 xor_(r0, scratch_reg, receiver_reg); |
4725 and_(r0, r0, mask, SetRC); | 4727 and_(r0, r0, mask, SetRC); |
4726 bne(no_memento_found, cr0); | 4728 bne(no_memento_found, cr0); |
4727 // Continue with the actual map check. | 4729 // Continue with the actual map check. |
4728 b(&map_check); | 4730 b(&map_check); |
4729 // If top is on the same page as the current object, we need to check whether | 4731 // If top is on the same page as the current object, we need to check whether |
4730 // we are below top. | 4732 // we are below top. |
4731 bind(&top_check); | 4733 bind(&top_check); |
4732 Cmpi(scratch_reg, Operand(new_space_allocation_top), r0); | 4734 cmp(scratch_reg, ip); |
4733 bgt(no_memento_found); | 4735 bgt(no_memento_found); |
4734 // Memento map check. | 4736 // Memento map check. |
4735 bind(&map_check); | 4737 bind(&map_check); |
4736 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 4738 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
4737 Cmpi(scratch_reg, Operand(isolate()->factory()->allocation_memento_map()), | 4739 Cmpi(scratch_reg, Operand(isolate()->factory()->allocation_memento_map()), |
4738 r0); | 4740 r0); |
4739 } | 4741 } |
4740 | 4742 |
4741 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, | 4743 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, |
4742 Register reg4, Register reg5, | 4744 Register reg4, Register reg5, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4888 } | 4890 } |
4889 if (mag.shift > 0) srawi(result, result, mag.shift); | 4891 if (mag.shift > 0) srawi(result, result, mag.shift); |
4890 ExtractBit(r0, dividend, 31); | 4892 ExtractBit(r0, dividend, 31); |
4891 add(result, result, r0); | 4893 add(result, result, r0); |
4892 } | 4894 } |
4893 | 4895 |
4894 } // namespace internal | 4896 } // namespace internal |
4895 } // namespace v8 | 4897 } // namespace v8 |
4896 | 4898 |
4897 #endif // V8_TARGET_ARCH_PPC | 4899 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |