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

Unified Diff: Source/heap/Visitor.h

Issue 203363003: Remove do-nothing trace traits on primitive types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/heap/HeapTest.cpp ('k') | Source/heap/Visitor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/Visitor.h
diff --git a/Source/heap/Visitor.h b/Source/heap/Visitor.h
index 27cce315e8cd2cf9ee2cfb1034f57e0c448fcee9..86fd15a6f89143917664f58904ce19ffea7852db 100644
--- a/Source/heap/Visitor.h
+++ b/Source/heap/Visitor.h
@@ -483,43 +483,6 @@ class HeapVectorBacking;
template<typename Key, typename Value, typename Extractor, typename Traits, typename KeyTraits>
class HeapHashTableBacking;
-inline void doNothingTrace(Visitor*, void*) { }
-
-// Non-class types like char don't have an trace method, so we provide a more
-// specialized template instantiation here that will be selected in preference
-// to the default. Most of them do nothing, since the type in question cannot
-// point to other heap allocated objects.
-#define ITERATE_DO_NOTHING_TYPES(f) \
- f(uint8_t) \
- f(void)
-
-#define DECLARE_DO_NOTHING_TRAIT(type) \
- template<> \
- class TraceTrait<type> { \
- public: \
- static void checkGCInfo(Visitor*, const void*) { } \
- static void mark(Visitor* visitor, const type* p) { \
- visitor->mark(p, reinterpret_cast<TraceCallback>(0)); \
- } \
- }; \
- template<> \
- struct FinalizerTrait<type> { \
- static void finalize(void*) { } \
- static const bool nonTrivialFinalizer = false; \
- }; \
- template<> \
- struct HEAP_EXPORT GCInfoTrait<type> { \
- static const GCInfo* get() \
- { \
- return &info; \
- } \
- static const GCInfo info; \
- };
-
-ITERATE_DO_NOTHING_TYPES(DECLARE_DO_NOTHING_TRAIT)
-
-#undef DECLARE_DO_NOTHING_TRAIT
-
template<typename T>
class DefaultTraceTrait<T, false> {
public:
« no previous file with comments | « Source/heap/HeapTest.cpp ('k') | Source/heap/Visitor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698