Index: Source/platform/heap/Visitor.h |
diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h |
index 587f0d6b3c3bf1aebe573743aee7b76be46ad482..989c35c31f6fdbfc2a7e0371193ee1ed857d9d11 100644 |
--- a/Source/platform/heap/Visitor.h |
+++ b/Source/platform/heap/Visitor.h |
@@ -863,7 +863,7 @@ extern PLATFORM_EXPORT GCInfo const** s_gcInfoTable; |
class GCInfoTable { |
public: |
- PLATFORM_EXPORT static size_t allocateGCInfoSlot(); |
+ PLATFORM_EXPORT static bool allocateGCInfoSlot(size_t&); |
static void init(); |
static void shutdown(); |
@@ -872,7 +872,7 @@ public: |
static const size_t maxIndex = 1 << 15; |
private: |
- static void resize(size_t); |
+ static void resize(); |
static int s_gcInfoIndex; |
static size_t s_gcInfoTableSize; |
@@ -880,12 +880,13 @@ private: |
// This macro should be used when returning a unique 15 bit integer |
// for a given gcInfo. |
-#define RETURN_GCINFO_INDEX() \ |
- static const size_t gcInfoIndex = GCInfoTable::allocateGCInfoSlot(); \ |
- ASSERT(gcInfoIndex >= 1); \ |
- ASSERT(gcInfoIndex < GCInfoTable::maxIndex); \ |
- ASSERT(s_gcInfoTable); \ |
- s_gcInfoTable[gcInfoIndex] = &gcInfo; \ |
+#define RETURN_GCINFO_INDEX() \ |
+ static size_t gcInfoIndex = 0; \ |
+ ASSERT(s_gcInfoTable); \ |
+ if (!gcInfoIndex && GCInfoTable::allocateGCInfoSlot(gcInfoIndex)) \ |
+ s_gcInfoTable[gcInfoIndex] = &gcInfo; \ |
haraken
2015/01/10 08:37:24
Can we do this assignment in allocateGCInfoSlot? P
sof
2015/01/10 08:42:46
I suppose, but I don't see the overall benefit.
haraken
2015/01/10 08:48:45
up to you :)
sof
2015/01/10 08:54:23
Done.
|
+ ASSERT(gcInfoIndex >= 1); \ |
+ ASSERT(gcInfoIndex < GCInfoTable::maxIndex); \ |
return gcInfoIndex; |
template<typename T> |