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

Unified Diff: Source/wtf/HashTable.h

Issue 824513004: ASSERT that Visitor::mark is only called when inGC() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: m_visitor Created 5 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/Visitor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/HashTable.h
diff --git a/Source/wtf/HashTable.h b/Source/wtf/HashTable.h
index 40d57616b4d1fc2e4fc315c7d71174d774f49cbb..1924e891fddefb78e4ac17dc38bd6b038798148e 100644
--- a/Source/wtf/HashTable.h
+++ b/Source/wtf/HashTable.h
@@ -1256,7 +1256,19 @@ template<typename Key, typename Value, typename Extractor, typename HashFunction
// At this stage calling trace can make no difference
// (everything is already traced), but we use the
// return value to remove things from the collection.
- if (TraceInCollectionTrait<WeakHandlingInCollections, WeakPointersActWeak, ValueType, Traits>::trace(visitor, *element)) {
+
+ // FIXME: This should be rewritten so that this can check
+ // if the element is dead without calling trace,
+ // which is semantically not correct to be called in
+ // weak processing stage.
+#if ENABLE(ASSERT)
+ visitor->setAllowMarkingForHashTableWeakProcessing(true);
+#endif
+ bool elementIsDead = TraceInCollectionTrait<WeakHandlingInCollections, WeakPointersActWeak, ValueType, Traits>::trace(visitor, *element);
+#if ENABLE(ASSERT)
+ visitor->setAllowMarkingForHashTableWeakProcessing(false);
+#endif
+ if (elementIsDead) {
table->registerModification();
HashTableType::deleteBucket(*element); // Also calls the destructor.
table->m_deletedCount++;
« no previous file with comments | « Source/platform/heap/Visitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698