haikuwebkit/Source/JavaScriptCore/dfg/DFGCommonData.cpp

180 lines
5.9 KiB
C++
Raw Permalink Normal View History

fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
/*
Refactoring: make DFG::Plan a class. https://bugs.webkit.org/show_bug.cgi?id=187968 Reviewed by Saam Barati. This patch makes all the DFG::Plan fields private, and provide accessor methods for them. This makes it easier to reason about how these fields are used and modified. * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleVarargsCall): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::handleIntrinsicCall): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): (JSC::DFG::ByteCodeParser::handleModuleNamespaceLoad): (JSC::DFG::ByteCodeParser::handleGetById): (JSC::DFG::ByteCodeParser::handlePutById): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): (JSC::DFG::ByteCodeParser::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): (JSC::DFG::CFAPhase::injectOSR): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::notifyCompilingStructureTransition): * dfg/DFGCommonData.h: * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDriver.cpp: (JSC::DFG::compileImpl): * dfg/DFGFinalizer.h: * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixupCompareStrictEqAndSameValue): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::watchCondition): (JSC::DFG::Graph::inferredTypeFor): (JSC::DFG::Graph::requiredRegisterCountForExit): (JSC::DFG::Graph::registerFrozenValues): (JSC::DFG::Graph::registerStructure): (JSC::DFG::Graph::registerAndWatchStructureTransition): (JSC::DFG::Graph::assertIsRegistered): * dfg/DFGGraph.h: (JSC::DFG::Graph::compilation): (JSC::DFG::Graph::identifiers): (JSC::DFG::Graph::watchpoints): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): (JSC::DFG::JITCompiler::disassemble): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::addWeakReference): * dfg/DFGJITFinalizer.cpp: (JSC::DFG::JITFinalizer::finalize): (JSC::DFG::JITFinalizer::finalizeFunction): (JSC::DFG::JITFinalizer::finalizeCommon): * dfg/DFGOSREntrypointCreationPhase.cpp: (JSC::DFG::OSREntrypointCreationPhase::run): * dfg/DFGPhase.cpp: (JSC::DFG::Phase::beginPhase): * dfg/DFGPhase.h: (JSC::DFG::runAndLog): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::computeCompileTimes const): (JSC::DFG::Plan::reportCompileTimes const): (JSC::DFG::Plan::compileInThread): (JSC::DFG::Plan::compileInThreadImpl): (JSC::DFG::Plan::isStillValid): (JSC::DFG::Plan::reallyAdd): (JSC::DFG::Plan::notifyCompiling): (JSC::DFG::Plan::notifyReady): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): (JSC::DFG::Plan::finalizeAndNotifyCallback): (JSC::DFG::Plan::key): (JSC::DFG::Plan::checkLivenessAndVisitChildren): (JSC::DFG::Plan::finalizeInGC): (JSC::DFG::Plan::isKnownToBeLiveDuringGC): (JSC::DFG::Plan::cancel): (JSC::DFG::Plan::cleanMustHandleValuesIfNecessary): * dfg/DFGPlan.h: (JSC::DFG::Plan::canTierUpAndOSREnter const): (JSC::DFG::Plan::vm const): (JSC::DFG::Plan::codeBlock): (JSC::DFG::Plan::mode const): (JSC::DFG::Plan::osrEntryBytecodeIndex const): (JSC::DFG::Plan::mustHandleValues const): (JSC::DFG::Plan::threadData const): (JSC::DFG::Plan::compilation const): (JSC::DFG::Plan::finalizer const): (JSC::DFG::Plan::setFinalizer): (JSC::DFG::Plan::inlineCallFrames const): (JSC::DFG::Plan::watchpoints): (JSC::DFG::Plan::identifiers): (JSC::DFG::Plan::weakReferences): (JSC::DFG::Plan::transitions): (JSC::DFG::Plan::recordedStatuses): (JSC::DFG::Plan::willTryToTierUp const): (JSC::DFG::Plan::setWillTryToTierUp): (JSC::DFG::Plan::tierUpInLoopHierarchy): (JSC::DFG::Plan::tierUpAndOSREnterBytecodes): (JSC::DFG::Plan::stage const): (JSC::DFG::Plan::callback const): (JSC::DFG::Plan::setCallback): * dfg/DFGPlanInlines.h: (JSC::DFG::Plan::iterateCodeBlocksForGC): * dfg/DFGPreciseLocalClobberize.h: (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): * dfg/DFGPredictionInjectionPhase.cpp: (JSC::DFG::PredictionInjectionPhase::run): * dfg/DFGSafepoint.cpp: (JSC::DFG::Safepoint::Safepoint): (JSC::DFG::Safepoint::~Safepoint): (JSC::DFG::Safepoint::begin): * dfg/DFGSafepoint.h: * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPointer): (JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPoisonedPointer): * dfg/DFGStackLayoutPhase.cpp: (JSC::DFG::StackLayoutPhase::run): * dfg/DFGStrengthReductionPhase.cpp: (JSC::DFG::StrengthReductionPhase::handleNode): * dfg/DFGTierUpCheckInjectionPhase.cpp: (JSC::DFG::TierUpCheckInjectionPhase::run): * dfg/DFGTypeCheckHoistingPhase.cpp: (JSC::DFG::TypeCheckHoistingPhase::disableHoistingAcrossOSREntries): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::isActiveForVM const): (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): * dfg/DFGWorklistInlines.h: (JSC::DFG::Worklist::iterateCodeBlocksForGC): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLFail.cpp: (JSC::FTL::fail): * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeCommon): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::buildExitArguments): (JSC::FTL::DFG::LowerDFGToB3::addWeakReference): * ftl/FTLState.cpp: (JSC::FTL::State::State): Canonical link: https://commits.webkit.org/203152@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-24 23:14:12 +00:00
* Copyright (C) 2013-2018 Apple Inc. All rights reserved.
fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
Move back primary header includes next to config.h https://bugs.webkit.org/show_bug.cgi?id=128912 Reviewed by Alexey Proskuryakov. * dfg/DFGAbstractHeap.cpp: * dfg/DFGAbstractValue.cpp: * dfg/DFGArgumentsSimplificationPhase.cpp: * dfg/DFGArithMode.cpp: * dfg/DFGArrayMode.cpp: * dfg/DFGAtTailAbstractState.cpp: * dfg/DFGAvailability.cpp: * dfg/DFGBackwardsPropagationPhase.cpp: * dfg/DFGBasicBlock.cpp: * dfg/DFGBinarySwitch.cpp: * dfg/DFGBlockInsertionSet.cpp: * dfg/DFGByteCodeParser.cpp: * dfg/DFGCFAPhase.cpp: * dfg/DFGCFGSimplificationPhase.cpp: * dfg/DFGCPSRethreadingPhase.cpp: * dfg/DFGCSEPhase.cpp: * dfg/DFGCapabilities.cpp: * dfg/DFGClobberSet.cpp: * dfg/DFGClobberize.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dfg/DFGCompilationKey.cpp: * dfg/DFGCompilationMode.cpp: * dfg/DFGConstantFoldingPhase.cpp: * dfg/DFGCriticalEdgeBreakingPhase.cpp: * dfg/DFGDCEPhase.cpp: * dfg/DFGDesiredIdentifiers.cpp: * dfg/DFGDesiredStructureChains.cpp: * dfg/DFGDesiredTransitions.cpp: * dfg/DFGDesiredWatchpoints.cpp: * dfg/DFGDesiredWeakReferences.cpp: * dfg/DFGDesiredWriteBarriers.cpp: * dfg/DFGDisassembler.cpp: * dfg/DFGDominators.cpp: * dfg/DFGEdge.cpp: * dfg/DFGFailedFinalizer.cpp: * dfg/DFGFinalizer.cpp: * dfg/DFGFixupPhase.cpp: * dfg/DFGFlushFormat.cpp: * dfg/DFGFlushLivenessAnalysisPhase.cpp: * dfg/DFGFlushedAt.cpp: * dfg/DFGGraph.cpp: * dfg/DFGGraphSafepoint.cpp: * dfg/DFGInPlaceAbstractState.cpp: * dfg/DFGIntegerCheckCombiningPhase.cpp: * dfg/DFGInvalidationPointInjectionPhase.cpp: * dfg/DFGJITCode.cpp: * dfg/DFGJITCompiler.cpp: * dfg/DFGJITFinalizer.cpp: * dfg/DFGJumpReplacement.cpp: * dfg/DFGLICMPhase.cpp: * dfg/DFGLazyJSValue.cpp: * dfg/DFGLivenessAnalysisPhase.cpp: * dfg/DFGLongLivedState.cpp: * dfg/DFGLoopPreHeaderCreationPhase.cpp: * dfg/DFGMinifiedNode.cpp: * dfg/DFGNaturalLoops.cpp: * dfg/DFGNode.cpp: * dfg/DFGNodeFlags.cpp: * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: * dfg/DFGOSREntry.cpp: * dfg/DFGOSREntrypointCreationPhase.cpp: * dfg/DFGOSRExit.cpp: * dfg/DFGOSRExitBase.cpp: * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: * dfg/DFGOSRExitCompiler64.cpp: * dfg/DFGOSRExitCompilerCommon.cpp: * dfg/DFGOSRExitJumpPlaceholder.cpp: * dfg/DFGOSRExitPreparation.cpp: * dfg/DFGPhase.cpp: * dfg/DFGPlan.cpp: * dfg/DFGPredictionInjectionPhase.cpp: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGResurrectionForValidationPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: * dfg/DFGSSALoweringPhase.cpp: * dfg/DFGSafepoint.cpp: * dfg/DFGSpeculativeJIT.cpp: * dfg/DFGSpeculativeJIT32_64.cpp: * dfg/DFGSpeculativeJIT64.cpp: * dfg/DFGStackLayoutPhase.cpp: * dfg/DFGStoreBarrierElisionPhase.cpp: * dfg/DFGStrengthReductionPhase.cpp: * dfg/DFGThreadData.cpp: * dfg/DFGThunks.cpp: * dfg/DFGTierUpCheckInjectionPhase.cpp: * dfg/DFGToFTLDeferredCompilationCallback.cpp: * dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp: * dfg/DFGTypeCheckHoistingPhase.cpp: * dfg/DFGUnificationPhase.cpp: * dfg/DFGUseKind.cpp: * dfg/DFGValidate.cpp: * dfg/DFGValueSource.cpp: * dfg/DFGVariableAccessDataDump.cpp: * dfg/DFGVariableEvent.cpp: * dfg/DFGVariableEventStream.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: * dfg/DFGWatchpointCollectionPhase.cpp: * dfg/DFGWorklist.cpp: * heap/JITStubRoutineSet.cpp: * jit/GCAwareJITStubRoutine.cpp: * jit/JIT.cpp: * jit/JITDisassembler.cpp: * jit/JITOperations.cpp: * jit/JITStubRoutine.cpp: * jit/JITStubs.cpp: * jit/TempRegisterSet.cpp: Canonical link: https://commits.webkit.org/146953@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-02-17 19:00:03 +00:00
#include "DFGCommonData.h"
fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
#if ENABLE(DFG_JIT)
Unreviewed, roll out http://trac.webkit.org/changeset/163796 The change was not justified in any way and it has a net negative effect on the code. * dfg/DFGAbstractInterpreter.h: * dfg/DFGAbstractValue.h: * dfg/DFGAdjacencyList.h: * dfg/DFGArgumentPosition.h: * dfg/DFGArgumentsSimplificationPhase.cpp: * dfg/DFGArrayMode.cpp: * dfg/DFGArrayifySlowPathGenerator.h: * dfg/DFGAtTailAbstractState.h: * dfg/DFGAvailability.h: * dfg/DFGBackwardsPropagationPhase.cpp: * dfg/DFGBasicBlock.h: * dfg/DFGBasicBlockInlines.h: * dfg/DFGByteCodeParser.cpp: * dfg/DFGCFAPhase.cpp: * dfg/DFGCFGSimplificationPhase.cpp: * dfg/DFGCPSRethreadingPhase.cpp: * dfg/DFGCSEPhase.cpp: * dfg/DFGCallArrayAllocatorSlowPathGenerator.h: * dfg/DFGCapabilities.cpp: * dfg/DFGCapabilities.h: * dfg/DFGClobberize.h: * dfg/DFGCommonData.cpp: * dfg/DFGConstantFoldingPhase.cpp: * dfg/DFGCriticalEdgeBreakingPhase.cpp: * dfg/DFGDCEPhase.cpp: * dfg/DFGDominators.h: * dfg/DFGDriver.cpp: * dfg/DFGDriver.h: * dfg/DFGFixupPhase.cpp: * dfg/DFGFlushLivenessAnalysisPhase.cpp: * dfg/DFGGenerationInfo.h: * dfg/DFGGraph.cpp: * dfg/DFGGraph.h: * dfg/DFGInPlaceAbstractState.cpp: * dfg/DFGInPlaceAbstractState.h: * dfg/DFGInlineCacheWrapperInlines.h: * dfg/DFGInvalidationPointInjectionPhase.cpp: * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: * dfg/DFGJITCompiler.h: * dfg/DFGJITFinalizer.cpp: * dfg/DFGJITFinalizer.h: * dfg/DFGLICMPhase.cpp: * dfg/DFGLivenessAnalysisPhase.cpp: * dfg/DFGLoopPreHeaderCreationPhase.cpp: * dfg/DFGMinifiedNode.h: * dfg/DFGNaturalLoops.h: * dfg/DFGNode.cpp: * dfg/DFGNode.h: * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: * dfg/DFGOSREntry.cpp: * dfg/DFGOSREntrypointCreationPhase.cpp: * dfg/DFGOSRExit.cpp: * dfg/DFGOSRExit.h: * dfg/DFGOSRExitBase.cpp: * dfg/DFGOSRExitCompilationInfo.h: * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: * dfg/DFGOSRExitCompiler64.cpp: * dfg/DFGOSRExitJumpPlaceholder.cpp: * dfg/DFGOperations.cpp: * dfg/DFGPhase.h: * dfg/DFGPlan.h: * dfg/DFGPredictionInjectionPhase.cpp: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGResurrectionForValidationPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: * dfg/DFGSSALoweringPhase.cpp: * dfg/DFGSaneStringGetByValSlowPathGenerator.h: * dfg/DFGSlowPathGenerator.h: * dfg/DFGSpeculativeJIT.cpp: * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: * dfg/DFGSpeculativeJIT64.cpp: * dfg/DFGStackLayoutPhase.cpp: * dfg/DFGStoreBarrierElisionPhase.cpp: * dfg/DFGStrengthReductionPhase.cpp: * dfg/DFGThunks.cpp: * dfg/DFGTierUpCheckInjectionPhase.cpp: * dfg/DFGTypeCheckHoistingPhase.cpp: * dfg/DFGUnificationPhase.cpp: * dfg/DFGValidate.h: * dfg/DFGValueSource.h: * dfg/DFGVariableAccessData.h: * dfg/DFGVariableAccessDataDump.cpp: * dfg/DFGVariableEvent.h: * dfg/DFGVariableEventStream.h: * dfg/DFGVirtualRegisterAllocationPhase.cpp: * dfg/DFGWatchpointCollectionPhase.cpp: * dfg/DFGWorklist.cpp: Canonical link: https://commits.webkit.org/146561@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-02-10 19:26:29 +00:00
#include "CodeBlock.h"
fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
#include "DFGNode.h"
<https://webkit.org/b/119833> Concurrent compilation thread should not trigger WriteBarriers Reviewed by Oliver Hunt. The concurrent compilation thread should interact minimally with the Heap, including not triggering WriteBarriers. This is a prerequisite for generational GC. * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::addOrFindConstant): (JSC::CodeBlock::findConstant): * bytecode/CodeBlock.h: (JSC::CodeBlock::addConstantLazily): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getJSConstantForValue): (JSC::DFG::ByteCodeParser::constantUndefined): (JSC::DFG::ByteCodeParser::constantNull): (JSC::DFG::ByteCodeParser::one): (JSC::DFG::ByteCodeParser::constantNaN): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::notifyCompilingStructureTransition): * dfg/DFGCommonData.h: * dfg/DFGDesiredTransitions.cpp: Added. (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransition::reallyAdd): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::~DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): * dfg/DFGDesiredTransitions.h: Added. * dfg/DFGDesiredWeakReferences.cpp: Added. (JSC::DFG::DesiredWeakReferences::DesiredWeakReferences): (JSC::DFG::DesiredWeakReferences::~DesiredWeakReferences): (JSC::DFG::DesiredWeakReferences::addLazily): (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGDesiredWeakReferences.h: Added. * dfg/DFGDesiredWriteBarriers.cpp: Added. (JSC::DFG::DesiredWriteBarrier::DesiredWriteBarrier): (JSC::DFG::DesiredWriteBarrier::trigger): (JSC::DFG::DesiredWriteBarriers::DesiredWriteBarriers): (JSC::DFG::DesiredWriteBarriers::~DesiredWriteBarriers): (JSC::DFG::DesiredWriteBarriers::addImpl): (JSC::DFG::DesiredWriteBarriers::trigger): * dfg/DFGDesiredWriteBarriers.h: Added. (JSC::DFG::DesiredWriteBarriers::add): (JSC::DFG::initializeLazyWriteBarrier): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::truncateConstantToInt32): * dfg/DFGGraph.h: (JSC::DFG::Graph::convertToConstant): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::addWeakReference): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::reallyAdd): * dfg/DFGPlan.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * runtime/WriteBarrier.h: (JSC::WriteBarrierBase::set): (JSC::WriteBarrier::WriteBarrier): Canonical link: https://commits.webkit.org/137839@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-16 03:28:39 +00:00
#include "DFGPlan.h"
Split InlineCallFrame into its own file https://bugs.webkit.org/show_bug.cgi?id=148131 Reviewed by Saam Barati. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CallLinkStatus.cpp: * bytecode/CodeBlock.h: (JSC::ExecState::r): (JSC::baselineCodeBlockForInlineCallFrame): Deleted. (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): Deleted. * bytecode/CodeOrigin.cpp: (JSC::CodeOrigin::inlineStack): (JSC::CodeOrigin::codeOriginOwner): (JSC::CodeOrigin::stackOffset): (JSC::CodeOrigin::dump): (JSC::CodeOrigin::dumpInContext): (JSC::InlineCallFrame::calleeConstant): Deleted. (JSC::InlineCallFrame::visitAggregate): Deleted. (JSC::InlineCallFrame::calleeForCallFrame): Deleted. (JSC::InlineCallFrame::hash): Deleted. (JSC::InlineCallFrame::hashAsStringIfPossible): Deleted. (JSC::InlineCallFrame::inferredName): Deleted. (JSC::InlineCallFrame::baselineCodeBlock): Deleted. (JSC::InlineCallFrame::dumpBriefFunctionInformation): Deleted. (JSC::InlineCallFrame::dumpInContext): Deleted. (JSC::InlineCallFrame::dump): Deleted. (WTF::printInternal): Deleted. * bytecode/CodeOrigin.h: (JSC::CodeOrigin::deletedMarker): (JSC::CodeOrigin::hash): (JSC::CodeOrigin::operator==): (JSC::CodeOriginHash::hash): (JSC::CodeOriginHash::equal): (JSC::InlineCallFrame::kindFor): Deleted. (JSC::InlineCallFrame::varargsKindFor): Deleted. (JSC::InlineCallFrame::specializationKindFor): Deleted. (JSC::InlineCallFrame::isVarargs): Deleted. (JSC::InlineCallFrame::InlineCallFrame): Deleted. (JSC::InlineCallFrame::specializationKind): Deleted. (JSC::InlineCallFrame::setStackOffset): Deleted. (JSC::InlineCallFrame::callerFrameOffset): Deleted. (JSC::InlineCallFrame::returnPCOffset): Deleted. (JSC::CodeOrigin::stackOffset): Deleted. (JSC::CodeOrigin::codeOriginOwner): Deleted. * bytecode/InlineCallFrame.cpp: Copied from Source/JavaScriptCore/bytecode/CodeOrigin.cpp. (JSC::InlineCallFrame::calleeConstant): (JSC::CodeOrigin::inlineDepthForCallFrame): Deleted. (JSC::CodeOrigin::inlineDepth): Deleted. (JSC::CodeOrigin::isApproximatelyEqualTo): Deleted. (JSC::CodeOrigin::approximateHash): Deleted. (JSC::CodeOrigin::inlineStack): Deleted. (JSC::CodeOrigin::dump): Deleted. (JSC::CodeOrigin::dumpInContext): Deleted. * bytecode/InlineCallFrame.h: Copied from Source/JavaScriptCore/bytecode/CodeOrigin.h. (JSC::InlineCallFrame::isVarargs): (JSC::InlineCallFrame::InlineCallFrame): (JSC::InlineCallFrame::specializationKind): (JSC::baselineCodeBlockForInlineCallFrame): (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): (JSC::CodeOrigin::CodeOrigin): Deleted. (JSC::CodeOrigin::isSet): Deleted. (JSC::CodeOrigin::operator!): Deleted. (JSC::CodeOrigin::isHashTableDeletedValue): Deleted. (JSC::CodeOrigin::operator!=): Deleted. (JSC::CodeOrigin::deletedMarker): Deleted. (JSC::CodeOrigin::stackOffset): Deleted. (JSC::CodeOrigin::hash): Deleted. (JSC::CodeOrigin::operator==): Deleted. (JSC::CodeOrigin::codeOriginOwner): Deleted. (JSC::CodeOriginHash::hash): Deleted. (JSC::CodeOriginHash::equal): Deleted. (JSC::CodeOriginApproximateHash::hash): Deleted. (JSC::CodeOriginApproximateHash::equal): Deleted. * bytecode/InlineCallFrameSet.cpp: * dfg/DFGCommonData.cpp: * dfg/DFGOSRExitBase.cpp: * dfg/DFGVariableEventStream.cpp: * ftl/FTLOperations.cpp: * interpreter/CallFrame.cpp: * interpreter/StackVisitor.cpp: * jit/AssemblyHelpers.h: * profiler/ProfilerOriginStack.cpp: * runtime/ClonedArguments.cpp: Canonical link: https://commits.webkit.org/166243@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-18 18:28:54 +00:00
#include "InlineCallFrame.h"
#include "JSCJSValueInlines.h"
DFG fragile frozen values are fundamentally broken https://bugs.webkit.org/show_bug.cgi?id=146602 Reviewed by Mark Lam. This change gets rid of the FragileValue value strength, because it was fundamentally broken. FragileValue was a value known to the compiler but not tracked by the GC in any way - it wasn't marked and it wasn't weak. This was used to support AI bootstrap for OSR must-handle values. The philosophy was that if the compiler did use the value for optimization, it would have been strengthened to a weak value (or maybe even a strong value, though we probably won't do that). But this was too much of a pipe dream. I've found at least one case where the compiler did use the value, but never strengthened it: it would happen if the value ended up in an OSR entry data expected value. Then if we GCed, we might have killed the value, but OSR entry would still try to use it for validation. That might have sort of just worked, but it's clearly shady. The reason why we made must-handle values fragile and not weak is that most of the time the values disappear from the abstract state: they are LUBed to a non-constant. If we kept them around as weak, we'd have too many cases of the GC killing the code because it thought that the value was somehow meaningful to the code when it was only used as a temporary artifact of optimization. So, it's true that it's very important for must-handle values not to automatically be weak or strong. It's also true that the values are necessary for AI bootstrap because we need to know what values OSR entry will require. But we shouldn't accomplish these goals by having the compiler hold onto what are essentially dangling pointers. This implements a better solution: instead of having InPlaceAbstractState bootstrap the AI with must-handle values at the beginning, we now widen the valuesAtHead of the must-handle block after AI converges. This widening is done in CFAPhase. This allows us to see if the must-handle values are necessary at all. In most cases, the widening takes a non-constant abstract value and simply amends something to its type based on the type of the must-handle value, and so the must-handle value never actually shows up in either the IR or any abstract value. In the unlikely event that the value at head is bottom, we freeze the must-handle value. This change removes FragileValue, and this freezing uses WeakValue as the strength. That makes sense: since the abstract value was bottom, the must-handle value becomes integral to the IR and so it makes no sense for the GC to keep the resulting CodeBlock alive if that must-handle value dies. This will sometimes happen for example if you have a very long-running loop whose pre-header allocates some object, but that pre-header appears to always exit to the optimizing JIT because it was only profiled once in the LLInt and that profiling appears insufficient to the DFG. In that case, we'll effectively constant-fold the references to the object inside the loop, which is both efficient (yay constant folding!) and necessary (otherwise we wouldn't know what the type of the variable should have been). Testing and debugging this is complicated. So, this adds some new capabilities: - DFG IR dumps also dump all of the FrozenValues that point to the heap along with their strengths, so that it's easy to see what GC objects the DFG feels are necessary for the compilation. - DFG OSR entry preparation prints out the OSR entry data structures, so that it's easy to see what GC pointers (and other things) are used for OSR entry validation. The printouts are quite detailed, and should also help other kinds of OSR entry debugging. - DFG::Plan now validates whether all of the GC pointers planted in the various JITCode data structures are also properly registered as either weak or strong pointers in the CodeBlock. This validation check previously failed due to fragile values ending up in the OSR entry data structures, both in the newly added test (dead-osr-entry-value.js) and in some pre-existing tests (like earley-boyer and 3d-raytrace). * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::stronglyVisitStrongReferences): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::visitAggregate): * bytecode/Operands.h: (JSC::Operands::operand): (JSC::Operands::hasOperand): * bytecode/StructureSet.cpp: (JSC::StructureSet::dump): (JSC::StructureSet::validateReferences): * bytecode/StructureSet.h: * bytecode/TrackedReferences.cpp: Added. (JSC::TrackedReferences::TrackedReferences): (JSC::TrackedReferences::~TrackedReferences): (JSC::TrackedReferences::add): (JSC::TrackedReferences::check): (JSC::TrackedReferences::dump): * bytecode/TrackedReferences.h: Added. * dfg/DFGAbstractValue.cpp: (JSC::DFG::AbstractValue::observeTransitions): (JSC::DFG::AbstractValue::set): (JSC::DFG::AbstractValue::fixTypeForRepresentation): (JSC::DFG::AbstractValue::mergeOSREntryValue): (JSC::DFG::AbstractValue::filter): (JSC::DFG::AbstractValue::dumpInContext): (JSC::DFG::AbstractValue::validateReferences): (JSC::DFG::AbstractValue::setOSREntryValue): Deleted. * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::fullTop): (JSC::DFG::AbstractValue::merge): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::validateReferences): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::requiredRegisterCountForExecutionAndExit): * dfg/DFGFrozenValue.h: (JSC::DFG::FrozenValue::FrozenValue): (JSC::DFG::FrozenValue::strengthenTo): (JSC::DFG::FrozenValue::pointsToHeap): (JSC::DFG::FrozenValue::strength): (JSC::DFG::FrozenValue::freeze): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::registerFrozenValues): (JSC::DFG::Graph::visitChildren): (JSC::DFG::Graph::freeze): (JSC::DFG::Graph::freezeStrong): (JSC::DFG::Graph::freezeFragile): Deleted. * dfg/DFGGraph.h: * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::setOptimizationThresholdBasedOnCompilationResult): (JSC::DFG::JITCode::validateReferences): * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::addressOfDoubleConstant): (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::branchStructurePtr): (JSC::DFG::JITCompiler::jitCode): (JSC::DFG::JITCompiler::noticeOSREntry): Deleted. * dfg/DFGMinifiedGraph.cpp: Added. (JSC::DFG::MinifiedGraph::prepareAndShrink): (JSC::DFG::MinifiedGraph::validateReferences): * dfg/DFGMinifiedGraph.h: (JSC::DFG::MinifiedGraph::append): (JSC::DFG::MinifiedGraph::prepareAndShrink): Deleted. * dfg/DFGOSREntry.cpp: (JSC::DFG::OSREntryData::dumpInContext): (JSC::DFG::OSREntryData::dump): (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): * dfg/DFGStructureAbstractValue.cpp: (JSC::DFG::StructureAbstractValue::dump): (JSC::DFG::StructureAbstractValue::validateReferences): * dfg/DFGStructureAbstractValue.h: * dfg/DFGValidate.cpp: (JSC::DFG::Validate::validate): * dfg/DFGValueStrength.cpp: (WTF::printInternal): * dfg/DFGValueStrength.h: (JSC::DFG::merge): * ftl/FTLExitPropertyValue.cpp: (JSC::FTL::ExitPropertyValue::dump): (JSC::FTL::ExitPropertyValue::validateReferences): * ftl/FTLExitPropertyValue.h: * ftl/FTLExitTimeObjectMaterialization.cpp: (JSC::FTL::ExitTimeObjectMaterialization::dump): (JSC::FTL::ExitTimeObjectMaterialization::validateReferences): * ftl/FTLExitTimeObjectMaterialization.h: * ftl/FTLExitValue.cpp: (JSC::FTL::ExitValue::dump): (JSC::FTL::ExitValue::validateReferences): * ftl/FTLExitValue.h: * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::dfgCommon): (JSC::FTL::JITCode::validateReferences): * ftl/FTLJITCode.h: (JSC::FTL::JITCode::handles): (JSC::FTL::JITCode::dataSections): * ftl/FTLOSRExit.cpp: (JSC::FTL::OSRExit::codeLocationForRepatch): (JSC::FTL::OSRExit::validateReferences): * ftl/FTLOSRExit.h: (JSC::FTL::OSRExit::considerAddingAsFrequentExitSite): * jit/JITCode.cpp: (JSC::JITCode::typeName): (JSC::JITCode::validateReferences): (JSC::JITCode::execute): * jit/JITCode.h: (JSC::JITCode::start): * tests/stress/dead-osr-entry-value.js: Added. (foo): Canonical link: https://commits.webkit.org/164928@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-10 21:19:51 +00:00
#include "TrackedReferences.h"
Drop CheckedLock / CheckedCondition aliases https://bugs.webkit.org/show_bug.cgi?id=226176 Reviewed by Kate Cheney. Drop CheckedLock / CheckedCondition aliases now that they are the default. Source/JavaScriptCore: * API/JSVirtualMachine.mm: * API/glib/JSCVirtualMachine.cpp: * assembler/PerfLog.h: * assembler/testmasm.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dfg/DFGPlan.h: * dfg/DFGThreadData.h: * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::Worklist): * dfg/DFGWorklist.h: * disassembler/Disassembler.cpp: * dynbench.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/BlockDirectory.h: (JSC::BlockDirectory::bitvectorLock): * heap/CodeBlockSet.h: (JSC::CodeBlockSet::getLock): * heap/Heap.cpp: (JSC::Heap::Heap): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * heap/MarkedSpace.h: (JSC::MarkedSpace::directoryLock): * heap/MarkingConstraintSolver.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::donateKnownParallel): * heap/SlotVisitor.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::getLock const): (JSC::dumpJITMemory): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::getLock const): * jit/JITWorklist.cpp: (JSC::JITWorklist::JITWorklist): * jit/JITWorklist.h: * jsc.cpp: * profiler/ProfilerDatabase.h: * runtime/ConcurrentJSLock.h: * runtime/DeferredWorkTimer.h: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::FrameWalker::FrameWalker): (JSC::CFrameWalker::CFrameWalker): (JSC::SamplingProfiler::takeSample): * runtime/SamplingProfiler.h: (JSC::SamplingProfiler::getLock): * runtime/VM.h: * runtime/VMTraps.cpp: (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): * runtime/VMTraps.h: * tools/FunctionOverrides.h: * tools/VMInspector.cpp: (JSC::ensureIsSafeToLock): * tools/VMInspector.h: (JSC::VMInspector::getLock): * wasm/WasmCalleeRegistry.h: (JSC::Wasm::CalleeRegistry::getLock): * wasm/WasmPlan.h: * wasm/WasmStreamingCompiler.h: * wasm/WasmThunks.h: * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::Worklist): * wasm/WasmWorklist.h: Source/WebCore: * Modules/indexeddb/IDBObjectStore.h: * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBSerializationContext.cpp: * Modules/indexeddb/server/IDBServer.cpp: * Modules/mediastream/RTCDataChannel.cpp: * Modules/mediastream/RTCRtpSFrameTransformer.h: * Modules/mediastream/RTCRtpScriptTransform.h: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.h: * Modules/speech/SpeechRecognitionCaptureSourceImpl.h: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webdatabase/Database.cpp: * Modules/webdatabase/Database.h: * Modules/webdatabase/DatabaseManager.h: * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.h: * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/webdatabase/OriginLock.cpp: * Modules/webdatabase/SQLCallbackWrapper.h: * Modules/webdatabase/SQLTransaction.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::instancesLock): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUPipeline.cpp: (WebCore::WebGPUPipeline::instancesLock): * Modules/webgpu/WebGPUPipeline.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsLock): * Modules/websockets/WebSocket.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: * accessibility/isolatedtree/AXIsolatedTree.h: * bindings/js/JSDOMGlobalObject.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.h: * dom/MessagePort.cpp: * dom/Node.cpp: * dom/ScriptExecutionContext.cpp: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::instancesLock): * html/canvas/CanvasRenderingContext.h: * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::objectGraphLockForAContext): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::objectGraphLockForContext): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::instancesLock): * html/canvas/WebGLProgram.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::objectGraphLock): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::objectGraphLockForContext): * html/canvas/WebGLSharedObject.h: * inspector/agents/WebHeapAgent.cpp: * page/ResourceUsageThread.h: * page/SecurityPolicy.cpp: * page/WheelEventTestMonitor.h: * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::WTF_RETURNS_LOCK): * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.h: (WebCore::ThreadedScrollingTree::WTF_RETURNS_LOCK): * page/scrolling/mac/ScrollingTreeMac.h: * platform/AbortableTaskQueue.h: * platform/GenericTaskQueue.cpp: * platform/GenericTaskQueue.h: * platform/LegacySchemeRegistry.cpp: * platform/audio/AudioDestination.h: * platform/audio/HRTFDatabaseLoader.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::backgroundThreadEntry): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: * platform/audio/mac/FFTFrameMac.cpp: * platform/encryptedmedia/CDMProxy.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::lock): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: * platform/graphics/cg/IOSurfacePool.h: * platform/graphics/cg/SubimageCacheWithTimer.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (WebCore::TextureMapperPlatformLayerProxy::WTF_RETURNS_LOCK): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/cocoa/WebCoreNSURLSession.mm: * platform/network/mac/UTIUtilities.mm: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h: * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteDatabaseTracker.cpp: * platform/text/TextEncodingRegistry.cpp: * storage/StorageQuotaManager.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerOrWorkletScriptController.h: * workers/WorkerOrWorkletThread.cpp: (WebCore::WorkerOrWorkletThread::workerOrWorkletThreadsLock): * workers/WorkerOrWorkletThread.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer): * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/WebStorage/StorageManagerSet.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: * NetworkProcess/glib/DNSCache.h: * Platform/IPC/Connection.cpp: * Platform/IPC/Connection.h: * Platform/IPC/StreamConnectionWorkQueue.h: * Platform/IPC/StreamServerConnection.h: * Shared/BlockingResponseMap.h: * Shared/Cocoa/XPCEndpointClient.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/mac/MediaFormatReader/MediaFormatReader.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.h: * Shared/mac/MediaFormatReader/MediaTrackReader.h: * UIProcess/API/glib/IconDatabase.h: * UIProcess/WebURLSchemeTask.h: * UIProcess/mac/DisplayLink.h: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView knowsPageRange:]): * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Plugins/PluginProcessConnectionManager.h: * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/ViewUpdateDispatcher.h: Source/WebKitLegacy: * Storage/StorageAreaSync.h: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThreadCondition::wait): (WTF::AutomaticThreadCondition::waitFor): (WTF::AutomaticThread::AutomaticThread): * wtf/AutomaticThread.h: * wtf/CMakeLists.txt: * wtf/CheckedCondition.h: Removed. * wtf/CheckedLock.h: Removed. * wtf/Condition.h: * wtf/CrossThreadQueue.h: * wtf/CrossThreadTaskHandler.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/FastMalloc.cpp: * wtf/Forward.h: * wtf/Language.cpp: * wtf/Lock.cpp: (WTF::UncheckedLock::lockSlow): (WTF::UncheckedLock::unlockSlow): (WTF::UncheckedLock::unlockFairlySlow): (WTF::UncheckedLock::safepointSlow): * wtf/Lock.h: (WTF::WTF_ASSERTS_ACQUIRED_LOCK): * wtf/Logger.cpp: * wtf/Logger.h: (WTF::Logger::WTF_RETURNS_LOCK): * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: * wtf/OSLogPrintStream.h: * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperPool::ParallelHelperPool): * wtf/ParallelHelperPool.h: * wtf/ParallelJobsGeneric.h: * wtf/ParallelVectorIterator.h: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/RunLoop.h: * wtf/SynchronizedFixedQueue.h: * wtf/Threading.cpp: (WTF::Thread::allThreadsLock): * wtf/Threading.h: * wtf/TimingScope.cpp: * wtf/URL.cpp: * wtf/WTFSemaphore.h: * wtf/WorkQueue.cpp: (WTF::WorkQueue::concurrentApply): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): * wtf/WorkerPool.h: * wtf/cf/LanguageCF.cpp: * wtf/text/AtomStringImpl.cpp: (WTF::AtomStringTableLocker::AtomStringTableLocker): * wtf/text/StringView.cpp: * wtf/threads/BinarySemaphore.h: * wtf/unicode/icu/CollatorICU.cpp: Tools: * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedConditionTest.cpp: Removed. * TestWebKitAPI/Tests/WTF/CheckedLockTest.cpp: Removed. * TestWebKitAPI/Tests/WTF/Condition.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/Lock.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: (WTR::AXThread::createThreadIfNeeded): Canonical link: https://commits.webkit.org/238085@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 18:29:01 +00:00
#include <wtf/Lock.h>
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
#include <wtf/NeverDestroyed.h>
fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
namespace JSC { namespace DFG {
void CommonData::shrinkToFit()
{
[JSC] Return DisposableCallSiteIndex when destroying GCAwareJITStubRoutineWithExceptionHandler https://bugs.webkit.org/show_bug.cgi?id=213069 <rdar://problem/64205186> Reviewed by Saam Barati. JSTests: * stress/dont-dispose-callsiteindex-while-executing.js: Added. (emptyFunction): (foo.bar.set catch): (foo.bar): (foo): Source/JavaScriptCore: Inside GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount, we are returning DisposableCallSiteIndex to freelist. However, GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount can be called even if the code of GCAwareJITStubRoutineWithExceptionHandler is on the stack. Let's consider the following scenario. 1. Execute GCAwareJITStubRoutineWithExceptionHandler's code. Set CallSiteIndex to the stack. 2. Execute more code. (1)'s GCAwareJITStubRoutineWithExceptionHandler's code is on the stack. 3. (1)'s GCAwareJITStubRoutineWithExceptionHandler's refcount becomes zero. 4. CallSiteIndex of GCAwareJITStubRoutineWithExceptionHandler is returned. 5. Execute StackVisitor to construct frames. But we cannot find CodeOrigin corresponding to CallSiteIndex stored in (1) since it is already returned. DisposableCallSiteIndex should be returned after ensuring that GCAwareJITStubRoutineWithExceptionHandler's code is not on the stack. Detecting this is the functionality what GCAwareJITStubRoutineWithExceptionHandler can offer. It is destroyed after ensuring that GCAwareJITStubRoutineWithExceptionHandler's code is not on the stack. This patch delays DisposableCallSiteIndex returning until we destroy owner GCAwareJITStubRoutineWithExceptionHandler. But it is possible that CodeBlock* corresponding to GCAwareJITStubRoutineWithExceptionHandler is already destroyed. To avoid this condition, we extract CodeOrigins vector as Ref<DFG::CodeOriginPool> and keep it alive from GCAwareJITStubRoutineWithExceptionHandler too. And since CodeOrigin addition / removal happens only from the main thread after finishing the compilation, and GCAwareJITStubRoutineWithExceptionHandler's destructor is called from the Heap's finalizer, which must be executed from the main thread, we can just modify it without a lock. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::newExceptionHandlingCallSiteIndex): (JSC::CodeBlock::codeOrigins): * bytecode/CodeBlock.h: (JSC::CodeBlock::codeOrigin): * dfg/DFGCodeOriginPool.cpp: Added. (JSC::DFG::CodeOriginPool::addCodeOrigin): (JSC::DFG::CodeOriginPool::addUniqueCallSiteIndex): (JSC::DFG::CodeOriginPool::lastCallSite const): (JSC::DFG::CodeOriginPool::addDisposableCallSiteIndex): (JSC::DFG::CodeOriginPool::removeDisposableCallSiteIndex): (JSC::DFG::CodeOriginPool::shrinkToFit): * dfg/DFGCodeOriginPool.h: Added. (JSC::DFG::CodeOriginPool::create): (JSC::DFG::CodeOriginPool::get): (JSC::DFG::CodeOriginPool::size const): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::addCodeOrigin): Deleted. (JSC::DFG::CommonData::addUniqueCallSiteIndex): Deleted. (JSC::DFG::CommonData::lastCallSite const): Deleted. (JSC::DFG::CommonData::addDisposableCallSiteIndex): Deleted. (JSC::DFG::CommonData::removeDisposableCallSiteIndex): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::CommonData): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exceptionCheck): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::addCallSite): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutById): (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal): (JSC::FTL::DFG::LowerDFGToB3::compileDelBy): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct): (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct): (JSC::FTL::DFG::LowerDFGToB3::compileTailCall): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs): (JSC::FTL::DFG::LowerDFGToB3::compileCallEval): (JSC::FTL::DFG::LowerDFGToB3::compileInById): (JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf): (JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenTail): (JSC::FTL::DFG::LowerDFGToB3::getById): (JSC::FTL::DFG::LowerDFGToB3::getByIdWithThis): (JSC::FTL::DFG::LowerDFGToB3::lazySlowPath): (JSC::FTL::DFG::LowerDFGToB3::callPreflight): * ftl/FTLSlowPathCall.cpp: (JSC::FTL::callSiteIndexForCodeOrigin): * jit/GCAwareJITStubRoutine.cpp: (JSC::GCAwareJITStubRoutineWithExceptionHandler::GCAwareJITStubRoutineWithExceptionHandler): (JSC::GCAwareJITStubRoutineWithExceptionHandler::~GCAwareJITStubRoutineWithExceptionHandler): (JSC::GCAwareJITStubRoutineWithExceptionHandler::aboutToDie): (JSC::GCAwareJITStubRoutineWithExceptionHandler::observeZeroRefCount): * jit/GCAwareJITStubRoutine.h: Canonical link: https://commits.webkit.org/225876@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-11 20:11:34 +00:00
codeOrigins->shrinkToFit();
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
m_jumpReplacements.shrinkToFit();
fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
}
Drop CheckedLock / CheckedCondition aliases https://bugs.webkit.org/show_bug.cgi?id=226176 Reviewed by Kate Cheney. Drop CheckedLock / CheckedCondition aliases now that they are the default. Source/JavaScriptCore: * API/JSVirtualMachine.mm: * API/glib/JSCVirtualMachine.cpp: * assembler/PerfLog.h: * assembler/testmasm.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dfg/DFGPlan.h: * dfg/DFGThreadData.h: * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::Worklist): * dfg/DFGWorklist.h: * disassembler/Disassembler.cpp: * dynbench.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/BlockDirectory.h: (JSC::BlockDirectory::bitvectorLock): * heap/CodeBlockSet.h: (JSC::CodeBlockSet::getLock): * heap/Heap.cpp: (JSC::Heap::Heap): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * heap/MarkedSpace.h: (JSC::MarkedSpace::directoryLock): * heap/MarkingConstraintSolver.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::donateKnownParallel): * heap/SlotVisitor.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::getLock const): (JSC::dumpJITMemory): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::getLock const): * jit/JITWorklist.cpp: (JSC::JITWorklist::JITWorklist): * jit/JITWorklist.h: * jsc.cpp: * profiler/ProfilerDatabase.h: * runtime/ConcurrentJSLock.h: * runtime/DeferredWorkTimer.h: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::FrameWalker::FrameWalker): (JSC::CFrameWalker::CFrameWalker): (JSC::SamplingProfiler::takeSample): * runtime/SamplingProfiler.h: (JSC::SamplingProfiler::getLock): * runtime/VM.h: * runtime/VMTraps.cpp: (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): * runtime/VMTraps.h: * tools/FunctionOverrides.h: * tools/VMInspector.cpp: (JSC::ensureIsSafeToLock): * tools/VMInspector.h: (JSC::VMInspector::getLock): * wasm/WasmCalleeRegistry.h: (JSC::Wasm::CalleeRegistry::getLock): * wasm/WasmPlan.h: * wasm/WasmStreamingCompiler.h: * wasm/WasmThunks.h: * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::Worklist): * wasm/WasmWorklist.h: Source/WebCore: * Modules/indexeddb/IDBObjectStore.h: * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBSerializationContext.cpp: * Modules/indexeddb/server/IDBServer.cpp: * Modules/mediastream/RTCDataChannel.cpp: * Modules/mediastream/RTCRtpSFrameTransformer.h: * Modules/mediastream/RTCRtpScriptTransform.h: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.h: * Modules/speech/SpeechRecognitionCaptureSourceImpl.h: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webdatabase/Database.cpp: * Modules/webdatabase/Database.h: * Modules/webdatabase/DatabaseManager.h: * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.h: * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/webdatabase/OriginLock.cpp: * Modules/webdatabase/SQLCallbackWrapper.h: * Modules/webdatabase/SQLTransaction.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::instancesLock): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUPipeline.cpp: (WebCore::WebGPUPipeline::instancesLock): * Modules/webgpu/WebGPUPipeline.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsLock): * Modules/websockets/WebSocket.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: * accessibility/isolatedtree/AXIsolatedTree.h: * bindings/js/JSDOMGlobalObject.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.h: * dom/MessagePort.cpp: * dom/Node.cpp: * dom/ScriptExecutionContext.cpp: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::instancesLock): * html/canvas/CanvasRenderingContext.h: * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::objectGraphLockForAContext): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::objectGraphLockForContext): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::instancesLock): * html/canvas/WebGLProgram.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::objectGraphLock): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::objectGraphLockForContext): * html/canvas/WebGLSharedObject.h: * inspector/agents/WebHeapAgent.cpp: * page/ResourceUsageThread.h: * page/SecurityPolicy.cpp: * page/WheelEventTestMonitor.h: * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::WTF_RETURNS_LOCK): * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.h: (WebCore::ThreadedScrollingTree::WTF_RETURNS_LOCK): * page/scrolling/mac/ScrollingTreeMac.h: * platform/AbortableTaskQueue.h: * platform/GenericTaskQueue.cpp: * platform/GenericTaskQueue.h: * platform/LegacySchemeRegistry.cpp: * platform/audio/AudioDestination.h: * platform/audio/HRTFDatabaseLoader.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::backgroundThreadEntry): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: * platform/audio/mac/FFTFrameMac.cpp: * platform/encryptedmedia/CDMProxy.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::lock): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: * platform/graphics/cg/IOSurfacePool.h: * platform/graphics/cg/SubimageCacheWithTimer.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (WebCore::TextureMapperPlatformLayerProxy::WTF_RETURNS_LOCK): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/cocoa/WebCoreNSURLSession.mm: * platform/network/mac/UTIUtilities.mm: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h: * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteDatabaseTracker.cpp: * platform/text/TextEncodingRegistry.cpp: * storage/StorageQuotaManager.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerOrWorkletScriptController.h: * workers/WorkerOrWorkletThread.cpp: (WebCore::WorkerOrWorkletThread::workerOrWorkletThreadsLock): * workers/WorkerOrWorkletThread.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer): * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/WebStorage/StorageManagerSet.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: * NetworkProcess/glib/DNSCache.h: * Platform/IPC/Connection.cpp: * Platform/IPC/Connection.h: * Platform/IPC/StreamConnectionWorkQueue.h: * Platform/IPC/StreamServerConnection.h: * Shared/BlockingResponseMap.h: * Shared/Cocoa/XPCEndpointClient.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/mac/MediaFormatReader/MediaFormatReader.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.h: * Shared/mac/MediaFormatReader/MediaTrackReader.h: * UIProcess/API/glib/IconDatabase.h: * UIProcess/WebURLSchemeTask.h: * UIProcess/mac/DisplayLink.h: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView knowsPageRange:]): * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Plugins/PluginProcessConnectionManager.h: * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/ViewUpdateDispatcher.h: Source/WebKitLegacy: * Storage/StorageAreaSync.h: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThreadCondition::wait): (WTF::AutomaticThreadCondition::waitFor): (WTF::AutomaticThread::AutomaticThread): * wtf/AutomaticThread.h: * wtf/CMakeLists.txt: * wtf/CheckedCondition.h: Removed. * wtf/CheckedLock.h: Removed. * wtf/Condition.h: * wtf/CrossThreadQueue.h: * wtf/CrossThreadTaskHandler.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/FastMalloc.cpp: * wtf/Forward.h: * wtf/Language.cpp: * wtf/Lock.cpp: (WTF::UncheckedLock::lockSlow): (WTF::UncheckedLock::unlockSlow): (WTF::UncheckedLock::unlockFairlySlow): (WTF::UncheckedLock::safepointSlow): * wtf/Lock.h: (WTF::WTF_ASSERTS_ACQUIRED_LOCK): * wtf/Logger.cpp: * wtf/Logger.h: (WTF::Logger::WTF_RETURNS_LOCK): * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: * wtf/OSLogPrintStream.h: * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperPool::ParallelHelperPool): * wtf/ParallelHelperPool.h: * wtf/ParallelJobsGeneric.h: * wtf/ParallelVectorIterator.h: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/RunLoop.h: * wtf/SynchronizedFixedQueue.h: * wtf/Threading.cpp: (WTF::Thread::allThreadsLock): * wtf/Threading.h: * wtf/TimingScope.cpp: * wtf/URL.cpp: * wtf/WTFSemaphore.h: * wtf/WorkQueue.cpp: (WTF::WorkQueue::concurrentApply): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): * wtf/WorkerPool.h: * wtf/cf/LanguageCF.cpp: * wtf/text/AtomStringImpl.cpp: (WTF::AtomStringTableLocker::AtomStringTableLocker): * wtf/text/StringView.cpp: * wtf/threads/BinarySemaphore.h: * wtf/unicode/icu/CollatorICU.cpp: Tools: * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedConditionTest.cpp: Removed. * TestWebKitAPI/Tests/WTF/CheckedLockTest.cpp: Removed. * TestWebKitAPI/Tests/WTF/Condition.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/Lock.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: (WTR::AXThread::createThreadIfNeeded): Canonical link: https://commits.webkit.org/238085@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 18:29:01 +00:00
static Lock pcCodeBlockMapLock;
Use CheckedLock in even more places https://bugs.webkit.org/show_bug.cgi?id=226152 Reviewed by Darin Adler. Use CheckedLock in even more places to benefit from Clang Thread Safety Analysis. Source/JavaScriptCore: * API/JSVirtualMachine.mm: (WTF_REQUIRES_LOCK): * API/glib/JSCVirtualMachine.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.h: (JSC::DFG::Plan::WTF_GUARDED_BY_LOCK): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: Source/WebCore: * 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/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/sql/SQLiteDatabase.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * NetworkProcess/glib/DNSCache.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::locateIterator const): (WebKit::MediaSampleCursor::locateMediaSample const): (WebKit::MediaSampleCursor::locateTiming const): (WebKit::MediaSampleCursor::stepInOrderedMap): (WebKit::MediaSampleCursor::stepInPresentationTime): (WebKit::MediaSampleCursor::getMediaSample const): (WebKit::MediaSampleCursor::getTiming const): (WebKit::MediaSampleCursor::getPlayableHorizon const): * Shared/mac/MediaFormatReader/MediaSampleCursor.h: Canonical link: https://commits.webkit.org/238064@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 20:33:29 +00:00
inline HashMap<void*, CodeBlock*>& pcCodeBlockMap() WTF_REQUIRES_LOCK(pcCodeBlockMapLock)
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
{
[JSC] Use LazyNeverDestroyed & std::call_once for complex singletons https://bugs.webkit.org/show_bug.cgi?id=215153 <rdar://problem/65718983> Reviewed by Mark Lam. Source/JavaScriptCore: We are getting some crashes in RemoteInspector and this speculatively fixes the crash. My guess is that NeverDestroyed<RemoteInspector> calls constructor twice in heavily contended situation: WebKit's static does not have thread-safety. If two threads come here at the same time, it is possible that constructor is invoked twice. In that case, later constructor will clear members, which involves clearing Lock m_mutex field. This makes Lock's invariant broken. This patch uses LazyNeverDestroyed and std::call_once to ensure invoking constructor only once. * API/glib/JSCVirtualMachine.cpp: * dfg/DFGCommonData.cpp: * disassembler/Disassembler.cpp: * inspector/remote/RemoteInspector.h: * inspector/remote/cocoa/RemoteInspectorCocoa.mm: (Inspector::RemoteInspector::singleton): * inspector/remote/glib/RemoteInspectorGlib.cpp: (Inspector::RemoteInspector::singleton): * inspector/remote/socket/RemoteInspectorServer.cpp: (Inspector::RemoteInspectorServer::singleton): * inspector/remote/socket/RemoteInspectorServer.h: * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::singleton): * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: (Inspector::RemoteInspectorSocketEndpoint::singleton): * interpreter/Interpreter.cpp: (JSC::Interpreter::opcodeIDTable): * runtime/IntlObject.cpp: (JSC::intlAvailableLocales): (JSC::intlCollatorAvailableLocales): (JSC::defaultLocale): (JSC::numberingSystemsForLocale): Source/WTF: Add lock's bits in crash information to investigate if this speculative fix does not work. * wtf/LockAlgorithmInlines.h: (WTF::Hooks>::lockSlow): (WTF::Hooks>::unlockSlow): Canonical link: https://commits.webkit.org/227957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-05 04:19:05 +00:00
static LazyNeverDestroyed<HashMap<void*, CodeBlock*>> pcCodeBlockMap;
static std::once_flag onceKey;
std::call_once(onceKey, [&] {
pcCodeBlockMap.construct();
});
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
return pcCodeBlockMap;
}
Add InvalidationPoints to the DFG and use them for all watchpoints https://bugs.webkit.org/show_bug.cgi?id=123472 Reviewed by Mark Hahnenberg. This makes a fundamental change to how watchpoints work in the DFG. Previously, a watchpoint was an instruction whose execution semantics were something like: if (watchpoint->invalidated) exit We would implement this without any branch by using jump replacement. This is a very good optimization. But it's a bit awkward once you get a lot of watchpoints: semantically we will have lots of these branches in the code, which the compiler needs to reason about even though they don't actually result in any emitted code. Separately, we also had a mechanism for jettisoning a CodeBlock. This mechanism would be invoked if a CodeBlock exited a lot. It would ensure that a CodeBlock wouldn't be called into again, but it would do nothing for CodeBlocks that were already on the stack. This change flips jettisoning and watchpoint invalidation on their heads. Now, the jump replacement has nothing to do with watchpoints; instead it's something that happens if you ever jettison a CodeBlock. Jump replacement is now an all-or-nothing operation over all of the potential call-return safe-exit-points in a CodeBlock. We call these "InvalidationPoint"s. A watchpoint instruction is now "lowered" by having the DFG collect all of the watchpoint sets that the CodeBlock cares about, and then registering a CodeBlockJettisoningWatchpoint with all of them. That is, if the watchpoint fires, it jettisons the CodeBlock, which in turn ensures that the CodeBlock can't be called into (because the entrypoint now points to baseline code) and can't be returned into (because returning exits to baseline before the next bytecode instruction). This will allow for a sensible lowering of watchpoints to LLVM IR. It will also allow for jettison() to be used effectively for things like breakpointing and single-stepping in the debugger. Well, basically, this mechanism just takes us into the HotSpot-style world where anyone can, at any time and for any reason, request that an optimized CodeBlock is rendered immediately invalid. You can use this for many cool things, I'm sure. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): * bytecode/CodeBlock.h: * bytecode/CodeBlockJettisoningWatchpoint.cpp: Added. (JSC::CodeBlockJettisoningWatchpoint::fireInternal): * bytecode/CodeBlockJettisoningWatchpoint.h: Added. (JSC::CodeBlockJettisoningWatchpoint::CodeBlockJettisoningWatchpoint): * bytecode/ExitKind.cpp: (JSC::exitKindToString): * bytecode/ExitKind.h: * bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp: Added. (JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal): * bytecode/ProfiledCodeBlockJettisoningWatchpoint.h: Added. (JSC::ProfiledCodeBlockJettisoningWatchpoint::ProfiledCodeBlockJettisoningWatchpoint): * dfg/DFGAbstractHeap.h: * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::::executeEffects): * dfg/DFGClobberize.cpp: (JSC::DFG::writesOverlap): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::AbstractHeapOverlaps::AbstractHeapOverlaps): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::AbstractHeapOverlaps::result): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::CommonData): * dfg/DFGDesiredWatchpoints.cpp: (JSC::DFG::DesiredWatchpoints::addLazily): (JSC::DFG::DesiredWatchpoints::reallyAdd): * dfg/DFGDesiredWatchpoints.h: (JSC::DFG::WatchpointForGenericWatchpointSet::WatchpointForGenericWatchpointSet): (JSC::DFG::GenericDesiredWatchpoints::addLazily): (JSC::DFG::GenericDesiredWatchpoints::reallyAdd): (JSC::DFG::GenericDesiredWatchpoints::areStillValid): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGInvalidationPointInjectionPhase.cpp: Added. (JSC::DFG::InvalidationPointInjectionPhase::InvalidationPointInjectionPhase): (JSC::DFG::InvalidationPointInjectionPhase::run): (JSC::DFG::InvalidationPointInjectionPhase::handle): (JSC::DFG::InvalidationPointInjectionPhase::insertInvalidationCheck): (JSC::DFG::performInvalidationPointInjection): * dfg/DFGInvalidationPointInjectionPhase.h: Added. * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): * dfg/DFGJITCompiler.h: * dfg/DFGJumpReplacement.cpp: Added. (JSC::DFG::JumpReplacement::fire): * dfg/DFGJumpReplacement.h: Added. (JSC::DFG::JumpReplacement::JumpReplacement): * dfg/DFGNodeType.h: * dfg/DFGOSRExitCompilationInfo.h: * dfg/DFGOperations.cpp: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): (JSC::DFG::Plan::reallyAdd): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::emitInvalidationPoint): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): (JSC::DFG::SpeculativeJIT::compileGetByValOnString): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::masqueradesAsUndefinedWatchpointIsStillValid): (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): (JSC::DFG::SpeculativeJIT::compileObjectEquality): (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): (JSC::DFG::SpeculativeJIT::compileObjectEquality): (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGWatchpointCollectionPhase.cpp: Added. (JSC::DFG::WatchpointCollectionPhase::WatchpointCollectionPhase): (JSC::DFG::WatchpointCollectionPhase::run): (JSC::DFG::WatchpointCollectionPhase::handle): (JSC::DFG::WatchpointCollectionPhase::handleEdge): (JSC::DFG::WatchpointCollectionPhase::handleMasqueradesAsUndefined): (JSC::DFG::WatchpointCollectionPhase::handleStringGetByVal): (JSC::DFG::WatchpointCollectionPhase::addLazily): (JSC::DFG::WatchpointCollectionPhase::globalObject): (JSC::DFG::performWatchpointCollection): * dfg/DFGWatchpointCollectionPhase.h: Added. * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileNode): (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compileGetByVal): (JSC::FTL::LowerDFGToLLVM::compileGlobalVarWatchpoint): (JSC::FTL::LowerDFGToLLVM::compileCompareEqConstant): (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq): (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant): (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint): (JSC::FTL::LowerDFGToLLVM::equalNullOrUndefined): (JSC::FTL::LowerDFGToLLVM::speculateNonNullObject): * jit/JITOperations.cpp: * jit/JumpReplacementWatchpoint.cpp: Removed. * jit/JumpReplacementWatchpoint.h: Removed. Canonical link: https://commits.webkit.org/141672@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-30 19:58:08 +00:00
bool CommonData::invalidate()
{
if (!isStillValid)
return false;
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
if (UNLIKELY(hasVMTrapsBreakpointsInstalled)) {
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/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { pcCodeBlockMapLock };
Use CheckedLock in even more places https://bugs.webkit.org/show_bug.cgi?id=226152 Reviewed by Darin Adler. Use CheckedLock in even more places to benefit from Clang Thread Safety Analysis. Source/JavaScriptCore: * API/JSVirtualMachine.mm: (WTF_REQUIRES_LOCK): * API/glib/JSCVirtualMachine.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.h: (JSC::DFG::Plan::WTF_GUARDED_BY_LOCK): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: Source/WebCore: * 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/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/sql/SQLiteDatabase.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * NetworkProcess/glib/DNSCache.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::locateIterator const): (WebKit::MediaSampleCursor::locateMediaSample const): (WebKit::MediaSampleCursor::locateTiming const): (WebKit::MediaSampleCursor::stepInOrderedMap): (WebKit::MediaSampleCursor::stepInPresentationTime): (WebKit::MediaSampleCursor::getMediaSample const): (WebKit::MediaSampleCursor::getTiming const): (WebKit::MediaSampleCursor::getPlayableHorizon const): * Shared/mac/MediaFormatReader/MediaSampleCursor.h: Canonical link: https://commits.webkit.org/238064@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 20:33:29 +00:00
auto& map = pcCodeBlockMap();
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
for (auto& jumpReplacement : m_jumpReplacements)
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
map.remove(jumpReplacement.dataLocation());
hasVMTrapsBreakpointsInstalled = false;
}
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
for (unsigned i = m_jumpReplacements.size(); i--;)
m_jumpReplacements[i].fire();
Add InvalidationPoints to the DFG and use them for all watchpoints https://bugs.webkit.org/show_bug.cgi?id=123472 Reviewed by Mark Hahnenberg. This makes a fundamental change to how watchpoints work in the DFG. Previously, a watchpoint was an instruction whose execution semantics were something like: if (watchpoint->invalidated) exit We would implement this without any branch by using jump replacement. This is a very good optimization. But it's a bit awkward once you get a lot of watchpoints: semantically we will have lots of these branches in the code, which the compiler needs to reason about even though they don't actually result in any emitted code. Separately, we also had a mechanism for jettisoning a CodeBlock. This mechanism would be invoked if a CodeBlock exited a lot. It would ensure that a CodeBlock wouldn't be called into again, but it would do nothing for CodeBlocks that were already on the stack. This change flips jettisoning and watchpoint invalidation on their heads. Now, the jump replacement has nothing to do with watchpoints; instead it's something that happens if you ever jettison a CodeBlock. Jump replacement is now an all-or-nothing operation over all of the potential call-return safe-exit-points in a CodeBlock. We call these "InvalidationPoint"s. A watchpoint instruction is now "lowered" by having the DFG collect all of the watchpoint sets that the CodeBlock cares about, and then registering a CodeBlockJettisoningWatchpoint with all of them. That is, if the watchpoint fires, it jettisons the CodeBlock, which in turn ensures that the CodeBlock can't be called into (because the entrypoint now points to baseline code) and can't be returned into (because returning exits to baseline before the next bytecode instruction). This will allow for a sensible lowering of watchpoints to LLVM IR. It will also allow for jettison() to be used effectively for things like breakpointing and single-stepping in the debugger. Well, basically, this mechanism just takes us into the HotSpot-style world where anyone can, at any time and for any reason, request that an optimized CodeBlock is rendered immediately invalid. You can use this for many cool things, I'm sure. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): * bytecode/CodeBlock.h: * bytecode/CodeBlockJettisoningWatchpoint.cpp: Added. (JSC::CodeBlockJettisoningWatchpoint::fireInternal): * bytecode/CodeBlockJettisoningWatchpoint.h: Added. (JSC::CodeBlockJettisoningWatchpoint::CodeBlockJettisoningWatchpoint): * bytecode/ExitKind.cpp: (JSC::exitKindToString): * bytecode/ExitKind.h: * bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp: Added. (JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal): * bytecode/ProfiledCodeBlockJettisoningWatchpoint.h: Added. (JSC::ProfiledCodeBlockJettisoningWatchpoint::ProfiledCodeBlockJettisoningWatchpoint): * dfg/DFGAbstractHeap.h: * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::::executeEffects): * dfg/DFGClobberize.cpp: (JSC::DFG::writesOverlap): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::AbstractHeapOverlaps::AbstractHeapOverlaps): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::AbstractHeapOverlaps::result): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::CommonData): * dfg/DFGDesiredWatchpoints.cpp: (JSC::DFG::DesiredWatchpoints::addLazily): (JSC::DFG::DesiredWatchpoints::reallyAdd): * dfg/DFGDesiredWatchpoints.h: (JSC::DFG::WatchpointForGenericWatchpointSet::WatchpointForGenericWatchpointSet): (JSC::DFG::GenericDesiredWatchpoints::addLazily): (JSC::DFG::GenericDesiredWatchpoints::reallyAdd): (JSC::DFG::GenericDesiredWatchpoints::areStillValid): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGInvalidationPointInjectionPhase.cpp: Added. (JSC::DFG::InvalidationPointInjectionPhase::InvalidationPointInjectionPhase): (JSC::DFG::InvalidationPointInjectionPhase::run): (JSC::DFG::InvalidationPointInjectionPhase::handle): (JSC::DFG::InvalidationPointInjectionPhase::insertInvalidationCheck): (JSC::DFG::performInvalidationPointInjection): * dfg/DFGInvalidationPointInjectionPhase.h: Added. * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): * dfg/DFGJITCompiler.h: * dfg/DFGJumpReplacement.cpp: Added. (JSC::DFG::JumpReplacement::fire): * dfg/DFGJumpReplacement.h: Added. (JSC::DFG::JumpReplacement::JumpReplacement): * dfg/DFGNodeType.h: * dfg/DFGOSRExitCompilationInfo.h: * dfg/DFGOperations.cpp: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): (JSC::DFG::Plan::reallyAdd): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::emitInvalidationPoint): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): (JSC::DFG::SpeculativeJIT::compileGetByValOnString): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::masqueradesAsUndefinedWatchpointIsStillValid): (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): (JSC::DFG::SpeculativeJIT::compileObjectEquality): (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): (JSC::DFG::SpeculativeJIT::compileObjectEquality): (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGWatchpointCollectionPhase.cpp: Added. (JSC::DFG::WatchpointCollectionPhase::WatchpointCollectionPhase): (JSC::DFG::WatchpointCollectionPhase::run): (JSC::DFG::WatchpointCollectionPhase::handle): (JSC::DFG::WatchpointCollectionPhase::handleEdge): (JSC::DFG::WatchpointCollectionPhase::handleMasqueradesAsUndefined): (JSC::DFG::WatchpointCollectionPhase::handleStringGetByVal): (JSC::DFG::WatchpointCollectionPhase::addLazily): (JSC::DFG::WatchpointCollectionPhase::globalObject): (JSC::DFG::performWatchpointCollection): * dfg/DFGWatchpointCollectionPhase.h: Added. * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileNode): (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compileGetByVal): (JSC::FTL::LowerDFGToLLVM::compileGlobalVarWatchpoint): (JSC::FTL::LowerDFGToLLVM::compileCompareEqConstant): (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq): (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant): (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint): (JSC::FTL::LowerDFGToLLVM::equalNullOrUndefined): (JSC::FTL::LowerDFGToLLVM::speculateNonNullObject): * jit/JITOperations.cpp: * jit/JumpReplacementWatchpoint.cpp: Removed. * jit/JumpReplacementWatchpoint.h: Removed. Canonical link: https://commits.webkit.org/141672@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-30 19:58:08 +00:00
isStillValid = false;
return true;
}
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
CommonData::~CommonData()
{
if (UNLIKELY(hasVMTrapsBreakpointsInstalled)) {
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/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { pcCodeBlockMapLock };
Use CheckedLock in even more places https://bugs.webkit.org/show_bug.cgi?id=226152 Reviewed by Darin Adler. Use CheckedLock in even more places to benefit from Clang Thread Safety Analysis. Source/JavaScriptCore: * API/JSVirtualMachine.mm: (WTF_REQUIRES_LOCK): * API/glib/JSCVirtualMachine.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.h: (JSC::DFG::Plan::WTF_GUARDED_BY_LOCK): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: Source/WebCore: * 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/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/sql/SQLiteDatabase.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * NetworkProcess/glib/DNSCache.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::locateIterator const): (WebKit::MediaSampleCursor::locateMediaSample const): (WebKit::MediaSampleCursor::locateTiming const): (WebKit::MediaSampleCursor::stepInOrderedMap): (WebKit::MediaSampleCursor::stepInPresentationTime): (WebKit::MediaSampleCursor::getMediaSample const): (WebKit::MediaSampleCursor::getTiming const): (WebKit::MediaSampleCursor::getPlayableHorizon const): * Shared/mac/MediaFormatReader/MediaSampleCursor.h: Canonical link: https://commits.webkit.org/238064@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 20:33:29 +00:00
auto& map = pcCodeBlockMap();
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
for (auto& jumpReplacement : m_jumpReplacements)
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
map.remove(jumpReplacement.dataLocation());
}
}
void CommonData::installVMTrapBreakpoints(CodeBlock* owner)
Make the VM Traps mechanism non-polling for the DFG and FTL. https://bugs.webkit.org/show_bug.cgi?id=168920 <rdar://problem/30738588> Reviewed by Filip Pizlo. Source/JavaScriptCore: 1. Added a ENABLE(SIGNAL_BASED_VM_TRAPS) configuration in Platform.h. This is currently only enabled for OS(DARWIN) and ENABLE(JIT). 2. Added assembler functions for overwriting an instruction with a breakpoint. 3. Added a new JettisonDueToVMTraps jettison reason. 4. Added CodeBlock and DFG::CommonData utility functions for over-writing invalidation points with breakpoint instructions. 5. The BytecodeGenerator now emits the op_check_traps bytecode unconditionally. 6. Remove the JSC_alwaysCheckTraps option because of (4) above. For ports that don't ENABLE(SIGNAL_BASED_VM_TRAPS), we'll force Options::usePollingTraps() to always be true. This makes the VMTraps implementation fall back to using polling based traps only. 7. Make VMTraps support signal based traps. Some design and implementation details of signal based VM traps: - The implementation makes use of 2 signal handlers for SIGUSR1 and SIGTRAP. - VMTraps::fireTrap() will set the flag for the requested trap and instantiate a SignalSender. The SignalSender will send SIGUSR1 to the mutator thread that we want to trap, and check for the occurence of one of the following events: a. VMTraps::handleTraps() has been called for the requested trap, or b. the VM is inactive and is no longer executing any JS code. We determine this to be the case if the thread no longer owns the JSLock and the VM's entryScope is null. Note: the thread can relinquish the JSLock while the VM's entryScope is not null. This happens when the thread calls JSLock::dropAllLocks() before calling a host function that may block on IO (or whatever). For our purpose, this counts as the VM still running JS code, and VM::fireTrap() will still be waiting. If the SignalSender does not see either of these events, it will sleep for a while and then re-send SIGUSR1 and check for the events again. When it sees one of these events, it will consider the mutator to have received the trap request. - The SIGUSR1 handler will try to insert breakpoints at the invalidation points in the DFG/FTL codeBlock at the top of the stack. This allows the mutator thread to break (with a SIGTRAP) exactly at an invalidation point, where it's safe to jettison the codeBlock. Note: we cannot have the requester thread (that called VMTraps::fireTrap()) insert the breakpoint instructions itself. This is because we need the register state of the the mutator thread (that we want to trap in) in order to find the codeBlocks that we wish to insert the breakpoints in. Currently, we don't have a generic way for the requester thread to get the register state of another thread. - The SIGTRAP handler will check to see if it is trapping on a breakpoint at an invalidation point. If so, it will jettison the codeBlock and adjust the PC to re-execute the invalidation OSR exit off-ramp. After the OSR exit, the baseline JIT code will eventually reach an op_check_traps and call VMTraps::handleTraps(). If the handler is not trapping at an invalidation point, then it must be observing an assertion failure (which also uses the breakpoint instruction). In this case, the handler will defer to the default SIGTRAP handler and crash. - The reason we need the SignalSender is because SignalSender::send() is called from another thread in a loop, so that VMTraps::fireTrap() can return sooner. send() needs to make use of the VM pointer, and it is not guaranteed that the VM will outlive the thread. SignalSender provides the mechanism by which we can nullify the VM pointer when the VM dies so that the thread does not continue to use it. * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithBrk): * assembler/ARMAssembler.h: (JSC::ARMAssembler::replaceWithBrk): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::replaceWithBkpt): * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::replaceWithBkpt): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::replaceWithJump): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::replaceWithBreakpoint): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::replaceWithBreakpoint): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::replaceWithJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::replaceWithBreakpoint): * assembler/X86Assembler.h: (JSC::X86Assembler::replaceWithInt3): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): (JSC::CodeBlock::hasInstalledVMTrapBreakpoints): (JSC::CodeBlock::installVMTrapBreakpoints): * bytecode/CodeBlock.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCheckTraps): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::hasInstalledVMTrapsBreakpoints): * dfg/DFGJumpReplacement.cpp: (JSC::DFG::JumpReplacement::installVMTrapBreakpoint): * dfg/DFGJumpReplacement.h: (JSC::DFG::JumpReplacement::dataLocation): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::contains): * heap/CodeBlockSet.h: * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterate): * heap/Heap.cpp: (JSC::Heap::forEachCodeBlockIgnoringJITPlansImpl): * heap/Heap.h: * heap/HeapInlines.h: (JSC::Heap::forEachCodeBlockIgnoringJITPlans): * heap/MachineStackMarker.h: (JSC::MachineThreads::threadsListHead): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * profiler/ProfilerJettisonReason.cpp: (WTF::printInternal): * profiler/ProfilerJettisonReason.h: * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/Options.h: * runtime/PlatformThread.h: (JSC::platformThreadSignal): * runtime/VM.cpp: (JSC::VM::~VM): (JSC::VM::ensureWatchdog): (JSC::VM::handleTraps): Deleted. (JSC::VM::setNeedAsynchronousTerminationSupport): Deleted. * runtime/VM.h: (JSC::VM::ownerThread): (JSC::VM::traps): (JSC::VM::handleTraps): (JSC::VM::needTrapHandling): (JSC::VM::needAsynchronousTerminationSupport): Deleted. * runtime/VMTraps.cpp: (JSC::VMTraps::vm): (JSC::SignalContext::SignalContext): (JSC::SignalContext::adjustPCToPointToTrappingInstruction): (JSC::vmIsInactive): (JSC::findActiveVMAndStackBounds): (JSC::handleSigusr1): (JSC::handleSigtrap): (JSC::installSignalHandlers): (JSC::sanitizedTopCallFrame): (JSC::isSaneFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::addSignalSender): (JSC::VMTraps::removeSignalSender): (JSC::VMTraps::SignalSender::willDestroyVM): (JSC::VMTraps::SignalSender::send): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): (JSC::VMTraps::needTrapHandling): (JSC::VMTraps::notifyGrabAllLocks): (JSC::VMTraps::SignalSender::SignalSender): (JSC::VMTraps::invalidateCodeBlocksOnStack): * tools/VMInspector.cpp: * tools/VMInspector.h: (JSC::VMInspector::getLock): (JSC::VMInspector::iterate): Source/WebCore: No new tests needed. This is covered by existing tests. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController): (WebCore::WorkerScriptController::scheduleExecutionTermination): Source/WTF: Make StackBounds more useful for checking if a pointer is within stack bounds. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::isInAllocatedMemory): * wtf/MetaAllocator.h: * wtf/Platform.h: * wtf/StackBounds.h: (WTF::StackBounds::emptyBounds): (WTF::StackBounds::StackBounds): (WTF::StackBounds::isEmpty): (WTF::StackBounds::contains): Canonical link: https://commits.webkit.org/186409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-09 19:08:46 +00:00
{
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/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { pcCodeBlockMapLock };
Make the VM Traps mechanism non-polling for the DFG and FTL. https://bugs.webkit.org/show_bug.cgi?id=168920 <rdar://problem/30738588> Reviewed by Filip Pizlo. Source/JavaScriptCore: 1. Added a ENABLE(SIGNAL_BASED_VM_TRAPS) configuration in Platform.h. This is currently only enabled for OS(DARWIN) and ENABLE(JIT). 2. Added assembler functions for overwriting an instruction with a breakpoint. 3. Added a new JettisonDueToVMTraps jettison reason. 4. Added CodeBlock and DFG::CommonData utility functions for over-writing invalidation points with breakpoint instructions. 5. The BytecodeGenerator now emits the op_check_traps bytecode unconditionally. 6. Remove the JSC_alwaysCheckTraps option because of (4) above. For ports that don't ENABLE(SIGNAL_BASED_VM_TRAPS), we'll force Options::usePollingTraps() to always be true. This makes the VMTraps implementation fall back to using polling based traps only. 7. Make VMTraps support signal based traps. Some design and implementation details of signal based VM traps: - The implementation makes use of 2 signal handlers for SIGUSR1 and SIGTRAP. - VMTraps::fireTrap() will set the flag for the requested trap and instantiate a SignalSender. The SignalSender will send SIGUSR1 to the mutator thread that we want to trap, and check for the occurence of one of the following events: a. VMTraps::handleTraps() has been called for the requested trap, or b. the VM is inactive and is no longer executing any JS code. We determine this to be the case if the thread no longer owns the JSLock and the VM's entryScope is null. Note: the thread can relinquish the JSLock while the VM's entryScope is not null. This happens when the thread calls JSLock::dropAllLocks() before calling a host function that may block on IO (or whatever). For our purpose, this counts as the VM still running JS code, and VM::fireTrap() will still be waiting. If the SignalSender does not see either of these events, it will sleep for a while and then re-send SIGUSR1 and check for the events again. When it sees one of these events, it will consider the mutator to have received the trap request. - The SIGUSR1 handler will try to insert breakpoints at the invalidation points in the DFG/FTL codeBlock at the top of the stack. This allows the mutator thread to break (with a SIGTRAP) exactly at an invalidation point, where it's safe to jettison the codeBlock. Note: we cannot have the requester thread (that called VMTraps::fireTrap()) insert the breakpoint instructions itself. This is because we need the register state of the the mutator thread (that we want to trap in) in order to find the codeBlocks that we wish to insert the breakpoints in. Currently, we don't have a generic way for the requester thread to get the register state of another thread. - The SIGTRAP handler will check to see if it is trapping on a breakpoint at an invalidation point. If so, it will jettison the codeBlock and adjust the PC to re-execute the invalidation OSR exit off-ramp. After the OSR exit, the baseline JIT code will eventually reach an op_check_traps and call VMTraps::handleTraps(). If the handler is not trapping at an invalidation point, then it must be observing an assertion failure (which also uses the breakpoint instruction). In this case, the handler will defer to the default SIGTRAP handler and crash. - The reason we need the SignalSender is because SignalSender::send() is called from another thread in a loop, so that VMTraps::fireTrap() can return sooner. send() needs to make use of the VM pointer, and it is not guaranteed that the VM will outlive the thread. SignalSender provides the mechanism by which we can nullify the VM pointer when the VM dies so that the thread does not continue to use it. * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithBrk): * assembler/ARMAssembler.h: (JSC::ARMAssembler::replaceWithBrk): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::replaceWithBkpt): * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::replaceWithBkpt): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::replaceWithJump): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::replaceWithBreakpoint): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::replaceWithBreakpoint): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::replaceWithJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::replaceWithBreakpoint): * assembler/X86Assembler.h: (JSC::X86Assembler::replaceWithInt3): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): (JSC::CodeBlock::hasInstalledVMTrapBreakpoints): (JSC::CodeBlock::installVMTrapBreakpoints): * bytecode/CodeBlock.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCheckTraps): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::hasInstalledVMTrapsBreakpoints): * dfg/DFGJumpReplacement.cpp: (JSC::DFG::JumpReplacement::installVMTrapBreakpoint): * dfg/DFGJumpReplacement.h: (JSC::DFG::JumpReplacement::dataLocation): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::contains): * heap/CodeBlockSet.h: * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterate): * heap/Heap.cpp: (JSC::Heap::forEachCodeBlockIgnoringJITPlansImpl): * heap/Heap.h: * heap/HeapInlines.h: (JSC::Heap::forEachCodeBlockIgnoringJITPlans): * heap/MachineStackMarker.h: (JSC::MachineThreads::threadsListHead): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * profiler/ProfilerJettisonReason.cpp: (WTF::printInternal): * profiler/ProfilerJettisonReason.h: * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/Options.h: * runtime/PlatformThread.h: (JSC::platformThreadSignal): * runtime/VM.cpp: (JSC::VM::~VM): (JSC::VM::ensureWatchdog): (JSC::VM::handleTraps): Deleted. (JSC::VM::setNeedAsynchronousTerminationSupport): Deleted. * runtime/VM.h: (JSC::VM::ownerThread): (JSC::VM::traps): (JSC::VM::handleTraps): (JSC::VM::needTrapHandling): (JSC::VM::needAsynchronousTerminationSupport): Deleted. * runtime/VMTraps.cpp: (JSC::VMTraps::vm): (JSC::SignalContext::SignalContext): (JSC::SignalContext::adjustPCToPointToTrappingInstruction): (JSC::vmIsInactive): (JSC::findActiveVMAndStackBounds): (JSC::handleSigusr1): (JSC::handleSigtrap): (JSC::installSignalHandlers): (JSC::sanitizedTopCallFrame): (JSC::isSaneFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::addSignalSender): (JSC::VMTraps::removeSignalSender): (JSC::VMTraps::SignalSender::willDestroyVM): (JSC::VMTraps::SignalSender::send): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): (JSC::VMTraps::needTrapHandling): (JSC::VMTraps::notifyGrabAllLocks): (JSC::VMTraps::SignalSender::SignalSender): (JSC::VMTraps::invalidateCodeBlocksOnStack): * tools/VMInspector.cpp: * tools/VMInspector.h: (JSC::VMInspector::getLock): (JSC::VMInspector::iterate): Source/WebCore: No new tests needed. This is covered by existing tests. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController): (WebCore::WorkerScriptController::scheduleExecutionTermination): Source/WTF: Make StackBounds more useful for checking if a pointer is within stack bounds. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::isInAllocatedMemory): * wtf/MetaAllocator.h: * wtf/Platform.h: * wtf/StackBounds.h: (WTF::StackBounds::emptyBounds): (WTF::StackBounds::StackBounds): (WTF::StackBounds::isEmpty): (WTF::StackBounds::contains): Canonical link: https://commits.webkit.org/186409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-09 19:08:46 +00:00
if (!isStillValid || hasVMTrapsBreakpointsInstalled)
return;
hasVMTrapsBreakpointsInstalled = true;
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
Use CheckedLock in even more places https://bugs.webkit.org/show_bug.cgi?id=226152 Reviewed by Darin Adler. Use CheckedLock in even more places to benefit from Clang Thread Safety Analysis. Source/JavaScriptCore: * API/JSVirtualMachine.mm: (WTF_REQUIRES_LOCK): * API/glib/JSCVirtualMachine.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.h: (JSC::DFG::Plan::WTF_GUARDED_BY_LOCK): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: Source/WebCore: * 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/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/sql/SQLiteDatabase.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * NetworkProcess/glib/DNSCache.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::locateIterator const): (WebKit::MediaSampleCursor::locateMediaSample const): (WebKit::MediaSampleCursor::locateTiming const): (WebKit::MediaSampleCursor::stepInOrderedMap): (WebKit::MediaSampleCursor::stepInPresentationTime): (WebKit::MediaSampleCursor::getMediaSample const): (WebKit::MediaSampleCursor::getTiming const): (WebKit::MediaSampleCursor::getPlayableHorizon const): * Shared/mac/MediaFormatReader/MediaSampleCursor.h: Canonical link: https://commits.webkit.org/238064@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 20:33:29 +00:00
auto& map = pcCodeBlockMap();
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
#if !defined(NDEBUG)
// We need to be able to handle more than one invalidation point at the same pc
// but we want to make sure we don't forget to remove a pc from the map.
HashSet<void*> newReplacements;
#endif
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
for (auto& jumpReplacement : m_jumpReplacements) {
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
jumpReplacement.installVMTrapBreakpoint();
void* source = jumpReplacement.dataLocation();
auto result = map.add(source, owner);
UNUSED_PARAM(result);
#if !defined(NDEBUG)
ASSERT(result.isNewEntry || newReplacements.contains(source));
newReplacements.add(source);
#endif
}
}
CodeBlock* codeBlockForVMTrapPC(void* pc)
{
ASSERT(isJITPC(pc));
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/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
Locker locker { pcCodeBlockMapLock };
Use CheckedLock in even more places https://bugs.webkit.org/show_bug.cgi?id=226152 Reviewed by Darin Adler. Use CheckedLock in even more places to benefit from Clang Thread Safety Analysis. Source/JavaScriptCore: * API/JSVirtualMachine.mm: (WTF_REQUIRES_LOCK): * API/glib/JSCVirtualMachine.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.h: (JSC::DFG::Plan::WTF_GUARDED_BY_LOCK): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: Source/WebCore: * 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/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/sql/SQLiteDatabase.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: * NetworkProcess/glib/DNSCache.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::locateIterator const): (WebKit::MediaSampleCursor::locateMediaSample const): (WebKit::MediaSampleCursor::locateTiming const): (WebKit::MediaSampleCursor::stepInOrderedMap): (WebKit::MediaSampleCursor::stepInPresentationTime): (WebKit::MediaSampleCursor::getMediaSample const): (WebKit::MediaSampleCursor::getTiming const): (WebKit::MediaSampleCursor::getPlayableHorizon const): * Shared/mac/MediaFormatReader/MediaSampleCursor.h: Canonical link: https://commits.webkit.org/238064@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 20:33:29 +00:00
auto& map = pcCodeBlockMap();
VMTraps has some races https://bugs.webkit.org/show_bug.cgi?id=173941 Reviewed by Michael Saboff. Source/JavaScriptCore: This patch refactors much of the VMTraps API. On the message sending side: 1) No longer uses the Yarr JIT check to determine if we are in RegExp code. That was unsound because RegExp JIT code can be run on compilation threads. Instead it looks at the current frame's code block slot and checks if it is valid, which is the same as what it did for JIT code previously. 2) Only have one signal sender thread, previously, there could be many at once, which caused some data races. Additionally, the signal sender thread is an automatic thread so it will deallocate itself when not in use. On the VMTraps breakpoint side: 1) We now have a true mapping of if we hit a breakpoint instead of a JIT assertion. So the exception handler won't eat JIT assertions anymore. 2) It jettisons all CodeBlocks that have VMTraps breakpoints on them instead of every CodeBlock on the stack. This both prevents us from hitting stale VMTraps breakpoints and also doesn't OSR codeblocks that otherwise don't need to be jettisoned. 3) The old exception handler could theoretically fail for a couple of reasons then resume execution with a clobbered instruction set. This patch will kill the program if the exception handler would fail. This patch also refactors some of the jsc.cpp functions to take the CommandLine options object instead of individual options. Also, there is a new command line option that makes exceptions due to watchdog timeouts an acceptable result. * API/tests/testapi.c: (main): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::installVMTrapBreakpoints): * dfg/DFGCommonData.cpp: (JSC::DFG::pcCodeBlockMap): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGCommonData.h: * jsc.cpp: (functionDollarAgentStart): (checkUncaughtException): (checkException): (runWithOptions): (printUsageStatement): (CommandLine::parseArguments): (jscmain): (runWithScripts): Deleted. * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/VMTraps.cpp: (JSC::sanitizedTopCallFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): (JSC::VMTraps::VMTraps): (JSC::VMTraps::~VMTraps): (JSC::findActiveVMAndStackBounds): Deleted. (JSC::installSignalHandler): Deleted. (JSC::VMTraps::addSignalSender): Deleted. (JSC::VMTraps::removeSignalSender): Deleted. (JSC::VMTraps::SignalSender::willDestroyVM): Deleted. (JSC::VMTraps::SignalSender::send): Deleted. * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): Deleted. (JSC::VMTraps::SignalSender::SignalSender): Deleted. Tools: Add new testing mode for testing the Watchdog with our stress tests. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/190805@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-29 17:34:57 +00:00
auto result = map.find(pc);
if (result == map.end())
return nullptr;
return result->value;
Make the VM Traps mechanism non-polling for the DFG and FTL. https://bugs.webkit.org/show_bug.cgi?id=168920 <rdar://problem/30738588> Reviewed by Filip Pizlo. Source/JavaScriptCore: 1. Added a ENABLE(SIGNAL_BASED_VM_TRAPS) configuration in Platform.h. This is currently only enabled for OS(DARWIN) and ENABLE(JIT). 2. Added assembler functions for overwriting an instruction with a breakpoint. 3. Added a new JettisonDueToVMTraps jettison reason. 4. Added CodeBlock and DFG::CommonData utility functions for over-writing invalidation points with breakpoint instructions. 5. The BytecodeGenerator now emits the op_check_traps bytecode unconditionally. 6. Remove the JSC_alwaysCheckTraps option because of (4) above. For ports that don't ENABLE(SIGNAL_BASED_VM_TRAPS), we'll force Options::usePollingTraps() to always be true. This makes the VMTraps implementation fall back to using polling based traps only. 7. Make VMTraps support signal based traps. Some design and implementation details of signal based VM traps: - The implementation makes use of 2 signal handlers for SIGUSR1 and SIGTRAP. - VMTraps::fireTrap() will set the flag for the requested trap and instantiate a SignalSender. The SignalSender will send SIGUSR1 to the mutator thread that we want to trap, and check for the occurence of one of the following events: a. VMTraps::handleTraps() has been called for the requested trap, or b. the VM is inactive and is no longer executing any JS code. We determine this to be the case if the thread no longer owns the JSLock and the VM's entryScope is null. Note: the thread can relinquish the JSLock while the VM's entryScope is not null. This happens when the thread calls JSLock::dropAllLocks() before calling a host function that may block on IO (or whatever). For our purpose, this counts as the VM still running JS code, and VM::fireTrap() will still be waiting. If the SignalSender does not see either of these events, it will sleep for a while and then re-send SIGUSR1 and check for the events again. When it sees one of these events, it will consider the mutator to have received the trap request. - The SIGUSR1 handler will try to insert breakpoints at the invalidation points in the DFG/FTL codeBlock at the top of the stack. This allows the mutator thread to break (with a SIGTRAP) exactly at an invalidation point, where it's safe to jettison the codeBlock. Note: we cannot have the requester thread (that called VMTraps::fireTrap()) insert the breakpoint instructions itself. This is because we need the register state of the the mutator thread (that we want to trap in) in order to find the codeBlocks that we wish to insert the breakpoints in. Currently, we don't have a generic way for the requester thread to get the register state of another thread. - The SIGTRAP handler will check to see if it is trapping on a breakpoint at an invalidation point. If so, it will jettison the codeBlock and adjust the PC to re-execute the invalidation OSR exit off-ramp. After the OSR exit, the baseline JIT code will eventually reach an op_check_traps and call VMTraps::handleTraps(). If the handler is not trapping at an invalidation point, then it must be observing an assertion failure (which also uses the breakpoint instruction). In this case, the handler will defer to the default SIGTRAP handler and crash. - The reason we need the SignalSender is because SignalSender::send() is called from another thread in a loop, so that VMTraps::fireTrap() can return sooner. send() needs to make use of the VM pointer, and it is not guaranteed that the VM will outlive the thread. SignalSender provides the mechanism by which we can nullify the VM pointer when the VM dies so that the thread does not continue to use it. * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithBrk): * assembler/ARMAssembler.h: (JSC::ARMAssembler::replaceWithBrk): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::replaceWithBkpt): * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::replaceWithBkpt): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::replaceWithJump): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::replaceWithBreakpoint): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::replaceWithBreakpoint): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::replaceWithJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::replaceWithBreakpoint): * assembler/X86Assembler.h: (JSC::X86Assembler::replaceWithInt3): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): (JSC::CodeBlock::hasInstalledVMTrapBreakpoints): (JSC::CodeBlock::installVMTrapBreakpoints): * bytecode/CodeBlock.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCheckTraps): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::hasInstalledVMTrapsBreakpoints): * dfg/DFGJumpReplacement.cpp: (JSC::DFG::JumpReplacement::installVMTrapBreakpoint): * dfg/DFGJumpReplacement.h: (JSC::DFG::JumpReplacement::dataLocation): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::contains): * heap/CodeBlockSet.h: * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterate): * heap/Heap.cpp: (JSC::Heap::forEachCodeBlockIgnoringJITPlansImpl): * heap/Heap.h: * heap/HeapInlines.h: (JSC::Heap::forEachCodeBlockIgnoringJITPlans): * heap/MachineStackMarker.h: (JSC::MachineThreads::threadsListHead): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * profiler/ProfilerJettisonReason.cpp: (WTF::printInternal): * profiler/ProfilerJettisonReason.h: * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/Options.h: * runtime/PlatformThread.h: (JSC::platformThreadSignal): * runtime/VM.cpp: (JSC::VM::~VM): (JSC::VM::ensureWatchdog): (JSC::VM::handleTraps): Deleted. (JSC::VM::setNeedAsynchronousTerminationSupport): Deleted. * runtime/VM.h: (JSC::VM::ownerThread): (JSC::VM::traps): (JSC::VM::handleTraps): (JSC::VM::needTrapHandling): (JSC::VM::needAsynchronousTerminationSupport): Deleted. * runtime/VMTraps.cpp: (JSC::VMTraps::vm): (JSC::SignalContext::SignalContext): (JSC::SignalContext::adjustPCToPointToTrappingInstruction): (JSC::vmIsInactive): (JSC::findActiveVMAndStackBounds): (JSC::handleSigusr1): (JSC::handleSigtrap): (JSC::installSignalHandlers): (JSC::sanitizedTopCallFrame): (JSC::isSaneFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::addSignalSender): (JSC::VMTraps::removeSignalSender): (JSC::VMTraps::SignalSender::willDestroyVM): (JSC::VMTraps::SignalSender::send): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): (JSC::VMTraps::needTrapHandling): (JSC::VMTraps::notifyGrabAllLocks): (JSC::VMTraps::SignalSender::SignalSender): (JSC::VMTraps::invalidateCodeBlocksOnStack): * tools/VMInspector.cpp: * tools/VMInspector.h: (JSC::VMInspector::getLock): (JSC::VMInspector::iterate): Source/WebCore: No new tests needed. This is covered by existing tests. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController): (WebCore::WorkerScriptController::scheduleExecutionTermination): Source/WTF: Make StackBounds more useful for checking if a pointer is within stack bounds. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::isInAllocatedMemory): * wtf/MetaAllocator.h: * wtf/Platform.h: * wtf/StackBounds.h: (WTF::StackBounds::emptyBounds): (WTF::StackBounds::StackBounds): (WTF::StackBounds::isEmpty): (WTF::StackBounds::contains): Canonical link: https://commits.webkit.org/186409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-09 19:08:46 +00:00
}
bool CommonData::isVMTrapBreakpoint(void* address)
{
if (!isStillValid)
return false;
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
for (unsigned i = m_jumpReplacements.size(); i--;) {
if (address == m_jumpReplacements[i].dataLocation())
Make the VM Traps mechanism non-polling for the DFG and FTL. https://bugs.webkit.org/show_bug.cgi?id=168920 <rdar://problem/30738588> Reviewed by Filip Pizlo. Source/JavaScriptCore: 1. Added a ENABLE(SIGNAL_BASED_VM_TRAPS) configuration in Platform.h. This is currently only enabled for OS(DARWIN) and ENABLE(JIT). 2. Added assembler functions for overwriting an instruction with a breakpoint. 3. Added a new JettisonDueToVMTraps jettison reason. 4. Added CodeBlock and DFG::CommonData utility functions for over-writing invalidation points with breakpoint instructions. 5. The BytecodeGenerator now emits the op_check_traps bytecode unconditionally. 6. Remove the JSC_alwaysCheckTraps option because of (4) above. For ports that don't ENABLE(SIGNAL_BASED_VM_TRAPS), we'll force Options::usePollingTraps() to always be true. This makes the VMTraps implementation fall back to using polling based traps only. 7. Make VMTraps support signal based traps. Some design and implementation details of signal based VM traps: - The implementation makes use of 2 signal handlers for SIGUSR1 and SIGTRAP. - VMTraps::fireTrap() will set the flag for the requested trap and instantiate a SignalSender. The SignalSender will send SIGUSR1 to the mutator thread that we want to trap, and check for the occurence of one of the following events: a. VMTraps::handleTraps() has been called for the requested trap, or b. the VM is inactive and is no longer executing any JS code. We determine this to be the case if the thread no longer owns the JSLock and the VM's entryScope is null. Note: the thread can relinquish the JSLock while the VM's entryScope is not null. This happens when the thread calls JSLock::dropAllLocks() before calling a host function that may block on IO (or whatever). For our purpose, this counts as the VM still running JS code, and VM::fireTrap() will still be waiting. If the SignalSender does not see either of these events, it will sleep for a while and then re-send SIGUSR1 and check for the events again. When it sees one of these events, it will consider the mutator to have received the trap request. - The SIGUSR1 handler will try to insert breakpoints at the invalidation points in the DFG/FTL codeBlock at the top of the stack. This allows the mutator thread to break (with a SIGTRAP) exactly at an invalidation point, where it's safe to jettison the codeBlock. Note: we cannot have the requester thread (that called VMTraps::fireTrap()) insert the breakpoint instructions itself. This is because we need the register state of the the mutator thread (that we want to trap in) in order to find the codeBlocks that we wish to insert the breakpoints in. Currently, we don't have a generic way for the requester thread to get the register state of another thread. - The SIGTRAP handler will check to see if it is trapping on a breakpoint at an invalidation point. If so, it will jettison the codeBlock and adjust the PC to re-execute the invalidation OSR exit off-ramp. After the OSR exit, the baseline JIT code will eventually reach an op_check_traps and call VMTraps::handleTraps(). If the handler is not trapping at an invalidation point, then it must be observing an assertion failure (which also uses the breakpoint instruction). In this case, the handler will defer to the default SIGTRAP handler and crash. - The reason we need the SignalSender is because SignalSender::send() is called from another thread in a loop, so that VMTraps::fireTrap() can return sooner. send() needs to make use of the VM pointer, and it is not guaranteed that the VM will outlive the thread. SignalSender provides the mechanism by which we can nullify the VM pointer when the VM dies so that the thread does not continue to use it. * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithBrk): * assembler/ARMAssembler.h: (JSC::ARMAssembler::replaceWithBrk): * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::replaceWithBkpt): * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::replaceWithBkpt): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::replaceWithJump): * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::replaceWithBreakpoint): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::replaceWithBreakpoint): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::replaceWithJump): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::replaceWithBreakpoint): * assembler/X86Assembler.h: (JSC::X86Assembler::replaceWithInt3): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::jettison): (JSC::CodeBlock::hasInstalledVMTrapBreakpoints): (JSC::CodeBlock::installVMTrapBreakpoints): * bytecode/CodeBlock.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCheckTraps): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::hasInstalledVMTrapsBreakpoints): * dfg/DFGJumpReplacement.cpp: (JSC::DFG::JumpReplacement::installVMTrapBreakpoint): * dfg/DFGJumpReplacement.h: (JSC::DFG::JumpReplacement::dataLocation): * dfg/DFGNodeType.h: * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::contains): * heap/CodeBlockSet.h: * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterate): * heap/Heap.cpp: (JSC::Heap::forEachCodeBlockIgnoringJITPlansImpl): * heap/Heap.h: * heap/HeapInlines.h: (JSC::Heap::forEachCodeBlockIgnoringJITPlans): * heap/MachineStackMarker.h: (JSC::MachineThreads::threadsListHead): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::isValidExecutableMemory): * jit/ExecutableAllocator.h: * profiler/ProfilerJettisonReason.cpp: (WTF::printInternal): * profiler/ProfilerJettisonReason.h: * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): * runtime/Options.cpp: (JSC::overrideDefaults): * runtime/Options.h: * runtime/PlatformThread.h: (JSC::platformThreadSignal): * runtime/VM.cpp: (JSC::VM::~VM): (JSC::VM::ensureWatchdog): (JSC::VM::handleTraps): Deleted. (JSC::VM::setNeedAsynchronousTerminationSupport): Deleted. * runtime/VM.h: (JSC::VM::ownerThread): (JSC::VM::traps): (JSC::VM::handleTraps): (JSC::VM::needTrapHandling): (JSC::VM::needAsynchronousTerminationSupport): Deleted. * runtime/VMTraps.cpp: (JSC::VMTraps::vm): (JSC::SignalContext::SignalContext): (JSC::SignalContext::adjustPCToPointToTrappingInstruction): (JSC::vmIsInactive): (JSC::findActiveVMAndStackBounds): (JSC::handleSigusr1): (JSC::handleSigtrap): (JSC::installSignalHandlers): (JSC::sanitizedTopCallFrame): (JSC::isSaneFrame): (JSC::VMTraps::tryInstallTrapBreakpoints): (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): (JSC::VMTraps::willDestroyVM): (JSC::VMTraps::addSignalSender): (JSC::VMTraps::removeSignalSender): (JSC::VMTraps::SignalSender::willDestroyVM): (JSC::VMTraps::SignalSender::send): (JSC::VMTraps::fireTrap): (JSC::VMTraps::handleTraps): * runtime/VMTraps.h: (JSC::VMTraps::~VMTraps): (JSC::VMTraps::needTrapHandling): (JSC::VMTraps::notifyGrabAllLocks): (JSC::VMTraps::SignalSender::SignalSender): (JSC::VMTraps::invalidateCodeBlocksOnStack): * tools/VMInspector.cpp: * tools/VMInspector.h: (JSC::VMInspector::getLock): (JSC::VMInspector::iterate): Source/WebCore: No new tests needed. This is covered by existing tests. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController): (WebCore::WorkerScriptController::scheduleExecutionTermination): Source/WTF: Make StackBounds more useful for checking if a pointer is within stack bounds. * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::isInAllocatedMemory): * wtf/MetaAllocator.h: * wtf/Platform.h: * wtf/StackBounds.h: (WTF::StackBounds::emptyBounds): (WTF::StackBounds::StackBounds): (WTF::StackBounds::isEmpty): (WTF::StackBounds::contains): Canonical link: https://commits.webkit.org/186409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-09 19:08:46 +00:00
return true;
}
return false;
}
DFG fragile frozen values are fundamentally broken https://bugs.webkit.org/show_bug.cgi?id=146602 Reviewed by Mark Lam. This change gets rid of the FragileValue value strength, because it was fundamentally broken. FragileValue was a value known to the compiler but not tracked by the GC in any way - it wasn't marked and it wasn't weak. This was used to support AI bootstrap for OSR must-handle values. The philosophy was that if the compiler did use the value for optimization, it would have been strengthened to a weak value (or maybe even a strong value, though we probably won't do that). But this was too much of a pipe dream. I've found at least one case where the compiler did use the value, but never strengthened it: it would happen if the value ended up in an OSR entry data expected value. Then if we GCed, we might have killed the value, but OSR entry would still try to use it for validation. That might have sort of just worked, but it's clearly shady. The reason why we made must-handle values fragile and not weak is that most of the time the values disappear from the abstract state: they are LUBed to a non-constant. If we kept them around as weak, we'd have too many cases of the GC killing the code because it thought that the value was somehow meaningful to the code when it was only used as a temporary artifact of optimization. So, it's true that it's very important for must-handle values not to automatically be weak or strong. It's also true that the values are necessary for AI bootstrap because we need to know what values OSR entry will require. But we shouldn't accomplish these goals by having the compiler hold onto what are essentially dangling pointers. This implements a better solution: instead of having InPlaceAbstractState bootstrap the AI with must-handle values at the beginning, we now widen the valuesAtHead of the must-handle block after AI converges. This widening is done in CFAPhase. This allows us to see if the must-handle values are necessary at all. In most cases, the widening takes a non-constant abstract value and simply amends something to its type based on the type of the must-handle value, and so the must-handle value never actually shows up in either the IR or any abstract value. In the unlikely event that the value at head is bottom, we freeze the must-handle value. This change removes FragileValue, and this freezing uses WeakValue as the strength. That makes sense: since the abstract value was bottom, the must-handle value becomes integral to the IR and so it makes no sense for the GC to keep the resulting CodeBlock alive if that must-handle value dies. This will sometimes happen for example if you have a very long-running loop whose pre-header allocates some object, but that pre-header appears to always exit to the optimizing JIT because it was only profiled once in the LLInt and that profiling appears insufficient to the DFG. In that case, we'll effectively constant-fold the references to the object inside the loop, which is both efficient (yay constant folding!) and necessary (otherwise we wouldn't know what the type of the variable should have been). Testing and debugging this is complicated. So, this adds some new capabilities: - DFG IR dumps also dump all of the FrozenValues that point to the heap along with their strengths, so that it's easy to see what GC objects the DFG feels are necessary for the compilation. - DFG OSR entry preparation prints out the OSR entry data structures, so that it's easy to see what GC pointers (and other things) are used for OSR entry validation. The printouts are quite detailed, and should also help other kinds of OSR entry debugging. - DFG::Plan now validates whether all of the GC pointers planted in the various JITCode data structures are also properly registered as either weak or strong pointers in the CodeBlock. This validation check previously failed due to fragile values ending up in the OSR entry data structures, both in the newly added test (dead-osr-entry-value.js) and in some pre-existing tests (like earley-boyer and 3d-raytrace). * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::stronglyVisitStrongReferences): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::visitAggregate): * bytecode/Operands.h: (JSC::Operands::operand): (JSC::Operands::hasOperand): * bytecode/StructureSet.cpp: (JSC::StructureSet::dump): (JSC::StructureSet::validateReferences): * bytecode/StructureSet.h: * bytecode/TrackedReferences.cpp: Added. (JSC::TrackedReferences::TrackedReferences): (JSC::TrackedReferences::~TrackedReferences): (JSC::TrackedReferences::add): (JSC::TrackedReferences::check): (JSC::TrackedReferences::dump): * bytecode/TrackedReferences.h: Added. * dfg/DFGAbstractValue.cpp: (JSC::DFG::AbstractValue::observeTransitions): (JSC::DFG::AbstractValue::set): (JSC::DFG::AbstractValue::fixTypeForRepresentation): (JSC::DFG::AbstractValue::mergeOSREntryValue): (JSC::DFG::AbstractValue::filter): (JSC::DFG::AbstractValue::dumpInContext): (JSC::DFG::AbstractValue::validateReferences): (JSC::DFG::AbstractValue::setOSREntryValue): Deleted. * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::fullTop): (JSC::DFG::AbstractValue::merge): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::validateReferences): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::requiredRegisterCountForExecutionAndExit): * dfg/DFGFrozenValue.h: (JSC::DFG::FrozenValue::FrozenValue): (JSC::DFG::FrozenValue::strengthenTo): (JSC::DFG::FrozenValue::pointsToHeap): (JSC::DFG::FrozenValue::strength): (JSC::DFG::FrozenValue::freeze): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::registerFrozenValues): (JSC::DFG::Graph::visitChildren): (JSC::DFG::Graph::freeze): (JSC::DFG::Graph::freezeStrong): (JSC::DFG::Graph::freezeFragile): Deleted. * dfg/DFGGraph.h: * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::setOptimizationThresholdBasedOnCompilationResult): (JSC::DFG::JITCode::validateReferences): * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::addressOfDoubleConstant): (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::branchStructurePtr): (JSC::DFG::JITCompiler::jitCode): (JSC::DFG::JITCompiler::noticeOSREntry): Deleted. * dfg/DFGMinifiedGraph.cpp: Added. (JSC::DFG::MinifiedGraph::prepareAndShrink): (JSC::DFG::MinifiedGraph::validateReferences): * dfg/DFGMinifiedGraph.h: (JSC::DFG::MinifiedGraph::append): (JSC::DFG::MinifiedGraph::prepareAndShrink): Deleted. * dfg/DFGOSREntry.cpp: (JSC::DFG::OSREntryData::dumpInContext): (JSC::DFG::OSREntryData::dump): (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): * dfg/DFGStructureAbstractValue.cpp: (JSC::DFG::StructureAbstractValue::dump): (JSC::DFG::StructureAbstractValue::validateReferences): * dfg/DFGStructureAbstractValue.h: * dfg/DFGValidate.cpp: (JSC::DFG::Validate::validate): * dfg/DFGValueStrength.cpp: (WTF::printInternal): * dfg/DFGValueStrength.h: (JSC::DFG::merge): * ftl/FTLExitPropertyValue.cpp: (JSC::FTL::ExitPropertyValue::dump): (JSC::FTL::ExitPropertyValue::validateReferences): * ftl/FTLExitPropertyValue.h: * ftl/FTLExitTimeObjectMaterialization.cpp: (JSC::FTL::ExitTimeObjectMaterialization::dump): (JSC::FTL::ExitTimeObjectMaterialization::validateReferences): * ftl/FTLExitTimeObjectMaterialization.h: * ftl/FTLExitValue.cpp: (JSC::FTL::ExitValue::dump): (JSC::FTL::ExitValue::validateReferences): * ftl/FTLExitValue.h: * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::dfgCommon): (JSC::FTL::JITCode::validateReferences): * ftl/FTLJITCode.h: (JSC::FTL::JITCode::handles): (JSC::FTL::JITCode::dataSections): * ftl/FTLOSRExit.cpp: (JSC::FTL::OSRExit::codeLocationForRepatch): (JSC::FTL::OSRExit::validateReferences): * ftl/FTLOSRExit.h: (JSC::FTL::OSRExit::considerAddingAsFrequentExitSite): * jit/JITCode.cpp: (JSC::JITCode::typeName): (JSC::JITCode::validateReferences): (JSC::JITCode::execute): * jit/JITCode.h: (JSC::JITCode::start): * tests/stress/dead-osr-entry-value.js: Added. (foo): Canonical link: https://commits.webkit.org/164928@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-10 21:19:51 +00:00
void CommonData::validateReferences(const TrackedReferences& trackedReferences)
{
if (InlineCallFrameSet* set = inlineCallFrames.get()) {
for (InlineCallFrame* inlineCallFrame : *set) {
[JSC] Use FixedVector more in bytecode dir and JumpTable https://bugs.webkit.org/show_bug.cgi?id=224275 Reviewed by Michael Saboff and Mark Lam. Source/JavaScriptCore: 1. Use FixedVector more in bytecode/ directory's long-living data structures. 2. Use FixedVector in SimpleJumpTable. This involves LLInt changes because we need to access FixedVector data from LLInt. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/InlineCallFrame.cpp: (JSC::InlineCallFrame::dumpInContext const): * bytecode/InlineCallFrame.h: * bytecode/JumpTable.h: (JSC::SimpleJumpTable::clear): * bytecode/ObjectPropertyConditionSet.cpp: (JSC::ObjectPropertyConditionSet::mergedWith const): (JSC::ObjectPropertyConditionSet::dumpInContext const): (JSC::ObjectPropertyConditionSet::isValidAndWatchable const): * bytecode/ObjectPropertyConditionSet.h: (JSC::ObjectPropertyConditionSet::create): (JSC::ObjectPropertyConditionSet::isValid const): (JSC::ObjectPropertyConditionSet::size const): (JSC::ObjectPropertyConditionSet::begin const): (JSC::ObjectPropertyConditionSet::end const): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal): (JSC::DFG::ByteCodeParser::flushImpl): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::validateReferences): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::isLiveInBytecode): * dfg/DFGGraph.h: * dfg/DFGPreciseLocalClobberize.h: (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): * dfg/DFGStackLayoutPhase.cpp: (JSC::DFG::StackLayoutPhase::run): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::argumentsStart): * jit/SetupVarargsFrame.cpp: (JSC::emitSetupVarargsFrameFastCase): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::createWithInlineFrame): Source/WTF: * wtf/FixedVector.h: (WTF::FixedVector::offsetOfStorage): * wtf/RefCountedArray.h: (WTF::RefCountedArray::Header::size): (WTF::RefCountedArray::Header::offsetOfLength): Canonical link: https://commits.webkit.org/236271@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-07 21:14:57 +00:00
for (ValueRecovery& recovery : inlineCallFrame->m_argumentsWithFixup) {
DFG fragile frozen values are fundamentally broken https://bugs.webkit.org/show_bug.cgi?id=146602 Reviewed by Mark Lam. This change gets rid of the FragileValue value strength, because it was fundamentally broken. FragileValue was a value known to the compiler but not tracked by the GC in any way - it wasn't marked and it wasn't weak. This was used to support AI bootstrap for OSR must-handle values. The philosophy was that if the compiler did use the value for optimization, it would have been strengthened to a weak value (or maybe even a strong value, though we probably won't do that). But this was too much of a pipe dream. I've found at least one case where the compiler did use the value, but never strengthened it: it would happen if the value ended up in an OSR entry data expected value. Then if we GCed, we might have killed the value, but OSR entry would still try to use it for validation. That might have sort of just worked, but it's clearly shady. The reason why we made must-handle values fragile and not weak is that most of the time the values disappear from the abstract state: they are LUBed to a non-constant. If we kept them around as weak, we'd have too many cases of the GC killing the code because it thought that the value was somehow meaningful to the code when it was only used as a temporary artifact of optimization. So, it's true that it's very important for must-handle values not to automatically be weak or strong. It's also true that the values are necessary for AI bootstrap because we need to know what values OSR entry will require. But we shouldn't accomplish these goals by having the compiler hold onto what are essentially dangling pointers. This implements a better solution: instead of having InPlaceAbstractState bootstrap the AI with must-handle values at the beginning, we now widen the valuesAtHead of the must-handle block after AI converges. This widening is done in CFAPhase. This allows us to see if the must-handle values are necessary at all. In most cases, the widening takes a non-constant abstract value and simply amends something to its type based on the type of the must-handle value, and so the must-handle value never actually shows up in either the IR or any abstract value. In the unlikely event that the value at head is bottom, we freeze the must-handle value. This change removes FragileValue, and this freezing uses WeakValue as the strength. That makes sense: since the abstract value was bottom, the must-handle value becomes integral to the IR and so it makes no sense for the GC to keep the resulting CodeBlock alive if that must-handle value dies. This will sometimes happen for example if you have a very long-running loop whose pre-header allocates some object, but that pre-header appears to always exit to the optimizing JIT because it was only profiled once in the LLInt and that profiling appears insufficient to the DFG. In that case, we'll effectively constant-fold the references to the object inside the loop, which is both efficient (yay constant folding!) and necessary (otherwise we wouldn't know what the type of the variable should have been). Testing and debugging this is complicated. So, this adds some new capabilities: - DFG IR dumps also dump all of the FrozenValues that point to the heap along with their strengths, so that it's easy to see what GC objects the DFG feels are necessary for the compilation. - DFG OSR entry preparation prints out the OSR entry data structures, so that it's easy to see what GC pointers (and other things) are used for OSR entry validation. The printouts are quite detailed, and should also help other kinds of OSR entry debugging. - DFG::Plan now validates whether all of the GC pointers planted in the various JITCode data structures are also properly registered as either weak or strong pointers in the CodeBlock. This validation check previously failed due to fragile values ending up in the OSR entry data structures, both in the newly added test (dead-osr-entry-value.js) and in some pre-existing tests (like earley-boyer and 3d-raytrace). * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::stronglyVisitStrongReferences): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::visitAggregate): * bytecode/Operands.h: (JSC::Operands::operand): (JSC::Operands::hasOperand): * bytecode/StructureSet.cpp: (JSC::StructureSet::dump): (JSC::StructureSet::validateReferences): * bytecode/StructureSet.h: * bytecode/TrackedReferences.cpp: Added. (JSC::TrackedReferences::TrackedReferences): (JSC::TrackedReferences::~TrackedReferences): (JSC::TrackedReferences::add): (JSC::TrackedReferences::check): (JSC::TrackedReferences::dump): * bytecode/TrackedReferences.h: Added. * dfg/DFGAbstractValue.cpp: (JSC::DFG::AbstractValue::observeTransitions): (JSC::DFG::AbstractValue::set): (JSC::DFG::AbstractValue::fixTypeForRepresentation): (JSC::DFG::AbstractValue::mergeOSREntryValue): (JSC::DFG::AbstractValue::filter): (JSC::DFG::AbstractValue::dumpInContext): (JSC::DFG::AbstractValue::validateReferences): (JSC::DFG::AbstractValue::setOSREntryValue): Deleted. * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::fullTop): (JSC::DFG::AbstractValue::merge): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::validateReferences): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::requiredRegisterCountForExecutionAndExit): * dfg/DFGFrozenValue.h: (JSC::DFG::FrozenValue::FrozenValue): (JSC::DFG::FrozenValue::strengthenTo): (JSC::DFG::FrozenValue::pointsToHeap): (JSC::DFG::FrozenValue::strength): (JSC::DFG::FrozenValue::freeze): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::registerFrozenValues): (JSC::DFG::Graph::visitChildren): (JSC::DFG::Graph::freeze): (JSC::DFG::Graph::freezeStrong): (JSC::DFG::Graph::freezeFragile): Deleted. * dfg/DFGGraph.h: * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::setOptimizationThresholdBasedOnCompilationResult): (JSC::DFG::JITCode::validateReferences): * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::addressOfDoubleConstant): (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::branchStructurePtr): (JSC::DFG::JITCompiler::jitCode): (JSC::DFG::JITCompiler::noticeOSREntry): Deleted. * dfg/DFGMinifiedGraph.cpp: Added. (JSC::DFG::MinifiedGraph::prepareAndShrink): (JSC::DFG::MinifiedGraph::validateReferences): * dfg/DFGMinifiedGraph.h: (JSC::DFG::MinifiedGraph::append): (JSC::DFG::MinifiedGraph::prepareAndShrink): Deleted. * dfg/DFGOSREntry.cpp: (JSC::DFG::OSREntryData::dumpInContext): (JSC::DFG::OSREntryData::dump): (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): * dfg/DFGStructureAbstractValue.cpp: (JSC::DFG::StructureAbstractValue::dump): (JSC::DFG::StructureAbstractValue::validateReferences): * dfg/DFGStructureAbstractValue.h: * dfg/DFGValidate.cpp: (JSC::DFG::Validate::validate): * dfg/DFGValueStrength.cpp: (WTF::printInternal): * dfg/DFGValueStrength.h: (JSC::DFG::merge): * ftl/FTLExitPropertyValue.cpp: (JSC::FTL::ExitPropertyValue::dump): (JSC::FTL::ExitPropertyValue::validateReferences): * ftl/FTLExitPropertyValue.h: * ftl/FTLExitTimeObjectMaterialization.cpp: (JSC::FTL::ExitTimeObjectMaterialization::dump): (JSC::FTL::ExitTimeObjectMaterialization::validateReferences): * ftl/FTLExitTimeObjectMaterialization.h: * ftl/FTLExitValue.cpp: (JSC::FTL::ExitValue::dump): (JSC::FTL::ExitValue::validateReferences): * ftl/FTLExitValue.h: * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::dfgCommon): (JSC::FTL::JITCode::validateReferences): * ftl/FTLJITCode.h: (JSC::FTL::JITCode::handles): (JSC::FTL::JITCode::dataSections): * ftl/FTLOSRExit.cpp: (JSC::FTL::OSRExit::codeLocationForRepatch): (JSC::FTL::OSRExit::validateReferences): * ftl/FTLOSRExit.h: (JSC::FTL::OSRExit::considerAddingAsFrequentExitSite): * jit/JITCode.cpp: (JSC::JITCode::typeName): (JSC::JITCode::validateReferences): (JSC::JITCode::execute): * jit/JITCode.h: (JSC::JITCode::start): * tests/stress/dead-osr-entry-value.js: Added. (foo): Canonical link: https://commits.webkit.org/164928@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-10 21:19:51 +00:00
if (recovery.isConstant())
trackedReferences.check(recovery.constant());
}
if (CodeBlock* baselineCodeBlock = inlineCallFrame->baselineCodeBlock.get())
trackedReferences.check(baselineCodeBlock);
DFG fragile frozen values are fundamentally broken https://bugs.webkit.org/show_bug.cgi?id=146602 Reviewed by Mark Lam. This change gets rid of the FragileValue value strength, because it was fundamentally broken. FragileValue was a value known to the compiler but not tracked by the GC in any way - it wasn't marked and it wasn't weak. This was used to support AI bootstrap for OSR must-handle values. The philosophy was that if the compiler did use the value for optimization, it would have been strengthened to a weak value (or maybe even a strong value, though we probably won't do that). But this was too much of a pipe dream. I've found at least one case where the compiler did use the value, but never strengthened it: it would happen if the value ended up in an OSR entry data expected value. Then if we GCed, we might have killed the value, but OSR entry would still try to use it for validation. That might have sort of just worked, but it's clearly shady. The reason why we made must-handle values fragile and not weak is that most of the time the values disappear from the abstract state: they are LUBed to a non-constant. If we kept them around as weak, we'd have too many cases of the GC killing the code because it thought that the value was somehow meaningful to the code when it was only used as a temporary artifact of optimization. So, it's true that it's very important for must-handle values not to automatically be weak or strong. It's also true that the values are necessary for AI bootstrap because we need to know what values OSR entry will require. But we shouldn't accomplish these goals by having the compiler hold onto what are essentially dangling pointers. This implements a better solution: instead of having InPlaceAbstractState bootstrap the AI with must-handle values at the beginning, we now widen the valuesAtHead of the must-handle block after AI converges. This widening is done in CFAPhase. This allows us to see if the must-handle values are necessary at all. In most cases, the widening takes a non-constant abstract value and simply amends something to its type based on the type of the must-handle value, and so the must-handle value never actually shows up in either the IR or any abstract value. In the unlikely event that the value at head is bottom, we freeze the must-handle value. This change removes FragileValue, and this freezing uses WeakValue as the strength. That makes sense: since the abstract value was bottom, the must-handle value becomes integral to the IR and so it makes no sense for the GC to keep the resulting CodeBlock alive if that must-handle value dies. This will sometimes happen for example if you have a very long-running loop whose pre-header allocates some object, but that pre-header appears to always exit to the optimizing JIT because it was only profiled once in the LLInt and that profiling appears insufficient to the DFG. In that case, we'll effectively constant-fold the references to the object inside the loop, which is both efficient (yay constant folding!) and necessary (otherwise we wouldn't know what the type of the variable should have been). Testing and debugging this is complicated. So, this adds some new capabilities: - DFG IR dumps also dump all of the FrozenValues that point to the heap along with their strengths, so that it's easy to see what GC objects the DFG feels are necessary for the compilation. - DFG OSR entry preparation prints out the OSR entry data structures, so that it's easy to see what GC pointers (and other things) are used for OSR entry validation. The printouts are quite detailed, and should also help other kinds of OSR entry debugging. - DFG::Plan now validates whether all of the GC pointers planted in the various JITCode data structures are also properly registered as either weak or strong pointers in the CodeBlock. This validation check previously failed due to fragile values ending up in the OSR entry data structures, both in the newly added test (dead-osr-entry-value.js) and in some pre-existing tests (like earley-boyer and 3d-raytrace). * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::stronglyVisitStrongReferences): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::visitAggregate): * bytecode/Operands.h: (JSC::Operands::operand): (JSC::Operands::hasOperand): * bytecode/StructureSet.cpp: (JSC::StructureSet::dump): (JSC::StructureSet::validateReferences): * bytecode/StructureSet.h: * bytecode/TrackedReferences.cpp: Added. (JSC::TrackedReferences::TrackedReferences): (JSC::TrackedReferences::~TrackedReferences): (JSC::TrackedReferences::add): (JSC::TrackedReferences::check): (JSC::TrackedReferences::dump): * bytecode/TrackedReferences.h: Added. * dfg/DFGAbstractValue.cpp: (JSC::DFG::AbstractValue::observeTransitions): (JSC::DFG::AbstractValue::set): (JSC::DFG::AbstractValue::fixTypeForRepresentation): (JSC::DFG::AbstractValue::mergeOSREntryValue): (JSC::DFG::AbstractValue::filter): (JSC::DFG::AbstractValue::dumpInContext): (JSC::DFG::AbstractValue::validateReferences): (JSC::DFG::AbstractValue::setOSREntryValue): Deleted. * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::fullTop): (JSC::DFG::AbstractValue::merge): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::validateReferences): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::requiredRegisterCountForExecutionAndExit): * dfg/DFGFrozenValue.h: (JSC::DFG::FrozenValue::FrozenValue): (JSC::DFG::FrozenValue::strengthenTo): (JSC::DFG::FrozenValue::pointsToHeap): (JSC::DFG::FrozenValue::strength): (JSC::DFG::FrozenValue::freeze): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::registerFrozenValues): (JSC::DFG::Graph::visitChildren): (JSC::DFG::Graph::freeze): (JSC::DFG::Graph::freezeStrong): (JSC::DFG::Graph::freezeFragile): Deleted. * dfg/DFGGraph.h: * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::setOptimizationThresholdBasedOnCompilationResult): (JSC::DFG::JITCode::validateReferences): * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::addressOfDoubleConstant): (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::branchStructurePtr): (JSC::DFG::JITCompiler::jitCode): (JSC::DFG::JITCompiler::noticeOSREntry): Deleted. * dfg/DFGMinifiedGraph.cpp: Added. (JSC::DFG::MinifiedGraph::prepareAndShrink): (JSC::DFG::MinifiedGraph::validateReferences): * dfg/DFGMinifiedGraph.h: (JSC::DFG::MinifiedGraph::append): (JSC::DFG::MinifiedGraph::prepareAndShrink): Deleted. * dfg/DFGOSREntry.cpp: (JSC::DFG::OSREntryData::dumpInContext): (JSC::DFG::OSREntryData::dump): (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): * dfg/DFGStructureAbstractValue.cpp: (JSC::DFG::StructureAbstractValue::dump): (JSC::DFG::StructureAbstractValue::validateReferences): * dfg/DFGStructureAbstractValue.h: * dfg/DFGValidate.cpp: (JSC::DFG::Validate::validate): * dfg/DFGValueStrength.cpp: (WTF::printInternal): * dfg/DFGValueStrength.h: (JSC::DFG::merge): * ftl/FTLExitPropertyValue.cpp: (JSC::FTL::ExitPropertyValue::dump): (JSC::FTL::ExitPropertyValue::validateReferences): * ftl/FTLExitPropertyValue.h: * ftl/FTLExitTimeObjectMaterialization.cpp: (JSC::FTL::ExitTimeObjectMaterialization::dump): (JSC::FTL::ExitTimeObjectMaterialization::validateReferences): * ftl/FTLExitTimeObjectMaterialization.h: * ftl/FTLExitValue.cpp: (JSC::FTL::ExitValue::dump): (JSC::FTL::ExitValue::validateReferences): * ftl/FTLExitValue.h: * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::dfgCommon): (JSC::FTL::JITCode::validateReferences): * ftl/FTLJITCode.h: (JSC::FTL::JITCode::handles): (JSC::FTL::JITCode::dataSections): * ftl/FTLOSRExit.cpp: (JSC::FTL::OSRExit::codeLocationForRepatch): (JSC::FTL::OSRExit::validateReferences): * ftl/FTLOSRExit.h: (JSC::FTL::OSRExit::considerAddingAsFrequentExitSite): * jit/JITCode.cpp: (JSC::JITCode::typeName): (JSC::JITCode::validateReferences): (JSC::JITCode::execute): * jit/JITCode.h: (JSC::JITCode::start): * tests/stress/dead-osr-entry-value.js: Added. (foo): Canonical link: https://commits.webkit.org/164928@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-10 21:19:51 +00:00
if (inlineCallFrame->calleeRecovery.isConstant())
trackedReferences.check(inlineCallFrame->calleeRecovery.constant());
}
}
DFG should have adaptive structure watchpoints https://bugs.webkit.org/show_bug.cgi?id=146929 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Before this change, if you wanted to efficiently validate whether an object has (or doesn't have) a property, you'd check that the object still has the structure that you first saw the object have. We optimized this a bit with transition watchpoints on the structure, which sometimes allowed us to elide the structure check. But this approach fails when that object frequently has new properties added to it. This would change the structure and fire the transition watchpoint, so the code we emitted would be invalid and we'd have to recompile either the IC or an entire code block. This change introduces a new concept: an object property condition. This value describes some condition involving a property on some object. There are four kinds: presence, absence, absence-of-setter, and equivalence. For example, a presence condition says that we expect that the object has some property at some offset with some attributes. This allows us to implement a new kind of watchpoint, which knows about the object property condition that it's being used to enforce. If the watchpoint fires because of a structure transition, the watchpoint may simply reinstall itself on the new structure. Object property conditions are used on the prototype chain of PutById transitions, GetById misses, and prototype accesses. They are also used for any DFG accesses to object constants, including global property accesses. Mostly because of the effect on global property access, this is a 9% speed-up on Kraken. It's neutral on most other things. It's a 68x speed-up on a microbenchmark that illustrates the prototype chain situation. It's also a small speed-up on getter-richards. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printGetByIdCacheStatus): (JSC::CodeBlock::printPutByIdCacheStatus): * bytecode/CodeBlockJettisoningWatchpoint.cpp: (JSC::CodeBlockJettisoningWatchpoint::fireInternal): * bytecode/ComplexGetStatus.cpp: (JSC::ComplexGetStatus::computeFor): * bytecode/ComplexGetStatus.h: (JSC::ComplexGetStatus::ComplexGetStatus): (JSC::ComplexGetStatus::takesSlowPath): (JSC::ComplexGetStatus::kind): (JSC::ComplexGetStatus::offset): (JSC::ComplexGetStatus::conditionSet): (JSC::ComplexGetStatus::attributes): Deleted. (JSC::ComplexGetStatus::specificValue): Deleted. (JSC::ComplexGetStatus::chain): Deleted. * bytecode/ConstantStructureCheck.cpp: Removed. * bytecode/ConstantStructureCheck.h: Removed. * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeForStubInfo): * bytecode/GetByIdVariant.cpp: (JSC::GetByIdVariant::GetByIdVariant): (JSC::GetByIdVariant::~GetByIdVariant): (JSC::GetByIdVariant::operator=): (JSC::GetByIdVariant::attemptToMerge): (JSC::GetByIdVariant::dumpInContext): (JSC::GetByIdVariant::baseStructure): Deleted. * bytecode/GetByIdVariant.h: (JSC::GetByIdVariant::operator!): (JSC::GetByIdVariant::structureSet): (JSC::GetByIdVariant::conditionSet): (JSC::GetByIdVariant::offset): (JSC::GetByIdVariant::callLinkStatus): (JSC::GetByIdVariant::constantChecks): Deleted. (JSC::GetByIdVariant::alternateBase): Deleted. * bytecode/ObjectPropertyCondition.cpp: Added. (JSC::ObjectPropertyCondition::dumpInContext): (JSC::ObjectPropertyCondition::dump): (JSC::ObjectPropertyCondition::structureEnsuresValidityAssumingImpurePropertyWatchpoint): (JSC::ObjectPropertyCondition::validityRequiresImpurePropertyWatchpoint): (JSC::ObjectPropertyCondition::isStillValid): (JSC::ObjectPropertyCondition::structureEnsuresValidity): (JSC::ObjectPropertyCondition::isWatchableAssumingImpurePropertyWatchpoint): (JSC::ObjectPropertyCondition::isWatchable): (JSC::ObjectPropertyCondition::isStillLive): (JSC::ObjectPropertyCondition::validateReferences): (JSC::ObjectPropertyCondition::attemptToMakeEquivalenceWithoutBarrier): * bytecode/ObjectPropertyCondition.h: Added. (JSC::ObjectPropertyCondition::ObjectPropertyCondition): (JSC::ObjectPropertyCondition::presenceWithoutBarrier): (JSC::ObjectPropertyCondition::presence): (JSC::ObjectPropertyCondition::absenceWithoutBarrier): (JSC::ObjectPropertyCondition::absence): (JSC::ObjectPropertyCondition::absenceOfSetterWithoutBarrier): (JSC::ObjectPropertyCondition::absenceOfSetter): (JSC::ObjectPropertyCondition::equivalenceWithoutBarrier): (JSC::ObjectPropertyCondition::equivalence): (JSC::ObjectPropertyCondition::operator!): (JSC::ObjectPropertyCondition::object): (JSC::ObjectPropertyCondition::condition): (JSC::ObjectPropertyCondition::kind): (JSC::ObjectPropertyCondition::uid): (JSC::ObjectPropertyCondition::hasOffset): (JSC::ObjectPropertyCondition::offset): (JSC::ObjectPropertyCondition::hasAttributes): (JSC::ObjectPropertyCondition::attributes): (JSC::ObjectPropertyCondition::hasPrototype): (JSC::ObjectPropertyCondition::prototype): (JSC::ObjectPropertyCondition::hasRequiredValue): (JSC::ObjectPropertyCondition::requiredValue): (JSC::ObjectPropertyCondition::hash): (JSC::ObjectPropertyCondition::operator==): (JSC::ObjectPropertyCondition::isHashTableDeletedValue): (JSC::ObjectPropertyCondition::isCompatibleWith): (JSC::ObjectPropertyCondition::watchingRequiresStructureTransitionWatchpoint): (JSC::ObjectPropertyCondition::watchingRequiresReplacementWatchpoint): (JSC::ObjectPropertyCondition::isValidValueForPresence): (JSC::ObjectPropertyConditionHash::hash): (JSC::ObjectPropertyConditionHash::equal): * bytecode/ObjectPropertyConditionSet.cpp: Added. (JSC::ObjectPropertyConditionSet::forObject): (JSC::ObjectPropertyConditionSet::forConditionKind): (JSC::ObjectPropertyConditionSet::numberOfConditionsWithKind): (JSC::ObjectPropertyConditionSet::hasOneSlotBaseCondition): (JSC::ObjectPropertyConditionSet::slotBaseCondition): (JSC::ObjectPropertyConditionSet::mergedWith): (JSC::ObjectPropertyConditionSet::structuresEnsureValidity): (JSC::ObjectPropertyConditionSet::structuresEnsureValidityAssumingImpurePropertyWatchpoint): (JSC::ObjectPropertyConditionSet::needImpurePropertyWatchpoint): (JSC::ObjectPropertyConditionSet::areStillLive): (JSC::ObjectPropertyConditionSet::dumpInContext): (JSC::ObjectPropertyConditionSet::dump): (JSC::generateConditionsForPropertyMiss): (JSC::generateConditionsForPropertySetterMiss): (JSC::generateConditionsForPrototypePropertyHit): (JSC::generateConditionsForPrototypePropertyHitCustom): (JSC::generateConditionsForPropertySetterMissConcurrently): * bytecode/ObjectPropertyConditionSet.h: Added. (JSC::ObjectPropertyConditionSet::ObjectPropertyConditionSet): (JSC::ObjectPropertyConditionSet::invalid): (JSC::ObjectPropertyConditionSet::nonEmpty): (JSC::ObjectPropertyConditionSet::isValid): (JSC::ObjectPropertyConditionSet::isEmpty): (JSC::ObjectPropertyConditionSet::begin): (JSC::ObjectPropertyConditionSet::end): (JSC::ObjectPropertyConditionSet::releaseRawPointer): (JSC::ObjectPropertyConditionSet::adoptRawPointer): (JSC::ObjectPropertyConditionSet::fromRawPointer): (JSC::ObjectPropertyConditionSet::Data::Data): * bytecode/PolymorphicGetByIdList.cpp: (JSC::GetByIdAccess::GetByIdAccess): (JSC::GetByIdAccess::~GetByIdAccess): (JSC::GetByIdAccess::visitWeak): * bytecode/PolymorphicGetByIdList.h: (JSC::GetByIdAccess::GetByIdAccess): (JSC::GetByIdAccess::structure): (JSC::GetByIdAccess::conditionSet): (JSC::GetByIdAccess::stubRoutine): (JSC::GetByIdAccess::chain): Deleted. (JSC::GetByIdAccess::chainCount): Deleted. * bytecode/PolymorphicPutByIdList.cpp: (JSC::PutByIdAccess::fromStructureStubInfo): (JSC::PutByIdAccess::visitWeak): * bytecode/PolymorphicPutByIdList.h: (JSC::PutByIdAccess::PutByIdAccess): (JSC::PutByIdAccess::transition): (JSC::PutByIdAccess::setter): (JSC::PutByIdAccess::newStructure): (JSC::PutByIdAccess::conditionSet): (JSC::PutByIdAccess::stubRoutine): (JSC::PutByIdAccess::chain): Deleted. (JSC::PutByIdAccess::chainCount): Deleted. * bytecode/PropertyCondition.cpp: Added. (JSC::PropertyCondition::dumpInContext): (JSC::PropertyCondition::dump): (JSC::PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint): (JSC::PropertyCondition::validityRequiresImpurePropertyWatchpoint): (JSC::PropertyCondition::isStillValid): (JSC::PropertyCondition::isWatchableWhenValid): (JSC::PropertyCondition::isWatchableAssumingImpurePropertyWatchpoint): (JSC::PropertyCondition::isWatchable): (JSC::PropertyCondition::isStillLive): (JSC::PropertyCondition::validateReferences): (JSC::PropertyCondition::isValidValueForAttributes): (JSC::PropertyCondition::isValidValueForPresence): (JSC::PropertyCondition::attemptToMakeEquivalenceWithoutBarrier): (WTF::printInternal): * bytecode/PropertyCondition.h: Added. (JSC::PropertyCondition::PropertyCondition): (JSC::PropertyCondition::presenceWithoutBarrier): (JSC::PropertyCondition::presence): (JSC::PropertyCondition::absenceWithoutBarrier): (JSC::PropertyCondition::absence): (JSC::PropertyCondition::absenceOfSetterWithoutBarrier): (JSC::PropertyCondition::absenceOfSetter): (JSC::PropertyCondition::equivalenceWithoutBarrier): (JSC::PropertyCondition::equivalence): (JSC::PropertyCondition::operator!): (JSC::PropertyCondition::kind): (JSC::PropertyCondition::uid): (JSC::PropertyCondition::hasOffset): (JSC::PropertyCondition::offset): (JSC::PropertyCondition::hasAttributes): (JSC::PropertyCondition::attributes): (JSC::PropertyCondition::hasPrototype): (JSC::PropertyCondition::prototype): (JSC::PropertyCondition::hasRequiredValue): (JSC::PropertyCondition::requiredValue): (JSC::PropertyCondition::hash): (JSC::PropertyCondition::operator==): (JSC::PropertyCondition::isHashTableDeletedValue): (JSC::PropertyCondition::isCompatibleWith): (JSC::PropertyCondition::watchingRequiresStructureTransitionWatchpoint): (JSC::PropertyCondition::watchingRequiresReplacementWatchpoint): (JSC::PropertyConditionHash::hash): (JSC::PropertyConditionHash::equal): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC::PutByIdStatus::computeFor): (JSC::PutByIdStatus::computeForStubInfo): * bytecode/PutByIdVariant.cpp: (JSC::PutByIdVariant::operator=): (JSC::PutByIdVariant::transition): (JSC::PutByIdVariant::setter): (JSC::PutByIdVariant::makesCalls): (JSC::PutByIdVariant::attemptToMerge): (JSC::PutByIdVariant::attemptToMergeTransitionWithReplace): (JSC::PutByIdVariant::dumpInContext): (JSC::PutByIdVariant::baseStructure): Deleted. * bytecode/PutByIdVariant.h: (JSC::PutByIdVariant::PutByIdVariant): (JSC::PutByIdVariant::kind): (JSC::PutByIdVariant::structure): (JSC::PutByIdVariant::structureSet): (JSC::PutByIdVariant::oldStructure): (JSC::PutByIdVariant::conditionSet): (JSC::PutByIdVariant::offset): (JSC::PutByIdVariant::callLinkStatus): (JSC::PutByIdVariant::constantChecks): Deleted. (JSC::PutByIdVariant::alternateBase): Deleted. * bytecode/StructureStubClearingWatchpoint.cpp: (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint): (JSC::StructureStubClearingWatchpoint::push): (JSC::StructureStubClearingWatchpoint::fireInternal): (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo): (JSC::WatchpointsOnStructureStubInfo::addWatchpoint): (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint): * bytecode/StructureStubClearingWatchpoint.h: (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint): (JSC::WatchpointsOnStructureStubInfo::codeBlock): (JSC::WatchpointsOnStructureStubInfo::stubInfo): * bytecode/StructureStubInfo.cpp: (JSC::StructureStubInfo::deref): (JSC::StructureStubInfo::visitWeakReferences): * bytecode/StructureStubInfo.h: (JSC::StructureStubInfo::initPutByIdTransition): (JSC::StructureStubInfo::initPutByIdReplace): (JSC::StructureStubInfo::setSeen): (JSC::StructureStubInfo::addWatchpoint): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp: Added. (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::AdaptiveInferredPropertyValueWatchpoint): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::install): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::fire): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::StructureWatchpoint::fireInternal): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::PropertyWatchpoint::fireInternal): * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h: Added. (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::key): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::StructureWatchpoint::StructureWatchpoint): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::PropertyWatchpoint::PropertyWatchpoint): * dfg/DFGAdaptiveStructureWatchpoint.cpp: Added. (JSC::DFG::AdaptiveStructureWatchpoint::AdaptiveStructureWatchpoint): (JSC::DFG::AdaptiveStructureWatchpoint::install): (JSC::DFG::AdaptiveStructureWatchpoint::fireInternal): * dfg/DFGAdaptiveStructureWatchpoint.h: Added. (JSC::DFG::AdaptiveStructureWatchpoint::key): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::cellConstantWithStructureCheck): (JSC::DFG::ByteCodeParser::handleConstantInternalFunction): (JSC::DFG::ByteCodeParser::handleGetByOffset): (JSC::DFG::ByteCodeParser::handlePutByOffset): (JSC::DFG::ByteCodeParser::check): (JSC::DFG::ByteCodeParser::promoteToConstant): (JSC::DFG::ByteCodeParser::planLoad): (JSC::DFG::ByteCodeParser::load): (JSC::DFG::ByteCodeParser::presenceLike): (JSC::DFG::ByteCodeParser::checkPresenceLike): (JSC::DFG::ByteCodeParser::store): (JSC::DFG::ByteCodeParser::handleGetById): (JSC::DFG::ByteCodeParser::handlePutById): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::emitChecks): Deleted. * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::validateReferences): * dfg/DFGCommonData.h: * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::emitGetByOffset): (JSC::DFG::ConstantFoldingPhase::addBaseCheck): (JSC::DFG::ConstantFoldingPhase::addStructureTransitionCheck): (JSC::DFG::ConstantFoldingPhase::addChecks): Deleted. * dfg/DFGDesiredWatchpoints.cpp: (JSC::DFG::ArrayBufferViewWatchpointAdaptor::add): (JSC::DFG::InferredValueAdaptor::add): (JSC::DFG::AdaptiveStructureWatchpointAdaptor::add): (JSC::DFG::DesiredWatchpoints::DesiredWatchpoints): (JSC::DFG::DesiredWatchpoints::addLazily): (JSC::DFG::DesiredWatchpoints::consider): (JSC::DFG::DesiredWatchpoints::reallyAdd): (JSC::DFG::DesiredWatchpoints::areStillValid): (JSC::DFG::DesiredWatchpoints::dumpInContext): * dfg/DFGDesiredWatchpoints.h: (JSC::DFG::SetPointerAdaptor::add): (JSC::DFG::SetPointerAdaptor::hasBeenInvalidated): (JSC::DFG::SetPointerAdaptor::dumpInContext): (JSC::DFG::InferredValueAdaptor::hasBeenInvalidated): (JSC::DFG::InferredValueAdaptor::dumpInContext): (JSC::DFG::ArrayBufferViewWatchpointAdaptor::hasBeenInvalidated): (JSC::DFG::ArrayBufferViewWatchpointAdaptor::dumpInContext): (JSC::DFG::AdaptiveStructureWatchpointAdaptor::hasBeenInvalidated): (JSC::DFG::AdaptiveStructureWatchpointAdaptor::dumpInContext): (JSC::DFG::GenericDesiredWatchpoints::reallyAdd): (JSC::DFG::GenericDesiredWatchpoints::isWatched): (JSC::DFG::GenericDesiredWatchpoints::dumpInContext): (JSC::DFG::DesiredWatchpoints::isWatched): (JSC::DFG::GenericSetAdaptor::add): Deleted. (JSC::DFG::GenericSetAdaptor::hasBeenInvalidated): Deleted. * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::addLazily): (JSC::DFG::DesiredWeakReferences::contains): * dfg/DFGDesiredWeakReferences.h: * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::clearFlagsOnAllNodes): (JSC::DFG::Graph::watchCondition): (JSC::DFG::Graph::isSafeToLoad): (JSC::DFG::Graph::livenessFor): (JSC::DFG::Graph::tryGetConstantProperty): (JSC::DFG::Graph::visitChildren): * dfg/DFGGraph.h: (JSC::DFG::Graph::identifiers): (JSC::DFG::Graph::watchpoints): * dfg/DFGMultiGetByOffsetData.cpp: Added. (JSC::DFG::GetByOffsetMethod::dumpInContext): (JSC::DFG::GetByOffsetMethod::dump): (JSC::DFG::MultiGetByOffsetCase::dumpInContext): (JSC::DFG::MultiGetByOffsetCase::dump): (WTF::printInternal): * dfg/DFGMultiGetByOffsetData.h: Added. (JSC::DFG::GetByOffsetMethod::GetByOffsetMethod): (JSC::DFG::GetByOffsetMethod::constant): (JSC::DFG::GetByOffsetMethod::load): (JSC::DFG::GetByOffsetMethod::loadFromPrototype): (JSC::DFG::GetByOffsetMethod::operator!): (JSC::DFG::GetByOffsetMethod::kind): (JSC::DFG::GetByOffsetMethod::prototype): (JSC::DFG::GetByOffsetMethod::offset): (JSC::DFG::MultiGetByOffsetCase::MultiGetByOffsetCase): (JSC::DFG::MultiGetByOffsetCase::set): (JSC::DFG::MultiGetByOffsetCase::method): * dfg/DFGNode.h: * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGStructureRegistrationPhase.cpp: (JSC::DFG::StructureRegistrationPhase::run): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileMultiGetByOffset): * jit/Repatch.cpp: (JSC::repatchByIdSelfAccess): (JSC::checkObjectPropertyCondition): (JSC::checkObjectPropertyConditions): (JSC::replaceWithJump): (JSC::generateByIdStub): (JSC::actionForCell): (JSC::tryBuildGetByIDList): (JSC::emitPutReplaceStub): (JSC::emitPutTransitionStub): (JSC::tryCachePutByID): (JSC::tryBuildPutByIdList): (JSC::tryRepatchIn): (JSC::addStructureTransitionCheck): Deleted. (JSC::emitPutTransitionStubAndGetOldStructure): Deleted. * runtime/IntendedStructureChain.cpp: Removed. * runtime/IntendedStructureChain.h: Removed. * runtime/JSCJSValue.h: * runtime/JSObject.cpp: (JSC::throwTypeError): (JSC::JSObject::convertToDictionary): (JSC::JSObject::shiftButterflyAfterFlattening): * runtime/JSObject.h: (JSC::JSObject::flattenDictionaryObject): (JSC::JSObject::convertToDictionary): Deleted. * runtime/Operations.h: (JSC::normalizePrototypeChain): (JSC::normalizePrototypeChainForChainAccess): Deleted. (JSC::isPrototypeChainNormalized): Deleted. * runtime/PropertySlot.h: (JSC::PropertySlot::PropertySlot): (JSC::PropertySlot::slotBase): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransition): (JSC::Structure::attributeChangeTransition): (JSC::Structure::toDictionaryTransition): (JSC::Structure::toCacheableDictionaryTransition): (JSC::Structure::toUncacheableDictionaryTransition): (JSC::Structure::ensurePropertyReplacementWatchpointSet): (JSC::Structure::startWatchingPropertyForReplacements): (JSC::Structure::didCachePropertyReplacement): (JSC::Structure::dump): * runtime/Structure.h: * runtime/VM.h: * tests/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check-new.js: Added. (foo): (bar): (baz): * tests/stress/multi-get-by-offset-self-or-proto.js: Added. (foo): * tests/stress/replacement-watchpoint-dictionary.js: Added. (foo): * tests/stress/replacement-watchpoint.js: Added. (foo): * tests/stress/undefined-access-dictionary-then-proto-change.js: Added. (foo): * tests/stress/undefined-access-then-proto-change.js: Added. (foo): LayoutTests: * js/regress/global-object-access-with-mutating-structure-expected.txt: Added. * js/regress/global-object-access-with-mutating-structure.html: Added. * js/regress/prototype-access-with-mutating-prototype-expected.txt: Added. * js/regress/prototype-access-with-mutating-prototype.html: Added. * js/regress/script-tests/global-object-access-with-mutating-structure.js: Added. (foo): * js/regress/script-tests/prototype-access-with-mutating-prototype.js: Added. (foo): * js/regress/script-tests/undefined-property-access.js: (foo): (bar): (baz): Canonical link: https://commits.webkit.org/165654@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-03 23:13:56 +00:00
[JSC] Do not use Bag<> for DFG / FTL watchpoints https://bugs.webkit.org/show_bug.cgi?id=224715 Reviewed by Darin Adler. While Bag<> is useful since its allocated memory will not be moved, this is really memory-inefficient data structure. Each entry gets a tail pointer (so adding 8 bytes) and we allocate each entry separately. In DFG and FTL, we are using Bag<> for watchpoints. But this is not necessary actually: thanks to concurrent compilers, our watchpoint registration is batched at the end of compilation. This means that we have a way to know how many watchpoints we should register at that point. In this patch, we introduce WatchpointCollector. In DesiredGlobalProperties, we run reallyAdd twice with WatchpointCollector. First time, we just count # of watchpoints. Then we allocate FixedVector<XXXWatchpoint> and install them. Since we do not (cannot) grow this fixed vector, watchpoint's address will not be changed as required. We also move DesiredGlobalProperties under DesiredWatchpoints since this basically registers watchpoints. * bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp: (JSC::AdaptiveInferredPropertyValueWatchpointBase::AdaptiveInferredPropertyValueWatchpointBase): (JSC::AdaptiveInferredPropertyValueWatchpointBase::initialize): * bytecode/AdaptiveInferredPropertyValueWatchpointBase.h: * bytecode/CodeBlockJettisoningWatchpoint.h: * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp: (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::AdaptiveInferredPropertyValueWatchpoint): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::initialize): * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h: * dfg/DFGAdaptiveStructureWatchpoint.cpp: (JSC::DFG::AdaptiveStructureWatchpoint::AdaptiveStructureWatchpoint): (JSC::DFG::AdaptiveStructureWatchpoint::initialize): * dfg/DFGAdaptiveStructureWatchpoint.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::validateReferences): (JSC::DFG::CommonData::clearWatchpoints): * dfg/DFGCommonData.h: * dfg/DFGDesiredGlobalProperties.cpp: (JSC::DFG::DesiredGlobalProperties::reallyAdd): * dfg/DFGDesiredGlobalProperties.h: * dfg/DFGDesiredWatchpoints.cpp: (JSC::DFG::ArrayBufferViewWatchpointAdaptor::add): (JSC::DFG::SymbolTableAdaptor::add): (JSC::DFG::FunctionExecutableAdaptor::add): (JSC::DFG::AdaptiveStructureWatchpointAdaptor::add): (JSC::DFG::DesiredWatchpoints::addLazily): (JSC::DFG::DesiredWatchpoints::reallyAdd): (JSC::DFG::DesiredWatchpoints::areStillValidOnMainThread): (JSC::DFG::WatchpointCollector::finalize): * dfg/DFGDesiredWatchpoints.h: (JSC::DFG::SetPointerAdaptor::add): (JSC::DFG::GenericDesiredWatchpoints::reallyAdd): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::watchGlobalProperty): * dfg/DFGGraph.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::reallyAdd): (JSC::DFG::Plan::isStillValidOnMainThread): (JSC::DFG::Plan::cancel): * dfg/DFGPlan.h: (JSC::DFG::Plan::transitions): (JSC::DFG::Plan::globalProperties): Deleted. Canonical link: https://commits.webkit.org/236708@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-18 08:06:48 +00:00
for (auto& watchpoint : m_adaptiveStructureWatchpoints)
watchpoint.key().validateReferences(trackedReferences);
DFG fragile frozen values are fundamentally broken https://bugs.webkit.org/show_bug.cgi?id=146602 Reviewed by Mark Lam. This change gets rid of the FragileValue value strength, because it was fundamentally broken. FragileValue was a value known to the compiler but not tracked by the GC in any way - it wasn't marked and it wasn't weak. This was used to support AI bootstrap for OSR must-handle values. The philosophy was that if the compiler did use the value for optimization, it would have been strengthened to a weak value (or maybe even a strong value, though we probably won't do that). But this was too much of a pipe dream. I've found at least one case where the compiler did use the value, but never strengthened it: it would happen if the value ended up in an OSR entry data expected value. Then if we GCed, we might have killed the value, but OSR entry would still try to use it for validation. That might have sort of just worked, but it's clearly shady. The reason why we made must-handle values fragile and not weak is that most of the time the values disappear from the abstract state: they are LUBed to a non-constant. If we kept them around as weak, we'd have too many cases of the GC killing the code because it thought that the value was somehow meaningful to the code when it was only used as a temporary artifact of optimization. So, it's true that it's very important for must-handle values not to automatically be weak or strong. It's also true that the values are necessary for AI bootstrap because we need to know what values OSR entry will require. But we shouldn't accomplish these goals by having the compiler hold onto what are essentially dangling pointers. This implements a better solution: instead of having InPlaceAbstractState bootstrap the AI with must-handle values at the beginning, we now widen the valuesAtHead of the must-handle block after AI converges. This widening is done in CFAPhase. This allows us to see if the must-handle values are necessary at all. In most cases, the widening takes a non-constant abstract value and simply amends something to its type based on the type of the must-handle value, and so the must-handle value never actually shows up in either the IR or any abstract value. In the unlikely event that the value at head is bottom, we freeze the must-handle value. This change removes FragileValue, and this freezing uses WeakValue as the strength. That makes sense: since the abstract value was bottom, the must-handle value becomes integral to the IR and so it makes no sense for the GC to keep the resulting CodeBlock alive if that must-handle value dies. This will sometimes happen for example if you have a very long-running loop whose pre-header allocates some object, but that pre-header appears to always exit to the optimizing JIT because it was only profiled once in the LLInt and that profiling appears insufficient to the DFG. In that case, we'll effectively constant-fold the references to the object inside the loop, which is both efficient (yay constant folding!) and necessary (otherwise we wouldn't know what the type of the variable should have been). Testing and debugging this is complicated. So, this adds some new capabilities: - DFG IR dumps also dump all of the FrozenValues that point to the heap along with their strengths, so that it's easy to see what GC objects the DFG feels are necessary for the compilation. - DFG OSR entry preparation prints out the OSR entry data structures, so that it's easy to see what GC pointers (and other things) are used for OSR entry validation. The printouts are quite detailed, and should also help other kinds of OSR entry debugging. - DFG::Plan now validates whether all of the GC pointers planted in the various JITCode data structures are also properly registered as either weak or strong pointers in the CodeBlock. This validation check previously failed due to fragile values ending up in the OSR entry data structures, both in the newly added test (dead-osr-entry-value.js) and in some pre-existing tests (like earley-boyer and 3d-raytrace). * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::stronglyVisitStrongReferences): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::visitAggregate): * bytecode/Operands.h: (JSC::Operands::operand): (JSC::Operands::hasOperand): * bytecode/StructureSet.cpp: (JSC::StructureSet::dump): (JSC::StructureSet::validateReferences): * bytecode/StructureSet.h: * bytecode/TrackedReferences.cpp: Added. (JSC::TrackedReferences::TrackedReferences): (JSC::TrackedReferences::~TrackedReferences): (JSC::TrackedReferences::add): (JSC::TrackedReferences::check): (JSC::TrackedReferences::dump): * bytecode/TrackedReferences.h: Added. * dfg/DFGAbstractValue.cpp: (JSC::DFG::AbstractValue::observeTransitions): (JSC::DFG::AbstractValue::set): (JSC::DFG::AbstractValue::fixTypeForRepresentation): (JSC::DFG::AbstractValue::mergeOSREntryValue): (JSC::DFG::AbstractValue::filter): (JSC::DFG::AbstractValue::dumpInContext): (JSC::DFG::AbstractValue::validateReferences): (JSC::DFG::AbstractValue::setOSREntryValue): Deleted. * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::fullTop): (JSC::DFG::AbstractValue::merge): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::validateReferences): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::requiredRegisterCountForExecutionAndExit): * dfg/DFGFrozenValue.h: (JSC::DFG::FrozenValue::FrozenValue): (JSC::DFG::FrozenValue::strengthenTo): (JSC::DFG::FrozenValue::pointsToHeap): (JSC::DFG::FrozenValue::strength): (JSC::DFG::FrozenValue::freeze): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::registerFrozenValues): (JSC::DFG::Graph::visitChildren): (JSC::DFG::Graph::freeze): (JSC::DFG::Graph::freezeStrong): (JSC::DFG::Graph::freezeFragile): Deleted. * dfg/DFGGraph.h: * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::setOptimizationThresholdBasedOnCompilationResult): (JSC::DFG::JITCode::validateReferences): * dfg/DFGJITCode.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::addressOfDoubleConstant): (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::branchStructurePtr): (JSC::DFG::JITCompiler::jitCode): (JSC::DFG::JITCompiler::noticeOSREntry): Deleted. * dfg/DFGMinifiedGraph.cpp: Added. (JSC::DFG::MinifiedGraph::prepareAndShrink): (JSC::DFG::MinifiedGraph::validateReferences): * dfg/DFGMinifiedGraph.h: (JSC::DFG::MinifiedGraph::append): (JSC::DFG::MinifiedGraph::prepareAndShrink): Deleted. * dfg/DFGOSREntry.cpp: (JSC::DFG::OSREntryData::dumpInContext): (JSC::DFG::OSREntryData::dump): (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): * dfg/DFGStructureAbstractValue.cpp: (JSC::DFG::StructureAbstractValue::dump): (JSC::DFG::StructureAbstractValue::validateReferences): * dfg/DFGStructureAbstractValue.h: * dfg/DFGValidate.cpp: (JSC::DFG::Validate::validate): * dfg/DFGValueStrength.cpp: (WTF::printInternal): * dfg/DFGValueStrength.h: (JSC::DFG::merge): * ftl/FTLExitPropertyValue.cpp: (JSC::FTL::ExitPropertyValue::dump): (JSC::FTL::ExitPropertyValue::validateReferences): * ftl/FTLExitPropertyValue.h: * ftl/FTLExitTimeObjectMaterialization.cpp: (JSC::FTL::ExitTimeObjectMaterialization::dump): (JSC::FTL::ExitTimeObjectMaterialization::validateReferences): * ftl/FTLExitTimeObjectMaterialization.h: * ftl/FTLExitValue.cpp: (JSC::FTL::ExitValue::dump): (JSC::FTL::ExitValue::validateReferences): * ftl/FTLExitValue.h: * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::dfgCommon): (JSC::FTL::JITCode::validateReferences): * ftl/FTLJITCode.h: (JSC::FTL::JITCode::handles): (JSC::FTL::JITCode::dataSections): * ftl/FTLOSRExit.cpp: (JSC::FTL::OSRExit::codeLocationForRepatch): (JSC::FTL::OSRExit::validateReferences): * ftl/FTLOSRExit.h: (JSC::FTL::OSRExit::considerAddingAsFrequentExitSite): * jit/JITCode.cpp: (JSC::JITCode::typeName): (JSC::JITCode::validateReferences): (JSC::JITCode::execute): * jit/JITCode.h: (JSC::JITCode::start): * tests/stress/dead-osr-entry-value.js: Added. (foo): Canonical link: https://commits.webkit.org/164928@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-10 21:19:51 +00:00
}
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
void CommonData::finalizeCatchEntrypoints(Vector<CatchEntrypointData>&& catchEntrypoints)
Support compiling catch in the FTL https://bugs.webkit.org/show_bug.cgi?id=175396 Reviewed by Filip Pizlo. This patch implements op_catch in the FTL. It extends the DFG implementation by supporting multiple entrypoints in DFG-SSA. This patch implements this by introducing an EntrySwitch node. When converting to SSA, we introduce a new root block with an EntrySwitch that has the previous DFG entrypoints as its successors. By convention, we pick the zeroth entry point index to be the op_enter entrypoint. Like in B3, in DFG-SSA, EntrySwitch just acts like a switch over the entrypoint index argument. DFG::EntrySwitch in the FTL simply lowers to B3::EntrySwitch. The EntrySwitch in the root block that SSAConversion creates can not exit because we would both not know where to exit to in the program: we would not have valid OSR exit state. This design also mandates that anything we hoist above EntrySwitch in the new root block can not exit since they also do not have valid OSR exit state. This patch also adds a new metadata node named InitializeEntrypointArguments. InitializeEntrypointArguments is a metadata node that initializes the flush format for the arguments at a given entrypoint. For a given entrypoint index, this node tells AI and OSRAvailabilityAnalysis what the flush format for each argument is. This allows each individual entrypoint to have an independent set of argument types. Currently, this won't happen in practice because ArgumentPosition unifies flush formats, but this is an implementation detail we probably want to modify in the future. SSAConversion will add InitializeEntrypointArguments to the beginning of each of the original DFG entrypoint blocks. This patch also adds the ability to specify custom prologue code generators in Air. This allows the FTL to specify a custom prologue for catch entrypoints that matches the op_catch OSR entry calling convention that the DFG uses. This way, the baseline JIT code OSR enters into op_catch the same way both in the DFG and the FTL. In the future, we can use this same mechanism to perform stack overflow checks instead of using a patchpoint. * b3/air/AirCode.cpp: (JSC::B3::Air::Code::isEntrypoint): (JSC::B3::Air::Code::entrypointIndex): * b3/air/AirCode.h: (JSC::B3::Air::Code::setPrologueForEntrypoint): (JSC::B3::Air::Code::prologueGeneratorForEntrypoint): * b3/air/AirGenerate.cpp: (JSC::B3::Air::generate): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGBasicBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFG.h: (JSC::DFG::selectCFG): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::invalidateCFG): (JSC::DFG::Graph::ensureCPSCFG): (JSC::DFG::Graph::methodOfGettingAValueProfileFor): * dfg/DFGGraph.h: (JSC::DFG::Graph::isEntrypoint): * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): (JSC::DFG::InPlaceAbstractState::mergeToSuccessors): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::shrinkToFit): (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGJITCode.h: (JSC::DFG::JITCode::catchOSREntryDataForBytecodeIndex): Deleted. (JSC::DFG::JITCode::appendCatchEntrypoint): Deleted. * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::noticeCatchEntrypoint): (JSC::DFG::JITCompiler::makeCatchOSREntryBuffer): * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::isEntrySwitch): (JSC::DFG::Node::isTerminal): (JSC::DFG::Node::entrySwitchData): (JSC::DFG::Node::numSuccessors): (JSC::DFG::Node::successor): (JSC::DFG::Node::entrypointIndex): * dfg/DFGNodeType.h: * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: (JSC::DFG::OSRAvailabilityAnalysisPhase::run): (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareCatchOSREntry): * dfg/DFGOSREntry.h: * dfg/DFGOSREntrypointCreationPhase.cpp: (JSC::DFG::OSREntrypointCreationPhase::run): * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::SSAConversionPhase): (JSC::DFG::SSAConversionPhase::run): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStaticExecutionCountEstimationPhase.cpp: (JSC::DFG::StaticExecutionCountEstimationPhase::run): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::lower): (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileExtractCatchLocal): (JSC::FTL::DFG::LowerDFGToB3::compileGetStack): (JSC::FTL::DFG::LowerDFGToB3::compileEntrySwitch): (JSC::FTL::DFG::LowerDFGToB3::speculate): (JSC::FTL::DFG::LowerDFGToB3::appendOSRExitDescriptor): (JSC::FTL::DFG::LowerDFGToB3::appendOSRExit): (JSC::FTL::DFG::LowerDFGToB3::blessSpeculation): * ftl/FTLOutput.cpp: (JSC::FTL::Output::entrySwitch): * ftl/FTLOutput.h: * jit/JITOperations.cpp: Canonical link: https://commits.webkit.org/192973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-05 03:21:33 +00:00
{
std::sort(catchEntrypoints.begin(), catchEntrypoints.end(),
[] (const CatchEntrypointData& a, const CatchEntrypointData& b) { return a.bytecodeIndex < b.bytecodeIndex; });
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
ASSERT(m_catchEntrypoints.isEmpty());
m_catchEntrypoints = WTFMove(catchEntrypoints);
Support compiling catch in the FTL https://bugs.webkit.org/show_bug.cgi?id=175396 Reviewed by Filip Pizlo. This patch implements op_catch in the FTL. It extends the DFG implementation by supporting multiple entrypoints in DFG-SSA. This patch implements this by introducing an EntrySwitch node. When converting to SSA, we introduce a new root block with an EntrySwitch that has the previous DFG entrypoints as its successors. By convention, we pick the zeroth entry point index to be the op_enter entrypoint. Like in B3, in DFG-SSA, EntrySwitch just acts like a switch over the entrypoint index argument. DFG::EntrySwitch in the FTL simply lowers to B3::EntrySwitch. The EntrySwitch in the root block that SSAConversion creates can not exit because we would both not know where to exit to in the program: we would not have valid OSR exit state. This design also mandates that anything we hoist above EntrySwitch in the new root block can not exit since they also do not have valid OSR exit state. This patch also adds a new metadata node named InitializeEntrypointArguments. InitializeEntrypointArguments is a metadata node that initializes the flush format for the arguments at a given entrypoint. For a given entrypoint index, this node tells AI and OSRAvailabilityAnalysis what the flush format for each argument is. This allows each individual entrypoint to have an independent set of argument types. Currently, this won't happen in practice because ArgumentPosition unifies flush formats, but this is an implementation detail we probably want to modify in the future. SSAConversion will add InitializeEntrypointArguments to the beginning of each of the original DFG entrypoint blocks. This patch also adds the ability to specify custom prologue code generators in Air. This allows the FTL to specify a custom prologue for catch entrypoints that matches the op_catch OSR entry calling convention that the DFG uses. This way, the baseline JIT code OSR enters into op_catch the same way both in the DFG and the FTL. In the future, we can use this same mechanism to perform stack overflow checks instead of using a patchpoint. * b3/air/AirCode.cpp: (JSC::B3::Air::Code::isEntrypoint): (JSC::B3::Air::Code::entrypointIndex): * b3/air/AirCode.h: (JSC::B3::Air::Code::setPrologueForEntrypoint): (JSC::B3::Air::Code::prologueGeneratorForEntrypoint): * b3/air/AirGenerate.cpp: (JSC::B3::Air::generate): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGBasicBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFG.h: (JSC::DFG::selectCFG): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::invalidateCFG): (JSC::DFG::Graph::ensureCPSCFG): (JSC::DFG::Graph::methodOfGettingAValueProfileFor): * dfg/DFGGraph.h: (JSC::DFG::Graph::isEntrypoint): * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): (JSC::DFG::InPlaceAbstractState::mergeToSuccessors): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::shrinkToFit): (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGJITCode.h: (JSC::DFG::JITCode::catchOSREntryDataForBytecodeIndex): Deleted. (JSC::DFG::JITCode::appendCatchEntrypoint): Deleted. * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::noticeCatchEntrypoint): (JSC::DFG::JITCompiler::makeCatchOSREntryBuffer): * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::isEntrySwitch): (JSC::DFG::Node::isTerminal): (JSC::DFG::Node::entrySwitchData): (JSC::DFG::Node::numSuccessors): (JSC::DFG::Node::successor): (JSC::DFG::Node::entrypointIndex): * dfg/DFGNodeType.h: * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: (JSC::DFG::OSRAvailabilityAnalysisPhase::run): (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareCatchOSREntry): * dfg/DFGOSREntry.h: * dfg/DFGOSREntrypointCreationPhase.cpp: (JSC::DFG::OSREntrypointCreationPhase::run): * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::SSAConversionPhase): (JSC::DFG::SSAConversionPhase::run): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStaticExecutionCountEstimationPhase.cpp: (JSC::DFG::StaticExecutionCountEstimationPhase::run): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::lower): (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileExtractCatchLocal): (JSC::FTL::DFG::LowerDFGToB3::compileGetStack): (JSC::FTL::DFG::LowerDFGToB3::compileEntrySwitch): (JSC::FTL::DFG::LowerDFGToB3::speculate): (JSC::FTL::DFG::LowerDFGToB3::appendOSRExitDescriptor): (JSC::FTL::DFG::LowerDFGToB3::appendOSRExit): (JSC::FTL::DFG::LowerDFGToB3::blessSpeculation): * ftl/FTLOutput.cpp: (JSC::FTL::Output::entrySwitch): * ftl/FTLOutput.h: * jit/JITOperations.cpp: Canonical link: https://commits.webkit.org/192973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-05 03:21:33 +00:00
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
#if ASSERT_ENABLED
[JSC] Change Vector<> to FixedVector<> in DFG::CommonData if possible https://bugs.webkit.org/show_bug.cgi?id=224588 Reviewed by Mark Lam. DFG::CommonData is kept alive so long as DFG code exists. It includes a lot of Vectors while they are not mutable after the DFG code compilation. This patch changes Vector<> to FixedVector<> if possible to shrink sizeof(DFG::CommonData). And this also removes the need of calling shrinkToFit explicitly for them. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::jettison): (JSC::CodeBlock::numberOfDFGIdentifiers const): (JSC::CodeBlock::identifier const): * bytecode/CodeBlock.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::CommonData::isVMTrapBreakpoint): (JSC::DFG::CommonData::finalizeCatchEntrypoints): (JSC::DFG::CommonData::notifyCompilingStructureTransition): Deleted. * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): Deleted. * dfg/DFGDesiredIdentifiers.cpp: (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredTransitions.cpp: (JSC::DFG::DesiredTransition::DesiredTransition): (JSC::DFG::DesiredTransitions::DesiredTransitions): (JSC::DFG::DesiredTransitions::addLazily): (JSC::DFG::DesiredTransitions::reallyAdd): (JSC::DFG::DesiredTransition::reallyAdd): Deleted. * dfg/DFGDesiredTransitions.h: * dfg/DFGDesiredWeakReferences.cpp: (JSC::DFG::DesiredWeakReferences::reallyAdd): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::noticeCatchEntrypoint): * dfg/DFGOSREntry.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::Plan): (JSC::DFG::Plan::finalizeWithoutNotifyingCallback): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compilePutStructure): (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset): (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint): Canonical link: https://commits.webkit.org/236557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 07:03:38 +00:00
for (unsigned i = 0; i + 1 < m_catchEntrypoints.size(); ++i)
ASSERT(m_catchEntrypoints[i].bytecodeIndex <= m_catchEntrypoints[i + 1].bytecodeIndex);
Support compiling catch in the FTL https://bugs.webkit.org/show_bug.cgi?id=175396 Reviewed by Filip Pizlo. This patch implements op_catch in the FTL. It extends the DFG implementation by supporting multiple entrypoints in DFG-SSA. This patch implements this by introducing an EntrySwitch node. When converting to SSA, we introduce a new root block with an EntrySwitch that has the previous DFG entrypoints as its successors. By convention, we pick the zeroth entry point index to be the op_enter entrypoint. Like in B3, in DFG-SSA, EntrySwitch just acts like a switch over the entrypoint index argument. DFG::EntrySwitch in the FTL simply lowers to B3::EntrySwitch. The EntrySwitch in the root block that SSAConversion creates can not exit because we would both not know where to exit to in the program: we would not have valid OSR exit state. This design also mandates that anything we hoist above EntrySwitch in the new root block can not exit since they also do not have valid OSR exit state. This patch also adds a new metadata node named InitializeEntrypointArguments. InitializeEntrypointArguments is a metadata node that initializes the flush format for the arguments at a given entrypoint. For a given entrypoint index, this node tells AI and OSRAvailabilityAnalysis what the flush format for each argument is. This allows each individual entrypoint to have an independent set of argument types. Currently, this won't happen in practice because ArgumentPosition unifies flush formats, but this is an implementation detail we probably want to modify in the future. SSAConversion will add InitializeEntrypointArguments to the beginning of each of the original DFG entrypoint blocks. This patch also adds the ability to specify custom prologue code generators in Air. This allows the FTL to specify a custom prologue for catch entrypoints that matches the op_catch OSR entry calling convention that the DFG uses. This way, the baseline JIT code OSR enters into op_catch the same way both in the DFG and the FTL. In the future, we can use this same mechanism to perform stack overflow checks instead of using a patchpoint. * b3/air/AirCode.cpp: (JSC::B3::Air::Code::isEntrypoint): (JSC::B3::Air::Code::entrypointIndex): * b3/air/AirCode.h: (JSC::B3::Air::Code::setPrologueForEntrypoint): (JSC::B3::Air::Code::prologueGeneratorForEntrypoint): * b3/air/AirGenerate.cpp: (JSC::B3::Air::generate): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGBasicBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFG.h: (JSC::DFG::selectCFG): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::shrinkToFit): (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGCommonData.h: (JSC::DFG::CommonData::catchOSREntryDataForBytecodeIndex): (JSC::DFG::CommonData::appendCatchEntrypoint): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::invalidateCFG): (JSC::DFG::Graph::ensureCPSCFG): (JSC::DFG::Graph::methodOfGettingAValueProfileFor): * dfg/DFGGraph.h: (JSC::DFG::Graph::isEntrypoint): * dfg/DFGInPlaceAbstractState.cpp: (JSC::DFG::InPlaceAbstractState::initialize): (JSC::DFG::InPlaceAbstractState::mergeToSuccessors): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::shrinkToFit): (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGJITCode.h: (JSC::DFG::JITCode::catchOSREntryDataForBytecodeIndex): Deleted. (JSC::DFG::JITCode::appendCatchEntrypoint): Deleted. * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::noticeCatchEntrypoint): (JSC::DFG::JITCompiler::makeCatchOSREntryBuffer): * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::isEntrySwitch): (JSC::DFG::Node::isTerminal): (JSC::DFG::Node::entrySwitchData): (JSC::DFG::Node::numSuccessors): (JSC::DFG::Node::successor): (JSC::DFG::Node::entrypointIndex): * dfg/DFGNodeType.h: * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: (JSC::DFG::OSRAvailabilityAnalysisPhase::run): (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareCatchOSREntry): * dfg/DFGOSREntry.h: * dfg/DFGOSREntrypointCreationPhase.cpp: (JSC::DFG::OSREntrypointCreationPhase::run): * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::SSAConversionPhase): (JSC::DFG::SSAConversionPhase::run): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::linkOSREntries): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStaticExecutionCountEstimationPhase.cpp: (JSC::DFG::StaticExecutionCountEstimationPhase::run): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::lower): (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileExtractCatchLocal): (JSC::FTL::DFG::LowerDFGToB3::compileGetStack): (JSC::FTL::DFG::LowerDFGToB3::compileEntrySwitch): (JSC::FTL::DFG::LowerDFGToB3::speculate): (JSC::FTL::DFG::LowerDFGToB3::appendOSRExitDescriptor): (JSC::FTL::DFG::LowerDFGToB3::appendOSRExit): (JSC::FTL::DFG::LowerDFGToB3::blessSpeculation): * ftl/FTLOutput.cpp: (JSC::FTL::Output::entrySwitch): * ftl/FTLOutput.h: * jit/JITOperations.cpp: Canonical link: https://commits.webkit.org/192973@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-05 03:21:33 +00:00
#endif
}
void CommonData::clearWatchpoints()
{
[JSC] Do not use Bag<> for DFG / FTL watchpoints https://bugs.webkit.org/show_bug.cgi?id=224715 Reviewed by Darin Adler. While Bag<> is useful since its allocated memory will not be moved, this is really memory-inefficient data structure. Each entry gets a tail pointer (so adding 8 bytes) and we allocate each entry separately. In DFG and FTL, we are using Bag<> for watchpoints. But this is not necessary actually: thanks to concurrent compilers, our watchpoint registration is batched at the end of compilation. This means that we have a way to know how many watchpoints we should register at that point. In this patch, we introduce WatchpointCollector. In DesiredGlobalProperties, we run reallyAdd twice with WatchpointCollector. First time, we just count # of watchpoints. Then we allocate FixedVector<XXXWatchpoint> and install them. Since we do not (cannot) grow this fixed vector, watchpoint's address will not be changed as required. We also move DesiredGlobalProperties under DesiredWatchpoints since this basically registers watchpoints. * bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp: (JSC::AdaptiveInferredPropertyValueWatchpointBase::AdaptiveInferredPropertyValueWatchpointBase): (JSC::AdaptiveInferredPropertyValueWatchpointBase::initialize): * bytecode/AdaptiveInferredPropertyValueWatchpointBase.h: * bytecode/CodeBlockJettisoningWatchpoint.h: * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.cpp: (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::AdaptiveInferredPropertyValueWatchpoint): (JSC::DFG::AdaptiveInferredPropertyValueWatchpoint::initialize): * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h: * dfg/DFGAdaptiveStructureWatchpoint.cpp: (JSC::DFG::AdaptiveStructureWatchpoint::AdaptiveStructureWatchpoint): (JSC::DFG::AdaptiveStructureWatchpoint::initialize): * dfg/DFGAdaptiveStructureWatchpoint.h: * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::validateReferences): (JSC::DFG::CommonData::clearWatchpoints): * dfg/DFGCommonData.h: * dfg/DFGDesiredGlobalProperties.cpp: (JSC::DFG::DesiredGlobalProperties::reallyAdd): * dfg/DFGDesiredGlobalProperties.h: * dfg/DFGDesiredWatchpoints.cpp: (JSC::DFG::ArrayBufferViewWatchpointAdaptor::add): (JSC::DFG::SymbolTableAdaptor::add): (JSC::DFG::FunctionExecutableAdaptor::add): (JSC::DFG::AdaptiveStructureWatchpointAdaptor::add): (JSC::DFG::DesiredWatchpoints::addLazily): (JSC::DFG::DesiredWatchpoints::reallyAdd): (JSC::DFG::DesiredWatchpoints::areStillValidOnMainThread): (JSC::DFG::WatchpointCollector::finalize): * dfg/DFGDesiredWatchpoints.h: (JSC::DFG::SetPointerAdaptor::add): (JSC::DFG::GenericDesiredWatchpoints::reallyAdd): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::watchGlobalProperty): * dfg/DFGGraph.h: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::reallyAdd): (JSC::DFG::Plan::isStillValidOnMainThread): (JSC::DFG::Plan::cancel): * dfg/DFGPlan.h: (JSC::DFG::Plan::transitions): (JSC::DFG::Plan::globalProperties): Deleted. Canonical link: https://commits.webkit.org/236708@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-18 08:06:48 +00:00
m_watchpoints = FixedVector<CodeBlockJettisoningWatchpoint>();
m_adaptiveStructureWatchpoints = FixedVector<AdaptiveStructureWatchpoint>();
m_adaptiveInferredPropertyValueWatchpoints = FixedVector<AdaptiveInferredPropertyValueWatchpoint>();
}
fourthTier: put DFG data into a DFG::JITCode, and put common DFG and FTL data into something accessible from both DFG::JITCode and FTL::JITCode https://bugs.webkit.org/show_bug.cgi?id=113905 Reviewed by Geoffrey Garen. This removes one pointer from CodeBlock. It also gives us a framework for having JITType-specific data in CodeBlock, by putting it into the appropriate JITCode class (either DFG::JITCode or FTL::JITCode). And it allows us to have DFG and FTL share some common data, via DFG::CommonData, which is stored in both DFG::JITCode and FTL::JITCode and always accessible via JITCode::dfgCommon(). * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC): (JSC::CodeBlock::dumpBytecode): (JSC::CodeBlock::visitAggregate): (JSC::CodeBlock::performTracingFixpointIteration): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::stronglyVisitWeakReferences): (JSC::CodeBlock::shrinkToFit): (JSC::CodeBlock::tallyFrequentExitSites): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::DFGCodeBlocks::mark): * dfg/DFGAssemblyHelpers.h: * dfg/DFGCommonData.cpp: Added. (DFG): (JSC::DFG::CommonData::notifyCompilingStructureTransition): (JSC::DFG::CommonData::shrinkToFit): * dfg/DFGCommonData.h: Added. (JSC): (DFG): (JSC::DFG::WeakReferenceTransition::WeakReferenceTransition): (WeakReferenceTransition): (CommonData): (JSC::DFG::CommonData::CommonData): * dfg/DFGDriver.cpp: (JSC::DFG::compile): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGDriver.h: (DFG): (JSC::DFG::tryCompile): (JSC::DFG::tryCompileFunction): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCode.cpp: Added. (DFG): (JSC::DFG::JITCode::JITCode): (JSC::DFG::JITCode::~JITCode): (JSC::DFG::JITCode::dfgCommon): (JSC::DFG::JITCode::dfg): (JSC::DFG::JITCode::shrinkToFit): * dfg/DFGJITCode.h: Added. (DFG): (JITCode): (JSC::DFG::JITCode::appendOSREntryData): (JSC::DFG::JITCode::osrEntryDataForBytecodeIndex): (JSC::DFG::JITCode::appendOSRExit): (JSC::DFG::JITCode::lastOSRExit): (JSC::DFG::JITCode::appendSpeculationRecovery): (JSC::DFG::JITCode::appendWatchpoint): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::linkOSRExits): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JITCompiler): (JSC::DFG::JITCompiler::addWeakReference): (JSC::DFG::JITCompiler::noticeOSREntry): (JSC::DFG::JITCompiler::jitCode): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.h: (OSRExit): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::SpeculativeJIT): (JSC::DFG::SpeculativeJIT::backwardSpeculationCheck): (JSC::DFG::SpeculativeJIT::speculationWatchpoint): (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGVariableEventStream.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::JITCode): (JSC::FTL::JITCode::~JITCode): (FTL): (JSC::FTL::JITCode::initializeCode): (JSC::FTL::JITCode::addressForCall): (JSC::FTL::JITCode::executableAddressAtOffset): (JSC::FTL::JITCode::dataAddressAtOffset): (JSC::FTL::JITCode::offsetOf): (JSC::FTL::JITCode::size): (JSC::FTL::JITCode::contains): (JSC::FTL::JITCode::ftl): (JSC::FTL::JITCode::dfgCommon): * ftl/FTLJITCode.h: (JITCode): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): (JSC::FTL::LowerDFGToLLVM::compilePutStructure): (JSC::FTL::LowerDFGToLLVM::compilePhantomPutStructure): (JSC::FTL::LowerDFGToLLVM::addWeakReference): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::weakPointer): * ftl/FTLState.cpp: (FTL): (JSC::FTL::State::State): (JSC::FTL::State::dumpState): * ftl/FTLState.h: (State): * heap/DFGCodeBlocks.cpp: (JSC::DFGCodeBlocks::~DFGCodeBlocks): (JSC::DFGCodeBlocks::jettison): (JSC::DFGCodeBlocks::clearMarks): (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks): (JSC::DFGCodeBlocks::traceMarkedCodeBlocks): * jit/JITCode.cpp: (JSC::JITCode::dfgCommon): (JSC): (JSC::JITCode::dfg): (JSC::JITCode::ftl): (JSC::DirectJITCode::DirectJITCode): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::DirectJITCode::executableAddressAtOffset): (JSC::DirectJITCode::dataAddressAtOffset): (JSC::DirectJITCode::offsetOf): (JSC::DirectJITCode::size): (JSC::DirectJITCode::contains): * jit/JITCode.h: (DFG): (FTL): (JSC): (JITCode): (DirectJITCode): Canonical link: https://commits.webkit.org/136900@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:58:20 +00:00
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)