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

Unified Diff: Source/platform/heap/Visitor.h

Issue 464283002: [oilpan] Null pointers must be treated as live, since they can't be marked live by strongification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Spelling fix Created 6 years, 4 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/HeapTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Visitor.h
diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h
index 7a701fc38f7ad9416b1c05669ead56532ea3fc4c..5d5971e250579a85b57f21b731a8a7d67bd1d4af 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -385,7 +385,14 @@ public:
{
// Check that we actually know the definition of T when tracing.
COMPILE_ASSERT(sizeof(T), WeNeedToKnowTheDefinitionOfTheTypeWeAreTracing);
- return !!obj && ObjectAliveTrait<T>::isAlive(this, obj);
+ // The strongification of collections relies on the fact that once a
+ // collection has been strongified, there is no way that it can contain
+ // non-live entries, so no entries will be removed. Since you can't set
+ // the mark bit on a null pointer, that means that null pointers are
+ // always 'alive'.
+ if (!obj)
+ return true;
+ return ObjectAliveTrait<T>::isAlive(this, obj);
}
template<typename T> inline bool isAlive(const Member<T>& member)
{
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698