From 41386e9cb918eed93b3f13648cbef387e371e451 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 20 May 2015 09:56:07 +0000 Subject: webkitgtk-2.4.9 --- Source/JavaScriptCore/heap/GCThread.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'Source/JavaScriptCore/heap/GCThread.cpp') diff --git a/Source/JavaScriptCore/heap/GCThread.cpp b/Source/JavaScriptCore/heap/GCThread.cpp index bf562b5cf..50f02ce19 100644 --- a/Source/JavaScriptCore/heap/GCThread.cpp +++ b/Source/JavaScriptCore/heap/GCThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2015 Apple Inc. All rights reserved. + * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,17 +29,17 @@ #include "CopyVisitor.h" #include "CopyVisitorInlines.h" #include "GCThreadSharedData.h" -#include "JSCInlines.h" #include "SlotVisitor.h" #include +#include namespace JSC { -GCThread::GCThread(GCThreadSharedData& shared, std::unique_ptr slotVisitor, std::unique_ptr copyVisitor) +GCThread::GCThread(GCThreadSharedData& shared, SlotVisitor* slotVisitor, CopyVisitor* copyVisitor) : m_threadID(0) , m_shared(shared) - , m_slotVisitor(WTF::move(slotVisitor)) - , m_copyVisitor(WTF::move(copyVisitor)) + , m_slotVisitor(WTF::adoptPtr(slotVisitor)) + , m_copyVisitor(WTF::adoptPtr(copyVisitor)) { } @@ -69,12 +69,12 @@ CopyVisitor* GCThread::copyVisitor() GCPhase GCThread::waitForNextPhase() { - std::unique_lock lock(m_shared.m_phaseMutex); + std::unique_lock lock(m_shared.m_phaseMutex); m_shared.m_phaseConditionVariable.wait(lock, [this] { return !m_shared.m_gcThreadsShouldWait; }); m_shared.m_numberOfActiveGCThreads--; if (!m_shared.m_numberOfActiveGCThreads) - m_shared.m_activityConditionVariable.notifyOne(); + m_shared.m_activityConditionVariable.notify_one(); m_shared.m_phaseConditionVariable.wait(lock, [this] { return m_shared.m_currentPhase != NoPhase; }); m_shared.m_numberOfActiveGCThreads++; @@ -90,7 +90,7 @@ void GCThread::gcThreadMain() // Wait for the main thread to finish creating and initializing us. The main thread grabs this lock before // creating this thread. We aren't guaranteed to have a valid threadID until the main thread releases this lock. { - std::lock_guard lock(m_shared.m_phaseMutex); + std::lock_guard lock(m_shared.m_phaseMutex); } { ParallelModeEnabler enabler(*m_slotVisitor); @@ -115,9 +115,6 @@ void GCThread::gcThreadMain() // all of the blocks that the GCThreads borrowed have been returned. doneCopying() // returns our borrowed CopiedBlock, allowing the copying phase to finish. m_copyVisitor->doneCopying(); - - WTF::releaseFastMallocFreeMemoryForThisThread(); - break; case NoPhase: RELEASE_ASSERT_NOT_REACHED(); -- cgit v1.2.1