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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2944 if (current_hash > hash) { | 2944 if (current_hash > hash) { |
2945 if (out_insertion_index != NULL) *out_insertion_index = sorted_index; | 2945 if (out_insertion_index != NULL) *out_insertion_index = sorted_index; |
2946 return T::kNotFound; | 2946 return T::kNotFound; |
2947 } | 2947 } |
2948 if (current_hash == hash && entry->Equals(name)) return sorted_index; | 2948 if (current_hash == hash && entry->Equals(name)) return sorted_index; |
2949 } | 2949 } |
2950 if (out_insertion_index != NULL) *out_insertion_index = len; | 2950 if (out_insertion_index != NULL) *out_insertion_index = len; |
2951 return T::kNotFound; | 2951 return T::kNotFound; |
2952 } else { | 2952 } else { |
2953 DCHECK(len >= valid_entries); | 2953 DCHECK(len >= valid_entries); |
2954 DCHECK_EQ(NULL, out_insertion_index); // Not supported here. | 2954 DCHECK_NULL(out_insertion_index); // Not supported here. |
2955 for (int number = 0; number < valid_entries; number++) { | 2955 for (int number = 0; number < valid_entries; number++) { |
2956 Name* entry = array->GetKey(number); | 2956 Name* entry = array->GetKey(number); |
2957 uint32_t current_hash = entry->Hash(); | 2957 uint32_t current_hash = entry->Hash(); |
2958 if (current_hash == hash && entry->Equals(name)) return number; | 2958 if (current_hash == hash && entry->Equals(name)) return number; |
2959 } | 2959 } |
2960 return T::kNotFound; | 2960 return T::kNotFound; |
2961 } | 2961 } |
2962 } | 2962 } |
2963 | 2963 |
2964 | 2964 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3385 CAST_ACCESSOR(String) | 3385 CAST_ACCESSOR(String) |
3386 CAST_ACCESSOR(StringTable) | 3386 CAST_ACCESSOR(StringTable) |
3387 CAST_ACCESSOR(Struct) | 3387 CAST_ACCESSOR(Struct) |
3388 CAST_ACCESSOR(Symbol) | 3388 CAST_ACCESSOR(Symbol) |
3389 CAST_ACCESSOR(UnseededNumberDictionary) | 3389 CAST_ACCESSOR(UnseededNumberDictionary) |
3390 CAST_ACCESSOR(WeakCell) | 3390 CAST_ACCESSOR(WeakCell) |
3391 CAST_ACCESSOR(WeakFixedArray) | 3391 CAST_ACCESSOR(WeakFixedArray) |
3392 CAST_ACCESSOR(WeakHashTable) | 3392 CAST_ACCESSOR(WeakHashTable) |
3393 | 3393 |
3394 | 3394 |
| 3395 // static |
| 3396 template <class Traits> |
| 3397 STATIC_CONST_MEMBER_DEFINITION const InstanceType |
| 3398 FixedTypedArray<Traits>::kInstanceType; |
| 3399 |
| 3400 |
3395 template <class Traits> | 3401 template <class Traits> |
3396 FixedTypedArray<Traits>* FixedTypedArray<Traits>::cast(Object* object) { | 3402 FixedTypedArray<Traits>* FixedTypedArray<Traits>::cast(Object* object) { |
3397 SLOW_DCHECK(object->IsHeapObject() && | 3403 SLOW_DCHECK(object->IsHeapObject() && |
3398 HeapObject::cast(object)->map()->instance_type() == | 3404 HeapObject::cast(object)->map()->instance_type() == |
3399 Traits::kInstanceType); | 3405 Traits::kInstanceType); |
3400 return reinterpret_cast<FixedTypedArray<Traits>*>(object); | 3406 return reinterpret_cast<FixedTypedArray<Traits>*>(object); |
3401 } | 3407 } |
3402 | 3408 |
3403 | 3409 |
3404 template <class Traits> | 3410 template <class Traits> |
(...skipping 4190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7595 #undef READ_SHORT_FIELD | 7601 #undef READ_SHORT_FIELD |
7596 #undef WRITE_SHORT_FIELD | 7602 #undef WRITE_SHORT_FIELD |
7597 #undef READ_BYTE_FIELD | 7603 #undef READ_BYTE_FIELD |
7598 #undef WRITE_BYTE_FIELD | 7604 #undef WRITE_BYTE_FIELD |
7599 #undef NOBARRIER_READ_BYTE_FIELD | 7605 #undef NOBARRIER_READ_BYTE_FIELD |
7600 #undef NOBARRIER_WRITE_BYTE_FIELD | 7606 #undef NOBARRIER_WRITE_BYTE_FIELD |
7601 | 7607 |
7602 } } // namespace v8::internal | 7608 } } // namespace v8::internal |
7603 | 7609 |
7604 #endif // V8_OBJECTS_INL_H_ | 7610 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |