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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 6542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6553 } | 6553 } |
6554 | 6554 |
6555 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, | 6555 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
6556 Register scratch_reg, | 6556 Register scratch_reg, |
6557 Label* no_memento_found) { | 6557 Label* no_memento_found) { |
6558 Label map_check; | 6558 Label map_check; |
6559 Label top_check; | 6559 Label top_check; |
6560 ExternalReference new_space_allocation_top_adr = | 6560 ExternalReference new_space_allocation_top_adr = |
6561 ExternalReference::new_space_allocation_top_address(isolate()); | 6561 ExternalReference::new_space_allocation_top_address(isolate()); |
6562 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 6562 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
6563 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 6563 const int kMementoLastWordOffset = |
| 6564 kMementoMapOffset + AllocationMemento::kSize - kPointerSize; |
6564 | 6565 |
6565 // Bail out if the object is not in new space. | 6566 // Bail out if the object is not in new space. |
6566 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 6567 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
6567 // If the object is in new space, we need to check whether it is on the same | 6568 // If the object is in new space, we need to check whether it is on the same |
6568 // page as the current top. | 6569 // page as the current top. |
6569 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6570 Addu(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
6570 li(at, Operand(new_space_allocation_top_adr)); | 6571 li(at, Operand(new_space_allocation_top_adr)); |
6571 lw(at, MemOperand(at)); | 6572 lw(at, MemOperand(at)); |
6572 Xor(scratch_reg, scratch_reg, Operand(at)); | 6573 Xor(scratch_reg, scratch_reg, Operand(at)); |
6573 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); | 6574 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
6574 Branch(&top_check, eq, scratch_reg, Operand(zero_reg)); | 6575 Branch(&top_check, eq, scratch_reg, Operand(zero_reg)); |
6575 // The object is on a different page than allocation top. Bail out if the | 6576 // The object is on a different page than allocation top. Bail out if the |
6576 // object sits on the page boundary as no memento can follow and we cannot | 6577 // object sits on the page boundary as no memento can follow and we cannot |
6577 // touch the memory following it. | 6578 // touch the memory following it. |
6578 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6579 Addu(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
6579 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); | 6580 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
6580 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); | 6581 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
6581 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg)); | 6582 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg)); |
6582 // Continue with the actual map check. | 6583 // Continue with the actual map check. |
6583 jmp(&map_check); | 6584 jmp(&map_check); |
6584 // If top is on the same page as the current object, we need to check whether | 6585 // If top is on the same page as the current object, we need to check whether |
6585 // we are below top. | 6586 // we are below top. |
6586 bind(&top_check); | 6587 bind(&top_check); |
6587 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6588 Addu(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
6588 li(at, Operand(new_space_allocation_top_adr)); | 6589 li(at, Operand(new_space_allocation_top_adr)); |
6589 lw(at, MemOperand(at)); | 6590 lw(at, MemOperand(at)); |
6590 Branch(no_memento_found, gt, scratch_reg, Operand(at)); | 6591 Branch(no_memento_found, ge, scratch_reg, Operand(at)); |
6591 // Memento map check. | 6592 // Memento map check. |
6592 bind(&map_check); | 6593 bind(&map_check); |
6593 lw(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 6594 lw(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
6594 Branch(no_memento_found, ne, scratch_reg, | 6595 Branch(no_memento_found, ne, scratch_reg, |
6595 Operand(isolate()->factory()->allocation_memento_map())); | 6596 Operand(isolate()->factory()->allocation_memento_map())); |
6596 } | 6597 } |
6597 | 6598 |
6598 | 6599 |
6599 Register GetRegisterThatIsNotOneOf(Register reg1, | 6600 Register GetRegisterThatIsNotOneOf(Register reg1, |
6600 Register reg2, | 6601 Register reg2, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6742 if (mag.shift > 0) sra(result, result, mag.shift); | 6743 if (mag.shift > 0) sra(result, result, mag.shift); |
6743 srl(at, dividend, 31); | 6744 srl(at, dividend, 31); |
6744 Addu(result, result, Operand(at)); | 6745 Addu(result, result, Operand(at)); |
6745 } | 6746 } |
6746 | 6747 |
6747 | 6748 |
6748 } // namespace internal | 6749 } // namespace internal |
6749 } // namespace v8 | 6750 } // namespace v8 |
6750 | 6751 |
6751 #endif // V8_TARGET_ARCH_MIPS | 6752 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |