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 "src/v8.h" | 5 #include "src/v8.h" |
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/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3947 // scratch0 points to properties hash. | 3947 // scratch0 points to properties hash. |
3948 // Compute the masked index: (hash + i + i * i) & mask. | 3948 // Compute the masked index: (hash + i + i * i) & mask. |
3949 Register index = scratch0; | 3949 Register index = scratch0; |
3950 // Capacity is smi 2^n. | 3950 // Capacity is smi 2^n. |
3951 __ lw(index, FieldMemOperand(properties, kCapacityOffset)); | 3951 __ lw(index, FieldMemOperand(properties, kCapacityOffset)); |
3952 __ Subu(index, index, Operand(1)); | 3952 __ Subu(index, index, Operand(1)); |
3953 __ And(index, index, Operand( | 3953 __ And(index, index, Operand( |
3954 Smi::FromInt(name->Hash() + NameDictionary::GetProbeOffset(i)))); | 3954 Smi::FromInt(name->Hash() + NameDictionary::GetProbeOffset(i)))); |
3955 | 3955 |
3956 // Scale the index by multiplying by the entry size. | 3956 // Scale the index by multiplying by the entry size. |
3957 DCHECK(NameDictionary::kEntrySize == 3); | 3957 STATIC_ASSERT(NameDictionary::kEntrySize == 3); |
3958 __ sll(at, index, 1); | 3958 __ sll(at, index, 1); |
3959 __ Addu(index, index, at); | 3959 __ Addu(index, index, at); |
3960 | 3960 |
3961 Register entity_name = scratch0; | 3961 Register entity_name = scratch0; |
3962 // Having undefined at this place means the name is not contained. | 3962 // Having undefined at this place means the name is not contained. |
3963 DCHECK_EQ(kSmiTagSize, 1); | 3963 DCHECK_EQ(kSmiTagSize, 1); |
3964 Register tmp = properties; | 3964 Register tmp = properties; |
3965 __ sll(scratch0, index, 1); | 3965 __ sll(scratch0, index, 1); |
3966 __ Addu(tmp, properties, scratch0); | 3966 __ Addu(tmp, properties, scratch0); |
3967 __ lw(entity_name, FieldMemOperand(tmp, kElementsStartOffset)); | 3967 __ lw(entity_name, FieldMemOperand(tmp, kElementsStartOffset)); |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 kStackUnwindSpace, NULL, | 5142 kStackUnwindSpace, NULL, |
5143 MemOperand(fp, 6 * kPointerSize), NULL); | 5143 MemOperand(fp, 6 * kPointerSize), NULL); |
5144 } | 5144 } |
5145 | 5145 |
5146 | 5146 |
5147 #undef __ | 5147 #undef __ |
5148 | 5148 |
5149 } } // namespace v8::internal | 5149 } } // namespace v8::internal |
5150 | 5150 |
5151 #endif // V8_TARGET_ARCH_MIPS | 5151 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |