| 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 6591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6602 cvt_w_d(temp_double_reg, input_reg); | 6602 cvt_w_d(temp_double_reg, input_reg); |
| 6603 mfc1(result_reg, temp_double_reg); | 6603 mfc1(result_reg, temp_double_reg); |
| 6604 bind(&done); | 6604 bind(&done); |
| 6605 } | 6605 } |
| 6606 | 6606 |
| 6607 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, | 6607 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
| 6608 Register scratch_reg, | 6608 Register scratch_reg, |
| 6609 Label* no_memento_found) { | 6609 Label* no_memento_found) { |
| 6610 Label map_check; | 6610 Label map_check; |
| 6611 Label top_check; | 6611 Label top_check; |
| 6612 ExternalReference new_space_allocation_top = | 6612 ExternalReference new_space_allocation_top_adr = |
| 6613 ExternalReference::new_space_allocation_top_address(isolate()); | 6613 ExternalReference::new_space_allocation_top_address(isolate()); |
| 6614 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 6614 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
| 6615 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 6615 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
| 6616 | 6616 |
| 6617 // Bail out if the object is not in new space. | 6617 // Bail out if the object is not in new space. |
| 6618 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 6618 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
| 6619 // If the object is in new space, we need to check whether it is on the same | 6619 // If the object is in new space, we need to check whether it is on the same |
| 6620 // page as the current top. | 6620 // page as the current top. |
| 6621 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6621 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 6622 Xor(scratch_reg, scratch_reg, Operand(new_space_allocation_top)); | 6622 li(at, Operand(new_space_allocation_top_adr)); |
| 6623 lw(at, MemOperand(at)); |
| 6624 Xor(scratch_reg, scratch_reg, Operand(at)); |
| 6623 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); | 6625 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 6624 Branch(&top_check, eq, scratch_reg, Operand(zero_reg)); | 6626 Branch(&top_check, eq, scratch_reg, Operand(zero_reg)); |
| 6625 // The object is on a different page than allocation top. Bail out if the | 6627 // The object is on a different page than allocation top. Bail out if the |
| 6626 // object sits on the page boundary as no memento can follow and we cannot | 6628 // object sits on the page boundary as no memento can follow and we cannot |
| 6627 // touch the memory following it. | 6629 // touch the memory following it. |
| 6628 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6630 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 6629 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); | 6631 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
| 6630 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); | 6632 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
| 6631 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg)); | 6633 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg)); |
| 6632 // Continue with the actual map check. | 6634 // Continue with the actual map check. |
| 6633 jmp(&map_check); | 6635 jmp(&map_check); |
| 6634 // If top is on the same page as the current object, we need to check whether | 6636 // If top is on the same page as the current object, we need to check whether |
| 6635 // we are below top. | 6637 // we are below top. |
| 6636 bind(&top_check); | 6638 bind(&top_check); |
| 6637 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6639 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
| 6638 li(at, Operand(new_space_allocation_top)); | 6640 li(at, Operand(new_space_allocation_top_adr)); |
| 6639 lw(at, MemOperand(at)); | 6641 lw(at, MemOperand(at)); |
| 6640 Branch(no_memento_found, gt, scratch_reg, Operand(at)); | 6642 Branch(no_memento_found, gt, scratch_reg, Operand(at)); |
| 6641 // Memento map check. | 6643 // Memento map check. |
| 6642 bind(&map_check); | 6644 bind(&map_check); |
| 6643 lw(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 6645 lw(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
| 6644 Branch(no_memento_found, ne, scratch_reg, | 6646 Branch(no_memento_found, ne, scratch_reg, |
| 6645 Operand(isolate()->factory()->allocation_memento_map())); | 6647 Operand(isolate()->factory()->allocation_memento_map())); |
| 6646 } | 6648 } |
| 6647 | 6649 |
| 6648 | 6650 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6793 if (mag.shift > 0) sra(result, result, mag.shift); | 6795 if (mag.shift > 0) sra(result, result, mag.shift); |
| 6794 srl(at, dividend, 31); | 6796 srl(at, dividend, 31); |
| 6795 Addu(result, result, Operand(at)); | 6797 Addu(result, result, Operand(at)); |
| 6796 } | 6798 } |
| 6797 | 6799 |
| 6798 | 6800 |
| 6799 } // namespace internal | 6801 } // namespace internal |
| 6800 } // namespace v8 | 6802 } // namespace v8 |
| 6801 | 6803 |
| 6802 #endif // V8_TARGET_ARCH_MIPS | 6804 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |