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 4412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4423 | 4423 |
4424 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, | 4424 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
4425 Register scratch_reg, | 4425 Register scratch_reg, |
4426 Register scratch2_reg, | 4426 Register scratch2_reg, |
4427 Label* no_memento_found) { | 4427 Label* no_memento_found) { |
4428 Label map_check; | 4428 Label map_check; |
4429 Label top_check; | 4429 Label top_check; |
4430 ExternalReference new_space_allocation_top_adr = | 4430 ExternalReference new_space_allocation_top_adr = |
4431 ExternalReference::new_space_allocation_top_address(isolate()); | 4431 ExternalReference::new_space_allocation_top_address(isolate()); |
4432 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 4432 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
4433 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 4433 const int kMementoLastWordOffset = |
| 4434 kMementoMapOffset + AllocationMemento::kSize - kPointerSize; |
4434 Register mask = scratch2_reg; | 4435 Register mask = scratch2_reg; |
4435 | 4436 |
4436 DCHECK(!AreAliased(receiver_reg, scratch_reg, mask)); | 4437 DCHECK(!AreAliased(receiver_reg, scratch_reg, mask)); |
4437 | 4438 |
4438 // Bail out if the object is not in new space. | 4439 // Bail out if the object is not in new space. |
4439 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 4440 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
4440 | 4441 |
4441 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); | 4442 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); |
4442 lis(mask, Operand((~Page::kPageAlignmentMask >> 16))); | 4443 lis(mask, Operand((~Page::kPageAlignmentMask >> 16))); |
4443 addi(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 4444 addi(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
4444 | 4445 |
4445 // If the object is in new space, we need to check whether it is on the same | 4446 // If the object is in new space, we need to check whether it is on the same |
4446 // page as the current top. | 4447 // page as the current top. |
4447 mov(ip, Operand(new_space_allocation_top_adr)); | 4448 mov(ip, Operand(new_space_allocation_top_adr)); |
4448 LoadP(ip, MemOperand(ip)); | 4449 LoadP(ip, MemOperand(ip)); |
4449 Xor(r0, scratch_reg, Operand(ip)); | 4450 Xor(r0, scratch_reg, Operand(ip)); |
4450 and_(r0, r0, mask, SetRC); | 4451 and_(r0, r0, mask, SetRC); |
4451 beq(&top_check, cr0); | 4452 beq(&top_check, cr0); |
4452 // The object is on a different page than allocation top. Bail out if the | 4453 // The object is on a different page than allocation top. Bail out if the |
4453 // object sits on the page boundary as no memento can follow and we cannot | 4454 // object sits on the page boundary as no memento can follow and we cannot |
4454 // touch the memory following it. | 4455 // touch the memory following it. |
4455 xor_(r0, scratch_reg, receiver_reg); | 4456 xor_(r0, scratch_reg, receiver_reg); |
4456 and_(r0, r0, mask, SetRC); | 4457 and_(r0, r0, mask, SetRC); |
4457 bne(no_memento_found, cr0); | 4458 bne(no_memento_found, cr0); |
4458 // Continue with the actual map check. | 4459 // Continue with the actual map check. |
4459 b(&map_check); | 4460 b(&map_check); |
4460 // If top is on the same page as the current object, we need to check whether | 4461 // If top is on the same page as the current object, we need to check whether |
4461 // we are below top. | 4462 // we are below top. |
4462 bind(&top_check); | 4463 bind(&top_check); |
4463 cmp(scratch_reg, ip); | 4464 cmp(scratch_reg, ip); |
4464 bgt(no_memento_found); | 4465 bge(no_memento_found); |
4465 // Memento map check. | 4466 // Memento map check. |
4466 bind(&map_check); | 4467 bind(&map_check); |
4467 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 4468 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
4468 Cmpi(scratch_reg, Operand(isolate()->factory()->allocation_memento_map()), | 4469 Cmpi(scratch_reg, Operand(isolate()->factory()->allocation_memento_map()), |
4469 r0); | 4470 r0); |
4470 } | 4471 } |
4471 | 4472 |
4472 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, | 4473 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, |
4473 Register reg4, Register reg5, | 4474 Register reg4, Register reg5, |
4474 Register reg6) { | 4475 Register reg6) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4618 } | 4619 } |
4619 if (mag.shift > 0) srawi(result, result, mag.shift); | 4620 if (mag.shift > 0) srawi(result, result, mag.shift); |
4620 ExtractBit(r0, dividend, 31); | 4621 ExtractBit(r0, dividend, 31); |
4621 add(result, result, r0); | 4622 add(result, result, r0); |
4622 } | 4623 } |
4623 | 4624 |
4624 } // namespace internal | 4625 } // namespace internal |
4625 } // namespace v8 | 4626 } // namespace v8 |
4626 | 4627 |
4627 #endif // V8_TARGET_ARCH_PPC | 4628 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |