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

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

Issue 2687283002: Remove ParkThreadsScope (Closed)
Patch Set: temp Created 3 years, 10 months 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.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 090aebee500210beb079e9aa9d02283b8133b76b..c8a4218a0457f075c3d138a19c500745bc224ed4 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -57,45 +57,6 @@ namespace blink {
HeapAllocHooks::AllocationHook* HeapAllocHooks::m_allocationHook = nullptr;
HeapAllocHooks::FreeHook* HeapAllocHooks::m_freeHook = nullptr;
-class ParkThreadsScope final {
- STACK_ALLOCATED();
-
- public:
- explicit ParkThreadsScope(ThreadState* state)
- : m_state(state), m_shouldResumeThreads(false) {}
-
- bool parkThreads() {
- TRACE_EVENT0("blink_gc", "ThreadHeap::ParkThreadsScope");
-
- // TODO(haraken): In an unlikely coincidence that two threads decide
- // to collect garbage at the same time, avoid doing two GCs in
- // a row and return false.
- double startTime = WTF::currentTimeMS();
-
- m_shouldResumeThreads = m_state->heap().park();
-
- double timeForStoppingThreads = WTF::currentTimeMS() - startTime;
- DEFINE_THREAD_SAFE_STATIC_LOCAL(
- CustomCountHistogram, timeToStopThreadsHistogram,
- new CustomCountHistogram("BlinkGC.TimeForStoppingThreads", 1, 1000,
- 50));
- timeToStopThreadsHistogram.count(timeForStoppingThreads);
-
- return m_shouldResumeThreads;
- }
-
- ~ParkThreadsScope() {
- // Only cleanup if we parked all threads in which case the GC happened
- // and we need to resume the other threads.
- if (m_shouldResumeThreads)
- m_state->heap().resume();
- }
-
- private:
- ThreadState* m_state;
- bool m_shouldResumeThreads;
-};
-
void ThreadHeap::flushHeapDoesNotContainCache() {
m_heapDoesNotContainCache->flush();
}
@@ -243,14 +204,6 @@ void ThreadHeap::detach(ThreadState* thread) {
delete this;
}
-bool ThreadHeap::park() {
- return m_safePointBarrier->parkOthers();
-}
-
-void ThreadHeap::resume() {
- m_safePointBarrier->resumeOthers();
-}
-
#if DCHECK_IS_ON()
BasePage* ThreadHeap::findPageFromAddress(Address address) {
MutexLocker locker(m_threadAttachMutex);
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698