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 6944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6955 } | 6955 } |
6956 | 6956 |
6957 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, | 6957 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
6958 Register scratch_reg, | 6958 Register scratch_reg, |
6959 Label* no_memento_found) { | 6959 Label* no_memento_found) { |
6960 Label map_check; | 6960 Label map_check; |
6961 Label top_check; | 6961 Label top_check; |
6962 ExternalReference new_space_allocation_top_adr = | 6962 ExternalReference new_space_allocation_top_adr = |
6963 ExternalReference::new_space_allocation_top_address(isolate()); | 6963 ExternalReference::new_space_allocation_top_address(isolate()); |
6964 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 6964 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
6965 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 6965 const int kMementoLastWordOffset = |
| 6966 kMementoMapOffset + AllocationMemento::kSize - kPointerSize; |
6966 | 6967 |
6967 // Bail out if the object is not in new space. | 6968 // Bail out if the object is not in new space. |
6968 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 6969 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
6969 // If the object is in new space, we need to check whether it is on the same | 6970 // If the object is in new space, we need to check whether it is on the same |
6970 // page as the current top. | 6971 // page as the current top. |
6971 Daddu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6972 Daddu(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
6972 li(at, Operand(new_space_allocation_top_adr)); | 6973 li(at, Operand(new_space_allocation_top_adr)); |
6973 ld(at, MemOperand(at)); | 6974 ld(at, MemOperand(at)); |
6974 Xor(scratch_reg, scratch_reg, Operand(at)); | 6975 Xor(scratch_reg, scratch_reg, Operand(at)); |
6975 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); | 6976 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
6976 Branch(&top_check, eq, scratch_reg, Operand(zero_reg)); | 6977 Branch(&top_check, eq, scratch_reg, Operand(zero_reg)); |
6977 // The object is on a different page than allocation top. Bail out if the | 6978 // The object is on a different page than allocation top. Bail out if the |
6978 // object sits on the page boundary as no memento can follow and we cannot | 6979 // object sits on the page boundary as no memento can follow and we cannot |
6979 // touch the memory following it. | 6980 // touch the memory following it. |
6980 Daddu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6981 Daddu(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
6981 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); | 6982 Xor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
6982 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); | 6983 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask)); |
6983 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg)); | 6984 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg)); |
6984 // Continue with the actual map check. | 6985 // Continue with the actual map check. |
6985 jmp(&map_check); | 6986 jmp(&map_check); |
6986 // If top is on the same page as the current object, we need to check whether | 6987 // If top is on the same page as the current object, we need to check whether |
6987 // we are below top. | 6988 // we are below top. |
6988 bind(&top_check); | 6989 bind(&top_check); |
6989 Daddu(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 6990 Daddu(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
6990 li(at, Operand(new_space_allocation_top_adr)); | 6991 li(at, Operand(new_space_allocation_top_adr)); |
6991 ld(at, MemOperand(at)); | 6992 ld(at, MemOperand(at)); |
6992 Branch(no_memento_found, gt, scratch_reg, Operand(at)); | 6993 Branch(no_memento_found, ge, scratch_reg, Operand(at)); |
6993 // Memento map check. | 6994 // Memento map check. |
6994 bind(&map_check); | 6995 bind(&map_check); |
6995 ld(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 6996 ld(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
6996 Branch(no_memento_found, ne, scratch_reg, | 6997 Branch(no_memento_found, ne, scratch_reg, |
6997 Operand(isolate()->factory()->allocation_memento_map())); | 6998 Operand(isolate()->factory()->allocation_memento_map())); |
6998 } | 6999 } |
6999 | 7000 |
7000 | 7001 |
7001 Register GetRegisterThatIsNotOneOf(Register reg1, | 7002 Register GetRegisterThatIsNotOneOf(Register reg1, |
7002 Register reg2, | 7003 Register reg2, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7143 if (mag.shift > 0) sra(result, result, mag.shift); | 7144 if (mag.shift > 0) sra(result, result, mag.shift); |
7144 srl(at, dividend, 31); | 7145 srl(at, dividend, 31); |
7145 Addu(result, result, Operand(at)); | 7146 Addu(result, result, Operand(at)); |
7146 } | 7147 } |
7147 | 7148 |
7148 | 7149 |
7149 } // namespace internal | 7150 } // namespace internal |
7150 } // namespace v8 | 7151 } // namespace v8 |
7151 | 7152 |
7152 #endif // V8_TARGET_ARCH_MIPS64 | 7153 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |