OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2008 David Levin <levin@chromium.org> | 4 * Copyright (C) 2008 David Levin <levin@chromium.org> |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 Allocator::registerDelayedMarkNoTracing(visitor, m_table); | 2098 Allocator::registerDelayedMarkNoTracing(visitor, m_table); |
2099 // Since we're delaying marking this HashTable, it is possible that the | 2099 // Since we're delaying marking this HashTable, it is possible that the |
2100 // registerWeakMembers is called multiple times (in rare | 2100 // registerWeakMembers is called multiple times (in rare |
2101 // cases). However, it shouldn't cause any issue. | 2101 // cases). However, it shouldn't cause any issue. |
2102 Allocator::registerWeakMembers( | 2102 Allocator::registerWeakMembers( |
2103 visitor, this, m_table, | 2103 visitor, this, m_table, |
2104 WeakProcessingHashTableHelper<Traits::weakHandlingFlag, Key, Value, | 2104 WeakProcessingHashTableHelper<Traits::weakHandlingFlag, Key, Value, |
2105 Extractor, HashFunctions, Traits, | 2105 Extractor, HashFunctions, Traits, |
2106 KeyTraits, Allocator>::process); | 2106 KeyTraits, Allocator>::process); |
2107 } | 2107 } |
| 2108 // If the backing store will be moved by sweep compaction, register the |
| 2109 // table reference pointing to the backing store object, so that the |
| 2110 // reference is updated upon object relocation. A no-op if not enabled |
| 2111 // by the visitor. |
| 2112 Allocator::registerBackingStoreReference(visitor, &m_table); |
2108 if (!IsTraceableInCollectionTrait<Traits>::value) | 2113 if (!IsTraceableInCollectionTrait<Traits>::value) |
2109 return; | 2114 return; |
2110 if (Traits::weakHandlingFlag == WeakHandlingInCollections) { | 2115 if (Traits::weakHandlingFlag == WeakHandlingInCollections) { |
2111 // If we have both strong and weak pointers in the collection then | 2116 // If we have both strong and weak pointers in the collection then |
2112 // we queue up the collection for fixed point iteration a la | 2117 // we queue up the collection for fixed point iteration a la |
2113 // Ephemerons: | 2118 // Ephemerons: |
2114 // http://dl.acm.org/citation.cfm?doid=263698.263733 - see also | 2119 // http://dl.acm.org/citation.cfm?doid=263698.263733 - see also |
2115 // http://www.jucs.org/jucs_14_21/eliminating_cycles_in_weak | 2120 // http://www.jucs.org/jucs_14_21/eliminating_cycles_in_weak |
2116 ASSERT(!enqueued() || Allocator::weakTableRegistered(visitor, this)); | 2121 ASSERT(!enqueued() || Allocator::weakTableRegistered(visitor, this)); |
2117 if (!enqueued()) { | 2122 if (!enqueued()) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2273 CollectionIterator end(toBeRemoved.end()); | 2278 CollectionIterator end(toBeRemoved.end()); |
2274 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) | 2279 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) |
2275 collection.remove(*it); | 2280 collection.remove(*it); |
2276 } | 2281 } |
2277 | 2282 |
2278 } // namespace WTF | 2283 } // namespace WTF |
2279 | 2284 |
2280 #include "wtf/HashIterators.h" | 2285 #include "wtf/HashIterators.h" |
2281 | 2286 |
2282 #endif // WTF_HashTable_h | 2287 #endif // WTF_HashTable_h |
OLD | NEW |