Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: third_party/WebKit/Source/wtf/HashTable.h

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: tidy up comment Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 // the backing is found in any other way than through its HashTable (ie from 2074 // the backing is found in any other way than through its HashTable (ie from
2075 // an iterator) then the mark bit will be set and the pointers will be 2075 // an iterator) then the mark bit will be set and the pointers will be
2076 // marked strongly, avoiding problems with iterating over things that 2076 // marked strongly, avoiding problems with iterating over things that
2077 // disappear due to weak processing while we are iterating over them. We 2077 // disappear due to weak processing while we are iterating over them. We
2078 // register the backing store pointer for delayed marking which will take 2078 // register the backing store pointer for delayed marking which will take
2079 // place after we know if the backing is reachable from elsewhere. We also 2079 // place after we know if the backing is reachable from elsewhere. We also
2080 // register a weakProcessing callback which will perform weak processing if 2080 // register a weakProcessing callback which will perform weak processing if
2081 // needed. 2081 // needed.
2082 if (Traits::weakHandlingFlag == NoWeakHandlingInCollections) { 2082 if (Traits::weakHandlingFlag == NoWeakHandlingInCollections) {
2083 Allocator::markNoTracing(visitor, m_table); 2083 Allocator::markNoTracing(visitor, m_table);
2084 // If the backing store will be moved by sweep compaction, register the
2085 // table reference pointing to the backing store object, so that the
2086 // reference is updated upon object relocation.
2087 Allocator::registerBackingStoreReference(visitor, &m_table);
2084 } else { 2088 } else {
2085 Allocator::registerDelayedMarkNoTracing(visitor, m_table); 2089 Allocator::registerDelayedMarkNoTracing(visitor, &m_table);
haraken 2016/11/30 06:29:53 Why don't we need to register the backing store of
sof 2016/11/30 06:52:44 See above answer.
2086 // Since we're delaying marking this HashTable, it is possible that the 2090 // Since we're delaying marking this HashTable, it is possible that the
2087 // registerWeakMembers is called multiple times (in rare 2091 // registerWeakMembers is called multiple times (in rare
2088 // cases). However, it shouldn't cause any issue. 2092 // cases). However, it shouldn't cause any issue.
2089 Allocator::registerWeakMembers( 2093 Allocator::registerWeakMembers(
2090 visitor, this, m_table, 2094 visitor, this, m_table,
2091 WeakProcessingHashTableHelper<Traits::weakHandlingFlag, Key, Value, 2095 WeakProcessingHashTableHelper<Traits::weakHandlingFlag, Key, Value,
2092 Extractor, HashFunctions, Traits, 2096 Extractor, HashFunctions, Traits,
2093 KeyTraits, Allocator>::process); 2097 KeyTraits, Allocator>::process);
2094 } 2098 }
2095 if (!IsTraceableInCollectionTrait<Traits>::value) 2099 if (!IsTraceableInCollectionTrait<Traits>::value)
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 CollectionIterator end(toBeRemoved.end()); 2264 CollectionIterator end(toBeRemoved.end());
2261 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) 2265 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it)
2262 collection.remove(*it); 2266 collection.remove(*it);
2263 } 2267 }
2264 2268
2265 } // namespace WTF 2269 } // namespace WTF
2266 2270
2267 #include "wtf/HashIterators.h" 2271 #include "wtf/HashIterators.h"
2268 2272
2269 #endif // WTF_HashTable_h 2273 #endif // WTF_HashTable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698