Skip to content
Permalink
Browse files
Replace LockHolder with Locker in local variables
https://bugs.webkit.org/show_bug.cgi?id=226133

Reviewed by Darin Adler.

Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock
type more easily since the compiler with deduce the lock type T for Locker<T>.

Source/JavaScriptCore:

* API/JSCallbackObject.h:
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
* API/JSValue.mm:
(handerForStructTag):
* API/tests/testapi.cpp:
(testCAPIViaCpp):
* assembler/testmasm.cpp:
(JSC::run):
* b3/air/testair.cpp:
* b3/testb3_1.cpp:
(run):
* bytecode/DirectEvalCodeCache.cpp:
(JSC::DirectEvalCodeCache::setSlow):
(JSC::DirectEvalCodeCache::clear):
(JSC::DirectEvalCodeCache::visitAggregateImpl):
* bytecode/SuperSampler.cpp:
(JSC::initializeSuperSampler):
(JSC::resetSuperSamplerState):
(JSC::printSuperSamplerState):
(JSC::enableSuperSampler):
(JSC::disableSuperSampler):
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::invalidate):
(JSC::DFG::CommonData::~CommonData):
(JSC::DFG::CommonData::installVMTrapBreakpoints):
(JSC::DFG::codeBlockForVMTrapPC):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::cleanMustHandleValuesIfNecessary):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::~Worklist):
(JSC::DFG::Worklist::finishCreation):
(JSC::DFG::Worklist::isActiveForVM const):
(JSC::DFG::Worklist::enqueue):
(JSC::DFG::Worklist::compilationState):
(JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady):
(JSC::DFG::Worklist::removeAllReadyPlansForVM):
(JSC::DFG::Worklist::completeAllReadyPlansForVM):
(JSC::DFG::Worklist::visitWeakReferences):
(JSC::DFG::Worklist::removeDeadPlans):
(JSC::DFG::Worklist::removeNonCompilingPlansForVM):
(JSC::DFG::Worklist::queueLength):
(JSC::DFG::Worklist::dump const):
(JSC::DFG::Worklist::setNumberOfThreads):
* dfg/DFGWorklistInlines.h:
(JSC::DFG::Worklist::iterateCodeBlocksForGC):
* disassembler/Disassembler.cpp:
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::addBlock):
* heap/CodeBlockSetInlines.h:
(JSC::CodeBlockSet::iterateCurrentlyExecuting):
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::add):
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::collectAsync):
(JSC::Heap::runBeginPhase):
(JSC::Heap::waitForCollector):
(JSC::Heap::requestCollection):
(JSC::Heap::notifyIsSafeToCollect):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didReachTermination):
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::startTracking):
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
(Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting):
* inspector/remote/RemoteConnectionToTarget.cpp:
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::sendMessageToTarget):
(Inspector::RemoteConnectionToTarget::close):
(Inspector::RemoteConnectionToTarget::targetClosed):
* inspector/remote/RemoteInspector.cpp:
(Inspector::RemoteInspector::registerTarget):
(Inspector::RemoteInspector::unregisterTarget):
(Inspector::RemoteInspector::updateTarget):
(Inspector::RemoteInspector::updateClientCapabilities):
(Inspector::RemoteInspector::setClient):
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::setupCompleted):
(Inspector::RemoteInspector::stop):
* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteTargetHandleRunSourceGlobal):
(Inspector::RemoteTargetQueueTaskOnGlobalQueue):
(Inspector::RemoteTargetHandleRunSourceWithInfo):
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::targetClosed):
(Inspector::RemoteConnectionToTarget::close):
(Inspector::RemoteConnectionToTarget::sendMessageToTarget):
(Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop):
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::setParentProcessInformation):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
* inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::closeFromMessage):
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
(Inspector::RemoteInspectorXPCConnection::handleEvent):
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::setupConnection):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::receivedGetTargetListMessage):
(Inspector::RemoteInspector::receivedDataMessage):
(Inspector::RemoteInspector::receivedCloseMessage):
(Inspector::RemoteInspector::setup):
* inspector/remote/socket/RemoteInspectorConnectionClient.cpp:
(Inspector::RemoteInspectorConnectionClient::didReceive):
* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::didClose):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::setup):
(Inspector::RemoteInspector::setupInspectorClient):
(Inspector::RemoteInspector::frontendDidClose):
(Inspector::RemoteInspector::sendMessageToBackend):
(Inspector::RemoteInspector::startAutomationSession):
* inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp:
(Inspector::RemoteInspectorSocketEndpoint::listenInet):
(Inspector::RemoteInspectorSocketEndpoint::isListening):
(Inspector::RemoteInspectorSocketEndpoint::workerThread):
(Inspector::RemoteInspectorSocketEndpoint::createClient):
(Inspector::RemoteInspectorSocketEndpoint::disconnect):
(Inspector::RemoteInspectorSocketEndpoint::invalidateClient):
(Inspector::RemoteInspectorSocketEndpoint::invalidateListener):
(Inspector::RemoteInspectorSocketEndpoint::getPort const):
(Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled):
(Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled):
(Inspector::RemoteInspectorSocketEndpoint::send):
(Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled):
* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::addToCommittedByteCount):
(JSC::CLoopStack::committedByteCount):
* jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):
* jit/ICStats.cpp:
(JSC::ICStats::ICStats):
(JSC::ICStats::~ICStats):
* jit/JITThunks.cpp:
(JSC::JITThunks::ctiStub):
(JSC::JITThunks::existingCTIStub):
(JSC::JITThunks::ctiSlowPathFunctionStub):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::Plan::compileInThread):
(JSC::JITWorklist::Plan::isFinishedCompiling):
(JSC::JITWorklist::JITWorklist):
(JSC::JITWorklist::completeAllForVM):
(JSC::JITWorklist::poll):
(JSC::JITWorklist::compileLater):
(JSC::JITWorklist::finalizePlans):
* parser/SourceProvider.cpp:
(JSC::SourceProvider::getID):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::ensureBytecodesFor):
(JSC::Profiler::Database::notifyDestruction):
(JSC::Profiler::Database::addCompilation):
(JSC::Profiler::Database::logEvent):
(JSC::Profiler::Database::addDatabaseToAtExit):
(JSC::Profiler::Database::removeDatabaseFromAtExit):
(JSC::Profiler::Database::removeFirstAtExitDatabase):
* profiler/ProfilerUID.cpp:
(JSC::Profiler::UID::create):
* runtime/DeferredWorkTimer.cpp:
(JSC::DeferredWorkTimer::scheduleWorkSoon):
(JSC::DeferredWorkTimer::didResumeScriptExecutionOwner):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::timerLoop):
(JSC::SamplingProfiler::shutdown):
(JSC::SamplingProfiler::start):
(JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread):
(JSC::SamplingProfiler::noticeJSLockAcquisition):
(JSC::SamplingProfiler::noticeVMEntry):
(JSC::SamplingProfiler::registerForReportAtExit):
* runtime/Watchdog.cpp:
(JSC::Watchdog::startTimer):
(JSC::Watchdog::willDestroyVM):
* tools/VMInspector.cpp:
(JSC::VMInspector::isValidExecutableMemory):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::work):
* wasm/WasmEntryPlan.cpp:
(JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder):
(JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::waitForCompletion):
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmSignature.cpp:
(JSC::Wasm::SignatureInformation::signatureFor):
(JSC::Wasm::SignatureInformation::tryCleanup):
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::enqueue):
(JSC::Wasm::Worklist::completePlanSynchronously):
(JSC::Wasm::Worklist::stopAllPlansForContext):
(JSC::Wasm::Worklist::Worklist):
(JSC::Wasm::Worklist::~Worklist):

Source/WebCore:

* Modules/webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
(WebCore::AsyncAudioDecoder::runLoop):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::performClose):
(WebCore::Database::inProgressTransactionCompleted):
(WebCore::Database::hasPendingTransaction):
(WebCore::Database::runTransaction):
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::start):
(WebCore::DatabaseThread::databaseThread):
(WebCore::DatabaseThread::recordDatabaseOpen):
(WebCore::DatabaseThread::recordDatabaseClosed):
(WebCore::DatabaseThread::hasPendingDatabaseActivity const):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::fullPathForDatabase):
(WebCore::DatabaseTracker::origins):
(WebCore::DatabaseTracker::databaseNames):
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
(WebCore::DatabaseTracker::setDatabaseDetails):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::openDatabases):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):
(WebCore::DatabaseTracker::originLockFor):
(WebCore::DatabaseTracker::quota):
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::deleteDatabaseFile):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
(WebCore::SQLCallbackWrapper::unwrap):
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::enqueueStatement):
(WebCore::SQLTransaction::checkAndHandleClosedDatabase):
(WebCore::SQLTransaction::getNextStatement):
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::doCleanup):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::clear):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::createSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateNodeProperty):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::focusedNode):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtree):
(WebCore::AXIsolatedTree::applyPendingChanges):
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::scrollingNodeForPoint):
(ScrollingTreeMac::eventListenerRegionTypesForPoint const):
* platform/AbortableTaskQueue.h:
* platform/audio/cocoa/CARingBuffer.cpp:
(WebCore::CARingBufferStorageVector::flush):
(WebCore::CARingBufferStorageVector::setCurrentFrameBounds):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::addToMap):
(WebCore::AVFWrapper::removeFromMap const):
(WebCore::AVFWrapper::periodicTimeObserverCallback):
(WebCore::AVFWrapper::processNotification):
(WebCore::AVFWrapper::loadPlayableCompletionCallback):
(WebCore::AVFWrapper::loadMetadataCompletionCallback):
(WebCore::AVFWrapper::seekCompletedCallback):
(WebCore::AVFWrapper::processCue):
(WebCore::AVFWrapper::legibleOutputCallback):
(WebCore::AVFWrapper::processShouldWaitForLoadingOfResource):
(WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]):
(-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]):
(-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
(WebCore::ImageDecoderAVFObjC::setTrack):
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::createFrameImageAtIndex):
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::handleSample):
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
* platform/graphics/gstreamer/MainThreadNotifier.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage):
(WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::start):
(VideoRenderRequestScheduler::stop):
(VideoRenderRequestScheduler::drain):
(VideoRenderRequestScheduler::requestRender):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformInPlace):
(sinkEventHandler):
(webKitMediaCommonEncryptionDecryptIsFlushing):
(setContext):
* platform/graphics/nicosia/NicosiaBuffer.cpp:
(Nicosia::Buffer::beginPainting):
(Nicosia::Buffer::completePainting):
(Nicosia::Buffer::waitUntilPaintingComplete):
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
(Nicosia::PlatformLayer::setSceneIntegration):
(Nicosia::PlatformLayer::createUpdateScope):
(Nicosia::CompositionLayer::updateState):
(Nicosia::CompositionLayer::flushState):
(Nicosia::CompositionLayer::commitState):
(Nicosia::CompositionLayer::accessPending):
(Nicosia::CompositionLayer::accessCommitted):
* platform/graphics/nicosia/NicosiaScene.h:
(Nicosia::Scene::accessState):
* platform/graphics/nicosia/NicosiaSceneIntegration.cpp:
(Nicosia::SceneIntegration::setClient):
(Nicosia::SceneIntegration::invalidate):
(Nicosia::SceneIntegration::requestUpdate):
* platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp:
(Nicosia::BackingStoreTextureMapperImpl::flushUpdate):
(Nicosia::BackingStoreTextureMapperImpl::takeUpdate):
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
(Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl):
(Nicosia::ContentLayerTextureMapperImpl::invalidateClient):
(Nicosia::ContentLayerTextureMapperImpl::flushUpdate):
(Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded):
* platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp:
(Nicosia::ImageBackingTextureMapperImpl::flushUpdate):
(Nicosia::ImageBackingTextureMapperImpl::takeUpdate):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::load):
(WebCore::MediaPlayerPrivateMediaFoundation::naturalSize const):
(WebCore::MediaPlayerPrivateMediaFoundation::addListener):
(WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
(WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
(WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
(WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice):
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameBytesAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
(WebCore::ScalableImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ScalableImageDecoder.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::setTilesOpaque):
(WebCore::LegacyTileCache::doLayoutTiles):
(WebCore::LegacyTileCache::setCurrentScale):
(WebCore::LegacyTileCache::commitScaleChange):
(WebCore::LegacyTileCache::layoutTilesNow):
(WebCore::LegacyTileCache::layoutTilesNowForRect):
(WebCore::LegacyTileCache::removeAllNonVisibleTiles):
(WebCore::LegacyTileCache::removeAllTiles):
(WebCore::LegacyTileCache::removeForegroundTiles):
(WebCore::LegacyTileCache::setContentReplacementImage):
(WebCore::LegacyTileCache::contentReplacementImage const):
(WebCore::LegacyTileCache::tileCreationTimerFired):
(WebCore::LegacyTileCache::setNeedsDisplayInRect):
(WebCore::LegacyTileCache::updateTilingMode):
(WebCore::LegacyTileCache::setTilingMode):
(WebCore::LegacyTileCache::doPendingRepaints):
(WebCore::LegacyTileCache::flushSavedDisplayRects):
(WebCore::LegacyTileCache::prepareToDraw):
* platform/ios/LegacyTileLayerPool.mm:
(WebCore::LegacyTileLayerPool::addLayer):
(WebCore::LegacyTileLayerPool::takeLayerWithSize):
(WebCore::LegacyTileLayerPool::setCapacity):
(WebCore::LegacyTileLayerPool::prune):
(WebCore::LegacyTileLayerPool::drain):
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow setExposedScrollViewRect:]):
(-[WAKWindow exposedScrollViewRect]):
* platform/ios/wak/WebCoreThread.mm:
(RunWebThread):
(StartWebThread):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::openNextStream):
(WebCore::formFinalize):
(WebCore::formClose):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setRequestPaused):
(WebCore::CurlRequest::setCallbackPaused):
(WebCore::CurlRequest::pausedStatusChanged):
(WebCore::CurlRequest::enableDownloadToFile):
(WebCore::CurlRequest::getDownloadedFilePath):
(WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
(WebCore::CurlRequest::closeDownloadFile):
(WebCore::CurlRequest::cleanupDownloadFile):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost):
(WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const):
(WebCore::CurlSSLHandle::setClientCertificateInfo):
(WebCore::CurlSSLHandle::getSSLClientCertificate const):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::close):
(WebCore::SQLiteDatabase::maximumSize):
(WebCore::SQLiteDatabase::setMaximumSize):
(WebCore::SQLiteDatabase::pageSize):
(WebCore::SQLiteDatabase::freeSpaceSize):
(WebCore::SQLiteDatabase::totalSize):
(WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
(WebCore::SQLiteDatabase::interrupt):
(WebCore::SQLiteDatabase::setAuthorizer):
(WebCore::constructAndPrepareStatement):
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::step):

Source/WebKit:

* NetworkProcess/IndexedDB/WebIDBServer.cpp:
(WebKit::m_closeCallback):
(WebKit::WebIDBServer::getOrigins):
(WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince):
(WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins):
(WebKit::WebIDBServer::renameOrigin):
(WebKit::WebIDBServer::openDatabase):
(WebKit::WebIDBServer::deleteDatabase):
(WebKit::WebIDBServer::abortTransaction):
(WebKit::WebIDBServer::commitTransaction):
(WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBServer::createObjectStore):
(WebKit::WebIDBServer::deleteObjectStore):
(WebKit::WebIDBServer::renameObjectStore):
(WebKit::WebIDBServer::clearObjectStore):
(WebKit::WebIDBServer::createIndex):
(WebKit::WebIDBServer::deleteIndex):
(WebKit::WebIDBServer::renameIndex):
(WebKit::WebIDBServer::putOrAdd):
(WebKit::WebIDBServer::getRecord):
(WebKit::WebIDBServer::getAllRecords):
(WebKit::WebIDBServer::getCount):
(WebKit::WebIDBServer::deleteRecord):
(WebKit::WebIDBServer::openCursor):
(WebKit::WebIDBServer::iterateCursor):
(WebKit::WebIDBServer::establishTransaction):
(WebKit::WebIDBServer::databaseConnectionPendingClose):
(WebKit::WebIDBServer::databaseConnectionClosed):
(WebKit::WebIDBServer::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBServer::didFireVersionChangeEvent):
(WebKit::WebIDBServer::openDBRequestCancelled):
(WebKit::WebIDBServer::getAllDatabaseNamesAndVersions):
(WebKit::WebIDBServer::addConnection):
(WebKit::WebIDBServer::removeConnection):
(WebKit::WebIDBServer::close):
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::writeSizeFile):
(WebKit::CacheStorage::Engine::readSizeFile):
(WebKit::CacheStorage::Engine::clearAllCachesFromDisk):
(WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread):
* NetworkProcess/glib/DNSCache.cpp:
(WebKit::DNSCache::lookup):
(WebKit::DNSCache::update):
(WebKit::DNSCache::removeExpiredResponsesFired):
(WebKit::DNSCache::clear):
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::suspend):
(WebKit::CompositingRunLoop::resume):
(WebKit::CompositingRunLoop::scheduleUpdate):
(WebKit::CompositingRunLoop::stopUpdates):
(WebKit::CompositingRunLoop::updateTimerFired):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::m_displayRefreshMonitor):
(WebKit::ThreadedCompositor::setScaleFactor):
(WebKit::ThreadedCompositor::setScrollPosition):
(WebKit::ThreadedCompositor::setViewportSize):
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
(WebKit::ThreadedCompositor::updateSceneState):
* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::populatePageURLToIconURLMap):
(WebKit::IconDatabase::clearLoadedIconsTimerFired):
(WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded):
(WebKit::IconDatabase::loadIconForPageURL):
(WebKit::IconDatabase::iconURLForPageURL):
(WebKit::IconDatabase::setIconForPageURL):
(WebKit::IconDatabase::clear):

Source/WebKitLegacy:

* Storage/InProcessIDBServer.cpp:
(InProcessIDBServer::InProcessIDBServer):
(InProcessIDBServer::deleteDatabase):
(InProcessIDBServer::openDatabase):
(InProcessIDBServer::abortTransaction):
(InProcessIDBServer::commitTransaction):
(InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
(InProcessIDBServer::createObjectStore):
(InProcessIDBServer::deleteObjectStore):
(InProcessIDBServer::renameObjectStore):
(InProcessIDBServer::clearObjectStore):
(InProcessIDBServer::createIndex):
(InProcessIDBServer::deleteIndex):
(InProcessIDBServer::renameIndex):
(InProcessIDBServer::putOrAdd):
(InProcessIDBServer::getRecord):
(InProcessIDBServer::getAllRecords):
(InProcessIDBServer::getCount):
(InProcessIDBServer::deleteRecord):
(InProcessIDBServer::openCursor):
(InProcessIDBServer::iterateCursor):
(InProcessIDBServer::establishTransaction):
(InProcessIDBServer::databaseConnectionPendingClose):
(InProcessIDBServer::databaseConnectionClosed):
(InProcessIDBServer::abortOpenAndUpgradeNeeded):
(InProcessIDBServer::didFireVersionChangeEvent):
(InProcessIDBServer::openDBRequestCancelled):
(InProcessIDBServer::getAllDatabaseNamesAndVersions):
(InProcessIDBServer::closeAndDeleteDatabasesModifiedSince):
* Storage/StorageAreaSync.cpp:
(WebKit::StorageAreaSync::syncTimerFired):
(WebKit::StorageAreaSync::performSync):
* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::finishedImportingOriginIdentifiers):
(WebKit::StorageTracker::syncImportOriginIdentifiers):
(WebKit::StorageTracker::syncFileSystemAndTrackerDatabase):
(WebKit::StorageTracker::setOriginDetails):
(WebKit::StorageTracker::syncSetOriginDetails):
(WebKit::StorageTracker::origins):
(WebKit::StorageTracker::deleteAllOrigins):
(WebKit::StorageTracker::syncDeleteAllOrigins):
(WebKit::StorageTracker::deleteOrigin):
(WebKit::StorageTracker::syncDeleteOrigin):
(WebKit::StorageTracker::canDeleteOrigin):
(WebKit::StorageTracker::cancelDeletingOrigin):
(WebKit::StorageTracker::diskUsageForOrigin):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _synchronizeCustomFixedPositionLayoutRect]):
(-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]):
(-[WebView _setCustomFixedPositionLayoutRect:]):
(-[WebView _fetchCustomFixedPositionLayoutRect:]):

Source/WebKitLegacy/win:

* Plugins/PluginMainThreadScheduler.cpp:
(WebCore::PluginMainThreadScheduler::scheduleCall):
(WebCore::PluginMainThreadScheduler::registerPlugin):
(WebCore::PluginMainThreadScheduler::unregisterPlugin):
(WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):

Source/WTF:

* benchmarks/LockSpeedTest.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::~AutomaticThread):
(WTF::AutomaticThread::join):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocator::addFreshFreeSpace):
(WTF::MetaAllocator::debugFreeSpaceSize):
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient):
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::setTask):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::doSomeHelping):
(WTF::ParallelHelperClient::runTask):
(WTF::ParallelHelperPool::~ParallelHelperPool):
(WTF::ParallelHelperPool::ensureThreads):
(WTF::ParallelHelperPool::doSomeHelping):
* wtf/Seconds.cpp:
(WTF::sleep):
* wtf/TimeWithDynamicClockType.cpp:
(WTF::sleep):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
(WTF::WorkerPool::~WorkerPool):
(WTF::WorkerPool::postTask):
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
* wtf/win/DbgHelperWin.cpp:
(WTF::DbgHelper::SymFromAddress):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):

Tools:

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp:
(TestWebKitAPI::DeterministicScheduler::ThreadContext::waitMyTurn):
(TestWebKitAPI::DeterministicScheduler::ThreadContext::yieldToThread):

Canonical link: https://commits.webkit.org/238046@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed May 22, 2021
1 parent 5b1b238 commit db20ed51e05e48b5c96551ad64a5d5474863fd11
Showing 120 changed files with 1,312 additions and 601 deletions.
@@ -95,21 +95,21 @@ struct JSCallbackObjectData {

void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value)
{
LockHolder locker(m_lock);
Locker locker { m_lock };
WriteBarrier<Unknown> empty;
m_propertyMap.add(propertyName.impl(), empty).iterator->value.set(vm, owner, value);
}

void deletePrivateProperty(const Identifier& propertyName)
{
LockHolder locker(m_lock);
Locker locker { m_lock };
m_propertyMap.remove(propertyName.impl());
}

template<typename Visitor>
void visitChildren(Visitor& visitor)
{
LockHolder locker(m_lock);
Locker locker { m_lock };
for (auto& pair : m_propertyMap) {
if (pair.value)
visitor.append(pair.value);
@@ -1209,7 +1209,7 @@ - (JSValue *)initWithValue:(JSValueRef)value inContext:(JSContext *)context
static StructTagHandler* handerForStructTag(const char* encodedType)
{
static Lock handerForStructTagLock;
LockHolder lockHolder(&handerForStructTagLock);
Locker lockHolder { handerForStructTagLock };

static StructHandlers* structHandlers = createStructHandlerMap();

@@ -765,7 +765,7 @@ int testCAPIViaCpp(const char* filter)
for (;;) {
RefPtr<SharedTask<void(TestAPI&)>> task;
{
LockHolder locker(lock);
Locker locker { lock };
if (tasks.isEmpty())
break;
task = tasks.takeFirst();
@@ -1,3 +1,222 @@
2021-05-21 Chris Dumez <cdumez@apple.com>

Replace LockHolder with Locker in local variables
https://bugs.webkit.org/show_bug.cgi?id=226133

Reviewed by Darin Adler.

Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock
type more easily since the compiler with deduce the lock type T for Locker<T>.

* API/JSCallbackObject.h:
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
* API/JSValue.mm:
(handerForStructTag):
* API/tests/testapi.cpp:
(testCAPIViaCpp):
* assembler/testmasm.cpp:
(JSC::run):
* b3/air/testair.cpp:
* b3/testb3_1.cpp:
(run):
* bytecode/DirectEvalCodeCache.cpp:
(JSC::DirectEvalCodeCache::setSlow):
(JSC::DirectEvalCodeCache::clear):
(JSC::DirectEvalCodeCache::visitAggregateImpl):
* bytecode/SuperSampler.cpp:
(JSC::initializeSuperSampler):
(JSC::resetSuperSamplerState):
(JSC::printSuperSamplerState):
(JSC::enableSuperSampler):
(JSC::disableSuperSampler):
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::invalidate):
(JSC::DFG::CommonData::~CommonData):
(JSC::DFG::CommonData::installVMTrapBreakpoints):
(JSC::DFG::codeBlockForVMTrapPC):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::cleanMustHandleValuesIfNecessary):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::~Worklist):
(JSC::DFG::Worklist::finishCreation):
(JSC::DFG::Worklist::isActiveForVM const):
(JSC::DFG::Worklist::enqueue):
(JSC::DFG::Worklist::compilationState):
(JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady):
(JSC::DFG::Worklist::removeAllReadyPlansForVM):
(JSC::DFG::Worklist::completeAllReadyPlansForVM):
(JSC::DFG::Worklist::visitWeakReferences):
(JSC::DFG::Worklist::removeDeadPlans):
(JSC::DFG::Worklist::removeNonCompilingPlansForVM):
(JSC::DFG::Worklist::queueLength):
(JSC::DFG::Worklist::dump const):
(JSC::DFG::Worklist::setNumberOfThreads):
* dfg/DFGWorklistInlines.h:
(JSC::DFG::Worklist::iterateCodeBlocksForGC):
* disassembler/Disassembler.cpp:
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::addBlock):
* heap/CodeBlockSetInlines.h:
(JSC::CodeBlockSet::iterateCurrentlyExecuting):
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::add):
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::collectAsync):
(JSC::Heap::runBeginPhase):
(JSC::Heap::waitForCollector):
(JSC::Heap::requestCollection):
(JSC::Heap::notifyIsSafeToCollect):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didReachTermination):
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::startTracking):
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
(Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting):
* inspector/remote/RemoteConnectionToTarget.cpp:
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::sendMessageToTarget):
(Inspector::RemoteConnectionToTarget::close):
(Inspector::RemoteConnectionToTarget::targetClosed):
* inspector/remote/RemoteInspector.cpp:
(Inspector::RemoteInspector::registerTarget):
(Inspector::RemoteInspector::unregisterTarget):
(Inspector::RemoteInspector::updateTarget):
(Inspector::RemoteInspector::updateClientCapabilities):
(Inspector::RemoteInspector::setClient):
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::setupCompleted):
(Inspector::RemoteInspector::stop):
* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteTargetHandleRunSourceGlobal):
(Inspector::RemoteTargetQueueTaskOnGlobalQueue):
(Inspector::RemoteTargetHandleRunSourceWithInfo):
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::targetClosed):
(Inspector::RemoteConnectionToTarget::close):
(Inspector::RemoteConnectionToTarget::sendMessageToTarget):
(Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop):
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::setParentProcessInformation):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
* inspector/remote/cocoa/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::closeFromMessage):
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
(Inspector::RemoteInspectorXPCConnection::handleEvent):
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::setupConnection):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::receivedGetTargetListMessage):
(Inspector::RemoteInspector::receivedDataMessage):
(Inspector::RemoteInspector::receivedCloseMessage):
(Inspector::RemoteInspector::setup):
* inspector/remote/socket/RemoteInspectorConnectionClient.cpp:
(Inspector::RemoteInspectorConnectionClient::didReceive):
* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::didClose):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::setup):
(Inspector::RemoteInspector::setupInspectorClient):
(Inspector::RemoteInspector::frontendDidClose):
(Inspector::RemoteInspector::sendMessageToBackend):
(Inspector::RemoteInspector::startAutomationSession):
* inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp:
(Inspector::RemoteInspectorSocketEndpoint::listenInet):
(Inspector::RemoteInspectorSocketEndpoint::isListening):
(Inspector::RemoteInspectorSocketEndpoint::workerThread):
(Inspector::RemoteInspectorSocketEndpoint::createClient):
(Inspector::RemoteInspectorSocketEndpoint::disconnect):
(Inspector::RemoteInspectorSocketEndpoint::invalidateClient):
(Inspector::RemoteInspectorSocketEndpoint::invalidateListener):
(Inspector::RemoteInspectorSocketEndpoint::getPort const):
(Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled):
(Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled):
(Inspector::RemoteInspectorSocketEndpoint::send):
(Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled):
* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::addToCommittedByteCount):
(JSC::CLoopStack::committedByteCount):
* jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):
* jit/ICStats.cpp:
(JSC::ICStats::ICStats):
(JSC::ICStats::~ICStats):
* jit/JITThunks.cpp:
(JSC::JITThunks::ctiStub):
(JSC::JITThunks::existingCTIStub):
(JSC::JITThunks::ctiSlowPathFunctionStub):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::Plan::compileInThread):
(JSC::JITWorklist::Plan::isFinishedCompiling):
(JSC::JITWorklist::JITWorklist):
(JSC::JITWorklist::completeAllForVM):
(JSC::JITWorklist::poll):
(JSC::JITWorklist::compileLater):
(JSC::JITWorklist::finalizePlans):
* parser/SourceProvider.cpp:
(JSC::SourceProvider::getID):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::ensureBytecodesFor):
(JSC::Profiler::Database::notifyDestruction):
(JSC::Profiler::Database::addCompilation):
(JSC::Profiler::Database::logEvent):
(JSC::Profiler::Database::addDatabaseToAtExit):
(JSC::Profiler::Database::removeDatabaseFromAtExit):
(JSC::Profiler::Database::removeFirstAtExitDatabase):
* profiler/ProfilerUID.cpp:
(JSC::Profiler::UID::create):
* runtime/DeferredWorkTimer.cpp:
(JSC::DeferredWorkTimer::scheduleWorkSoon):
(JSC::DeferredWorkTimer::didResumeScriptExecutionOwner):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::timerLoop):
(JSC::SamplingProfiler::shutdown):
(JSC::SamplingProfiler::start):
(JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread):
(JSC::SamplingProfiler::noticeJSLockAcquisition):
(JSC::SamplingProfiler::noticeVMEntry):
(JSC::SamplingProfiler::registerForReportAtExit):
* runtime/Watchdog.cpp:
(JSC::Watchdog::startTimer):
(JSC::Watchdog::willDestroyVM):
* tools/VMInspector.cpp:
(JSC::VMInspector::isValidExecutableMemory):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::work):
* wasm/WasmEntryPlan.cpp:
(JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder):
(JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::waitForCompletion):
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmSignature.cpp:
(JSC::Wasm::SignatureInformation::signatureFor):
(JSC::Wasm::SignatureInformation::tryCleanup):
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::enqueue):
(JSC::Wasm::Worklist::completePlanSynchronously):
(JSC::Wasm::Worklist::stopAllPlansForContext):
(JSC::Wasm::Worklist::Worklist):
(JSC::Wasm::Worklist::~Worklist):

2021-05-21 Chris Dumez <cdumez@apple.com>

Stop using holdLock() in JSC as it is not compatible with Clang thread safety analysis
@@ -2724,7 +2724,7 @@ void run(const char* filter)
for (;;) {
RefPtr<SharedTask<void()>> task;
{
LockHolder locker(lock);
Locker locker { lock };
if (tasks.isEmpty())
return;
task = tasks.takeFirst();
@@ -129,7 +129,7 @@ void loadConstantImpl(BasicBlock* block, T value, B3::Air::Opcode move, Tmp tmp,
static Lock lock;
static StdMap<T, T*>* map; // I'm not messing with HashMap's problems with integers.

LockHolder locker(lock);
Locker locker { lock };
if (!map)
map = new StdMap<T, T*>();

@@ -2469,7 +2469,7 @@ void run(const char* filter)
for (;;) {
RefPtr<SharedTask<void()>> task;
{
LockHolder locker(lock);
Locker locker { lock };
if (tasks.isEmpty())
return;
task = tasks.takeFirst();
@@ -867,7 +867,7 @@ void run(const char* filter)
for (;;) {
RefPtr<SharedTask<void()>> task;
{
LockHolder locker(lock);
Locker locker { lock };
if (tasks.isEmpty())
return;
task = tasks.takeFirst();
@@ -35,20 +35,20 @@ void DirectEvalCodeCache::setSlow(JSGlobalObject* globalObject, JSCell* owner, c
if (!evalExecutable->allowDirectEvalCache())
return;

LockHolder locker(m_lock);
Locker locker { m_lock };
m_cacheMap.set(CacheKey(evalSource, callSiteIndex), WriteBarrier<DirectEvalExecutable>(globalObject->vm(), owner, evalExecutable));
}

void DirectEvalCodeCache::clear()
{
LockHolder locker(m_lock);
Locker locker { m_lock };
m_cacheMap.clear();
}

template<typename Visitor>
void DirectEvalCodeCache::visitAggregateImpl(Visitor& visitor)
{
LockHolder locker(m_lock);
Locker locker { m_lock };
EvalCacheMap::iterator end = m_cacheMap.end();
for (EvalCacheMap::iterator ptr = m_cacheMap.begin(); ptr != end; ++ptr)
visitor.append(ptr->value);
@@ -53,7 +53,7 @@ void initializeSuperSampler()
for (;;) {
for (int ms = 0; ms < printingPeriod; ms += sleepQuantum) {
if (g_superSamplerEnabled) {
LockHolder locker(lock);
Locker locker { lock };
if (g_superSamplerCount)
in++;
else
@@ -70,7 +70,7 @@ void initializeSuperSampler()

void resetSuperSamplerState()
{
LockHolder locker(lock);
Locker locker { lock };
in = 0;
out = 0;
}
@@ -80,7 +80,7 @@ void printSuperSamplerState()
if (!Options::useSuperSampler())
return;

LockHolder locker(lock);
Locker locker { lock };
double percentage = 100.0 * in / (in + out);
if (percentage != percentage)
percentage = 0.0;
@@ -89,13 +89,13 @@ void printSuperSamplerState()

void enableSuperSampler()
{
LockHolder locker(lock);
Locker locker { lock };
g_superSamplerEnabled = true;
}

void disableSuperSampler()
{
LockHolder locker(lock);
Locker locker { lock };
g_superSamplerEnabled = false;
}

0 comments on commit db20ed5

Please sign in to comment.