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

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

Issue 2619493003: Replace ASSERTs in platform/heap/ with DCHECKs
Patch Set: temp Created 3 years, 11 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: 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 d68f968d640480ce3d387e3598462092904053b3..2e2ac447b473c22583cbc5bf38fe05d7efa5cf96 100644
--- a/third_party/WebKit/Source/platform/heap/GCInfo.h
+++ b/third_party/WebKit/Source/platform/heap/GCInfo.h
@@ -156,7 +156,15 @@ struct GCInfo {
// object header keeps its index into this table.
extern PLATFORM_EXPORT GCInfo const** s_gcInfoTable;
-#if ENABLE(ASSERT)
+// The (max + 1) GCInfo index supported.
+// We assume that 14 bits is enough to represent all possible types: during
+// telemetry runs, we see about 1000 different types, looking at the output
+// of the oilpan gc clang plugin, there appear to be at most about 6000
+// types, so 14 bits should be more than twice as many bits as we will ever
+// encounter.
+static const size_t gcInfoMaxIndex = 1 << 14;
haraken 2017/01/06 04:18:49 I hit a link error if I put this in GCInfo. I coul
sof 2017/01/08 07:10:46 Do you remember what the link error was?
+
+#if DCHECK_IS_ON()
PLATFORM_EXPORT void assertObjectHasGCInfo(const void*, size_t gcInfoIndex);
#endif
@@ -171,14 +179,6 @@ class GCInfoTable {
static size_t gcInfoIndex() { return s_gcInfoIndex; }
- // The (max + 1) GCInfo index supported.
- // We assume that 14 bits is enough to represent all possible types: during
- // telemetry runs, we see about 1000 different types, looking at the output
- // of the oilpan gc clang plugin, there appear to be at most about 6000
- // types, so 14 bits should be more than twice as many bits as we will ever
- // encounter.
- static const size_t maxIndex = 1 << 14;
-
private:
static void resize();
@@ -199,11 +199,11 @@ struct GCInfoAtBaseType {
};
static size_t gcInfoIndex = 0;
- ASSERT(s_gcInfoTable);
+ DCHECK(s_gcInfoTable);
if (!acquireLoad(&gcInfoIndex))
GCInfoTable::ensureGCInfoIndex(&gcInfo, &gcInfoIndex);
- ASSERT(gcInfoIndex >= 1);
- ASSERT(gcInfoIndex < GCInfoTable::maxIndex);
+ DCHECK_GE(gcInfoIndex, 1UL);
+ DCHECK_LT(gcInfoIndex, gcInfoMaxIndex);
return gcInfoIndex;
}
};
« no previous file with comments | « third_party/WebKit/Source/platform/heap/CallbackStack.cpp ('k') | third_party/WebKit/Source/platform/heap/GCInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698