| 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3138 | 3138 |
| 3139 // Swap first and second descriptor. | 3139 // Swap first and second descriptor. |
| 3140 inline void SwapSortedKeys(int first, int second); | 3140 inline void SwapSortedKeys(int first, int second); |
| 3141 | 3141 |
| 3142 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 3142 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
| 3143 }; | 3143 }; |
| 3144 | 3144 |
| 3145 | 3145 |
| 3146 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; | 3146 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; |
| 3147 | 3147 |
| 3148 template<SearchMode search_mode, typename T> | 3148 template <SearchMode search_mode, typename T> |
| 3149 inline int LinearSearch(T* array, Name* name, int len, int valid_entries); | 3149 inline int Search(T* array, Name* name, int valid_entries = 0, |
| 3150 | 3150 int* out_insertion_index = NULL); |
| 3151 | |
| 3152 template<SearchMode search_mode, typename T> | |
| 3153 inline int Search(T* array, Name* name, int valid_entries = 0); | |
| 3154 | 3151 |
| 3155 | 3152 |
| 3156 // HashTable is a subclass of FixedArray that implements a hash table | 3153 // HashTable is a subclass of FixedArray that implements a hash table |
| 3157 // that uses open addressing and quadratic probing. | 3154 // that uses open addressing and quadratic probing. |
| 3158 // | 3155 // |
| 3159 // In order for the quadratic probing to work, elements that have not | 3156 // In order for the quadratic probing to work, elements that have not |
| 3160 // yet been used and elements that have been deleted are | 3157 // yet been used and elements that have been deleted are |
| 3161 // distinguished. Probing continues when deleted elements are | 3158 // distinguished. Probing continues when deleted elements are |
| 3162 // encountered and stops when unused elements are encountered. | 3159 // encountered and stops when unused elements are encountered. |
| 3163 // | 3160 // |
| (...skipping 7768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10932 } else { | 10929 } else { |
| 10933 value &= ~(1 << bit_position); | 10930 value &= ~(1 << bit_position); |
| 10934 } | 10931 } |
| 10935 return value; | 10932 return value; |
| 10936 } | 10933 } |
| 10937 }; | 10934 }; |
| 10938 | 10935 |
| 10939 } } // namespace v8::internal | 10936 } } // namespace v8::internal |
| 10940 | 10937 |
| 10941 #endif // V8_OBJECTS_H_ | 10938 #endif // V8_OBJECTS_H_ |
| OLD | NEW |