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; |
} |
}; |