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

Unified Diff: third_party/WebKit/Source/platform/heap/GCInfo.h

Issue 1379603006: [Oilpan] Refactoring: Rename GarbageCollectedBase to GarbageCollectedType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | third_party/WebKit/Source/platform/heap/Heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/GCInfo.h
diff --git a/third_party/WebKit/Source/platform/heap/GCInfo.h b/third_party/WebKit/Source/platform/heap/GCInfo.h
index b90465ba852dc44e7f6ce75efe6e3becf0d7e8f2..9d4fedbdbeb770dccc386e5dfb8cb38a13ffd2e3 100644
--- a/third_party/WebKit/Source/platform/heap/GCInfo.h
+++ b/third_party/WebKit/Source/platform/heap/GCInfo.h
@@ -153,19 +153,10 @@ private:
static size_t s_gcInfoTableSize;
};
-// This macro should be used when returning a unique 14 bit integer
+// GCInfotAtBaseType should be used when returning a unique 14 bit integer
// for a given gcInfo.
-#define RETURN_GCINFO_INDEX() \
- static size_t gcInfoIndex = 0; \
- ASSERT(s_gcInfoTable); \
- if (!acquireLoad(&gcInfoIndex)) \
- GCInfoTable::ensureGCInfoIndex(&gcInfo, &gcInfoIndex); \
- ASSERT(gcInfoIndex >= 1); \
- ASSERT(gcInfoIndex < GCInfoTable::maxIndex); \
- return gcInfoIndex;
-
template<typename T>
-struct GCInfoAtBase {
+struct GCInfoAtBaseType {
static size_t index()
{
static_assert(sizeof(T), "T must be fully defined");
@@ -178,27 +169,34 @@ struct GCInfoAtBase {
TypenameStringTrait<T>::get
#endif
};
- RETURN_GCINFO_INDEX();
+
+ static size_t gcInfoIndex = 0;
+ ASSERT(s_gcInfoTable);
+ if (!acquireLoad(&gcInfoIndex))
+ GCInfoTable::ensureGCInfoIndex(&gcInfo, &gcInfoIndex);
+ ASSERT(gcInfoIndex >= 1);
+ ASSERT(gcInfoIndex < GCInfoTable::maxIndex);
+ return gcInfoIndex;
}
};
-template<typename T, bool = WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<T>::Type, GarbageCollected>::value> struct GetGarbageCollectedBase;
+template<typename T, bool = WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<T>::Type, GarbageCollected>::value> struct GetGarbageCollectedType;
template<typename T>
-struct GetGarbageCollectedBase<T, true> {
- typedef typename T::GarbageCollectedBase type;
+struct GetGarbageCollectedType<T, true> {
+ using type = typename T::GarbageCollectedType;
};
template<typename T>
-struct GetGarbageCollectedBase<T, false> {
- typedef T type;
+struct GetGarbageCollectedType<T, false> {
+ using type = T;
};
template<typename T>
struct GCInfoTrait {
static size_t index()
{
- return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::index();
+ return GCInfoAtBaseType<typename GetGarbageCollectedType<T>::type>::index();
}
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698