Chromium Code Reviews| 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..3002b32f1057f3b8ab07db16878b99a6db5e2cba 100644 |
| --- a/third_party/WebKit/Source/platform/heap/Heap.h |
| +++ b/third_party/WebKit/Source/platform/heap/Heap.h |
| @@ -136,7 +136,7 @@ public: |
| } |
| // Push a trace callback on the marking stack. |
| - static void pushTraceCallback(void* containerObject, TraceCallback); |
| + static void pushTraceCallback(void* containerObject, TraceCallback, ThreadState*); |
|
haraken
2016/01/07 08:06:22
This change is okay in this CL, but ideally these
|
| // Push a trace callback on the post-marking callback stack. These |
| // callbacks are called after normal marking (including ephemeron |
| @@ -156,7 +156,7 @@ public: |
| // pointer callbacks are added to a static callback work list and the weak |
| // callback is performed on the thread performing garbage collection. This |
| // is OK because cells are just cleared and no deallocation can happen. |
| - static void pushGlobalWeakCallback(void** cell, WeakCallback); |
| + static void pushGlobalWeakCallback(void** cell, WeakCallback, ThreadState*); |
| // Pop the top of a marking stack and call the callback with the visitor |
| // and the object. Returns false when there is nothing more to do. |
| @@ -173,9 +173,9 @@ public: |
| static bool popAndInvokeGlobalWeakCallback(Visitor*); |
| // Register an ephemeron table for fixed-point iteration. |
| - static void registerWeakTable(void* containerObject, EphemeronCallback, EphemeronCallback); |
| + static void registerWeakTable(void* containerObject, EphemeronCallback, EphemeronCallback, ThreadState*); |
| #if ENABLE(ASSERT) |
| - static bool weakTableRegistered(const void*); |
| + static bool weakTableRegistered(const void*, ThreadState*); |
| #endif |
| static inline size_t allocationSizeFromSize(size_t size) |
| @@ -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,15 +215,13 @@ 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. |
| - static BasePage* lookup(Address); |
| + static BasePage* lookup(Address, ThreadState*); |
| static void addPageMemoryRegion(PageMemoryRegion*); |
| static void removePageMemoryRegion(PageMemoryRegion*); |
| @@ -236,81 +235,13 @@ 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; |
| }; |