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

Unified Diff: Source/heap/Visitor.h

Issue 171843002: [oilpan] Remove GC_INFO_{DEFINE,DECLARE} macros (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 6 years, 10 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
Index: Source/heap/Visitor.h
diff --git a/Source/heap/Visitor.h b/Source/heap/Visitor.h
index 25bf88ced6acee0747f8382bcdd16248027d71d2..8d34a1a26989f99ecdf4d357dc578b3e9022f4fd 100644
--- a/Source/heap/Visitor.h
+++ b/Source/heap/Visitor.h
@@ -152,28 +152,10 @@ template<typename T> struct FinalizerTrait {
static void finalize(void* obj) { FinalizerTraitImpl<T, nonTrivialFinalizer>::finalize(obj); }
};
-#define DECLARE_GC_INFO \
-public: \
- static const GCInfo s_gcInfo; \
- template<typename Any> friend struct FinalizerTrait; \
-private: \
-
-#define DEFINE_GC_INFO(Type) \
-const GCInfo Type::s_gcInfo = { \
- #Type, \
- TraceTrait<Type>::trace, \
- FinalizerTrait<Type>::finalize, \
- FinalizerTrait<Type>::nonTrivialFinalizer, \
- CLASSOF_FUNC(Type) \
-}; \
+#define DECLARE_GC_INFO
+#define DEFINE_GC_INFO(Type)
-template<typename T>
-struct GCInfoTrait {
- static const GCInfo* get()
- {
- return &T::s_gcInfo;
- }
-};
+template<typename T> struct GCInfoTrait;
template<typename T>
const char* getTypeMarker()
@@ -532,5 +514,30 @@ public:
}
};
+template<typename T>
+struct GCInfoAtBase {
+ static const GCInfo* get()
+ {
+ static char foo = 'a'; // FIXME
haraken 2014/02/19 02:51:40 foo => type (or className) Add more description.
kouhei (in TOK) 2014/02/19 03:08:20 @Slava I want your suggestions here. I'm not sure
zerny-chromium 2014/02/19 09:44:48 We only need the type marker on debug builds so we
kouhei (in TOK) 2014/02/19 11:57:27 Thanks for your comment. Just to clarify, the abo
Vyacheslav Egorov (Chromium) 2014/02/19 15:03:31 CLASSOF_FUNC could delegate to a virtual classOf m
kouhei (in TOK) 2014/02/20 01:07:41 Thanks, Slava! I'll split work and do the followin
+ static const GCInfo gcInfo = {
+ &foo,
+ TraceTrait<T>::trace,
+ FinalizerTrait<T>::finalize,
+ FinalizerTrait<T>::nonTrivialFinalizer,
+ CLASSOF_FUNC(T)
+ };
+ return &gcInfo;
+ }
+};
+
+template<typename T>
+struct GCInfoTrait {
+ static const GCInfo* get()
+ {
+ return GCInfoAtBase<typename T::HeapAllocatedBase>::get();
+ }
+};
+
}
+
#endif
« Source/heap/Heap.h ('K') | « Source/heap/Heap.h ('k') | Source/heap/tests/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698