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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 6694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6705 li(result_reg, Operand(255)); | 6705 li(result_reg, Operand(255)); |
6706 Branch(&done); | 6706 Branch(&done); |
6707 | 6707 |
6708 // In 0-255 range, round and truncate. | 6708 // In 0-255 range, round and truncate. |
6709 bind(&in_bounds); | 6709 bind(&in_bounds); |
6710 cvt_w_d(temp_double_reg, input_reg); | 6710 cvt_w_d(temp_double_reg, input_reg); |
6711 mfc1(result_reg, temp_double_reg); | 6711 mfc1(result_reg, temp_double_reg); |
6712 bind(&done); | 6712 bind(&done); |
6713 } | 6713 } |
6714 | 6714 |
6715 | 6715 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
6716 void MacroAssembler::TestJSArrayForAllocationMemento( | 6716 Register scratch_reg, |
6717 Register receiver_reg, | 6717 Label* no_memento_found) { |
6718 Register scratch_reg, | 6718 Label map_check; |
6719 Label* no_memento_found, | |
6720 Condition cond, | |
6721 Label* allocation_memento_present) { | |
6722 ExternalReference new_space_start = | |
6723 ExternalReference::new_space_start(isolate()); | |
6724 ExternalReference new_space_allocation_top = | 6719 ExternalReference new_space_allocation_top = |
6725 ExternalReference::new_space_allocation_top_address(isolate()); | 6720 ExternalReference::new_space_allocation_top_address(isolate()); |
6726 Daddu(scratch_reg, receiver_reg, | 6721 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
6727 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); | 6722 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
6728 Branch(no_memento_found, lt, scratch_reg, Operand(new_space_start)); | 6723 |
| 6724 // Bail out if the object sits on the page boundary as no memento can follow |
| 6725 // and we cannot touch the memory following it. |
| 6726 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 6727 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
| 6728 Branch(no_memento_found, gt, scratch_reg, Operand(Page::kPageSize)); |
| 6729 // Bail out if the object is not in new space. |
| 6730 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 6731 JumpIfNotInNewSpace(scratch_reg, scratch_reg, no_memento_found); |
| 6732 // If the object is in new space, we need to check whether it is on the same |
| 6733 // page as the current top. |
| 6734 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 6735 Xor(scratch_reg, scratch_reg, Operand(new_space_allocation_top)); |
| 6736 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 6737 Branch(&map_check, ne, scratch_reg, Operand(zero_reg)); |
| 6738 // Otherwise, we have to check whether we are still below top, to ensure that |
| 6739 // we are not checking against a stale memento. |
| 6740 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
6729 li(at, Operand(new_space_allocation_top)); | 6741 li(at, Operand(new_space_allocation_top)); |
6730 ld(at, MemOperand(at)); | 6742 lw(at, MemOperand(at)); |
6731 Branch(no_memento_found, gt, scratch_reg, Operand(at)); | 6743 Branch(no_memento_found, gt, scratch_reg, Operand(at)); |
6732 ld(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); | 6744 bind(&map_check); |
6733 if (allocation_memento_present) { | 6745 lw(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
6734 Branch(allocation_memento_present, cond, scratch_reg, | 6746 Branch(no_memento_found, ne, scratch_reg, |
6735 Operand(isolate()->factory()->allocation_memento_map())); | 6747 Operand(isolate()->factory()->allocation_memento_map())); |
6736 } | |
6737 } | 6748 } |
6738 | 6749 |
6739 | 6750 |
6740 Register GetRegisterThatIsNotOneOf(Register reg1, | 6751 Register GetRegisterThatIsNotOneOf(Register reg1, |
6741 Register reg2, | 6752 Register reg2, |
6742 Register reg3, | 6753 Register reg3, |
6743 Register reg4, | 6754 Register reg4, |
6744 Register reg5, | 6755 Register reg5, |
6745 Register reg6) { | 6756 Register reg6) { |
6746 RegList regs = 0; | 6757 RegList regs = 0; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6883 if (mag.shift > 0) sra(result, result, mag.shift); | 6894 if (mag.shift > 0) sra(result, result, mag.shift); |
6884 srl(at, dividend, 31); | 6895 srl(at, dividend, 31); |
6885 Addu(result, result, Operand(at)); | 6896 Addu(result, result, Operand(at)); |
6886 } | 6897 } |
6887 | 6898 |
6888 | 6899 |
6889 } // namespace internal | 6900 } // namespace internal |
6890 } // namespace v8 | 6901 } // namespace v8 |
6891 | 6902 |
6892 #endif // V8_TARGET_ARCH_MIPS64 | 6903 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |