Chromium Code Reviews| Index: Source/platform/heap/Heap.h |
| diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h |
| index 66dedb0b733fc1c1acc42e3ff989cb40111266d1..2a5380cd94ffd86475536ed09ad7ac725d32effb 100644 |
| --- a/Source/platform/heap/Heap.h |
| +++ b/Source/platform/heap/Heap.h |
| @@ -990,8 +990,25 @@ public: |
| static void increaseAllocatedSpace(size_t delta) { atomicAdd(&s_allocatedSpace, static_cast<long>(delta)); } |
| static void decreaseAllocatedSpace(size_t delta) { atomicSubtract(&s_allocatedSpace, static_cast<long>(delta)); } |
| static size_t allocatedSpace() { return acquireLoad(&s_allocatedSpace); } |
| + |
| static double estimatedMarkingTime(); |
| + // On object allocation, register its externally allocated memory. |
| + static void increaseExternallyAllocatedBytes(size_t); |
| + static size_t externallyAllocatedBytes() { return acquireLoad(&s_externallyAllocatedBytes); } |
| + |
| + // On object tracing, register its externally allocated memory (as still live.) |
| + static void increaseExternallyAllocatedBytesAlive(size_t delta) |
| + { |
| + ASSERT(ThreadState::current()->isInGC()); |
| + s_externallyAllocatedBytesAlive += delta; |
| + } |
| + static size_t externallyAllocatedBytesAlive() { return s_externallyAllocatedBytesAlive; } |
| + |
| + static void requestUrgentGC() { releaseStore(&s_requestedUrgentGC, 1); } |
| + static void clearUrgentGC() { releaseStore(&s_requestedUrgentGC, 0); } |
| + static bool isGCUrgentlyRequested() { return acquireLoad(&s_requestedUrgentGC); } |
|
haraken
2015/02/19 23:47:44
isUrgentGCRequested ?
sof
2015/02/20 09:33:49
It would permutedly express the exact same, but wh
|
| + |
| private: |
| // A RegionTree is a simple binary search tree of PageMemoryRegions sorted |
| // by base addresses. |
| @@ -1012,8 +1029,8 @@ private: |
| RegionTree* m_right; |
| }; |
| - static void resetAllocatedObjectSize() { ASSERT(ThreadState::current()->isInGC()); s_allocatedObjectSize = 0; } |
| - static void resetMarkedObjectSize() { ASSERT(ThreadState::current()->isInGC()); s_markedObjectSize = 0; } |
| + // Reset counters that track live and allocated-since-last-GC sizes. |
| + static void resetHeapCounters(); |
| static Visitor* s_markingVisitor; |
| static CallbackStack* s_markingStack; |
| @@ -1029,6 +1046,10 @@ private: |
| static size_t s_allocatedSpace; |
| static size_t s_allocatedObjectSize; |
| static size_t s_markedObjectSize; |
| + static size_t s_externallyAllocatedBytes; |
| + static size_t s_externallyAllocatedBytesAlive; |
| + static unsigned s_requestedUrgentGC; |
| + |
| friend class ThreadState; |
| }; |