OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 return -1; | 230 return -1; |
231 } | 231 } |
232 | 232 |
233 | 233 |
234 template <typename T> | 234 template <typename T> |
235 int SortedListBSearch(const List<T>& list, T elem) { | 235 int SortedListBSearch(const List<T>& list, T elem) { |
236 return SortedListBSearch<T>(list, elem, PointerValueCompare<T>); | 236 return SortedListBSearch<T>(list, elem, PointerValueCompare<T>); |
237 } | 237 } |
238 | 238 |
| 239 |
| 240 template <class T> |
| 241 List<T*>* UnwrapHandleList(List<T*>* destination, List<Handle<T> >* source) { |
| 242 ASSERT(destination->is_empty()); |
| 243 int length = source->length(); |
| 244 for (int i = 0; i < length; ++i) { |
| 245 Handle<T> handle = source->at(i); |
| 246 destination->Add(handle.is_null() ? NULL : *handle); |
| 247 } |
| 248 return destination; |
| 249 } |
| 250 |
| 251 |
239 } } // namespace v8::internal | 252 } } // namespace v8::internal |
240 | 253 |
241 #endif // V8_LIST_INL_H_ | 254 #endif // V8_LIST_INL_H_ |
OLD | NEW |