| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 David Levin <levin@chromium.org> | 3 * Copyright (C) 2008 David Levin <levin@chromium.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 }; | 1282 }; |
| 1283 | 1283 |
| 1284 template<typename Key, typename Value, typename Extractor, typename HashFunc
tions, typename Traits, typename KeyTraits, typename Allocator> | 1284 template<typename Key, typename Value, typename Extractor, typename HashFunc
tions, typename Traits, typename KeyTraits, typename Allocator> |
| 1285 template<typename VisitorDispatcher> | 1285 template<typename VisitorDispatcher> |
| 1286 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allo
cator>::trace(VisitorDispatcher visitor) | 1286 void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allo
cator>::trace(VisitorDispatcher visitor) |
| 1287 { | 1287 { |
| 1288 // If someone else already marked the backing and queued up the trace | 1288 // If someone else already marked the backing and queued up the trace |
| 1289 // and/or weak callback then we are done. This optimization does not | 1289 // and/or weak callback then we are done. This optimization does not |
| 1290 // happen for ListHashSet since its iterator does not point at the | 1290 // happen for ListHashSet since its iterator does not point at the |
| 1291 // backing. | 1291 // backing. |
| 1292 if (!m_table || visitor->isHeapObjectAlive(m_table)) | 1292 if (!m_table || Allocator::isHeapObjectAlive(m_table)) |
| 1293 return; | 1293 return; |
| 1294 // Normally, we mark the backing store without performing trace. This | 1294 // Normally, we mark the backing store without performing trace. This |
| 1295 // means it is marked live, but the pointers inside it are not marked. | 1295 // means it is marked live, but the pointers inside it are not marked. |
| 1296 // Instead we will mark the pointers below. However, for backing | 1296 // Instead we will mark the pointers below. However, for backing |
| 1297 // stores that contain weak pointers the handling is rather different. | 1297 // stores that contain weak pointers the handling is rather different. |
| 1298 // We don't mark the backing store here, so the marking GC will leave | 1298 // We don't mark the backing store here, so the marking GC will leave |
| 1299 // the backing unmarked. If the backing is found in any other way than | 1299 // the backing unmarked. If the backing is found in any other way than |
| 1300 // through its HashTable (ie from an iterator) then the mark bit will | 1300 // through its HashTable (ie from an iterator) then the mark bit will |
| 1301 // be set and the pointers will be marked strongly, avoiding problems | 1301 // be set and the pointers will be marked strongly, avoiding problems |
| 1302 // with iterating over things that disappear due to weak processing | 1302 // with iterating over things that disappear due to weak processing |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 CollectionIterator end(toBeRemoved.end()); | 1441 CollectionIterator end(toBeRemoved.end()); |
| 1442 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) | 1442 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) |
| 1443 collection.remove(*it); | 1443 collection.remove(*it); |
| 1444 } | 1444 } |
| 1445 | 1445 |
| 1446 } // namespace WTF | 1446 } // namespace WTF |
| 1447 | 1447 |
| 1448 #include "wtf/HashIterators.h" | 1448 #include "wtf/HashIterators.h" |
| 1449 | 1449 |
| 1450 #endif // WTF_HashTable_h | 1450 #endif // WTF_HashTable_h |
| OLD | NEW |