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

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

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/Heap.h
diff --git a/third_party/WebKit/Source/platform/heap/Heap.h b/third_party/WebKit/Source/platform/heap/Heap.h
index 67a8bc873ef643166d19459cecc0c07fab89dab3..343bb922fb2a1ea834412d75ce5efa671ee3fd04 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.h
+++ b/third_party/WebKit/Source/platform/heap/Heap.h
@@ -198,6 +198,7 @@ public:
static const char* gcReasonString(BlinkGC::GCReason);
static void collectGarbage(BlinkGC::StackState, BlinkGC::GCType, BlinkGC::GCReason);
static void collectGarbageForTerminatingThread(ThreadState*);
+ static void collectGarbageForIsolatedThread(ThreadState*);
static void collectAllGarbage();
static void processMarkingStack(Visitor*);
@@ -214,11 +215,6 @@ public:
static size_t objectPayloadSizeForTesting();
- static void flushHeapDoesNotContainCache();
-
- static FreePagePool* freePagePool() { return s_freePagePool; }
- static OrphanedPagePool* orphanedPagePool() { return s_orphanedPagePool; }
-
// This look-up uses the region search tree and a negative contains cache to
// provide an efficient mapping from arbitrary addresses to the containing
// heap-page if one exists.
@@ -236,82 +232,10 @@ public:
return info;
}
- static void setMarkedObjectSizeAtLastCompleteSweep(size_t size) { releaseStore(&s_markedObjectSizeAtLastCompleteSweep, size); }
- static size_t markedObjectSizeAtLastCompleteSweep() { return acquireLoad(&s_markedObjectSizeAtLastCompleteSweep); }
- static void increaseAllocatedObjectSize(size_t delta) { atomicAdd(&s_allocatedObjectSize, static_cast<long>(delta)); }
- static void decreaseAllocatedObjectSize(size_t delta) { atomicSubtract(&s_allocatedObjectSize, static_cast<long>(delta)); }
- static size_t allocatedObjectSize() { return acquireLoad(&s_allocatedObjectSize); }
- static void increaseMarkedObjectSize(size_t delta) { atomicAdd(&s_markedObjectSize, static_cast<long>(delta)); }
- static size_t markedObjectSize() { return acquireLoad(&s_markedObjectSize); }
- 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 size_t objectSizeAtLastGC() { return acquireLoad(&s_objectSizeAtLastGC); }
- static void increaseWrapperCount(size_t delta) { atomicAdd(&s_wrapperCount, static_cast<long>(delta)); }
- static void decreaseWrapperCount(size_t delta) { atomicSubtract(&s_wrapperCount, static_cast<long>(delta)); }
- static size_t wrapperCount() { return acquireLoad(&s_wrapperCount); }
- static size_t wrapperCountAtLastGC() { return acquireLoad(&s_wrapperCountAtLastGC); }
- static void increaseCollectedWrapperCount(size_t delta) { atomicAdd(&s_collectedWrapperCount, static_cast<long>(delta)); }
- static size_t collectedWrapperCount() { return acquireLoad(&s_collectedWrapperCount); }
- static size_t partitionAllocSizeAtLastGC() { return acquireLoad(&s_partitionAllocSizeAtLastGC); }
-
- static double estimatedMarkingTime();
- static void reportMemoryUsageHistogram();
- static void reportMemoryUsageForTracing();
-
-#if ENABLE(ASSERT)
- static uint16_t gcGeneration() { return s_gcGeneration; }
-#endif
-
private:
- // A RegionTree is a simple binary search tree of PageMemoryRegions sorted
- // by base addresses.
- class RegionTree {
- public:
- explicit RegionTree(PageMemoryRegion* region) : m_region(region), m_left(nullptr), m_right(nullptr) { }
- ~RegionTree()
- {
- delete m_left;
- delete m_right;
- }
- PageMemoryRegion* lookup(Address);
- static void add(RegionTree*, RegionTree**);
- static void remove(PageMemoryRegion*, RegionTree**);
- private:
- PageMemoryRegion* m_region;
- RegionTree* m_left;
- RegionTree* m_right;
- };
-
- // Reset counters that track live and allocated-since-last-GC sizes.
- static void resetHeapCounters();
-
static int heapIndexForObjectSize(size_t);
static bool isNormalHeapIndex(int);
- static CallbackStack* s_markingStack;
- static CallbackStack* s_postMarkingCallbackStack;
- static CallbackStack* s_globalWeakCallbackStack;
- static CallbackStack* s_ephemeronStack;
- static HeapDoesNotContainCache* s_heapDoesNotContainCache;
- static bool s_shutdownCalled;
- static FreePagePool* s_freePagePool;
- static OrphanedPagePool* s_orphanedPagePool;
- static RegionTree* s_regionTree;
- static size_t s_allocatedSpace;
- static size_t s_allocatedObjectSize;
- static size_t s_objectSizeAtLastGC;
- static size_t s_markedObjectSize;
- static size_t s_markedObjectSizeAtLastCompleteSweep;
- static size_t s_wrapperCount;
- static size_t s_wrapperCountAtLastGC;
- static size_t s_collectedWrapperCount;
- static size_t s_partitionAllocSizeAtLastGC;
- static double s_estimatedMarkingTimePerByte;
-#if ENABLE(ASSERT)
- static uint16_t s_gcGeneration;
-#endif
-
friend class ThreadState;
};

Powered by Google App Engine
This is Rietveld 408576698