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

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

Issue 1166623002: Oilpan: Remove a visitor parameter from isHeapObjectAlive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/TraceTraits.h ('k') | Source/web/WebFrame.cpp » ('j') | 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 c331c2a7ad4358ef65a4d2014ec023597c68bece..13ee04035f56a19f7b6f960de56464aa40a9910f 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -141,48 +141,6 @@ public:
#define DEFINE_INLINE_TRACE() DEFINE_INLINE_TRACE_IMPL(EMPTY_MACRO_ARGUMENT)
#define DEFINE_INLINE_VIRTUAL_TRACE() DEFINE_INLINE_TRACE_IMPL(virtual)
-template<typename T, bool = WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<T>::Type, GarbageCollected>::value> class NeedsAdjustAndMark;
-
-template<typename T>
-class NeedsAdjustAndMark<T, true> {
- static_assert(sizeof(T), "T must be fully defined");
-public:
- static const bool value = false;
-};
-template <typename T> const bool NeedsAdjustAndMark<T, true>::value;
-
-template<typename T>
-class NeedsAdjustAndMark<T, false> {
- static_assert(sizeof(T), "T must be fully defined");
-public:
- static const bool value = IsGarbageCollectedMixin<typename WTF::RemoveConst<T>::Type>::value;
-};
-template <typename T> const bool NeedsAdjustAndMark<T, false>::value;
-
-template<typename T, bool = NeedsAdjustAndMark<T>::value> class ObjectAliveTrait;
-
-template<typename T>
-class ObjectAliveTrait<T, false> {
-public:
- template<typename VisitorDispatcher>
- static bool isHeapObjectAlive(VisitorDispatcher visitor, T* obj)
- {
- static_assert(sizeof(T), "T must be fully defined");
- return visitor->isMarked(obj);
- }
-};
-
-template<typename T>
-class ObjectAliveTrait<T, true> {
-public:
- template<typename VisitorDispatcher>
- static bool isHeapObjectAlive(VisitorDispatcher visitor, T* obj)
- {
- static_assert(sizeof(T), "T must be fully defined");
- return obj->isHeapObjectAlive(visitor);
- }
-};
-
// VisitorHelper contains common implementation of Visitor helper methods.
//
// VisitorHelper avoids virtual methods by using CRTP.
@@ -353,34 +311,9 @@ public:
Derived::fromHelper(this)->registerWeakMembers(object, object, callback);
}
- template<typename T> inline bool isHeapObjectAlive(T* obj)
- {
- static_assert(sizeof(T), "T must be fully defined");
- // 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>::isHeapObjectAlive(Derived::fromHelper(this), obj);
- }
- template<typename T> inline bool isHeapObjectAlive(const Member<T>& member)
- {
- return isHeapObjectAlive(member.get());
- }
- template<typename T> inline bool isHeapObjectAlive(const WeakMember<T>& member)
- {
- return isHeapObjectAlive(member.get());
- }
- template<typename T> inline bool isHeapObjectAlive(const RawPtr<T>& ptr)
- {
- return isHeapObjectAlive(ptr.get());
- }
-
private:
- template <typename T>
- static void handleWeakCell(Visitor* self, void* obj);
+ template<typename T>
+ static void handleWeakCell(Visitor* self, void* object);
};
// Visitor is used to traverse the Blink object graph. Used for the
@@ -452,7 +385,6 @@ public:
virtual bool weakTableRegistered(const void*) = 0;
#endif
- virtual bool isMarked(const void*) = 0;
virtual bool ensureMarked(const void*) = 0;
#if ENABLE(GC_PROFILING)
@@ -488,15 +420,6 @@ private:
bool m_isGlobalMarkingVisitor;
};
-template <typename Derived>
-template <typename T>
-void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* obj)
-{
- T** cell = reinterpret_cast<T**>(obj);
- if (*cell && !self->isHeapObjectAlive(*cell))
- *cell = nullptr;
-}
-
#if ENABLE(GC_PROFILING)
template<typename T>
struct TypenameStringTrait {
« no previous file with comments | « Source/platform/heap/TraceTraits.h ('k') | Source/web/WebFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698