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 4630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7595 #undef READ_SHORT_FIELD | 7595 #undef READ_SHORT_FIELD |
7596 #undef WRITE_SHORT_FIELD | 7596 #undef WRITE_SHORT_FIELD |
7597 #undef READ_BYTE_FIELD | 7597 #undef READ_BYTE_FIELD |
7598 #undef WRITE_BYTE_FIELD | 7598 #undef WRITE_BYTE_FIELD |
7599 #undef NOBARRIER_READ_BYTE_FIELD | 7599 #undef NOBARRIER_READ_BYTE_FIELD |
7600 #undef NOBARRIER_WRITE_BYTE_FIELD | 7600 #undef NOBARRIER_WRITE_BYTE_FIELD |
7601 | 7601 |
7602 } } // namespace v8::internal | 7602 } } // namespace v8::internal |
7603 | 7603 |
7604 #endif // V8_OBJECTS_INL_H_ | 7604 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |