OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 T Remove(int i); | 110 T Remove(int i); |
111 | 111 |
112 // Remove the given element from the list. Returns whether or not | 112 // Remove the given element from the list. Returns whether or not |
113 // the input is included in the list in the first place. | 113 // the input is included in the list in the first place. |
114 bool RemoveElement(const T& elm); | 114 bool RemoveElement(const T& elm); |
115 | 115 |
116 // Removes the last element without deleting it even if T is a | 116 // Removes the last element without deleting it even if T is a |
117 // pointer type. Returns the removed element. | 117 // pointer type. Returns the removed element. |
118 INLINE(T RemoveLast()) { return Remove(length_ - 1); } | 118 INLINE(T RemoveLast()) { return Remove(length_ - 1); } |
119 | 119 |
120 // Allocates space for 'length' elements. | |
mnaganov (inactive)
2012/05/08 12:05:20
nit: Please state that it also deletes current lis
alexeif
2012/05/09 12:38:07
Done.
| |
121 INLINE(void Allocate(int length)); | |
122 | |
120 // Clears the list by setting the length to zero. Even if T is a | 123 // Clears the list by setting the length to zero. Even if T is a |
121 // pointer type, clearing the list doesn't delete the entries. | 124 // pointer type, clearing the list doesn't delete the entries. |
122 INLINE(void Clear()); | 125 INLINE(void Clear()); |
123 | 126 |
124 // Drops all but the first 'pos' elements from the list. | 127 // Drops all but the first 'pos' elements from the list. |
125 INLINE(void Rewind(int pos)); | 128 INLINE(void Rewind(int pos)); |
126 | 129 |
127 // Drop the last 'count' elements from the list. | 130 // Drop the last 'count' elements from the list. |
128 INLINE(void RewindBy(int count)) { Rewind(length_ - count); } | 131 INLINE(void RewindBy(int count)) { Rewind(length_ - count); } |
129 | 132 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 template <typename T, class P> | 182 template <typename T, class P> |
180 int SortedListBSearch(const List<T>& list, P cmp); | 183 int SortedListBSearch(const List<T>& list, P cmp); |
181 template <typename T> | 184 template <typename T> |
182 int SortedListBSearch(const List<T>& list, T elem); | 185 int SortedListBSearch(const List<T>& list, T elem); |
183 | 186 |
184 | 187 |
185 } } // namespace v8::internal | 188 } } // namespace v8::internal |
186 | 189 |
187 | 190 |
188 #endif // V8_LIST_H_ | 191 #endif // V8_LIST_H_ |
OLD | NEW |