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

Unified Diff: third_party/WebKit/Source/platform/heap/ThreadState.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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 1abc179cb463ba423bbbcc3a3e8725b1b4cc13ca..7b4404fe8225dd79d74273971d49c822f361fdaa 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -99,45 +99,6 @@ const char* ThreadState::gcReasonString(BlinkGC::GCReason reason) {
return "<Unknown>";
}
-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;
-};
-
ThreadState::ThreadState()
: m_thread(currentThread()),
m_persistentRegion(WTF::makeUnique<PersistentRegion>()),
@@ -1570,13 +1531,6 @@ void ThreadState::collectGarbage(BlinkGC::StackState stackState,
{
SafePointScope safePointScope(stackState, this);
- // Resume all parked threads upon leaving this scope.
- ParkThreadsScope parkThreadsScope(this);
-
- // Try to park the other threads. If we're unable to, bail out of the GC.
- if (!parkThreadsScope.parkThreads())
- return;
-
std::unique_ptr<Visitor> visitor;
if (gcType == BlinkGC::TakeSnapshot) {
visitor = Visitor::create(this, Visitor::SnapshotMarking);
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698