Source/JavaScriptCore/ChangeLog

 12016-11-15 Filip Pizlo <fpizlo@apple.com>
 2
 3 Rename CONCURRENT_JIT/ConcurrentJIT to CONCURRENT_JS/ConcurrentJS
 4 https://bugs.webkit.org/show_bug.cgi?id=164791
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Just renaming.
 9
 10 * JavaScriptCore.xcodeproj/project.pbxproj:
 11 * bytecode/ArrayProfile.cpp:
 12 (JSC::ArrayProfile::computeUpdatedPrediction):
 13 (JSC::ArrayProfile::briefDescription):
 14 (JSC::ArrayProfile::briefDescriptionWithoutUpdating):
 15 * bytecode/ArrayProfile.h:
 16 (JSC::ArrayProfile::observedArrayModes):
 17 (JSC::ArrayProfile::mayInterceptIndexedAccesses):
 18 (JSC::ArrayProfile::mayStoreToHole):
 19 (JSC::ArrayProfile::outOfBounds):
 20 (JSC::ArrayProfile::usesOriginalArrayStructures):
 21 * bytecode/CallLinkStatus.cpp:
 22 (JSC::CallLinkStatus::computeFromLLInt):
 23 (JSC::CallLinkStatus::computeFor):
 24 (JSC::CallLinkStatus::computeExitSiteData):
 25 (JSC::CallLinkStatus::computeFromCallLinkInfo):
 26 (JSC::CallLinkStatus::computeDFGStatuses):
 27 * bytecode/CallLinkStatus.h:
 28 * bytecode/CodeBlock.cpp:
 29 (JSC::CodeBlock::dumpValueProfiling):
 30 (JSC::CodeBlock::dumpArrayProfiling):
 31 (JSC::CodeBlock::finishCreation):
 32 (JSC::CodeBlock::setConstantRegisters):
 33 (JSC::CodeBlock::getStubInfoMap):
 34 (JSC::CodeBlock::getCallLinkInfoMap):
 35 (JSC::CodeBlock::getByValInfoMap):
 36 (JSC::CodeBlock::addStubInfo):
 37 (JSC::CodeBlock::addByValInfo):
 38 (JSC::CodeBlock::addCallLinkInfo):
 39 (JSC::CodeBlock::resetJITData):
 40 (JSC::CodeBlock::shrinkToFit):
 41 (JSC::CodeBlock::getArrayProfile):
 42 (JSC::CodeBlock::addArrayProfile):
 43 (JSC::CodeBlock::getOrAddArrayProfile):
 44 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
 45 (JSC::CodeBlock::updateAllArrayPredictions):
 46 (JSC::CodeBlock::nameForRegister):
 47 (JSC::CodeBlock::livenessAnalysisSlow):
 48 * bytecode/CodeBlock.h:
 49 (JSC::CodeBlock::setJITCode):
 50 (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
 51 (JSC::CodeBlock::addFrequentExitSite):
 52 (JSC::CodeBlock::hasExitSite):
 53 (JSC::CodeBlock::livenessAnalysis):
 54 * bytecode/DFGExitProfile.cpp:
 55 (JSC::DFG::ExitProfile::add):
 56 (JSC::DFG::ExitProfile::hasExitSite):
 57 (JSC::DFG::QueryableExitProfile::initialize):
 58 * bytecode/DFGExitProfile.h:
 59 (JSC::DFG::ExitProfile::hasExitSite):
 60 * bytecode/GetByIdStatus.cpp:
 61 (JSC::GetByIdStatus::hasExitSite):
 62 (JSC::GetByIdStatus::computeFor):
 63 (JSC::GetByIdStatus::computeForStubInfo):
 64 (JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
 65 * bytecode/GetByIdStatus.h:
 66 * bytecode/LazyOperandValueProfile.cpp:
 67 (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
 68 (JSC::CompressedLazyOperandValueProfileHolder::add):
 69 (JSC::LazyOperandValueProfileParser::initialize):
 70 (JSC::LazyOperandValueProfileParser::prediction):
 71 * bytecode/LazyOperandValueProfile.h:
 72 * bytecode/MethodOfGettingAValueProfile.cpp:
 73 (JSC::MethodOfGettingAValueProfile::emitReportValue):
 74 * bytecode/PutByIdStatus.cpp:
 75 (JSC::PutByIdStatus::hasExitSite):
 76 (JSC::PutByIdStatus::computeFor):
 77 (JSC::PutByIdStatus::computeForStubInfo):
 78 * bytecode/PutByIdStatus.h:
 79 * bytecode/StructureStubClearingWatchpoint.cpp:
 80 (JSC::StructureStubClearingWatchpoint::fireInternal):
 81 * bytecode/ValueProfile.h:
 82 (JSC::ValueProfileBase::briefDescription):
 83 (JSC::ValueProfileBase::computeUpdatedPrediction):
 84 * dfg/DFGArrayMode.cpp:
 85 (JSC::DFG::ArrayMode::fromObserved):
 86 * dfg/DFGArrayMode.h:
 87 (JSC::DFG::ArrayMode::withSpeculationFromProfile):
 88 (JSC::DFG::ArrayMode::withProfile):
 89 * dfg/DFGByteCodeParser.cpp:
 90 (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
 91 (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
 92 (JSC::DFG::ByteCodeParser::getArrayMode):
 93 (JSC::DFG::ByteCodeParser::handleInlining):
 94 (JSC::DFG::ByteCodeParser::parseBlock):
 95 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
 96 * dfg/DFGDriver.cpp:
 97 (JSC::DFG::compileImpl):
 98 * dfg/DFGFixupPhase.cpp:
 99 (JSC::DFG::FixupPhase::fixupNode):
 100 (JSC::DFG::FixupPhase::attemptToMakeGetArrayLength):
 101 * dfg/DFGGraph.cpp:
 102 (JSC::DFG::Graph::tryGetConstantClosureVar):
 103 * dfg/DFGObjectAllocationSinkingPhase.cpp:
 104 * dfg/DFGPredictionInjectionPhase.cpp:
 105 (JSC::DFG::PredictionInjectionPhase::run):
 106 * ftl/FTLLowerDFGToB3.cpp:
 107 (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeCreateActivation):
 108 * ftl/FTLOperations.cpp:
 109 (JSC::FTL::operationMaterializeObjectInOSR):
 110 * heap/Heap.cpp:
 111 (JSC::Heap::addToRememberedSet):
 112 * jit/JIT.cpp:
 113 (JSC::JIT::compileWithoutLinking):
 114 * jit/JITInlines.h:
 115 (JSC::JIT::chooseArrayMode):
 116 * jit/JITOperations.cpp:
 117 (JSC::tryGetByValOptimize):
 118 * jit/JITPropertyAccess.cpp:
 119 (JSC::JIT::privateCompileGetByValWithCachedId):
 120 (JSC::JIT::privateCompilePutByValWithCachedId):
 121 * jit/JITWorklist.cpp:
 122 (JSC::JITWorklist::compileLater):
 123 (JSC::JITWorklist::compileNow):
 124 * jit/Repatch.cpp:
 125 (JSC::repatchGetByID):
 126 (JSC::repatchPutByID):
 127 * llint/LLIntSlowPaths.cpp:
 128 (JSC::LLInt::setupGetByIdPrototypeCache):
 129 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
 130 (JSC::LLInt::setUpCall):
 131 * profiler/ProfilerBytecodeSequence.cpp:
 132 (JSC::Profiler::BytecodeSequence::BytecodeSequence):
 133 * runtime/CommonSlowPaths.cpp:
 134 (JSC::SLOW_PATH_DECL):
 135 * runtime/CommonSlowPaths.h:
 136 (JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
 137 (JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):
 138 * runtime/ConcurrentJITLock.h: Removed.
 139 * runtime/ConcurrentJSLock.h: Copied from Source/JavaScriptCore/runtime/ConcurrentJITLock.h.
 140 (JSC::ConcurrentJSLockerBase::ConcurrentJSLockerBase):
 141 (JSC::ConcurrentJSLockerBase::~ConcurrentJSLockerBase):
 142 (JSC::GCSafeConcurrentJSLocker::GCSafeConcurrentJSLocker):
 143 (JSC::GCSafeConcurrentJSLocker::~GCSafeConcurrentJSLocker):
 144 (JSC::ConcurrentJSLocker::ConcurrentJSLocker):
 145 (JSC::ConcurrentJITLockerBase::ConcurrentJITLockerBase): Deleted.
 146 (JSC::ConcurrentJITLockerBase::~ConcurrentJITLockerBase): Deleted.
 147 (JSC::ConcurrentJITLockerBase::unlockEarly): Deleted.
 148 (JSC::GCSafeConcurrentJITLocker::GCSafeConcurrentJITLocker): Deleted.
 149 (JSC::GCSafeConcurrentJITLocker::~GCSafeConcurrentJITLocker): Deleted.
 150 (JSC::ConcurrentJITLocker::ConcurrentJITLocker): Deleted.
 151 * runtime/InferredType.cpp:
 152 (JSC::InferredType::canWatch):
 153 (JSC::InferredType::addWatchpoint):
 154 (JSC::InferredType::willStoreValueSlow):
 155 (JSC::InferredType::makeTopSlow):
 156 (JSC::InferredType::set):
 157 (JSC::InferredType::removeStructure):
 158 * runtime/InferredType.h:
 159 * runtime/InferredTypeTable.cpp:
 160 (JSC::InferredTypeTable::visitChildren):
 161 (JSC::InferredTypeTable::get):
 162 (JSC::InferredTypeTable::willStoreValue):
 163 (JSC::InferredTypeTable::makeTop):
 164 * runtime/InferredTypeTable.h:
 165 * runtime/JSEnvironmentRecord.cpp:
 166 (JSC::JSEnvironmentRecord::heapSnapshot):
 167 * runtime/JSGlobalObject.cpp:
 168 (JSC::JSGlobalObject::addGlobalVar):
 169 (JSC::JSGlobalObject::addStaticGlobals):
 170 * runtime/JSLexicalEnvironment.cpp:
 171 (JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames):
 172 * runtime/JSObject.cpp:
 173 (JSC::JSObject::deleteProperty):
 174 (JSC::JSObject::shiftButterflyAfterFlattening):
 175 * runtime/JSObject.h:
 176 * runtime/JSObjectInlines.h:
 177 (JSC::JSObject::putDirectWithoutTransition):
 178 (JSC::JSObject::putDirectInternal):
 179 * runtime/JSScope.cpp:
 180 (JSC::abstractAccess):
 181 (JSC::JSScope::collectClosureVariablesUnderTDZ):
 182 * runtime/JSSegmentedVariableObject.cpp:
 183 (JSC::JSSegmentedVariableObject::findVariableIndex):
 184 (JSC::JSSegmentedVariableObject::addVariables):
 185 (JSC::JSSegmentedVariableObject::heapSnapshot):
 186 * runtime/JSSegmentedVariableObject.h:
 187 * runtime/JSSymbolTableObject.cpp:
 188 (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):
 189 * runtime/JSSymbolTableObject.h:
 190 (JSC::symbolTableGet):
 191 (JSC::symbolTablePut):
 192 * runtime/Options.cpp:
 193 (JSC::recomputeDependentOptions):
 194 * runtime/Options.h:
 195 * runtime/ProgramExecutable.cpp:
 196 (JSC::ProgramExecutable::initializeGlobalProperties):
 197 * runtime/RegExp.cpp:
 198 (JSC::RegExp::compile):
 199 (JSC::RegExp::matchConcurrently):
 200 (JSC::RegExp::compileMatchOnly):
 201 (JSC::RegExp::deleteCode):
 202 * runtime/RegExp.h:
 203 * runtime/Structure.cpp:
 204 (JSC::Structure::materializePropertyTable):
 205 (JSC::Structure::addPropertyTransitionToExistingStructureConcurrently):
 206 (JSC::Structure::addNewPropertyTransition):
 207 (JSC::Structure::takePropertyTableOrCloneIfPinned):
 208 (JSC::Structure::nonPropertyTransition):
 209 (JSC::Structure::flattenDictionaryStructure):
 210 (JSC::Structure::ensurePropertyReplacementWatchpointSet):
 211 (JSC::Structure::add):
 212 (JSC::Structure::remove):
 213 (JSC::Structure::visitChildren):
 214 * runtime/Structure.h:
 215 * runtime/StructureInlines.h:
 216 (JSC::Structure::propertyReplacementWatchpointSet):
 217 (JSC::Structure::add):
 218 (JSC::Structure::remove):
 219 * runtime/SymbolTable.cpp:
 220 (JSC::SymbolTable::visitChildren):
 221 (JSC::SymbolTable::localToEntry):
 222 (JSC::SymbolTable::entryFor):
 223 (JSC::SymbolTable::prepareForTypeProfiling):
 224 (JSC::SymbolTable::uniqueIDForVariable):
 225 (JSC::SymbolTable::uniqueIDForOffset):
 226 (JSC::SymbolTable::globalTypeSetForOffset):
 227 (JSC::SymbolTable::globalTypeSetForVariable):
 228 * runtime/SymbolTable.h:
 229 * runtime/TypeSet.cpp:
 230 (JSC::TypeSet::addTypeInformation):
 231 (JSC::TypeSet::invalidateCache):
 232 * runtime/TypeSet.h:
 233 (JSC::TypeSet::structureSet):
 234 * runtime/VM.h:
 235 * runtime/WriteBarrierInlines.h:
 236 (JSC::WriteBarrierBase<T>::set):
 237 (JSC::WriteBarrierBase<Unknown>::set):
 238 * yarr/YarrInterpreter.cpp:
 239 (JSC::Yarr::ByteCompiler::compile):
 240 (JSC::Yarr::byteCompile):
 241 * yarr/YarrInterpreter.h:
 242 (JSC::Yarr::BytecodePattern::BytecodePattern):
 243
12442016-11-15 Filip Pizlo <fpizlo@apple.com>
2245
3246 It should be possible to disable concurrent GC timeslicing
208754

Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

743743 0FDB2CCA173DA523007B3C1B /* FTLValueFromBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CC8173DA51E007B3C1B /* FTLValueFromBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
744744 0FDB2CE7174830A2007B3C1B /* DFGWorklist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDB2CE5174830A2007B3C1B /* DFGWorklist.cpp */; };
745745 0FDB2CE8174830A2007B3C1B /* DFGWorklist.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */; };
746  0FDB2CEA174896C7007B3C1B /* ConcurrentJITLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */; settings = {ATTRIBUTES = (Private, ); }; };
 746 0FDB2CEA174896C7007B3C1B /* ConcurrentJSLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE9174896C7007B3C1B /* ConcurrentJSLock.h */; settings = {ATTRIBUTES = (Private, ); }; };
747747 0FDDBFB51666EED800C55FEF /* DFGVariableAccessDataDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFB21666EED500C55FEF /* DFGVariableAccessDataDump.cpp */; };
748748 0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */; };
749749 0FDF67D21D9C6D27001B9825 /* B3Kind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDF67D11D9C6086001B9825 /* B3Kind.h */; };

31573157 0FDB2CC8173DA51E007B3C1B /* FTLValueFromBlock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FTLValueFromBlock.h; path = ftl/FTLValueFromBlock.h; sourceTree = "<group>"; };
31583158 0FDB2CE5174830A2007B3C1B /* DFGWorklist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGWorklist.cpp; path = dfg/DFGWorklist.cpp; sourceTree = "<group>"; };
31593159 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGWorklist.h; path = dfg/DFGWorklist.h; sourceTree = "<group>"; };
3160  0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcurrentJITLock.h; sourceTree = "<group>"; };
 3160 0FDB2CE9174896C7007B3C1B /* ConcurrentJSLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcurrentJSLock.h; sourceTree = "<group>"; };
31613161 0FDDBFB21666EED500C55FEF /* DFGVariableAccessDataDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGVariableAccessDataDump.cpp; path = dfg/DFGVariableAccessDataDump.cpp; sourceTree = "<group>"; };
31623162 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGVariableAccessDataDump.h; path = dfg/DFGVariableAccessDataDump.h; sourceTree = "<group>"; };
31633163 0FDF67D01D9C6086001B9825 /* B3Kind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3Kind.cpp; path = b3/B3Kind.cpp; sourceTree = "<group>"; };

61136113 A7E5A3A61797432D00E893C0 /* CompilationResult.h */,
61146114 969A09220ED1E09C00F1F681 /* Completion.cpp */,
61156115 F5BB2BC5030F772101FCFE1D /* Completion.h */,
6116  0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */,
 6116 0FDB2CE9174896C7007B3C1B /* ConcurrentJSLock.h */,
61176117 A5B6A74C18C6DBA600F11E91 /* ConsoleClient.cpp */,
61186118 A53CE08918BC21C300BEDF76 /* ConsoleClient.h */,
61196119 A55714BC1CD8048E0004D2C6 /* ConsoleObject.cpp */,

78757875 A7E5A3A81797432D00E893C0 /* CompilationResult.h in Headers */,
78767876 BC18C3F40E16F5CD00B34460 /* Completion.h in Headers */,
78777877 0F6FC751196110A800E1D02D /* ComplexGetStatus.h in Headers */,
7878  0FDB2CEA174896C7007B3C1B /* ConcurrentJITLock.h in Headers */,
 7878 0FDB2CEA174896C7007B3C1B /* ConcurrentJSLock.h in Headers */,
78797879 BC18C3F50E16F5CD00B34460 /* config.h in Headers */,
78807880 144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */,
78817881 A53CE08A18BC21C300BEDF76 /* ConsoleClient.h in Headers */,
208754

Source/JavaScriptCore/bytecode/ArrayProfile.cpp

@@void dumpArrayModes(PrintStream& out, Ar
9494 out.print(comma, "Float64ArrayMode");
9595}
9696
97 void ArrayProfile::computeUpdatedPrediction(const ConcurrentJITLocker& locker, CodeBlock* codeBlock)
 97void ArrayProfile::computeUpdatedPrediction(const ConcurrentJSLocker& locker, CodeBlock* codeBlock)
9898{
9999 if (!m_lastSeenStructureID)
100100 return;

@@void ArrayProfile::computeUpdatedPredict
104104 m_lastSeenStructureID = 0;
105105}
106106
107 void ArrayProfile::computeUpdatedPrediction(const ConcurrentJITLocker&, CodeBlock* codeBlock, Structure* lastSeenStructure)
 107void ArrayProfile::computeUpdatedPrediction(const ConcurrentJSLocker&, CodeBlock* codeBlock, Structure* lastSeenStructure)
108108{
109109 m_observedArrayModes |= arrayModeFromStructure(lastSeenStructure);
110110

@@void ArrayProfile::computeUpdatedPredict
122122 m_usesOriginalArrayStructures = false;
123123}
124124
125 CString ArrayProfile::briefDescription(const ConcurrentJITLocker& locker, CodeBlock* codeBlock)
 125CString ArrayProfile::briefDescription(const ConcurrentJSLocker& locker, CodeBlock* codeBlock)
126126{
127127 computeUpdatedPrediction(locker, codeBlock);
128128 return briefDescriptionWithoutUpdating(locker);
129129}
130130
131 CString ArrayProfile::briefDescriptionWithoutUpdating(const ConcurrentJITLocker&)
 131CString ArrayProfile::briefDescriptionWithoutUpdating(const ConcurrentJSLocker&)
132132{
133133 StringPrintStream out;
134134
208754

Source/JavaScriptCore/bytecode/ArrayProfile.h

2525
2626#pragma once
2727
28 #include "ConcurrentJITLock.h"
 28#include "ConcurrentJSLock.h"
2929#include "JSArray.h"
3030#include "Structure.h"
3131#include <wtf/SegmentedVector.h>

@@public:
216216 m_lastSeenStructureID = structure->id();
217217 }
218218
219  void computeUpdatedPrediction(const ConcurrentJITLocker&, CodeBlock*);
220  void computeUpdatedPrediction(const ConcurrentJITLocker&, CodeBlock*, Structure* lastSeenStructure);
 219 void computeUpdatedPrediction(const ConcurrentJSLocker&, CodeBlock*);
 220 void computeUpdatedPrediction(const ConcurrentJSLocker&, CodeBlock*, Structure* lastSeenStructure);
221221
222  ArrayModes observedArrayModes(const ConcurrentJITLocker&) const { return m_observedArrayModes; }
223  bool mayInterceptIndexedAccesses(const ConcurrentJITLocker&) const { return m_mayInterceptIndexedAccesses; }
 222 ArrayModes observedArrayModes(const ConcurrentJSLocker&) const { return m_observedArrayModes; }
 223 bool mayInterceptIndexedAccesses(const ConcurrentJSLocker&) const { return m_mayInterceptIndexedAccesses; }
224224
225  bool mayStoreToHole(const ConcurrentJITLocker&) const { return m_mayStoreToHole; }
226  bool outOfBounds(const ConcurrentJITLocker&) const { return m_outOfBounds; }
 225 bool mayStoreToHole(const ConcurrentJSLocker&) const { return m_mayStoreToHole; }
 226 bool outOfBounds(const ConcurrentJSLocker&) const { return m_outOfBounds; }
227227
228  bool usesOriginalArrayStructures(const ConcurrentJITLocker&) const { return m_usesOriginalArrayStructures; }
 228 bool usesOriginalArrayStructures(const ConcurrentJSLocker&) const { return m_usesOriginalArrayStructures; }
229229
230  CString briefDescription(const ConcurrentJITLocker&, CodeBlock*);
231  CString briefDescriptionWithoutUpdating(const ConcurrentJITLocker&);
 230 CString briefDescription(const ConcurrentJSLocker&, CodeBlock*);
 231 CString briefDescriptionWithoutUpdating(const ConcurrentJSLocker&);
232232
233233private:
234234 friend class LLIntOffsetsExtractor;
208754

Source/JavaScriptCore/bytecode/CallLinkStatus.cpp

@@CallLinkStatus::CallLinkStatus(JSValue v
5252 m_variants.append(CallVariant(value.asCell()));
5353}
5454
55 CallLinkStatus CallLinkStatus::computeFromLLInt(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
 55CallLinkStatus CallLinkStatus::computeFromLLInt(const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
5656{
5757 UNUSED_PARAM(profiledBlock);
5858 UNUSED_PARAM(bytecodeIndex);

@@CallLinkStatus CallLinkStatus::computeFr
8181CallLinkStatus CallLinkStatus::computeFor(
8282 CodeBlock* profiledBlock, unsigned bytecodeIndex, const CallLinkInfoMap& map)
8383{
84  ConcurrentJITLocker locker(profiledBlock->m_lock);
 84 ConcurrentJSLocker locker(profiledBlock->m_lock);
8585
8686 UNUSED_PARAM(profiledBlock);
8787 UNUSED_PARAM(bytecodeIndex);

@@CallLinkStatus CallLinkStatus::computeFo
103103}
104104
105105CallLinkStatus::ExitSiteData CallLinkStatus::computeExitSiteData(
106  const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
 106 const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
107107{
108108 ExitSiteData exitSiteData;
109109

@@CallLinkStatus::ExitSiteData CallLinkSta
124124
125125#if ENABLE(JIT)
126126CallLinkStatus CallLinkStatus::computeFor(
127  const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, CallLinkInfo& callLinkInfo)
 127 const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, CallLinkInfo& callLinkInfo)
128128{
129129 // We don't really need this, but anytime we have to debug this code, it becomes indispensable.
130130 UNUSED_PARAM(profiledBlock);

@@CallLinkStatus CallLinkStatus::computeFo
135135}
136136
137137CallLinkStatus CallLinkStatus::computeFromCallLinkInfo(
138  const ConcurrentJITLocker&, CallLinkInfo& callLinkInfo)
 138 const ConcurrentJSLocker&, CallLinkInfo& callLinkInfo)
139139{
140140 if (callLinkInfo.clearedByGC())
141141 return takesSlowPath();

@@CallLinkStatus CallLinkStatus::computeFr
228228}
229229
230230CallLinkStatus CallLinkStatus::computeFor(
231  const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, CallLinkInfo& callLinkInfo,
 231 const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, CallLinkInfo& callLinkInfo,
232232 ExitSiteData exitSiteData)
233233{
234234 CallLinkStatus result = computeFor(locker, profiledBlock, callLinkInfo);

@@void CallLinkStatus::computeDFGStatuses(
277277 baselineCodeBlockForOriginAndBaselineCodeBlock(codeOrigin, baselineCodeBlock);
278278 ExitSiteData exitSiteData;
279279 {
280  ConcurrentJITLocker locker(currentBaseline->m_lock);
 280 ConcurrentJSLocker locker(currentBaseline->m_lock);
281281 exitSiteData = computeExitSiteData(
282282 locker, currentBaseline, codeOrigin.bytecodeIndex);
283283 }
284284
285285 {
286  ConcurrentJITLocker locker(dfgCodeBlock->m_lock);
 286 ConcurrentJSLocker locker(dfgCodeBlock->m_lock);
287287 map.add(info.codeOrigin(), computeFor(locker, dfgCodeBlock, info, exitSiteData));
288288 }
289289 }
208754

Source/JavaScriptCore/bytecode/CallLinkStatus.h

2929#include "CallVariant.h"
3030#include "CodeOrigin.h"
3131#include "CodeSpecializationKind.h"
32 #include "ConcurrentJITLock.h"
 32#include "ConcurrentJSLock.h"
3333#include "ExitingJITType.h"
3434#include "Intrinsic.h"
3535#include "JSCJSValue.h"

@@public:
7070 bool takesSlowPath { false };
7171 bool badFunction { false };
7272 };
73  static ExitSiteData computeExitSiteData(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
 73 static ExitSiteData computeExitSiteData(const ConcurrentJSLocker&, CodeBlock*, unsigned bytecodeIndex);
7474
7575#if ENABLE(JIT)
7676 // Computes the status assuming that we never took slow path and never previously
7777 // exited.
78  static CallLinkStatus computeFor(const ConcurrentJITLocker&, CodeBlock*, CallLinkInfo&);
 78 static CallLinkStatus computeFor(const ConcurrentJSLocker&, CodeBlock*, CallLinkInfo&);
7979 static CallLinkStatus computeFor(
80  const ConcurrentJITLocker&, CodeBlock*, CallLinkInfo&, ExitSiteData);
 80 const ConcurrentJSLocker&, CodeBlock*, CallLinkInfo&, ExitSiteData);
8181#endif
8282
8383 typedef HashMap<CodeOrigin, CallLinkStatus, CodeOriginApproximateHash> ContextMap;

@@public:
118118private:
119119 void makeClosureCall();
120120
121  static CallLinkStatus computeFromLLInt(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
 121 static CallLinkStatus computeFromLLInt(const ConcurrentJSLocker&, CodeBlock*, unsigned bytecodeIndex);
122122#if ENABLE(JIT)
123123 static CallLinkStatus computeFromCallLinkInfo(
124  const ConcurrentJITLocker&, CallLinkInfo&);
 124 const ConcurrentJSLocker&, CallLinkInfo&);
125125#endif
126126
127127 CallVariantList m_variants;
208754

Source/JavaScriptCore/bytecode/CodeBlock.cpp

@@void CodeBlock::beginDumpProfiling(Print
679679
680680void CodeBlock::dumpValueProfiling(PrintStream& out, const Instruction*& it, bool& hasPrintedProfiling)
681681{
682  ConcurrentJITLocker locker(m_lock);
 682 ConcurrentJSLocker locker(m_lock);
683683
684684 ++it;
685685 CString description = it->u.profile->briefDescription(locker);

@@void CodeBlock::dumpValueProfiling(Print
691691
692692void CodeBlock::dumpArrayProfiling(PrintStream& out, const Instruction*& it, bool& hasPrintedProfiling)
693693{
694  ConcurrentJITLocker locker(m_lock);
 694 ConcurrentJSLocker locker(m_lock);
695695
696696 ++it;
697697 if (!it->u.arrayProfile)

@@void CodeBlock::finishCreation(VM& vm, S
19641964 if (UnlinkedModuleProgramCodeBlock* unlinkedModuleProgramCodeBlock = jsDynamicCast<UnlinkedModuleProgramCodeBlock*>(unlinkedCodeBlock)) {
19651965 SymbolTable* clonedSymbolTable = jsCast<ModuleProgramExecutable*>(ownerExecutable)->moduleEnvironmentSymbolTable();
19661966 if (m_vm->typeProfiler()) {
1967  ConcurrentJITLocker locker(clonedSymbolTable->m_lock);
 1967 ConcurrentJSLocker locker(clonedSymbolTable->m_lock);
19681968 clonedSymbolTable->prepareForTypeProfiling(locker);
19691969 }
19701970 replaceConstant(unlinkedModuleProgramCodeBlock->moduleEnvironmentSymbolTableConstantRegisterOffset(), clonedSymbolTable);

@@void CodeBlock::finishCreation(VM& vm, S
22192219 int symbolTableIndex = pc[5].u.operand;
22202220 SymbolTable* symbolTable = jsCast<SymbolTable*>(getConstant(symbolTableIndex));
22212221 const Identifier& ident = identifier(pc[2].u.operand);
2222  ConcurrentJITLocker locker(symbolTable->m_lock);
 2222 ConcurrentJSLocker locker(symbolTable->m_lock);
22232223 auto iter = symbolTable->find(locker, ident.impl());
22242224 ASSERT(iter != symbolTable->end(locker));
22252225 iter->value.prepareToWatch();

@@void CodeBlock::finishCreation(VM& vm, S
22752275
22762276 UniquedStringImpl* impl = (op.type == ModuleVar) ? op.importedName.get() : ident.impl();
22772277 if (symbolTable) {
2278  ConcurrentJITLocker locker(symbolTable->m_lock);
 2278 ConcurrentJSLocker locker(symbolTable->m_lock);
22792279 // If our parent scope was created while profiling was disabled, it will not have prepared for profiling yet.
22802280 symbolTable->prepareForTypeProfiling(locker);
22812281 globalVariableID = symbolTable->uniqueIDForVariable(locker, impl, vm);

@@void CodeBlock::finishCreation(VM& vm, S
22892289 int symbolTableIndex = pc[2].u.operand;
22902290 SymbolTable* symbolTable = jsCast<SymbolTable*>(getConstant(symbolTableIndex));
22912291 const Identifier& ident = identifier(pc[4].u.operand);
2292  ConcurrentJITLocker locker(symbolTable->m_lock);
 2292 ConcurrentJSLocker locker(symbolTable->m_lock);
22932293 // If our parent scope was created while profiling was disabled, it will not have prepared for profiling yet.
22942294 globalVariableID = symbolTable->uniqueIDForVariable(locker, ident.impl(), vm);
22952295 globalTypeSet = symbolTable->globalTypeSetForVariable(locker, ident.impl(), vm);

@@void CodeBlock::setConstantRegisters(con
24572457 if (!constant.isEmpty()) {
24582458 if (SymbolTable* symbolTable = jsDynamicCast<SymbolTable*>(constant)) {
24592459 if (hasTypeProfiler) {
2460  ConcurrentJITLocker locker(symbolTable->m_lock);
 2460 ConcurrentJSLocker locker(symbolTable->m_lock);
24612461 symbolTable->prepareForTypeProfiling(locker);
24622462 }
24632463

@@void CodeBlock::UnconditionalFinalizer::
29732973#endif
29742974}
29752975
2976 void CodeBlock::getStubInfoMap(const ConcurrentJITLocker&, StubInfoMap& result)
 2976void CodeBlock::getStubInfoMap(const ConcurrentJSLocker&, StubInfoMap& result)
29772977{
29782978#if ENABLE(JIT)
29792979 if (JITCode::isJIT(jitType()))

@@void CodeBlock::getStubInfoMap(const Con
29852985
29862986void CodeBlock::getStubInfoMap(StubInfoMap& result)
29872987{
2988  ConcurrentJITLocker locker(m_lock);
 2988 ConcurrentJSLocker locker(m_lock);
29892989 getStubInfoMap(locker, result);
29902990}
29912991
2992 void CodeBlock::getCallLinkInfoMap(const ConcurrentJITLocker&, CallLinkInfoMap& result)
 2992void CodeBlock::getCallLinkInfoMap(const ConcurrentJSLocker&, CallLinkInfoMap& result)
29932993{
29942994#if ENABLE(JIT)
29952995 if (JITCode::isJIT(jitType()))

@@void CodeBlock::getCallLinkInfoMap(const
30013001
30023002void CodeBlock::getCallLinkInfoMap(CallLinkInfoMap& result)
30033003{
3004  ConcurrentJITLocker locker(m_lock);
 3004 ConcurrentJSLocker locker(m_lock);
30053005 getCallLinkInfoMap(locker, result);
30063006}
30073007
3008 void CodeBlock::getByValInfoMap(const ConcurrentJITLocker&, ByValInfoMap& result)
 3008void CodeBlock::getByValInfoMap(const ConcurrentJSLocker&, ByValInfoMap& result)
30093009{
30103010#if ENABLE(JIT)
30113011 if (JITCode::isJIT(jitType())) {

@@void CodeBlock::getByValInfoMap(const Co
30193019
30203020void CodeBlock::getByValInfoMap(ByValInfoMap& result)
30213021{
3022  ConcurrentJITLocker locker(m_lock);
 3022 ConcurrentJSLocker locker(m_lock);
30233023 getByValInfoMap(locker, result);
30243024}
30253025
30263026#if ENABLE(JIT)
30273027StructureStubInfo* CodeBlock::addStubInfo(AccessType accessType)
30283028{
3029  ConcurrentJITLocker locker(m_lock);
 3029 ConcurrentJSLocker locker(m_lock);
30303030 return m_stubInfos.add(accessType);
30313031}
30323032

@@StructureStubInfo* CodeBlock::findStubIn
30613061
30623062ByValInfo* CodeBlock::addByValInfo()
30633063{
3064  ConcurrentJITLocker locker(m_lock);
 3064 ConcurrentJSLocker locker(m_lock);
30653065 return m_byValInfos.add();
30663066}
30673067
30683068CallLinkInfo* CodeBlock::addCallLinkInfo()
30693069{
3070  ConcurrentJITLocker locker(m_lock);
 3070 ConcurrentJSLocker locker(m_lock);
30713071 return m_callLinkInfos.add();
30723072}
30733073

@@CallLinkInfo* CodeBlock::getCallLinkInfo
30833083void CodeBlock::resetJITData()
30843084{
30853085 RELEASE_ASSERT(!JITCode::isJIT(jitType()));
3086  ConcurrentJITLocker locker(m_lock);
 3086 ConcurrentJSLocker locker(m_lock);
30873087
30883088 // We can clear these because no other thread will have references to any stub infos, call
30893089 // link infos, or by val infos if we don't have JIT code. Attempts to query these data

@@bool CodeBlock::hasOpDebugForLineAndColu
33133313
33143314void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
33153315{
3316  ConcurrentJITLocker locker(m_lock);
 3316 ConcurrentJSLocker locker(m_lock);
33173317
33183318 m_rareCaseProfiles.shrinkToFit();
33193319

@@bool CodeBlock::shouldReoptimizeFromLoop
39753975}
39763976#endif
39773977
3978 ArrayProfile* CodeBlock::getArrayProfile(const ConcurrentJITLocker&, unsigned bytecodeOffset)
 3978ArrayProfile* CodeBlock::getArrayProfile(const ConcurrentJSLocker&, unsigned bytecodeOffset)
39793979{
39803980 for (unsigned i = 0; i < m_arrayProfiles.size(); ++i) {
39813981 if (m_arrayProfiles[i].bytecodeOffset() == bytecodeOffset)

@@ArrayProfile* CodeBlock::getArrayProfile
39863986
39873987ArrayProfile* CodeBlock::getArrayProfile(unsigned bytecodeOffset)
39883988{
3989  ConcurrentJITLocker locker(m_lock);
 3989 ConcurrentJSLocker locker(m_lock);
39903990 return getArrayProfile(locker, bytecodeOffset);
39913991}
39923992
3993 ArrayProfile* CodeBlock::addArrayProfile(const ConcurrentJITLocker&, unsigned bytecodeOffset)
 3993ArrayProfile* CodeBlock::addArrayProfile(const ConcurrentJSLocker&, unsigned bytecodeOffset)
39943994{
39953995 m_arrayProfiles.append(ArrayProfile(bytecodeOffset));
39963996 return &m_arrayProfiles.last();

@@ArrayProfile* CodeBlock::addArrayProfile
39983998
39993999ArrayProfile* CodeBlock::addArrayProfile(unsigned bytecodeOffset)
40004000{
4001  ConcurrentJITLocker locker(m_lock);
 4001 ConcurrentJSLocker locker(m_lock);
40024002 return addArrayProfile(locker, bytecodeOffset);
40034003}
40044004
4005 ArrayProfile* CodeBlock::getOrAddArrayProfile(const ConcurrentJITLocker& locker, unsigned bytecodeOffset)
 4005ArrayProfile* CodeBlock::getOrAddArrayProfile(const ConcurrentJSLocker& locker, unsigned bytecodeOffset)
40064006{
40074007 ArrayProfile* result = getArrayProfile(locker, bytecodeOffset);
40084008 if (result)

@@ArrayProfile* CodeBlock::getOrAddArrayPr
40124012
40134013ArrayProfile* CodeBlock::getOrAddArrayProfile(unsigned bytecodeOffset)
40144014{
4015  ConcurrentJITLocker locker(m_lock);
 4015 ConcurrentJSLocker locker(m_lock);
40164016 return getOrAddArrayProfile(locker, bytecodeOffset);
40174017}
40184018

@@const Identifier& CodeBlock::identifier(
40424042
40434043void CodeBlock::updateAllPredictionsAndCountLiveness(unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles)
40444044{
4045  ConcurrentJITLocker locker(m_lock);
 4045 ConcurrentJSLocker locker(m_lock);
40464046
40474047 numberOfLiveNonArgumentValueProfiles = 0;
40484048 numberOfSamplesInProfiles = 0; // If this divided by ValueProfile::numberOfBuckets equals numberOfValueProfiles() then value profiles are full.

@@void CodeBlock::updateAllValueProfilePre
40744074
40754075void CodeBlock::updateAllArrayPredictions()
40764076{
4077  ConcurrentJITLocker locker(m_lock);
 4077 ConcurrentJSLocker locker(m_lock);
40784078
40794079 for (unsigned i = m_arrayProfiles.size(); i--;)
40804080 m_arrayProfiles[i].computeUpdatedPrediction(locker, this);

@@String CodeBlock::nameForRegister(Virtua
42844284 if (m_constantRegisters[i].get().isEmpty())
42854285 continue;
42864286 if (SymbolTable* symbolTable = jsDynamicCast<SymbolTable*>(m_constantRegisters[i].get())) {
4287  ConcurrentJITLocker locker(symbolTable->m_lock);
 4287 ConcurrentJSLocker locker(symbolTable->m_lock);
42884288 auto end = symbolTable->end(locker);
42894289 for (auto ptr = symbolTable->begin(locker); ptr != end; ++ptr) {
42904290 if (ptr->value.varOffset() == VarOffset(virtualRegister)) {

@@BytecodeLivenessAnalysis& CodeBlock::liv
46364636{
46374637 std::unique_ptr<BytecodeLivenessAnalysis> analysis = std::make_unique<BytecodeLivenessAnalysis>(this);
46384638 {
4639  ConcurrentJITLocker locker(m_lock);
 4639 ConcurrentJSLocker locker(m_lock);
46404640 if (!m_livenessAnalysis)
46414641 m_livenessAnalysis = WTFMove(analysis);
46424642 return *m_livenessAnalysis;
208754

Source/JavaScriptCore/bytecode/CodeBlock.h

3838#include "CodeOrigin.h"
3939#include "CodeType.h"
4040#include "CompactJITCodeMap.h"
41 #include "ConcurrentJITLock.h"
 41#include "ConcurrentJSLock.h"
4242#include "DFGCommon.h"
4343#include "DFGExitProfile.h"
4444#include "DeferredCompilationCallback.h"

@@public:
235235
236236 Optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex);
237237
238  void getStubInfoMap(const ConcurrentJITLocker&, StubInfoMap& result);
 238 void getStubInfoMap(const ConcurrentJSLocker&, StubInfoMap& result);
239239 void getStubInfoMap(StubInfoMap& result);
240240
241  void getCallLinkInfoMap(const ConcurrentJITLocker&, CallLinkInfoMap& result);
 241 void getCallLinkInfoMap(const ConcurrentJSLocker&, CallLinkInfoMap& result);
242242 void getCallLinkInfoMap(CallLinkInfoMap& result);
243243
244  void getByValInfoMap(const ConcurrentJITLocker&, ByValInfoMap& result);
 244 void getByValInfoMap(const ConcurrentJSLocker&, ByValInfoMap& result);
245245 void getByValInfoMap(ByValInfoMap& result);
246246
247247#if ENABLE(JIT)

@@public:
322322 {
323323 ASSERT(heap()->isDeferred());
324324 heap()->reportExtraMemoryAllocated(code->size());
325  ConcurrentJITLocker locker(m_lock);
 325 ConcurrentJSLocker locker(m_lock);
326326 WTF::storeStoreFence(); // This is probably not needed because the lock will also do something similar, but it's good to be paranoid.
327327 m_jitCode = code;
328328 }

@@public:
413413 unsigned numberOfValueProfiles() { return m_valueProfiles.size(); }
414414 ValueProfile* valueProfile(int index) { return &m_valueProfiles[index]; }
415415 ValueProfile* valueProfileForBytecodeOffset(int bytecodeOffset);
416  SpeculatedType valueProfilePredictionForBytecodeOffset(const ConcurrentJITLocker& locker, int bytecodeOffset)
 416 SpeculatedType valueProfilePredictionForBytecodeOffset(const ConcurrentJSLocker& locker, int bytecodeOffset)
417417 {
418418 if (ValueProfile* valueProfile = valueProfileForBytecodeOffset(bytecodeOffset))
419419 return valueProfile->computeUpdatedPrediction(locker);

@@public:
459459
460460 unsigned numberOfArrayProfiles() const { return m_arrayProfiles.size(); }
461461 const ArrayProfileVector& arrayProfiles() { return m_arrayProfiles; }
462  ArrayProfile* addArrayProfile(const ConcurrentJITLocker&, unsigned bytecodeOffset);
 462 ArrayProfile* addArrayProfile(const ConcurrentJSLocker&, unsigned bytecodeOffset);
463463 ArrayProfile* addArrayProfile(unsigned bytecodeOffset);
464  ArrayProfile* getArrayProfile(const ConcurrentJITLocker&, unsigned bytecodeOffset);
 464 ArrayProfile* getArrayProfile(const ConcurrentJSLocker&, unsigned bytecodeOffset);
465465 ArrayProfile* getArrayProfile(unsigned bytecodeOffset);
466  ArrayProfile* getOrAddArrayProfile(const ConcurrentJITLocker&, unsigned bytecodeOffset);
 466 ArrayProfile* getOrAddArrayProfile(const ConcurrentJSLocker&, unsigned bytecodeOffset);
467467 ArrayProfile* getOrAddArrayProfile(unsigned bytecodeOffset);
468468
469469 // Exception handling support

@@public:
497497 bool addFrequentExitSite(const DFG::FrequentExitSite& site)
498498 {
499499 ASSERT(JITCode::isBaselineCode(jitType()));
500  ConcurrentJITLocker locker(m_lock);
 500 ConcurrentJSLocker locker(m_lock);
501501 return m_exitProfile.add(locker, this, site);
502502 }
503503
504  bool hasExitSite(const ConcurrentJITLocker& locker, const DFG::FrequentExitSite& site) const
 504 bool hasExitSite(const ConcurrentJSLocker& locker, const DFG::FrequentExitSite& site) const
505505 {
506506 return m_exitProfile.hasExitSite(locker, site);
507507 }
508508 bool hasExitSite(const DFG::FrequentExitSite& site) const
509509 {
510  ConcurrentJITLocker locker(m_lock);
 510 ConcurrentJSLocker locker(m_lock);
511511 return hasExitSite(locker, site);
512512 }
513513

@@public:
591591 BytecodeLivenessAnalysis& livenessAnalysis()
592592 {
593593 {
594  ConcurrentJITLocker locker(m_lock);
 594 ConcurrentJSLocker locker(m_lock);
595595 if (!!m_livenessAnalysis)
596596 return *m_livenessAnalysis;
597597 }

@@public:
834834 // Another exception to the rules is that the GC can do whatever it wants
835835 // without holding any locks, because the GC is guaranteed to wait until any
836836 // concurrent compilation threads finish what they're doing.
837  mutable ConcurrentJITLock m_lock;
 837 mutable ConcurrentJSLock m_lock;
838838
839839 Atomic<bool> m_visitWeaklyHasBeenCalled;
840840
208754

Source/JavaScriptCore/bytecode/DFGExitProfile.cpp

@@void FrequentExitSite::dump(PrintStream&
4141ExitProfile::ExitProfile() { }
4242ExitProfile::~ExitProfile() { }
4343
44 bool ExitProfile::add(const ConcurrentJITLocker&, CodeBlock* owner, const FrequentExitSite& site)
 44bool ExitProfile::add(const ConcurrentJSLocker&, CodeBlock* owner, const FrequentExitSite& site)
4545{
4646 ASSERT(site.jitType() != ExitFromAnything);
4747

@@Vector<FrequentExitSite> ExitProfile::ex
8585 return result;
8686}
8787
88 bool ExitProfile::hasExitSite(const ConcurrentJITLocker&, const FrequentExitSite& site) const
 88bool ExitProfile::hasExitSite(const ConcurrentJSLocker&, const FrequentExitSite& site) const
8989{
9090 if (!m_frequentExitSites)
9191 return false;

@@bool ExitProfile::hasExitSite(const Conc
100100QueryableExitProfile::QueryableExitProfile() { }
101101QueryableExitProfile::~QueryableExitProfile() { }
102102
103 void QueryableExitProfile::initialize(const ConcurrentJITLocker&, const ExitProfile& profile)
 103void QueryableExitProfile::initialize(const ConcurrentJSLocker&, const ExitProfile& profile)
104104{
105105 if (!profile.m_frequentExitSites)
106106 return;
208754

Source/JavaScriptCore/bytecode/DFGExitProfile.h

2727
2828#if ENABLE(DFG_JIT)
2929
30 #include "ConcurrentJITLock.h"
 30#include "ConcurrentJSLock.h"
3131#include "ExitKind.h"
3232#include "ExitingJITType.h"
3333#include <wtf/HashSet.h>

@@public:
160160 // be called a fixed number of times per recompilation. Recompilation is
161161 // rare to begin with, and implies doing O(n) operations on the CodeBlock
162162 // anyway.
163  bool add(const ConcurrentJITLocker&, CodeBlock* owner, const FrequentExitSite&);
 163 bool add(const ConcurrentJSLocker&, CodeBlock* owner, const FrequentExitSite&);
164164
165165 // Get the frequent exit sites for a bytecode index. This is O(n), and is
166166 // meant to only be used from debugging/profiling code.

@@public:
170170 // in the compiler. It should be strictly cheaper than building a
171171 // QueryableExitProfile, if you really expect this to be called infrequently
172172 // and you believe that there are few exit sites.
173  bool hasExitSite(const ConcurrentJITLocker&, const FrequentExitSite&) const;
174  bool hasExitSite(const ConcurrentJITLocker& locker, ExitKind kind) const
 173 bool hasExitSite(const ConcurrentJSLocker&, const FrequentExitSite&) const;
 174 bool hasExitSite(const ConcurrentJSLocker& locker, ExitKind kind) const
175175 {
176176 return hasExitSite(locker, FrequentExitSite(kind));
177177 }
178  bool hasExitSite(const ConcurrentJITLocker& locker, unsigned bytecodeIndex, ExitKind kind) const
 178 bool hasExitSite(const ConcurrentJSLocker& locker, unsigned bytecodeIndex, ExitKind kind) const
179179 {
180180 return hasExitSite(locker, FrequentExitSite(bytecodeIndex, kind));
181181 }

@@public:
191191 QueryableExitProfile();
192192 ~QueryableExitProfile();
193193
194  void initialize(const ConcurrentJITLocker&, const ExitProfile&);
 194 void initialize(const ConcurrentJSLocker&, const ExitProfile&);
195195
196196 bool hasExitSite(const FrequentExitSite& site) const
197197 {
208754

Source/JavaScriptCore/bytecode/GetByIdStatus.cpp

@@bool GetByIdStatus::appendVariant(const
6262}
6363
6464#if ENABLE(DFG_JIT)
65 bool GetByIdStatus::hasExitSite(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
 65bool GetByIdStatus::hasExitSite(const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
6666{
6767 return profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCache))
6868 || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadConstantCache));

@@GetByIdStatus GetByIdStatus::computeFrom
109109
110110GetByIdStatus GetByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& map, unsigned bytecodeIndex, UniquedStringImpl* uid)
111111{
112  ConcurrentJITLocker locker(profiledBlock->m_lock);
 112 ConcurrentJSLocker locker(profiledBlock->m_lock);
113113
114114 GetByIdStatus result;
115115

@@GetByIdStatus GetByIdStatus::computeFor(
132132}
133133
134134#if ENABLE(DFG_JIT)
135 GetByIdStatus GetByIdStatus::computeForStubInfo(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, CodeOrigin codeOrigin, UniquedStringImpl* uid)
 135GetByIdStatus GetByIdStatus::computeForStubInfo(const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, CodeOrigin codeOrigin, UniquedStringImpl* uid)
136136{
137137 GetByIdStatus result = GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback(
138138 locker, profiledBlock, stubInfo, uid,

@@GetByIdStatus GetByIdStatus::computeForS
146146
147147#if ENABLE(JIT)
148148GetByIdStatus GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback(
149  const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, UniquedStringImpl* uid,
 149 const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, UniquedStringImpl* uid,
150150 CallLinkStatus::ExitSiteData callExitSiteData)
151151{
152152 if (!stubInfo || !stubInfo->everConsidered)

@@GetByIdStatus GetByIdStatus::computeFor(
298298 if (dfgBlock) {
299299 CallLinkStatus::ExitSiteData exitSiteData;
300300 {
301  ConcurrentJITLocker locker(profiledBlock->m_lock);
 301 ConcurrentJSLocker locker(profiledBlock->m_lock);
302302 exitSiteData = CallLinkStatus::computeExitSiteData(
303303 locker, profiledBlock, codeOrigin.bytecodeIndex);
304304 }
305305
306306 GetByIdStatus result;
307307 {
308  ConcurrentJITLocker locker(dfgBlock->m_lock);
 308 ConcurrentJSLocker locker(dfgBlock->m_lock);
309309 result = computeForStubInfoWithoutExitSiteFeedback(
310310 locker, dfgBlock, dfgMap.get(codeOrigin), uid, exitSiteData);
311311 }

@@GetByIdStatus GetByIdStatus::computeFor(
314314 return result;
315315
316316 {
317  ConcurrentJITLocker locker(profiledBlock->m_lock);
 317 ConcurrentJSLocker locker(profiledBlock->m_lock);
318318 if (hasExitSite(locker, profiledBlock, codeOrigin.bytecodeIndex))
319319 return GetByIdStatus(TakesSlowPath, true);
320320 }
208754

Source/JavaScriptCore/bytecode/GetByIdStatus.h

2727
2828#include "CallLinkStatus.h"
2929#include "CodeOrigin.h"
30 #include "ConcurrentJITLock.h"
 30#include "ConcurrentJSLock.h"
3131#include "ExitingJITType.h"
3232#include "GetByIdVariant.h"
3333

@@public:
7575 static GetByIdStatus computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin, UniquedStringImpl* uid);
7676
7777#if ENABLE(DFG_JIT)
78  static GetByIdStatus computeForStubInfo(const ConcurrentJITLocker&, CodeBlock* baselineBlock, StructureStubInfo*, CodeOrigin, UniquedStringImpl* uid);
 78 static GetByIdStatus computeForStubInfo(const ConcurrentJSLocker&, CodeBlock* baselineBlock, StructureStubInfo*, CodeOrigin, UniquedStringImpl* uid);
7979#endif
8080
8181 State state() const { return m_state; }

@@public:
102102
103103private:
104104#if ENABLE(DFG_JIT)
105  static bool hasExitSite(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
 105 static bool hasExitSite(const ConcurrentJSLocker&, CodeBlock*, unsigned bytecodeIndex);
106106#endif
107107#if ENABLE(JIT)
108108 static GetByIdStatus computeForStubInfoWithoutExitSiteFeedback(
109  const ConcurrentJITLocker&, CodeBlock* profiledBlock, StructureStubInfo*,
 109 const ConcurrentJSLocker&, CodeBlock* profiledBlock, StructureStubInfo*,
110110 UniquedStringImpl* uid, CallLinkStatus::ExitSiteData);
111111#endif
112112 static GetByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, UniquedStringImpl* uid);
208754

Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp

@@namespace JSC {
3333CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder() { }
3434CompressedLazyOperandValueProfileHolder::~CompressedLazyOperandValueProfileHolder() { }
3535
36 void CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions(const ConcurrentJITLocker& locker)
 36void CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions(const ConcurrentJSLocker& locker)
3737{
3838 if (!m_data)
3939 return;

@@void CompressedLazyOperandValueProfileHo
4343}
4444
4545LazyOperandValueProfile* CompressedLazyOperandValueProfileHolder::add(
46  const ConcurrentJITLocker&, const LazyOperandValueProfileKey& key)
 46 const ConcurrentJSLocker&, const LazyOperandValueProfileKey& key)
4747{
4848 if (!m_data)
4949 m_data = std::make_unique<LazyOperandValueProfile::List>();

@@LazyOperandValueProfileParser::LazyOpera
6262LazyOperandValueProfileParser::~LazyOperandValueProfileParser() { }
6363
6464void LazyOperandValueProfileParser::initialize(
65  const ConcurrentJITLocker&, CompressedLazyOperandValueProfileHolder& holder)
 65 const ConcurrentJSLocker&, CompressedLazyOperandValueProfileHolder& holder)
6666{
6767 ASSERT(m_map.isEmpty());
6868

@@LazyOperandValueProfile* LazyOperandValu
8787}
8888
8989SpeculatedType LazyOperandValueProfileParser::prediction(
90  const ConcurrentJITLocker& locker, const LazyOperandValueProfileKey& key) const
 90 const ConcurrentJSLocker& locker, const LazyOperandValueProfileKey& key) const
9191{
9292 LazyOperandValueProfile* profile = getIfPresent(key);
9393 if (!profile)
208754

Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h

2525
2626#pragma once
2727
28 #include "ConcurrentJITLock.h"
 28#include "ConcurrentJSLock.h"
2929#include "ValueProfile.h"
3030#include "VirtualRegister.h"
3131#include <wtf/HashMap.h>

@@public:
152152 CompressedLazyOperandValueProfileHolder();
153153 ~CompressedLazyOperandValueProfileHolder();
154154
155  void computeUpdatedPredictions(const ConcurrentJITLocker&);
 155 void computeUpdatedPredictions(const ConcurrentJSLocker&);
156156
157157 LazyOperandValueProfile* add(
158  const ConcurrentJITLocker&, const LazyOperandValueProfileKey& key);
 158 const ConcurrentJSLocker&, const LazyOperandValueProfileKey& key);
159159
160160private:
161161 friend class LazyOperandValueProfileParser;

@@public:
169169 ~LazyOperandValueProfileParser();
170170
171171 void initialize(
172  const ConcurrentJITLocker&, CompressedLazyOperandValueProfileHolder& holder);
 172 const ConcurrentJSLocker&, CompressedLazyOperandValueProfileHolder& holder);
173173
174174 LazyOperandValueProfile* getIfPresent(
175175 const LazyOperandValueProfileKey& key) const;
176176
177177 SpeculatedType prediction(
178  const ConcurrentJITLocker&, const LazyOperandValueProfileKey& key) const;
 178 const ConcurrentJSLocker&, const LazyOperandValueProfileKey& key) const;
179179private:
180180 HashMap<LazyOperandValueProfileKey, LazyOperandValueProfile*> m_map;
181181};
208754

Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.cpp

@@void MethodOfGettingAValueProfile::emitR
5959 case LazyOperand: {
6060 LazyOperandValueProfileKey key(u.lazyOperand.bytecodeOffset, VirtualRegister(u.lazyOperand.operand));
6161
62  ConcurrentJITLocker locker(u.lazyOperand.codeBlock->m_lock);
 62 ConcurrentJSLocker locker(u.lazyOperand.codeBlock->m_lock);
6363 LazyOperandValueProfile* profile =
6464 u.lazyOperand.codeBlock->lazyOperandValueProfiles().add(locker, key);
6565 jit.storeValue(regs, profile->specFailBucket(0));
208754

Source/JavaScriptCore/bytecode/PutByIdStatus.cpp

@@bool PutByIdStatus::appendVariant(const
5454}
5555
5656#if ENABLE(DFG_JIT)
57 bool PutByIdStatus::hasExitSite(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
 57bool PutByIdStatus::hasExitSite(const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
5858{
5959 return profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCache))
6060 || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadConstantCache));

@@PutByIdStatus PutByIdStatus::computeFrom
110110
111111PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& map, unsigned bytecodeIndex, UniquedStringImpl* uid)
112112{
113  ConcurrentJITLocker locker(profiledBlock->m_lock);
 113 ConcurrentJSLocker locker(profiledBlock->m_lock);
114114
115115 UNUSED_PARAM(profiledBlock);
116116 UNUSED_PARAM(bytecodeIndex);

@@PutByIdStatus PutByIdStatus::computeFor(
134134}
135135
136136#if ENABLE(JIT)
137 PutByIdStatus PutByIdStatus::computeForStubInfo(const ConcurrentJITLocker& locker, CodeBlock* baselineBlock, StructureStubInfo* stubInfo, CodeOrigin codeOrigin, UniquedStringImpl* uid)
 137PutByIdStatus PutByIdStatus::computeForStubInfo(const ConcurrentJSLocker& locker, CodeBlock* baselineBlock, StructureStubInfo* stubInfo, CodeOrigin codeOrigin, UniquedStringImpl* uid)
138138{
139139 return computeForStubInfo(
140140 locker, baselineBlock, stubInfo, uid,

@@PutByIdStatus PutByIdStatus::computeForS
142142}
143143
144144PutByIdStatus PutByIdStatus::computeForStubInfo(
145  const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo,
 145 const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo,
146146 UniquedStringImpl* uid, CallLinkStatus::ExitSiteData callExitSiteData)
147147{
148148 if (!stubInfo || !stubInfo->everConsidered)

@@PutByIdStatus PutByIdStatus::computeFor(
266266 if (dfgBlock) {
267267 CallLinkStatus::ExitSiteData exitSiteData;
268268 {
269  ConcurrentJITLocker locker(baselineBlock->m_lock);
 269 ConcurrentJSLocker locker(baselineBlock->m_lock);
270270 if (hasExitSite(locker, baselineBlock, codeOrigin.bytecodeIndex))
271271 return PutByIdStatus(TakesSlowPath);
272272 exitSiteData = CallLinkStatus::computeExitSiteData(

@@PutByIdStatus PutByIdStatus::computeFor(
275275
276276 PutByIdStatus result;
277277 {
278  ConcurrentJITLocker locker(dfgBlock->m_lock);
 278 ConcurrentJSLocker locker(dfgBlock->m_lock);
279279 result = computeForStubInfo(
280280 locker, dfgBlock, dfgMap.get(codeOrigin), uid, exitSiteData);
281281 }
208754

Source/JavaScriptCore/bytecode/PutByIdStatus.h

@@public:
7777 static PutByIdStatus computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin, UniquedStringImpl* uid);
7878
7979#if ENABLE(JIT)
80  static PutByIdStatus computeForStubInfo(const ConcurrentJITLocker&, CodeBlock* baselineBlock, StructureStubInfo*, CodeOrigin, UniquedStringImpl* uid);
 80 static PutByIdStatus computeForStubInfo(const ConcurrentJSLocker&, CodeBlock* baselineBlock, StructureStubInfo*, CodeOrigin, UniquedStringImpl* uid);
8181#endif
8282
8383 State state() const { return m_state; }

@@public:
9797
9898private:
9999#if ENABLE(DFG_JIT)
100  static bool hasExitSite(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
 100 static bool hasExitSite(const ConcurrentJSLocker&, CodeBlock*, unsigned bytecodeIndex);
101101#endif
102102#if ENABLE(JIT)
103103 static PutByIdStatus computeForStubInfo(
104  const ConcurrentJITLocker&, CodeBlock*, StructureStubInfo*, UniquedStringImpl* uid,
 104 const ConcurrentJSLocker&, CodeBlock*, StructureStubInfo*, UniquedStringImpl* uid,
105105 CallLinkStatus::ExitSiteData);
106106#endif
107107 static PutByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, UniquedStringImpl* uid);
208754

Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp

@@void StructureStubClearingWatchpoint::fi
5454 // This will implicitly cause my own demise: stub reset removes all watchpoints.
5555 // That works, because deleting a watchpoint removes it from the set's list, and
5656 // the set's list traversal for firing is robust against the set changing.
57  ConcurrentJITLocker locker(m_holder.codeBlock()->m_lock);
 57 ConcurrentJSLocker locker(m_holder.codeBlock()->m_lock);
5858 m_holder.stubInfo()->reset(m_holder.codeBlock());
5959 return;
6060 }
208754

Source/JavaScriptCore/bytecode/ValueProfile.h

2828
2929#pragma once
3030
31 #include "ConcurrentJITLock.h"
 31#include "ConcurrentJSLock.h"
3232#include "Heap.h"
3333#include "JSArray.h"
3434#include "SpeculatedType.h"

@@struct ValueProfileBase {
106106 return false;
107107 }
108108
109  CString briefDescription(const ConcurrentJITLocker& locker)
 109 CString briefDescription(const ConcurrentJSLocker& locker)
110110 {
111111 computeUpdatedPrediction(locker);
112112

@@struct ValueProfileBase {
134134
135135 // Updates the prediction and returns the new one. Never call this from any thread
136136 // that isn't executing the code.
137  SpeculatedType computeUpdatedPrediction(const ConcurrentJITLocker&)
 137 SpeculatedType computeUpdatedPrediction(const ConcurrentJSLocker&)
138138 {
139139 for (unsigned i = 0; i < totalNumberOfBuckets; ++i) {
140140 JSValue value = JSValue::decode(m_buckets[i]);
208754

Source/JavaScriptCore/dfg/DFGArrayMode.cpp

3535
3636namespace JSC { namespace DFG {
3737
38 ArrayMode ArrayMode::fromObserved(const ConcurrentJITLocker& locker, ArrayProfile* profile, Array::Action action, bool makeSafe)
 38ArrayMode ArrayMode::fromObserved(const ConcurrentJSLocker& locker, ArrayProfile* profile, Array::Action action, bool makeSafe)
3939{
4040 Array::Class nonArray;
4141 if (profile->usesOriginalArrayStructures(locker))
208754

Source/JavaScriptCore/dfg/DFGArrayMode.h

@@public:
168168 return ArrayMode(word);
169169 }
170170
171  static ArrayMode fromObserved(const ConcurrentJITLocker&, ArrayProfile*, Array::Action, bool makeSafe);
 171 static ArrayMode fromObserved(const ConcurrentJSLocker&, ArrayProfile*, Array::Action, bool makeSafe);
172172
173173 ArrayMode withSpeculation(Array::Speculation speculation) const
174174 {

@@public:
180180 return ArrayMode(type(), arrayClass, speculation(), conversion());
181181 }
182182
183  ArrayMode withSpeculationFromProfile(const ConcurrentJITLocker& locker, ArrayProfile* profile, bool makeSafe) const
 183 ArrayMode withSpeculationFromProfile(const ConcurrentJSLocker& locker, ArrayProfile* profile, bool makeSafe) const
184184 {
185185 Array::Speculation mySpeculation;
186186

@@public:
194194 return withSpeculation(mySpeculation);
195195 }
196196
197  ArrayMode withProfile(const ConcurrentJITLocker& locker, ArrayProfile* profile, bool makeSafe) const
 197 ArrayMode withProfile(const ConcurrentJSLocker& locker, ArrayProfile* profile, bool makeSafe) const
198198 {
199199 Array::Class myArrayClass;
200200
208754

Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

@@private:
407407 {
408408 ASSERT(node->op() == GetLocal);
409409 ASSERT(node->origin.semantic.bytecodeIndex == m_currentIndex);
410  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 410 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
411411 LazyOperandValueProfileKey key(m_currentIndex, node->local());
412412 SpeculatedType prediction = m_inlineStackTop->m_lazyOperands.prediction(locker, key);
413413 node->variableAccessData()->predict(prediction);

@@private:
852852 {
853853 SpeculatedType prediction;
854854 {
855  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 855 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
856856 prediction = m_inlineStackTop->m_profiledBlock->valueProfilePredictionForBytecodeOffset(locker, bytecodeIndex);
857857 }
858858

@@private:
891891
892892 bytecodeIndex = codeOrigin->bytecodeIndex;
893893 CodeBlock* profiledBlock = stack->m_profiledBlock;
894  ConcurrentJITLocker locker(profiledBlock->m_lock);
 894 ConcurrentJSLocker locker(profiledBlock->m_lock);
895895 return profiledBlock->valueProfilePredictionForBytecodeOffset(locker, bytecodeIndex);
896896 }
897897

@@private:
928928
929929 ArrayMode getArrayMode(ArrayProfile* profile, Array::Action action)
930930 {
931  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 931 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
932932 profile->computeUpdatedPrediction(locker, m_inlineStackTop->m_profiledBlock);
933933 bool makeSafe = profile->outOfBounds(locker);
934934 return ArrayMode::fromObserved(locker, profile, action, makeSafe);

@@bool ByteCodeParser::handleInlining(
18831883 // arguments received inside the callee. But that probably won't matter for most
18841884 // calls.
18851885 if (codeBlock && argument < static_cast<unsigned>(codeBlock->numParameters())) {
1886  ConcurrentJITLocker locker(codeBlock->m_lock);
 1886 ConcurrentJSLocker locker(codeBlock->m_lock);
18871887 if (ValueProfile* profile = codeBlock->valueProfileForArgument(argument))
18881888 variable->predict(profile->computeUpdatedPrediction(locker));
18891889 }

@@bool ByteCodeParser::parseBlock(unsigned
42614261 GetByIdStatus getByIdStatus;
42624262 unsigned identifierNumber = 0;
42634263 {
4264  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 4264 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
42654265 ByValInfo* byValInfo = m_inlineStackTop->m_byValInfos.get(CodeOrigin(currentCodeOrigin().bytecodeIndex));
42664266 // FIXME: When the bytecode is not compiled in the baseline JIT, byValInfo becomes null.
42674267 // At that time, there is no information.

@@bool ByteCodeParser::parseBlock(unsigned
43194319 unsigned identifierNumber = std::numeric_limits<unsigned>::max();
43204320 PutByIdStatus putByIdStatus;
43214321 {
4322  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 4322 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
43234323 ByValInfo* byValInfo = m_inlineStackTop->m_byValInfos.get(CodeOrigin(currentCodeOrigin().bytecodeIndex));
43244324 // FIXME: When the bytecode is not compiled in the baseline JIT, byValInfo becomes null.
43254325 // At that time, there is no information.

@@bool ByteCodeParser::parseBlock(unsigned
49454945 WatchpointSet* watchpoints = 0;
49464946 uintptr_t operand;
49474947 {
4948  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 4948 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
49494949 if (resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks || resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks)
49504950 watchpoints = currentInstruction[5].u.watchpointSet;
49514951 else if (resolveType != UnresolvedProperty && resolveType != UnresolvedPropertyWithVarInjectionChecks)

@@bool ByteCodeParser::parseBlock(unsigned
49914991 ScopeOffset offset;
49924992 JSSegmentedVariableObject* scopeObject = jsCast<JSSegmentedVariableObject*>(JSScope::constantScopeForCodeBlock(resolveType, m_inlineStackTop->m_codeBlock));
49934993 {
4994  ConcurrentJITLocker locker(scopeObject->symbolTable()->m_lock);
 4994 ConcurrentJSLocker locker(scopeObject->symbolTable()->m_lock);
49954995 SymbolTableEntry entry = scopeObject->symbolTable()->get(locker, uid);
49964996 watchpointSet = entry.watchpointSet();
49974997 offset = entry.scopeOffset();

@@bool ByteCodeParser::parseBlock(unsigned
51145114 WatchpointSet* watchpoints = nullptr;
51155115 uintptr_t operand;
51165116 {
5117  ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
 5117 ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
51185118 if (resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks || resolveType == LocalClosureVar || resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks)
51195119 watchpoints = currentInstruction[5].u.watchpointSet;
51205120 else if (resolveType != UnresolvedProperty && resolveType != UnresolvedPropertyWithVarInjectionChecks)

@@ByteCodeParser::InlineStackEntry::Inline
55525552 , m_caller(byteCodeParser->m_inlineStackTop)
55535553{
55545554 {
5555  ConcurrentJITLocker locker(m_profiledBlock->m_lock);
 5555 ConcurrentJSLocker locker(m_profiledBlock->m_lock);
55565556 m_lazyOperands.initialize(locker, m_profiledBlock->lazyOperandValueProfiles());
55575557 m_exitProfile.initialize(locker, profiledBlock->exitProfile());
55585558
208754

Source/JavaScriptCore/dfg/DFGDriver.cpp

@@static CompilationResult compileImpl(
100100 new Plan(codeBlock, profiledDFGCodeBlock, mode, osrEntryBytecodeIndex, mustHandleValues));
101101
102102 plan->callback = callback;
103  if (Options::useConcurrentJIT()) {
 103 if (Options::useConcurrentJS()) {
104104 Worklist& worklist = ensureGlobalWorklistFor(mode);
105105 if (logCompilationChanges(mode))
106106 dataLog("Deferring DFG compilation of ", *codeBlock, " with queue length ", worklist.queueLength(), ".\n");
208754

Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

@@private:
15771577 } else if (typeSet->doesTypeConformTo(TypeObject)) {
15781578 StructureSet set;
15791579 {
1580  ConcurrentJITLocker locker(typeSet->m_lock);
 1580 ConcurrentJSLocker locker(typeSet->m_lock);
15811581 set = typeSet->structureSet(locker);
15821582 }
15831583 if (!set.isEmpty()) {

@@private:
26592659 profiledBlock->getArrayProfile(node->origin.semantic.bytecodeIndex);
26602660 ArrayMode arrayMode = ArrayMode(Array::SelectUsingPredictions);
26612661 if (arrayProfile) {
2662  ConcurrentJITLocker locker(profiledBlock->m_lock);
 2662 ConcurrentJSLocker locker(profiledBlock->m_lock);
26632663 arrayProfile->computeUpdatedPrediction(locker, profiledBlock);
26642664 arrayMode = ArrayMode::fromObserved(locker, arrayProfile, Array::Read, false);
26652665 if (arrayMode.type() == Array::Unprofiled) {
208754

Source/JavaScriptCore/dfg/DFGGraph.cpp

@@JSValue Graph::tryGetConstantClosureVar(
13231323 JSValue value;
13241324 WatchpointSet* set;
13251325 {
1326  ConcurrentJITLocker locker(symbolTable->m_lock);
 1326 ConcurrentJSLocker locker(symbolTable->m_lock);
13271327
13281328 SymbolTableEntry* entry = symbolTable->entryFor(locker, offset);
13291329 if (!entry)
208754

Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp

@@private:
865865 writes.add(ActivationScopePLoc, LazyNode(node->child1().node()));
866866 {
867867 SymbolTable* symbolTable = node->castOperand<SymbolTable*>();
868  ConcurrentJITLocker locker(symbolTable->m_lock);
 868 ConcurrentJSLocker locker(symbolTable->m_lock);
869869 LazyNode initialValue(m_graph.freeze(node->initializationValueForActivation()));
870870 for (auto iter = symbolTable->begin(locker), end = symbolTable->end(locker); iter != end; ++iter) {
871871 writes.add(
208754

Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp

@@public:
4949
5050 ASSERT(codeBlock()->numParameters() >= 1);
5151 {
52  ConcurrentJITLocker locker(profiledBlock()->m_lock);
 52 ConcurrentJSLocker locker(profiledBlock()->m_lock);
5353
5454 for (size_t arg = 0; arg < static_cast<size_t>(codeBlock()->numParameters()); ++arg) {
5555 ValueProfile* profile = profiledBlock()->valueProfileForArgument(arg);
208754

Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

@@private:
83888388
83898389 if (validationEnabled()) {
83908390 // Validate to make sure every slot in the scope has one value.
8391  ConcurrentJITLocker locker(table->m_lock);
 8391 ConcurrentJSLocker locker(table->m_lock);
83928392 for (auto iter = table->begin(locker), end = table->end(locker); iter != end; ++iter) {
83938393 bool found = false;
83948394 for (unsigned i = 0; i < data.m_properties.size(); ++i) {
208754

Source/JavaScriptCore/ftl/FTLOperations.cpp

@@extern "C" JSCell* JIT_OPERATION operati
214214
215215 if (validationEnabled()) {
216216 // Validate to make sure every slot in the scope has one value.
217  ConcurrentJITLocker locker(table->m_lock);
 217 ConcurrentJSLocker locker(table->m_lock);
218218 for (auto iter = table->begin(locker), end = table->end(locker); iter != end; ++iter) {
219219 bool found = false;
220220 for (unsigned i = materialization->properties().size(); i--;) {
208754

Source/JavaScriptCore/heap/Heap.cpp

@@void Heap::deleteUnmarkedCompiledCode()
987987void Heap::addToRememberedSet(const JSCell* cell)
988988{
989989 ASSERT(cell);
990  ASSERT(!Options::useConcurrentJIT() || !isCompilationThread());
 990 ASSERT(!Options::useConcurrentJS() || !isCompilationThread());
991991 if (!Heap::isMarkedConcurrently(cell)) {
992992 // During a full collection a store into an unmarked object that had surivived past
993993 // collections will manifest as a store to an unmarked black object. If the object gets
208754

Source/JavaScriptCore/jit/JIT.cpp

@@void JIT::compileWithoutLinking(JITCompi
525525 before = monotonicallyIncreasingTimeMS();
526526
527527 {
528  ConcurrentJITLocker locker(m_codeBlock->m_lock);
 528 ConcurrentJSLocker locker(m_codeBlock->m_lock);
529529 m_instructions = m_codeBlock->instructions().clone();
530530 }
531531
208754

Source/JavaScriptCore/jit/JITInlines.h

@@static inline bool arrayProfileSaw(Array
10211021
10221022inline JITArrayMode JIT::chooseArrayMode(ArrayProfile* profile)
10231023{
1024  ConcurrentJITLocker locker(m_codeBlock->m_lock);
 1024 ConcurrentJSLocker locker(m_codeBlock->m_lock);
10251025 profile->computeUpdatedPrediction(locker, m_codeBlock);
10261026 ArrayModes arrayModes = profile->observedArrayModes(locker);
10271027 if (arrayProfileSaw(arrayModes, DoubleShape))
208754

Source/JavaScriptCore/jit/JITOperations.cpp

@@static OptimizationResult tryPutByValOpt
610610 JITArrayMode arrayMode = jitArrayModeForStructure(structure);
611611 if (jitArrayModePermitsPut(arrayMode) && arrayMode != byValInfo->arrayMode) {
612612 CodeBlock* codeBlock = exec->codeBlock();
613  ConcurrentJITLocker locker(codeBlock->m_lock);
 613 ConcurrentJSLocker locker(codeBlock->m_lock);
614614 byValInfo->arrayProfile->computeUpdatedPrediction(locker, codeBlock, structure);
615615
616616 JIT::compilePutByVal(&vm, exec->codeBlock(), byValInfo, returnAddress, arrayMode);

@@static OptimizationResult tryPutByValOpt
638638 }
639639 } else {
640640 CodeBlock* codeBlock = exec->codeBlock();
641  ConcurrentJITLocker locker(codeBlock->m_lock);
 641 ConcurrentJSLocker locker(codeBlock->m_lock);
642642 byValInfo->seen = true;
643643 byValInfo->cachedId = propertyName;
644644 if (subscript.isSymbol())

@@static OptimizationResult tryDirectPutBy
694694 JITArrayMode arrayMode = jitArrayModeForStructure(structure);
695695 if (jitArrayModePermitsPut(arrayMode) && arrayMode != byValInfo->arrayMode) {
696696 CodeBlock* codeBlock = exec->codeBlock();
697  ConcurrentJITLocker locker(codeBlock->m_lock);
 697 ConcurrentJSLocker locker(codeBlock->m_lock);
698698 byValInfo->arrayProfile->computeUpdatedPrediction(locker, codeBlock, structure);
699699
700700 JIT::compileDirectPutByVal(&vm, exec->codeBlock(), byValInfo, returnAddress, arrayMode);

@@static OptimizationResult tryDirectPutBy
720720 }
721721 } else {
722722 CodeBlock* codeBlock = exec->codeBlock();
723  ConcurrentJITLocker locker(codeBlock->m_lock);
 723 ConcurrentJSLocker locker(codeBlock->m_lock);
724724 byValInfo->seen = true;
725725 byValInfo->cachedId = propertyName;
726726 if (subscript.isSymbol())

@@static OptimizationResult tryGetByValOpt
17431743 // If we reached this case, we got an interesting array mode we did not expect when we compiled.
17441744 // Let's update the profile to do better next time.
17451745 CodeBlock* codeBlock = exec->codeBlock();
1746  ConcurrentJITLocker locker(codeBlock->m_lock);
 1746 ConcurrentJSLocker locker(codeBlock->m_lock);
17471747 byValInfo->arrayProfile->computeUpdatedPrediction(locker, codeBlock, structure);
17481748
17491749 JIT::compileGetByVal(&vm, exec->codeBlock(), byValInfo, returnAddress, arrayMode);

@@static OptimizationResult tryGetByValOpt
17711771 }
17721772 } else {
17731773 CodeBlock* codeBlock = exec->codeBlock();
1774  ConcurrentJITLocker locker(codeBlock->m_lock);
 1774 ConcurrentJSLocker locker(codeBlock->m_lock);
17751775 byValInfo->seen = true;
17761776 byValInfo->cachedId = propertyName;
17771777 if (subscript.isSymbol())
208754

Source/JavaScriptCore/jit/JITPropertyAccess.cpp

@@void JIT::privateCompileGetByValWithCach
13241324
13251325 JITGetByIdGenerator gen = emitGetByValWithCachedId(byValInfo, currentInstruction, propertyName, fastDoneCase, slowDoneCase, slowCases);
13261326
1327  ConcurrentJITLocker locker(m_codeBlock->m_lock);
 1327 ConcurrentJSLocker locker(m_codeBlock->m_lock);
13281328 LinkBuffer patchBuffer(*m_vm, *this, m_codeBlock);
13291329 patchBuffer.link(slowCases, CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(returnAddress.value())).labelAtOffset(byValInfo->returnAddressToSlowPath));
13301330 patchBuffer.link(fastDoneCase, byValInfo->badTypeJump.labelAtOffset(byValInfo->badTypeJumpToDone));

@@void JIT::privateCompilePutByValWithCach
14151415
14161416 JITPutByIdGenerator gen = emitPutByValWithCachedId(byValInfo, currentInstruction, putKind, propertyName, doneCases, slowCases);
14171417
1418  ConcurrentJITLocker locker(m_codeBlock->m_lock);
 1418 ConcurrentJSLocker locker(m_codeBlock->m_lock);
14191419 LinkBuffer patchBuffer(*m_vm, *this, m_codeBlock);
14201420 patchBuffer.link(slowCases, CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(returnAddress.value())).labelAtOffset(byValInfo->returnAddressToSlowPath));
14211421 patchBuffer.link(doneCases, byValInfo->badTypeJump.labelAtOffset(byValInfo->badTypeJumpToDone));
208754

Source/JavaScriptCore/jit/JITWorklist.cpp

@@void JITWorklist::compileLater(CodeBlock
229229 return;
230230 }
231231
232  if (!Options::useConcurrentJIT()) {
 232 if (!Options::useConcurrentJS()) {
233233 Plan::compileNow(codeBlock);
234234 return;
235235 }

@@void JITWorklist::compileNow(CodeBlock*
284284 }
285285
286286 if (isPlanned) {
287  RELEASE_ASSERT(Options::useConcurrentJIT());
 287 RELEASE_ASSERT(Options::useConcurrentJS());
288288 // This is expensive, but probably good enough.
289289 completeAllForVM(*codeBlock->vm());
290290 }
208754

Source/JavaScriptCore/jit/Repatch.cpp

@@static InlineCacheAction tryCacheGetByID
319319void repatchGetByID(ExecState* exec, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot, StructureStubInfo& stubInfo, GetByIDKind kind)
320320{
321321 SuperSamplerScope superSamplerScope(false);
322  GCSafeConcurrentJITLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
 322 GCSafeConcurrentJSLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
323323
324324 if (tryCacheGetByID(exec, baseValue, propertyName, slot, stubInfo, kind) == GiveUpOnCache)
325325 ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), appropriateGenericGetByIdFunction(kind));

@@static InlineCacheAction tryCachePutByID
473473void repatchPutByID(ExecState* exec, JSValue baseValue, Structure* structure, const Identifier& propertyName, const PutPropertySlot& slot, StructureStubInfo& stubInfo, PutKind putKind)
474474{
475475 SuperSamplerScope superSamplerScope(false);
476  GCSafeConcurrentJITLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
 476 GCSafeConcurrentJSLocker locker(exec->codeBlock()->m_lock, exec->vm().heap);
477477
478478 if (tryCachePutByID(exec, baseValue, structure, propertyName, slot, stubInfo, putKind) == GiveUpOnCache)
479479 ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), appropriateGenericPutByIdFunction(slot, putKind));
208754

Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

@@static void setupGetByIdPrototypeCache(E
627627 }
628628 ASSERT((offset == invalidOffset) == slot.isUnset());
629629
630  ConcurrentJITLocker locker(codeBlock->m_lock);
 630 ConcurrentJSLocker locker(codeBlock->m_lock);
631631
632632 if (slot.isUnset()) {
633633 pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_unset);

@@LLINT_SLOW_PATH_DECL(slow_path_get_by_id
675675 if (structure->propertyAccessesAreCacheable()) {
676676 vm.heap.writeBarrier(codeBlock);
677677
678  ConcurrentJITLocker locker(codeBlock->m_lock);
 678 ConcurrentJSLocker locker(codeBlock->m_lock);
679679
680680 pc[4].u.structureID = structure->id();
681681 pc[5].u.operand = slot.cachedOffset();

@@LLINT_SLOW_PATH_DECL(slow_path_put_by_id
748748 vm.heap.writeBarrier(codeBlock);
749749
750750 if (slot.type() == PutPropertySlot::NewProperty) {
751  GCSafeConcurrentJITLocker locker(codeBlock->m_lock, vm.heap);
 751 GCSafeConcurrentJSLocker locker(codeBlock->m_lock, vm.heap);
752752
753753 if (!structure->isDictionary() && structure->previousID()->outOfLineCapacity() == structure->outOfLineCapacity()) {
754754 ASSERT(structure->previousID()->transitionWatchpointSetHasBeenInvalidated());

@@inline SlowPathReturnType setUpCall(Exec
13351335 if (!LLINT_ALWAYS_ACCESS_SLOW && callLinkInfo) {
13361336 CodeBlock* callerCodeBlock = exec->codeBlock();
13371337
1338  ConcurrentJITLocker locker(callerCodeBlock->m_lock);
 1338 ConcurrentJSLocker locker(callerCodeBlock->m_lock);
13391339
13401340 if (callLinkInfo->isOnList())
13411341 callLinkInfo->remove();
208754

Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp

@@BytecodeSequence::BytecodeSequence(CodeB
4040 StringPrintStream out;
4141
4242 for (unsigned i = 0; i < codeBlock->numberOfArgumentValueProfiles(); ++i) {
43  ConcurrentJITLocker locker(codeBlock->m_lock);
 43 ConcurrentJSLocker locker(codeBlock->m_lock);
4444 CString description = codeBlock->valueProfileForArgument(i)->briefDescription(locker);
4545 if (!description.length())
4646 continue;
208754

Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

@@SLOW_PATH_DECL(slow_path_resolve_scope)
826826 if (resolvedScope->isGlobalObject()) {
827827 JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(resolvedScope);
828828 if (globalObject->hasProperty(exec, ident)) {
829  ConcurrentJITLocker locker(exec->codeBlock()->m_lock);
 829 ConcurrentJSLocker locker(exec->codeBlock()->m_lock);
830830 if (resolveType == UnresolvedProperty)
831831 pc[4].u.operand = GlobalProperty;
832832 else

@@SLOW_PATH_DECL(slow_path_resolve_scope)
836836 }
837837 } else if (resolvedScope->isGlobalLexicalEnvironment()) {
838838 JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(resolvedScope);
839  ConcurrentJITLocker locker(exec->codeBlock()->m_lock);
 839 ConcurrentJSLocker locker(exec->codeBlock()->m_lock);
840840 if (resolveType == UnresolvedProperty)
841841 pc[4].u.operand = GlobalLexicalVar;
842842 else
208754

Source/JavaScriptCore/runtime/CommonSlowPaths.h

@@inline void tryCachePutToScopeGlobal(
106106 ResolveType newResolveType = resolveType == UnresolvedProperty ? GlobalProperty : GlobalPropertyWithVarInjectionChecks;
107107 resolveType = newResolveType;
108108 getPutInfo = GetPutInfo(getPutInfo.resolveMode(), newResolveType, getPutInfo.initializationMode());
109  ConcurrentJITLocker locker(codeBlock->m_lock);
 109 ConcurrentJSLocker locker(codeBlock->m_lock);
110110 pc[4].u.operand = getPutInfo.operand();
111111 } else if (scope->isGlobalLexicalEnvironment()) {
112112 JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(scope);

@@inline void tryCachePutToScopeGlobal(
114114 pc[4].u.operand = GetPutInfo(getPutInfo.resolveMode(), newResolveType, getPutInfo.initializationMode()).operand();
115115 SymbolTableEntry entry = globalLexicalEnvironment->symbolTable()->get(ident.impl());
116116 ASSERT(!entry.isNull());
117  ConcurrentJITLocker locker(codeBlock->m_lock);
 117 ConcurrentJSLocker locker(codeBlock->m_lock);
118118 pc[5].u.watchpointSet = entry.watchpointSet();
119119 pc[6].u.pointer = static_cast<void*>(globalLexicalEnvironment->variableAt(entry.scopeOffset()).slot());
120120 }

@@inline void tryCachePutToScopeGlobal(
134134
135135 scope->structure()->didCachePropertyReplacement(exec->vm(), slot.cachedOffset());
136136
137  ConcurrentJITLocker locker(codeBlock->m_lock);
 137 ConcurrentJSLocker locker(codeBlock->m_lock);
138138 pc[5].u.structure.set(exec->vm(), codeBlock, scope->structure());
139139 pc[6].u.operand = slot.cachedOffset();
140140 }

@@inline void tryCacheGetFromScopeGlobal(
150150 if (scope->isGlobalObject()) {
151151 ResolveType newResolveType = resolveType == UnresolvedProperty ? GlobalProperty : GlobalPropertyWithVarInjectionChecks;
152152 resolveType = newResolveType; // Allow below caching mechanism to kick in.
153  ConcurrentJITLocker locker(exec->codeBlock()->m_lock);
 153 ConcurrentJSLocker locker(exec->codeBlock()->m_lock);
154154 pc[4].u.operand = GetPutInfo(getPutInfo.resolveMode(), newResolveType, getPutInfo.initializationMode()).operand();
155155 } else if (scope->isGlobalLexicalEnvironment()) {
156156 JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(scope);
157157 ResolveType newResolveType = resolveType == UnresolvedProperty ? GlobalLexicalVar : GlobalLexicalVarWithVarInjectionChecks;
158158 SymbolTableEntry entry = globalLexicalEnvironment->symbolTable()->get(ident.impl());
159159 ASSERT(!entry.isNull());
160  ConcurrentJITLocker locker(exec->codeBlock()->m_lock);
 160 ConcurrentJSLocker locker(exec->codeBlock()->m_lock);
161161 pc[4].u.operand = GetPutInfo(getPutInfo.resolveMode(), newResolveType, getPutInfo.initializationMode()).operand();
162162 pc[5].u.watchpointSet = entry.watchpointSet();
163163 pc[6].u.pointer = static_cast<void*>(globalLexicalEnvironment->variableAt(entry.scopeOffset()).slot());

@@inline void tryCacheGetFromScopeGlobal(
170170 CodeBlock* codeBlock = exec->codeBlock();
171171 Structure* structure = scope->structure(vm);
172172 {
173  ConcurrentJITLocker locker(codeBlock->m_lock);
 173 ConcurrentJSLocker locker(codeBlock->m_lock);
174174 pc[5].u.structure.set(exec->vm(), codeBlock, structure);
175175 pc[6].u.operand = slot.cachedOffset();
176176 }
208754

Source/JavaScriptCore/runtime/ConcurrentJITLock.h

1 /*
2  * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #pragma once
27 
28 #include "DeferGC.h"
29 #include <wtf/Lock.h>
30 #include <wtf/NoLock.h>
31 #include <wtf/Optional.h>
32 
33 namespace JSC {
34 
35 #if ENABLE(CONCURRENT_JIT)
36 typedef Lock ConcurrentJITLock;
37 typedef LockHolder ConcurrentJITLockerImpl;
38 #else
39 typedef NoLock ConcurrentJITLock;
40 typedef NoLockLocker ConcurrentJITLockerImpl;
41 #endif
42 
43 class ConcurrentJITLockerBase {
44  WTF_MAKE_NONCOPYABLE(ConcurrentJITLockerBase);
45 public:
46  explicit ConcurrentJITLockerBase(ConcurrentJITLock& lockable)
47  : m_locker(&lockable)
48  {
49  }
50  explicit ConcurrentJITLockerBase(ConcurrentJITLock* lockable)
51  : m_locker(lockable)
52  {
53  }
54 
55  explicit ConcurrentJITLockerBase(NoLockingNecessaryTag)
56  : m_locker(NoLockingNecessary)
57  {
58  }
59 
60  ~ConcurrentJITLockerBase()
61  {
62  }
63 
64  void unlockEarly()
65  {
66  m_locker.unlockEarly();
67  }
68 
69 private:
70  ConcurrentJITLockerImpl m_locker;
71 };
72 
73 class GCSafeConcurrentJITLocker : public ConcurrentJITLockerBase {
74 public:
75  GCSafeConcurrentJITLocker(ConcurrentJITLock& lockable, Heap& heap)
76  : ConcurrentJITLockerBase(lockable)
77  , m_deferGC(heap)
78  {
79  }
80 
81  GCSafeConcurrentJITLocker(ConcurrentJITLock* lockable, Heap& heap)
82  : ConcurrentJITLockerBase(lockable)
83  , m_deferGC(heap)
84  {
85  }
86 
87  ~GCSafeConcurrentJITLocker()
88  {
89  // We have to unlock early due to the destruction order of base
90  // vs. derived classes. If we didn't, then we would destroy the
91  // DeferGC object before unlocking the lock which could cause a GC
92  // and resulting deadlock.
93  unlockEarly();
94  }
95 
96 private:
97  DeferGC m_deferGC;
98 };
99 
100 class ConcurrentJITLocker : public ConcurrentJITLockerBase {
101 public:
102  ConcurrentJITLocker(ConcurrentJITLock& lockable)
103  : ConcurrentJITLockerBase(lockable)
104 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
105  , m_disallowGC(InPlace)
106 #endif
107  {
108  }
109 
110  ConcurrentJITLocker(ConcurrentJITLock* lockable)
111  : ConcurrentJITLockerBase(lockable)
112 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
113  , m_disallowGC(InPlace)
114 #endif
115  {
116  }
117 
118  ConcurrentJITLocker(NoLockingNecessaryTag)
119  : ConcurrentJITLockerBase(NoLockingNecessary)
120 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
121  , m_disallowGC(Nullopt)
122 #endif
123  {
124  }
125 
126  ConcurrentJITLocker(int) = delete;
127 
128 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
129 private:
130  Optional<DisallowGC> m_disallowGC;
131 #endif
132 };
133 
134 } // namespace JSC
208754

Source/JavaScriptCore/runtime/ConcurrentJSLock.h

 1/*
 2 * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#include "DeferGC.h"
 29#include <wtf/Lock.h>
 30#include <wtf/NoLock.h>
 31#include <wtf/Optional.h>
 32
 33namespace JSC {
 34
 35#if ENABLE(CONCURRENT_JIT)
 36typedef Lock ConcurrentJITLock;
 37typedef LockHolder ConcurrentJITLockerImpl;
 38#else
 39typedef NoLock ConcurrentJITLock;
 40typedef NoLockLocker ConcurrentJITLockerImpl;
 41#endif
 42
 43class ConcurrentJITLockerBase {
 44 WTF_MAKE_NONCOPYABLE(ConcurrentJITLockerBase);
 45public:
 46 explicit ConcurrentJITLockerBase(ConcurrentJITLock& lockable)
 47 : m_locker(&lockable)
 48 {
 49 }
 50 explicit ConcurrentJITLockerBase(ConcurrentJITLock* lockable)
 51 : m_locker(lockable)
 52 {
 53 }
 54
 55 explicit ConcurrentJITLockerBase(NoLockingNecessaryTag)
 56 : m_locker(NoLockingNecessary)
 57 {
 58 }
 59
 60 ~ConcurrentJITLockerBase()
 61 {
 62 }
 63
 64 void unlockEarly()
 65 {
 66 m_locker.unlockEarly();
 67 }
 68
 69private:
 70 ConcurrentJITLockerImpl m_locker;
 71};
 72
 73class GCSafeConcurrentJITLocker : public ConcurrentJITLockerBase {
 74public:
 75 GCSafeConcurrentJITLocker(ConcurrentJITLock& lockable, Heap& heap)
 76 : ConcurrentJITLockerBase(lockable)
 77 , m_deferGC(heap)
 78 {
 79 }
 80
 81 GCSafeConcurrentJITLocker(ConcurrentJITLock* lockable, Heap& heap)
 82 : ConcurrentJITLockerBase(lockable)
 83 , m_deferGC(heap)
 84 {
 85 }
 86
 87 ~GCSafeConcurrentJITLocker()
 88 {
 89 // We have to unlock early due to the destruction order of base
 90 // vs. derived classes. If we didn't, then we would destroy the
 91 // DeferGC object before unlocking the lock which could cause a GC
 92 // and resulting deadlock.
 93 unlockEarly();
 94 }
 95
 96private:
 97 DeferGC m_deferGC;
 98};
 99
 100class ConcurrentJITLocker : public ConcurrentJITLockerBase {
 101public:
 102 ConcurrentJITLocker(ConcurrentJITLock& lockable)
 103 : ConcurrentJITLockerBase(lockable)
 104#if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 105 , m_disallowGC(InPlace)
 106#endif
 107 {
 108 }
 109
 110 ConcurrentJITLocker(ConcurrentJITLock* lockable)
 111 : ConcurrentJITLockerBase(lockable)
 112#if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 113 , m_disallowGC(InPlace)
 114#endif
 115 {
 116 }
 117
 118 ConcurrentJITLocker(NoLockingNecessaryTag)
 119 : ConcurrentJITLockerBase(NoLockingNecessary)
 120#if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 121 , m_disallowGC(Nullopt)
 122#endif
 123 {
 124 }
 125
 126 ConcurrentJITLocker(int) = delete;
 127
 128#if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 129private:
 130 Optional<DisallowGC> m_disallowGC;
 131#endif
 132};
 133
 134} // namespace JSC
208754

Source/JavaScriptCore/runtime/ConcurrentJSLock.h

3232
3333namespace JSC {
3434
35 #if ENABLE(CONCURRENT_JIT)
36 typedef Lock ConcurrentJITLock;
37 typedef LockHolder ConcurrentJITLockerImpl;
 35#if ENABLE(CONCURRENT_JS)
 36typedef Lock ConcurrentJSLock;
 37typedef LockHolder ConcurrentJSLockerImpl;
3838#else
39 typedef NoLock ConcurrentJITLock;
40 typedef NoLockLocker ConcurrentJITLockerImpl;
 39typedef NoLock ConcurrentJSLock;
 40typedef NoLockLocker ConcurrentJSLockerImpl;
4141#endif
4242
43 class ConcurrentJITLockerBase {
44  WTF_MAKE_NONCOPYABLE(ConcurrentJITLockerBase);
 43class ConcurrentJSLockerBase {
 44 WTF_MAKE_NONCOPYABLE(ConcurrentJSLockerBase);
4545public:
46  explicit ConcurrentJITLockerBase(ConcurrentJITLock& lockable)
 46 explicit ConcurrentJSLockerBase(ConcurrentJSLock& lockable)
4747 : m_locker(&lockable)
4848 {
4949 }
50  explicit ConcurrentJITLockerBase(ConcurrentJITLock* lockable)
 50 explicit ConcurrentJSLockerBase(ConcurrentJSLock* lockable)
5151 : m_locker(lockable)
5252 {
5353 }
5454
55  explicit ConcurrentJITLockerBase(NoLockingNecessaryTag)
 55 explicit ConcurrentJSLockerBase(NoLockingNecessaryTag)
5656 : m_locker(NoLockingNecessary)
5757 {
5858 }
5959
60  ~ConcurrentJITLockerBase()
 60 ~ConcurrentJSLockerBase()
6161 {
6262 }
6363

@@public:
6767 }
6868
6969private:
70  ConcurrentJITLockerImpl m_locker;
 70 ConcurrentJSLockerImpl m_locker;
7171};
7272
73 class GCSafeConcurrentJITLocker : public ConcurrentJITLockerBase {
 73class GCSafeConcurrentJSLocker : public ConcurrentJSLockerBase {
7474public:
75  GCSafeConcurrentJITLocker(ConcurrentJITLock& lockable, Heap& heap)
76  : ConcurrentJITLockerBase(lockable)
 75 GCSafeConcurrentJSLocker(ConcurrentJSLock& lockable, Heap& heap)
 76 : ConcurrentJSLockerBase(lockable)
7777 , m_deferGC(heap)
7878 {
7979 }
8080
81  GCSafeConcurrentJITLocker(ConcurrentJITLock* lockable, Heap& heap)
82  : ConcurrentJITLockerBase(lockable)
 81 GCSafeConcurrentJSLocker(ConcurrentJSLock* lockable, Heap& heap)
 82 : ConcurrentJSLockerBase(lockable)
8383 , m_deferGC(heap)
8484 {
8585 }
8686
87  ~GCSafeConcurrentJITLocker()
 87 ~GCSafeConcurrentJSLocker()
8888 {
8989 // We have to unlock early due to the destruction order of base
9090 // vs. derived classes. If we didn't, then we would destroy the

@@private:
9797 DeferGC m_deferGC;
9898};
9999
100 class ConcurrentJITLocker : public ConcurrentJITLockerBase {
 100class ConcurrentJSLocker : public ConcurrentJSLockerBase {
101101public:
102  ConcurrentJITLocker(ConcurrentJITLock& lockable)
103  : ConcurrentJITLockerBase(lockable)
104 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 102 ConcurrentJSLocker(ConcurrentJSLock& lockable)
 103 : ConcurrentJSLockerBase(lockable)
 104#if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
105105 , m_disallowGC(InPlace)
106106#endif
107107 {
108108 }
109109
110  ConcurrentJITLocker(ConcurrentJITLock* lockable)
111  : ConcurrentJITLockerBase(lockable)
112 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 110 ConcurrentJSLocker(ConcurrentJSLock* lockable)
 111 : ConcurrentJSLockerBase(lockable)
 112#if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
113113 , m_disallowGC(InPlace)
114114#endif
115115 {
116116 }
117117
118  ConcurrentJITLocker(NoLockingNecessaryTag)
119  : ConcurrentJITLockerBase(NoLockingNecessary)
120 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 118 ConcurrentJSLocker(NoLockingNecessaryTag)
 119 : ConcurrentJSLockerBase(NoLockingNecessary)
 120#if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
121121 , m_disallowGC(Nullopt)
122122#endif
123123 {
124124 }
125125
126  ConcurrentJITLocker(int) = delete;
 126 ConcurrentJSLocker(int) = delete;
127127
128 #if ENABLE(CONCURRENT_JIT) && !defined(NDEBUG)
 128#if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
129129private:
130130 Optional<DisallowGC> m_disallowGC;
131131#endif
208754

Source/JavaScriptCore/runtime/InferredType.cpp

@@InferredType::~InferredType()
366366{
367367}
368368
369 bool InferredType::canWatch(const ConcurrentJITLocker& locker, const Descriptor& expected)
 369bool InferredType::canWatch(const ConcurrentJSLocker& locker, const Descriptor& expected)
370370{
371371 if (expected.kind() == Top)
372372 return false;

@@bool InferredType::canWatch(const Concur
376376
377377bool InferredType::canWatch(const Descriptor& expected)
378378{
379  ConcurrentJITLocker locker(m_lock);
 379 ConcurrentJSLocker locker(m_lock);
380380 return canWatch(locker, expected);
381381}
382382
383 void InferredType::addWatchpoint(const ConcurrentJITLocker& locker, Watchpoint* watchpoint)
 383void InferredType::addWatchpoint(const ConcurrentJSLocker& locker, Watchpoint* watchpoint)
384384{
385385 RELEASE_ASSERT(descriptor(locker).kind() != Top);
386386

@@void InferredType::addWatchpoint(const C
389389
390390void InferredType::addWatchpoint(Watchpoint* watchpoint)
391391{
392  ConcurrentJITLocker locker(m_lock);
 392 ConcurrentJSLocker locker(m_lock);
393393 addWatchpoint(locker, watchpoint);
394394}
395395

@@bool InferredType::willStoreValueSlow(VM
404404 Descriptor myType;
405405 bool result;
406406 {
407  ConcurrentJITLocker locker(m_lock);
 407 ConcurrentJSLocker locker(m_lock);
408408 oldType = descriptor(locker);
409409 myType = Descriptor::forValue(value);
410410

@@void InferredType::makeTopSlow(VM& vm, P
427427{
428428 Descriptor oldType;
429429 {
430  ConcurrentJITLocker locker(m_lock);
 430 ConcurrentJSLocker locker(m_lock);
431431 oldType = descriptor(locker);
432432 if (!set(locker, vm, Top))
433433 return;

@@void InferredType::makeTopSlow(VM& vm, P
437437 m_watchpointSet.fireAll(vm, detail);
438438}
439439
440 bool InferredType::set(const ConcurrentJITLocker& locker, VM& vm, Descriptor newDescriptor)
 440bool InferredType::set(const ConcurrentJSLocker& locker, VM& vm, Descriptor newDescriptor)
441441{
442442 // We will trigger write barriers while holding our lock. Currently, write barriers don't GC, but that
443443 // could change. If it does, we don't want to deadlock. Note that we could have used
444  // GCSafeConcurrentJITLocker in the caller, but the caller is on a fast path so maybe that wouldn't be
 444 // GCSafeConcurrentJSLocker in the caller, but the caller is on a fast path so maybe that wouldn't be
445445 // a good idea.
446446 DeferGCForAWhile deferGC(vm.heap);
447447

@@void InferredType::removeStructure()
506506 Descriptor oldDescriptor;
507507 Descriptor newDescriptor;
508508 {
509  ConcurrentJITLocker locker(m_lock);
 509 ConcurrentJSLocker locker(m_lock);
510510 oldDescriptor = descriptor(locker);
511511 newDescriptor = oldDescriptor;
512512 newDescriptor.removeStructure();
208754

Source/JavaScriptCore/runtime/InferredType.h

2525
2626#pragma once
2727
28 #include "ConcurrentJITLock.h"
 28#include "ConcurrentJSLock.h"
2929#include "JSCell.h"
3030#include "PropertyName.h"
3131#include "PutByIdFlags.h"

@@public:
173173 Structure* m_structure;
174174 };
175175
176  ConcurrentJITLock& lock() const { return m_lock; }
 176 ConcurrentJSLock& lock() const { return m_lock; }
177177
178178 Descriptor descriptorMainThread() const
179179 {
180180 return Descriptor(m_kind, m_structure ? m_structure->structure() : nullptr);
181181 }
182182
183  Descriptor descriptor(const ConcurrentJITLocker&) const
 183 Descriptor descriptor(const ConcurrentJSLocker&) const
184184 {
185185 return descriptorMainThread();
186186 }
187187 Descriptor descriptor() const
188188 {
189  ConcurrentJITLocker locker(m_lock);
 189 ConcurrentJSLocker locker(m_lock);
190190 return descriptor(locker);
191191 }
192192
193  Kind kind(const ConcurrentJITLocker& locker) const { return descriptor(locker).kind(); }
 193 Kind kind(const ConcurrentJSLocker& locker) const { return descriptor(locker).kind(); }
194194
195195 bool isTop() const { return m_kind == Top; }
196196 bool isRelevant() const { return m_kind != Top; }

@@public:
214214
215215 // Returns true if it currently makes sense to watch this InferredType for this descriptor. Note that
216216 // this will always return false for Top.
217  bool canWatch(const ConcurrentJITLocker&, const Descriptor&);
 217 bool canWatch(const ConcurrentJSLocker&, const Descriptor&);
218218 bool canWatch(const Descriptor&);
219219
220  void addWatchpoint(const ConcurrentJITLocker&, Watchpoint*);
 220 void addWatchpoint(const ConcurrentJSLocker&, Watchpoint*);
221221 void addWatchpoint(Watchpoint*);
222222
223223 void dump(PrintStream&) const;

@@private:
231231
232232 // Helper for willStoreValueSlow() and makeTopSlow(). This returns true if we should fire the
233233 // watchpoint set.
234  bool set(const ConcurrentJITLocker&, VM&, Descriptor);
 234 bool set(const ConcurrentJSLocker&, VM&, Descriptor);
235235
236236 void removeStructure();
237237
238  mutable ConcurrentJITLock m_lock;
 238 mutable ConcurrentJSLock m_lock;
239239
240240 Kind m_kind { Bottom };
241241
208754

Source/JavaScriptCore/runtime/InferredTypeTable.cpp

@@void InferredTypeTable::visitChildren(JS
5454{
5555 InferredTypeTable* inferredTypeTable = jsCast<InferredTypeTable*>(cell);
5656
57  ConcurrentJITLocker locker(inferredTypeTable->m_lock);
 57 ConcurrentJSLocker locker(inferredTypeTable->m_lock);
5858
5959 for (auto& entry : inferredTypeTable->m_table) {
6060 if (!entry.value)

@@void InferredTypeTable::visitChildren(JS
6666 }
6767}
6868
69 InferredType* InferredTypeTable::get(const ConcurrentJITLocker&, UniquedStringImpl* uid)
 69InferredType* InferredTypeTable::get(const ConcurrentJSLocker&, UniquedStringImpl* uid)
7070{
7171 auto iter = m_table.find(uid);
7272 if (iter == m_table.end() || !iter->value)

@@InferredType* InferredTypeTable::get(con
8383
8484InferredType* InferredTypeTable::get(UniquedStringImpl* uid)
8585{
86  ConcurrentJITLocker locker(m_lock);
 86 ConcurrentJSLocker locker(m_lock);
8787 return get(locker, uid);
8888}
8989

@@bool InferredTypeTable::willStoreValue(
111111
112112 TableType::AddResult result;
113113 {
114  ConcurrentJITLocker locker(m_lock);
 114 ConcurrentJSLocker locker(m_lock);
115115 result = m_table.add(propertyName.uid(), WriteBarrier<InferredType>());
116116 }
117117 if (result.isNewEntry) {

@@void InferredTypeTable::makeTop(VM& vm,
143143
144144 TableType::AddResult result;
145145 {
146  ConcurrentJITLocker locker(m_lock);
 146 ConcurrentJSLocker locker(m_lock);
147147 result = m_table.add(propertyName.uid(), WriteBarrier<InferredType>());
148148 }
149149 if (!result.iterator->value)
208754

Source/JavaScriptCore/runtime/InferredTypeTable.h

@@public:
5555
5656 DECLARE_INFO;
5757
58  ConcurrentJITLock& lock() { return m_lock; }
 58 ConcurrentJSLock& lock() { return m_lock; }
5959
6060 bool isEmpty() const { return m_table.isEmpty(); }
6161
6262 // Get the current inferred type. Returns nullptr for both Top and Bottom. Null means Bottom if the
6363 // owning Structure doesn't know about the property.
64  InferredType* get(const ConcurrentJITLocker&, UniquedStringImpl*);
 64 InferredType* get(const ConcurrentJSLocker&, UniquedStringImpl*);
6565 InferredType* get(UniquedStringImpl*);
6666 InferredType* get(PropertyName);
6767

@@private:
103103
104104 // We only grab this lock when we're doing modifications on the main thread, or reads on the compiler
105105 // thread. The compiler thread is not allowed to do modifications.
106  ConcurrentJITLock m_lock;
 106 ConcurrentJSLock m_lock;
107107};
108108
109109} // namespace JSC
208754

Source/JavaScriptCore/runtime/JSEnvironmentRecord.cpp

@@void JSEnvironmentRecord::heapSnapshot(J
4949 JSEnvironmentRecord* thisObject = jsCast<JSEnvironmentRecord*>(cell);
5050 Base::heapSnapshot(cell, builder);
5151
52  ConcurrentJITLocker locker(thisObject->symbolTable()->m_lock);
 52 ConcurrentJSLocker locker(thisObject->symbolTable()->m_lock);
5353 SymbolTable::Map::iterator end = thisObject->symbolTable()->end(locker);
5454 for (SymbolTable::Map::iterator it = thisObject->symbolTable()->begin(locker); it != end; ++it) {
5555 SymbolTableEntry::Fast entry = it->value;
208754

Source/JavaScriptCore/runtime/JSGlobalObject.cpp

@@bool JSGlobalObject::defineOwnProperty(J
960960
961961void JSGlobalObject::addGlobalVar(const Identifier& ident)
962962{
963  ConcurrentJITLocker locker(symbolTable()->m_lock);
 963 ConcurrentJSLocker locker(symbolTable()->m_lock);
964964 SymbolTableEntry entry = symbolTable()->get(locker, ident.impl());
965965 if (!entry.isNull())
966966 return;

@@void JSGlobalObject::addStaticGlobals(Gl
12831283 WatchpointSet* watchpointSet = nullptr;
12841284 WriteBarrierBase<Unknown>* variable = nullptr;
12851285 {
1286  ConcurrentJITLocker locker(symbolTable()->m_lock);
 1286 ConcurrentJSLocker locker(symbolTable()->m_lock);
12871287 ScopeOffset offset = symbolTable()->takeNextScopeOffset(locker);
12881288 RELEASE_ASSERT(offset = startOffset + i);
12891289 SymbolTableEntry newEntry(VarOffset(offset), global.attributes);
208754

Source/JavaScriptCore/runtime/JSLexicalEnvironment.cpp

@@void JSLexicalEnvironment::getOwnNonInde
4444 JSLexicalEnvironment* thisObject = jsCast<JSLexicalEnvironment*>(object);
4545
4646 {
47  ConcurrentJITLocker locker(thisObject->symbolTable()->m_lock);
 47 ConcurrentJSLocker locker(thisObject->symbolTable()->m_lock);
4848 SymbolTable::Map::iterator end = thisObject->symbolTable()->end(locker);
4949 for (SymbolTable::Map::iterator it = thisObject->symbolTable()->begin(locker); it != end; ++it) {
5050 if (it->value.getAttributes() & DontEnum && !mode.includeDontEnumProperties())
208754

Source/JavaScriptCore/runtime/JSObject.cpp

@@bool JSObject::deleteProperty(JSCell* ce
15541554
15551555 PropertyOffset offset;
15561556 if (structure->isUncacheableDictionary())
1557  offset = structure->removePropertyWithoutTransition(vm, propertyName, [] (const ConcurrentJITLocker&, PropertyOffset) { });
 1557 offset = structure->removePropertyWithoutTransition(vm, propertyName, [] (const ConcurrentJSLocker&, PropertyOffset) { });
15581558 else
15591559 thisObject->setStructure(vm, Structure::removePropertyTransition(vm, structure, propertyName, offset));
15601560

@@void JSObject::convertToDictionary(VM& v
31893189 vm, Structure::toCacheableDictionaryTransition(vm, structure(vm), &deferredWatchpointFire));
31903190}
31913191
3192 void JSObject::shiftButterflyAfterFlattening(const GCSafeConcurrentJITLocker&, VM& vm, Structure* structure, size_t outOfLineCapacityAfter)
 3192void JSObject::shiftButterflyAfterFlattening(const GCSafeConcurrentJSLocker&, VM& vm, Structure* structure, size_t outOfLineCapacityAfter)
31933193{
31943194 // This could interleave visitChildren because some old structure could have been a non
31953195 // dictionary structure. We have to be crazy careful. But, we are guaranteed to be holding
208754

Source/JavaScriptCore/runtime/JSObject.h

@@public:
758758 {
759759 structure(vm)->flattenDictionaryStructure(vm, this);
760760 }
761  void shiftButterflyAfterFlattening(const GCSafeConcurrentJITLocker&, VM&, Structure* structure, size_t outOfLineCapacityAfter);
 761 void shiftButterflyAfterFlattening(const GCSafeConcurrentJSLocker&, VM&, Structure* structure, size_t outOfLineCapacityAfter);
762762
763763 JSGlobalObject* globalObject() const
764764 {
208754

Source/JavaScriptCore/runtime/JSObjectInlines.h

@@inline void JSObject::putDirectWithoutTr
167167 unsigned oldOutOfLineCapacity = structure->outOfLineCapacity();
168168 structure->addPropertyWithoutTransition(
169169 vm, propertyName, attributes,
170  [&] (const GCSafeConcurrentJITLocker&, PropertyOffset offset) {
 170 [&] (const GCSafeConcurrentJSLocker&, PropertyOffset offset) {
171171 if (structure->outOfLineCapacity() != oldOutOfLineCapacity) {
172172 butterfly = allocateMoreOutOfLineStorage(vm, oldOutOfLineCapacity, structure->outOfLineCapacity());
173173 WTF::storeStoreFence();

@@ALWAYS_INLINE bool JSObject::putDirectIn
266266 unsigned oldOutOfLineCapacity = structure->outOfLineCapacity();
267267 offset = structure->addPropertyWithoutTransition(
268268 vm, propertyName, attributes,
269  [&] (const GCSafeConcurrentJITLocker&, PropertyOffset offset) {
 269 [&] (const GCSafeConcurrentJSLocker&, PropertyOffset offset) {
270270 Butterfly* butterfly = this->butterfly();
271271 if (structure->outOfLineCapacity() != oldOutOfLineCapacity) {
272272 butterfly = allocateMoreOutOfLineStorage(vm, oldOutOfLineCapacity, structure->outOfLineCapacity());
208754

Source/JavaScriptCore/runtime/JSScope.cpp

@@static inline bool abstractAccess(ExecSt
5959
6060 SymbolTable* symbolTable = lexicalEnvironment->symbolTable();
6161 {
62  ConcurrentJITLocker locker(symbolTable->m_lock);
 62 ConcurrentJSLocker locker(symbolTable->m_lock);
6363 auto iter = symbolTable->find(locker, ident.impl());
6464 if (iter != symbolTable->end(locker)) {
6565 SymbolTableEntry& entry = iter->value;

@@static inline bool abstractAccess(ExecSt
8383 JSModuleRecord* importedRecord = resolution.moduleRecord;
8484 JSModuleEnvironment* importedEnvironment = importedRecord->moduleEnvironment();
8585 SymbolTable* symbolTable = importedEnvironment->symbolTable();
86  ConcurrentJITLocker locker(symbolTable->m_lock);
 86 ConcurrentJSLocker locker(symbolTable->m_lock);
8787 auto iter = symbolTable->find(locker, resolution.localName.impl());
8888 ASSERT(iter != symbolTable->end(locker));
8989 SymbolTableEntry& entry = iter->value;

@@static inline bool abstractAccess(ExecSt
101101 if (scope->isGlobalLexicalEnvironment()) {
102102 JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(scope);
103103 SymbolTable* symbolTable = globalLexicalEnvironment->symbolTable();
104  ConcurrentJITLocker locker(symbolTable->m_lock);
 104 ConcurrentJSLocker locker(symbolTable->m_lock);
105105 auto iter = symbolTable->find(locker, ident.impl());
106106 if (iter != symbolTable->end(locker)) {
107107 SymbolTableEntry& entry = iter->value;

@@static inline bool abstractAccess(ExecSt
134134 JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(scope);
135135 {
136136 SymbolTable* symbolTable = globalObject->symbolTable();
137  ConcurrentJITLocker locker(symbolTable->m_lock);
 137 ConcurrentJSLocker locker(symbolTable->m_lock);
138138 auto iter = symbolTable->find(locker, ident.impl());
139139 if (iter != symbolTable->end(locker)) {
140140 SymbolTableEntry& entry = iter->value;

@@void JSScope::collectClosureVariablesUnd
277277
278278 SymbolTable* symbolTable = jsCast<JSSymbolTableObject*>(scope)->symbolTable();
279279 ASSERT(symbolTable->scopeType() == SymbolTable::ScopeType::LexicalScope || symbolTable->scopeType() == SymbolTable::ScopeType::CatchScope);
280  ConcurrentJITLocker locker(symbolTable->m_lock);
 280 ConcurrentJSLocker locker(symbolTable->m_lock);
281281 for (auto end = symbolTable->end(locker), iter = symbolTable->begin(locker); iter != end; ++iter)
282282 result.add(iter->key);
283283 }
208754

Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp

@@namespace JSC {
3636
3737ScopeOffset JSSegmentedVariableObject::findVariableIndex(void* variableAddress)
3838{
39  ConcurrentJITLocker locker(m_lock);
 39 ConcurrentJSLocker locker(m_lock);
4040
4141 for (unsigned i = m_variables.size(); i--;) {
4242 if (&m_variables[i] != variableAddress)

@@ScopeOffset JSSegmentedVariableObject::f
4949
5050ScopeOffset JSSegmentedVariableObject::addVariables(unsigned numberOfVariablesToAdd, JSValue initialValue)
5151{
52  ConcurrentJITLocker locker(m_lock);
 52 ConcurrentJSLocker locker(m_lock);
5353
5454 size_t oldSize = m_variables.size();
5555 m_variables.grow(oldSize + numberOfVariablesToAdd);

@@void JSSegmentedVariableObject::heapSnap
7575 JSSegmentedVariableObject* thisObject = jsCast<JSSegmentedVariableObject*>(cell);
7676 Base::heapSnapshot(cell, builder);
7777
78  ConcurrentJITLocker locker(thisObject->symbolTable()->m_lock);
 78 ConcurrentJSLocker locker(thisObject->symbolTable()->m_lock);
7979 SymbolTable::Map::iterator end = thisObject->symbolTable()->end(locker);
8080 for (SymbolTable::Map::iterator it = thisObject->symbolTable()->begin(locker); it != end; ++it) {
8181 SymbolTableEntry::Fast entry = it->value;
208754

Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h

2828
2929#pragma once
3030
31 #include "ConcurrentJITLock.h"
 31#include "ConcurrentJSLock.h"
3232#include "JSObject.h"
3333#include "JSSymbolTableObject.h"
3434#include "SymbolTable.h"

@@protected:
9797 }
9898
9999 SegmentedVector<WriteBarrier<Unknown>, 16> m_variables;
100  ConcurrentJITLock m_lock;
 100 ConcurrentJSLock m_lock;
101101};
102102
103103} // namespace JSC
208754

Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp

@@void JSSymbolTableObject::getOwnNonIndex
5757{
5858 JSSymbolTableObject* thisObject = jsCast<JSSymbolTableObject*>(object);
5959 {
60  ConcurrentJITLocker locker(thisObject->symbolTable()->m_lock);
 60 ConcurrentJSLocker locker(thisObject->symbolTable()->m_lock);
6161 SymbolTable::Map::iterator end = thisObject->symbolTable()->end(locker);
6262 for (SymbolTable::Map::iterator it = thisObject->symbolTable()->begin(locker); it != end; ++it) {
6363 if (!(it->value.getAttributes() & DontEnum) || mode.includeDontEnumProperties()) {
208754

Source/JavaScriptCore/runtime/JSSymbolTableObject.h

@@inline bool symbolTableGet(
8181 SymbolTableObjectType* object, PropertyName propertyName, PropertySlot& slot)
8282{
8383 SymbolTable& symbolTable = *object->symbolTable();
84  ConcurrentJITLocker locker(symbolTable.m_lock);
 84 ConcurrentJSLocker locker(symbolTable.m_lock);
8585 SymbolTable::Map::iterator iter = symbolTable.find(locker, propertyName.uid());
8686 if (iter == symbolTable.end(locker))
8787 return false;

@@inline bool symbolTableGet(
102102 SymbolTableObjectType* object, PropertyName propertyName, PropertyDescriptor& descriptor)
103103{
104104 SymbolTable& symbolTable = *object->symbolTable();
105  ConcurrentJITLocker locker(symbolTable.m_lock);
 105 ConcurrentJSLocker locker(symbolTable.m_lock);
106106 SymbolTable::Map::iterator iter = symbolTable.find(locker, propertyName.uid());
107107 if (iter == symbolTable.end(locker))
108108 return false;

@@inline bool symbolTableGet(
124124 bool& slotIsWriteable)
125125{
126126 SymbolTable& symbolTable = *object->symbolTable();
127  ConcurrentJITLocker locker(symbolTable.m_lock);
 127 ConcurrentJSLocker locker(symbolTable.m_lock);
128128 SymbolTable::Map::iterator iter = symbolTable.find(locker, propertyName.uid());
129129 if (iter == symbolTable.end(locker))
130130 return false;

@@inline bool symbolTablePut(SymbolTableOb
174174 SymbolTable& symbolTable = *object->symbolTable();
175175 // FIXME: This is very suspicious. We shouldn't need a GC-safe lock here.
176176 // https://bugs.webkit.org/show_bug.cgi?id=134601
177  GCSafeConcurrentJITLocker locker(symbolTable.m_lock, vm.heap);
 177 GCSafeConcurrentJSLocker locker(symbolTable.m_lock, vm.heap);
178178 SymbolTable::Map::iterator iter = symbolTable.find(locker, propertyName.uid());
179179 if (iter == symbolTable.end(locker))
180180 return false;
208754

Source/JavaScriptCore/runtime/Options.cpp

@@static void recomputeDependentOptions()
317317#if !ENABLE(YARR_JIT)
318318 Options::useRegExpJIT() = false;
319319#endif
320 #if !ENABLE(CONCURRENT_JIT)
321  Options::useConcurrentJIT() = false;
 320#if !ENABLE(CONCURRENT_JS)
 321 Options::useConcurrentJS() = false;
322322#endif
323323#if !ENABLE(DFG_JIT)
324324 Options::useDFGJIT() = false;

@@static void recomputeDependentOptions()
370370 Options::thresholdForFTLOptimizeAfterWarmUp() = 20;
371371 Options::thresholdForFTLOptimizeSoon() = 20;
372372 Options::maximumEvalCacheableSourceLength() = 150000;
373  Options::useConcurrentJIT() = false;
 373 Options::useConcurrentJS() = false;
374374 }
375375 if (Options::useMaximalFlushInsertionPhase()) {
376376 Options::useOSREntryToDFG() = false;
208754

Source/JavaScriptCore/runtime/Options.h

@@typedef const char* optionString;
233233 v(bool, useObjectAllocationSinking, true, Normal, nullptr) \
234234 v(bool, logExecutableAllocation, false, Normal, nullptr) \
235235 \
236  v(bool, useConcurrentJIT, true, Normal, "allows the DFG / FTL compilation in threads other than the executing JS thread") \
 236 v(bool, useConcurrentJS, true, Normal, "allows the DFG / FTL compilation in threads other than the executing JS thread") \
237237 v(unsigned, numberOfDFGCompilerThreads, computeNumberOfWorkerThreads(2, 2) - 1, Normal, nullptr) \
238238 v(unsigned, numberOfFTLCompilerThreads, computeNumberOfWorkerThreads(8, 2) - 1, Normal, nullptr) \
239239 v(int32, priorityDeltaOfDFGCompilerThreads, computePriorityDeltaOfWorkerThreads(-1, 0), Normal, nullptr) \

@@enum OptionEquivalence {
431431 v(enablePolymorphicCallInlining, usePolymorphicCallInlining, SameOption) \
432432 v(enableMovHintRemoval, useMovHintRemoval, SameOption) \
433433 v(enableObjectAllocationSinking, useObjectAllocationSinking, SameOption) \
434  v(enableConcurrentJIT, useConcurrentJIT, SameOption) \
 434 v(enableConcurrentJS, useConcurrentJS, SameOption) \
435435 v(enableProfiler, useProfiler, SameOption) \
436436 v(enableArchitectureSpecificOptimizations, useArchitectureSpecificOptimizations, SameOption) \
437437 v(enablePolyvariantCallInlining, usePolyvariantCallInlining, SameOption) \
208754

Source/JavaScriptCore/runtime/ProgramExecutable.cpp

@@JSObject* ProgramExecutable::initializeG
153153 {
154154 JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(globalObject->globalScope());
155155 SymbolTable* symbolTable = globalLexicalEnvironment->symbolTable();
156  ConcurrentJITLocker locker(symbolTable->m_lock);
 156 ConcurrentJSLocker locker(symbolTable->m_lock);
157157 for (auto& entry : lexicalDeclarations) {
158158 if (UNLIKELY(entry.value.isConst() && !vm.globalConstRedeclarationShouldThrow() && !isStrictMode())) {
159159 if (symbolTable->contains(locker, entry.key.get()))
208754

Source/JavaScriptCore/runtime/RegExp.cpp

@@RegExp* RegExp::create(VM& vm, const Str
262262
263263void RegExp::compile(VM* vm, Yarr::YarrCharSize charSize)
264264{
265  ConcurrentJITLocker locker(m_lock);
 265 ConcurrentJSLocker locker(m_lock);
266266
267267 Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm->stackLimit());
268268 if (m_constructionError) {

@@int RegExp::match(VM& vm, const String&
304304bool RegExp::matchConcurrently(
305305 VM& vm, const String& s, unsigned startOffset, int& position, Vector<int>& ovector)
306306{
307  ConcurrentJITLocker locker(m_lock);
 307 ConcurrentJSLocker locker(m_lock);
308308
309309 if (!hasCodeFor(s.is8Bit() ? Yarr::Char8 : Yarr::Char16))
310310 return false;

@@bool RegExp::matchConcurrently(
315315
316316void RegExp::compileMatchOnly(VM* vm, Yarr::YarrCharSize charSize)
317317{
318  ConcurrentJITLocker locker(m_lock);
 318 ConcurrentJSLocker locker(m_lock);
319319
320320 Yarr::YarrPattern pattern(m_patternString, m_flags, &m_constructionError, vm->stackLimit());
321321 if (m_constructionError) {

@@MatchResult RegExp::match(VM& vm, const
356356
357357bool RegExp::matchConcurrently(VM& vm, const String& s, unsigned startOffset, MatchResult& result)
358358{
359  ConcurrentJITLocker locker(m_lock);
 359 ConcurrentJSLocker locker(m_lock);
360360
361361 if (!hasMatchOnlyCodeFor(s.is8Bit() ? Yarr::Char8 : Yarr::Char16))
362362 return false;

@@bool RegExp::matchConcurrently(VM& vm, c
367367
368368void RegExp::deleteCode()
369369{
370  ConcurrentJITLocker locker(m_lock);
 370 ConcurrentJSLocker locker(m_lock);
371371
372372 if (!hasCode())
373373 return;
208754

Source/JavaScriptCore/runtime/RegExp.h

2121
2222#pragma once
2323
24 #include "ConcurrentJITLock.h"
 24#include "ConcurrentJSLock.h"
2525#include "ExecutableAllocator.h"
2626#include "MatchResult.h"
2727#include "RegExpKey.h"

@@private:
142142 unsigned m_rtMatchCallCount;
143143 unsigned m_rtMatchFoundCount;
144144#endif
145  ConcurrentJITLock m_lock;
 145 ConcurrentJSLock m_lock;
146146
147147#if ENABLE(YARR_JIT)
148148 Yarr::YarrCodeBlock m_regExpJITCode;
208754

Source/JavaScriptCore/runtime/Structure.cpp

@@PropertyTable* Structure::materializePro
337337 // Must hold the lock on this structure, since we will be modifying this structure's
338338 // property map. We don't want getConcurrently() to see the property map in a half-baked
339339 // state.
340  GCSafeConcurrentJITLocker locker(m_lock, vm.heap);
 340 GCSafeConcurrentJSLocker locker(m_lock, vm.heap);
341341 if (setPropertyTable)
342342 this->setPropertyTable(vm, table);
343343

@@Structure* Structure::addPropertyTransit
380380
381381Structure* Structure::addPropertyTransitionToExistingStructureConcurrently(Structure* structure, UniquedStringImpl* uid, unsigned attributes, PropertyOffset& offset)
382382{
383  ConcurrentJITLocker locker(structure->m_lock);
 383 ConcurrentJSLocker locker(structure->m_lock);
384384 return addPropertyTransitionToExistingStructureImpl(structure, uid, attributes, offset);
385385}
386386

@@Structure* Structure::addNewPropertyTran
478478
479479 checkOffset(transition->m_offset, transition->inlineCapacity());
480480 {
481  ConcurrentJITLocker locker(structure->m_lock);
 481 ConcurrentJSLocker locker(structure->m_lock);
482482 structure->m_transitionTable.add(vm, transition);
483483 }
484484 transition->checkOffsetConsistency();

@@PropertyTable* Structure::takePropertyTa
597597 if (result) {
598598 if (isPinnedPropertyTable())
599599 return result->copy(vm, result->size() + 1);
600  ConcurrentJITLocker locker(m_lock);
 600 ConcurrentJSLocker locker(m_lock);
601601 setPropertyTable(vm, nullptr);
602602 return result;
603603 }

@@Structure* Structure::nonPropertyTransit
668668 if (structure->isDictionary())
669669 transition->pin(vm, transition->ensurePropertyTable(vm));
670670 else {
671  ConcurrentJITLocker locker(structure->m_lock);
 671 ConcurrentJSLocker locker(structure->m_lock);
672672 structure->m_transitionTable.add(vm, transition);
673673 }
674674

@@Structure* Structure::flattenDictionaryS
719719 checkOffsetConsistency();
720720 ASSERT(isDictionary());
721721
722  GCSafeConcurrentJITLocker locker(m_lock, vm.heap);
 722 GCSafeConcurrentJSLocker locker(m_lock, vm.heap);
723723
724724 size_t beforeOutOfLineCapacity = this->outOfLineCapacity();
725725 if (isUncacheableDictionary()) {

@@WatchpointSet* Structure::ensureProperty
803803
804804 if (!hasRareData())
805805 allocateRareData(vm);
806  ConcurrentJITLocker locker(m_lock);
 806 ConcurrentJSLocker locker(m_lock);
807807 StructureRareData* rareData = this->rareData();
808808 if (!rareData->m_replacementWatchpointSets) {
809809 rareData->m_replacementWatchpointSets =

@@Vector<PropertyMapEntry> Structure::getP
943943
944944PropertyOffset Structure::add(VM& vm, PropertyName propertyName, unsigned attributes)
945945{
946  return add(vm, propertyName, attributes, [] (const GCSafeConcurrentJITLocker&, PropertyOffset) { });
 946 return add(vm, propertyName, attributes, [] (const GCSafeConcurrentJSLocker&, PropertyOffset) { });
947947}
948948
949949PropertyOffset Structure::remove(PropertyName propertyName)
950950{
951  return remove(propertyName, [] (const ConcurrentJITLocker&, PropertyOffset) { });
 951 return remove(propertyName, [] (const ConcurrentJSLocker&, PropertyOffset) { });
952952}
953953
954954void Structure::getPropertyNamesFromStructure(VM& vm, PropertyNameArray& propertyNames, EnumerationMode mode)

@@void Structure::visitChildren(JSCell* ce
10231023
10241024 JSCell::visitChildren(thisObject, visitor);
10251025
1026  ConcurrentJITLocker locker(thisObject->m_lock);
 1026 ConcurrentJSLocker locker(thisObject->m_lock);
10271027
10281028 visitor.append(&thisObject->m_globalObject);
10291029 if (!thisObject->isObject())
208754

Source/JavaScriptCore/runtime/Structure.h

2626#pragma once
2727
2828#include "ClassInfo.h"
29 #include "ConcurrentJITLock.h"
 29#include "ConcurrentJSLock.h"
3030#include "IndexingType.h"
3131#include "InferredTypeTable.h"
3232#include "JSCJSValue.h"

@@public:
581581
582582 static void dumpContextHeader(PrintStream&);
583583
584  ConcurrentJITLock& lock() { return m_lock; }
 584 ConcurrentJSLock& lock() { return m_lock; }
585585
586586 DECLARE_EXPORT_INFO;
587587

@@private:
760760
761761 uint8_t m_inlineCapacity;
762762
763  ConcurrentJITLock m_lock;
 763 ConcurrentJSLock m_lock;
764764
765765 uint32_t m_bitField;
766766};
208754

Source/JavaScriptCore/runtime/StructureInlines.h

@@inline void Structure::didReplacePropert
233233
234234inline WatchpointSet* Structure::propertyReplacementWatchpointSet(PropertyOffset offset)
235235{
236  ConcurrentJITLocker locker(m_lock);
 236 ConcurrentJSLocker locker(m_lock);
237237 if (!hasRareData())
238238 return nullptr;
239239 WTF::loadLoadFence();

@@inline PropertyOffset Structure::add(VM&
290290{
291291 PropertyTable* table = ensurePropertyTable(vm);
292292
293  GCSafeConcurrentJITLocker locker(m_lock, vm.heap);
 293 GCSafeConcurrentJSLocker locker(m_lock, vm.heap);
294294
295295 setPropertyTable(vm, table);
296296

@@inline PropertyOffset Structure::add(VM&
315315template<typename Func>
316316inline PropertyOffset Structure::remove(PropertyName propertyName, const Func& func)
317317{
318  ConcurrentJITLocker locker(m_lock);
 318 ConcurrentJSLocker locker(m_lock);
319319
320320 checkConsistency();
321321
208754

Source/JavaScriptCore/runtime/SymbolTable.cpp

@@void SymbolTable::visitChildren(JSCell*
108108 visitor.append(&thisSymbolTable->m_rareData->m_codeBlock);
109109
110110 // Save some memory. This is O(n) to rebuild and we do so on the fly.
111  ConcurrentJITLocker locker(thisSymbolTable->m_lock);
 111 ConcurrentJSLocker locker(thisSymbolTable->m_lock);
112112 thisSymbolTable->m_localToEntry = nullptr;
113113}
114114
115 const SymbolTable::LocalToEntryVec& SymbolTable::localToEntry(const ConcurrentJITLocker&)
 115const SymbolTable::LocalToEntryVec& SymbolTable::localToEntry(const ConcurrentJSLocker&)
116116{
117117 if (UNLIKELY(!m_localToEntry)) {
118118 unsigned size = 0;

@@const SymbolTable::LocalToEntryVec& Symb
133133 return *m_localToEntry;
134134}
135135
136 SymbolTableEntry* SymbolTable::entryFor(const ConcurrentJITLocker& locker, ScopeOffset offset)
 136SymbolTableEntry* SymbolTable::entryFor(const ConcurrentJSLocker& locker, ScopeOffset offset)
137137{
138138 auto& toEntryVector = localToEntry(locker);
139139 if (offset.offset() >= toEntryVector.size())

@@SymbolTable* SymbolTable::cloneScopePart
190190 return result;
191191}
192192
193 void SymbolTable::prepareForTypeProfiling(const ConcurrentJITLocker&)
 193void SymbolTable::prepareForTypeProfiling(const ConcurrentJSLocker&)
194194{
195195 if (m_rareData)
196196 return;

@@void SymbolTable::setRareDataCodeBlock(C
220220 m_rareData->m_codeBlock.set(*codeBlock->vm(), this, codeBlock);
221221}
222222
223 GlobalVariableID SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&, UniquedStringImpl* key, VM& vm)
 223GlobalVariableID SymbolTable::uniqueIDForVariable(const ConcurrentJSLocker&, UniquedStringImpl* key, VM& vm)
224224{
225225 RELEASE_ASSERT(m_rareData);
226226

@@GlobalVariableID SymbolTable::uniqueIDFo
239239 return id;
240240}
241241
242 GlobalVariableID SymbolTable::uniqueIDForOffset(const ConcurrentJITLocker& locker, VarOffset offset, VM& vm)
 242GlobalVariableID SymbolTable::uniqueIDForOffset(const ConcurrentJSLocker& locker, VarOffset offset, VM& vm)
243243{
244244 RELEASE_ASSERT(m_rareData);
245245

@@GlobalVariableID SymbolTable::uniqueIDFo
251251 return uniqueIDForVariable(locker, iter->value.get(), vm);
252252}
253253
254 RefPtr<TypeSet> SymbolTable::globalTypeSetForOffset(const ConcurrentJITLocker& locker, VarOffset offset, VM& vm)
 254RefPtr<TypeSet> SymbolTable::globalTypeSetForOffset(const ConcurrentJSLocker& locker, VarOffset offset, VM& vm)
255255{
256256 RELEASE_ASSERT(m_rareData);
257257

@@RefPtr<TypeSet> SymbolTable::globalTypeS
265265 return globalTypeSetForVariable(locker, iter->value.get(), vm);
266266}
267267
268 RefPtr<TypeSet> SymbolTable::globalTypeSetForVariable(const ConcurrentJITLocker& locker, UniquedStringImpl* key, VM& vm)
 268RefPtr<TypeSet> SymbolTable::globalTypeSetForVariable(const ConcurrentJSLocker& locker, UniquedStringImpl* key, VM& vm)
269269{
270270 RELEASE_ASSERT(m_rareData);
271271
208754

Source/JavaScriptCore/runtime/SymbolTable.h

2828
2929#pragma once
3030
31 #include "ConcurrentJITLock.h"
 31#include "ConcurrentJSLock.h"
3232#include "ConstantMode.h"
3333#include "InferredValue.h"
3434#include "JSObject.h"

@@public:
462462 }
463463
464464 // You must hold the lock until after you're done with the iterator.
465  Map::iterator find(const ConcurrentJITLocker&, UniquedStringImpl* key)
 465 Map::iterator find(const ConcurrentJSLocker&, UniquedStringImpl* key)
466466 {
467467 return m_map.find(key);
468468 }
469469
470  Map::iterator find(const GCSafeConcurrentJITLocker&, UniquedStringImpl* key)
 470 Map::iterator find(const GCSafeConcurrentJSLocker&, UniquedStringImpl* key)
471471 {
472472 return m_map.find(key);
473473 }
474474
475  SymbolTableEntry get(const ConcurrentJITLocker&, UniquedStringImpl* key)
 475 SymbolTableEntry get(const ConcurrentJSLocker&, UniquedStringImpl* key)
476476 {
477477 return m_map.get(key);
478478 }
479479
480480 SymbolTableEntry get(UniquedStringImpl* key)
481481 {
482  ConcurrentJITLocker locker(m_lock);
 482 ConcurrentJSLocker locker(m_lock);
483483 return get(locker, key);
484484 }
485485
486  SymbolTableEntry inlineGet(const ConcurrentJITLocker&, UniquedStringImpl* key)
 486 SymbolTableEntry inlineGet(const ConcurrentJSLocker&, UniquedStringImpl* key)
487487 {
488488 return m_map.inlineGet(key);
489489 }
490490
491491 SymbolTableEntry inlineGet(UniquedStringImpl* key)
492492 {
493  ConcurrentJITLocker locker(m_lock);
 493 ConcurrentJSLocker locker(m_lock);
494494 return inlineGet(locker, key);
495495 }
496496
497  Map::iterator begin(const ConcurrentJITLocker&)
 497 Map::iterator begin(const ConcurrentJSLocker&)
498498 {
499499 return m_map.begin();
500500 }
501501
502  Map::iterator end(const ConcurrentJITLocker&)
 502 Map::iterator end(const ConcurrentJSLocker&)
503503 {
504504 return m_map.end();
505505 }
506506
507  Map::iterator end(const GCSafeConcurrentJITLocker&)
 507 Map::iterator end(const GCSafeConcurrentJSLocker&)
508508 {
509509 return m_map.end();
510510 }
511511
512  size_t size(const ConcurrentJITLocker&) const
 512 size_t size(const ConcurrentJSLocker&) const
513513 {
514514 return m_map.size();
515515 }
516516
517517 size_t size() const
518518 {
519  ConcurrentJITLocker locker(m_lock);
 519 ConcurrentJSLocker locker(m_lock);
520520 return size(locker);
521521 }
522522

@@public:
555555 return ScopeOffset(scopeSize());
556556 }
557557
558  ScopeOffset takeNextScopeOffset(const ConcurrentJITLocker&)
 558 ScopeOffset takeNextScopeOffset(const ConcurrentJSLocker&)
559559 {
560560 ScopeOffset result = nextScopeOffset();
561561 m_maxScopeOffset = result;

@@public:
564564
565565 ScopeOffset takeNextScopeOffset()
566566 {
567  ConcurrentJITLocker locker(m_lock);
 567 ConcurrentJSLocker locker(m_lock);
568568 return takeNextScopeOffset(locker);
569569 }
570570
571571 template<typename Entry>
572  void add(const ConcurrentJITLocker&, UniquedStringImpl* key, Entry&& entry)
 572 void add(const ConcurrentJSLocker&, UniquedStringImpl* key, Entry&& entry)
573573 {
574574 RELEASE_ASSERT(!m_localToEntry);
575575 didUseVarOffset(entry.varOffset());

@@public:
580580 template<typename Entry>
581581 void add(UniquedStringImpl* key, Entry&& entry)
582582 {
583  ConcurrentJITLocker locker(m_lock);
 583 ConcurrentJSLocker locker(m_lock);
584584 add(locker, key, std::forward<Entry>(entry));
585585 }
586586
587587 template<typename Entry>
588  void set(const ConcurrentJITLocker&, UniquedStringImpl* key, Entry&& entry)
 588 void set(const ConcurrentJSLocker&, UniquedStringImpl* key, Entry&& entry)
589589 {
590590 RELEASE_ASSERT(!m_localToEntry);
591591 didUseVarOffset(entry.varOffset());

@@public:
595595 template<typename Entry>
596596 void set(UniquedStringImpl* key, Entry&& entry)
597597 {
598  ConcurrentJITLocker locker(m_lock);
 598 ConcurrentJSLocker locker(m_lock);
599599 set(locker, key, std::forward<Entry>(entry));
600600 }
601601
602  bool contains(const ConcurrentJITLocker&, UniquedStringImpl* key)
 602 bool contains(const ConcurrentJSLocker&, UniquedStringImpl* key)
603603 {
604604 return m_map.contains(key);
605605 }
606606
607607 bool contains(UniquedStringImpl* key)
608608 {
609  ConcurrentJITLocker locker(m_lock);
 609 ConcurrentJSLocker locker(m_lock);
610610 return contains(locker, key);
611611 }
612612

@@public:
651651 return m_arguments.get();
652652 }
653653
654  const LocalToEntryVec& localToEntry(const ConcurrentJITLocker&);
655  SymbolTableEntry* entryFor(const ConcurrentJITLocker&, ScopeOffset);
 654 const LocalToEntryVec& localToEntry(const ConcurrentJSLocker&);
 655 SymbolTableEntry* entryFor(const ConcurrentJSLocker&, ScopeOffset);
656656
657  GlobalVariableID uniqueIDForVariable(const ConcurrentJITLocker&, UniquedStringImpl* key, VM&);
658  GlobalVariableID uniqueIDForOffset(const ConcurrentJITLocker&, VarOffset, VM&);
659  RefPtr<TypeSet> globalTypeSetForOffset(const ConcurrentJITLocker&, VarOffset, VM&);
660  RefPtr<TypeSet> globalTypeSetForVariable(const ConcurrentJITLocker&, UniquedStringImpl* key, VM&);
 657 GlobalVariableID uniqueIDForVariable(const ConcurrentJSLocker&, UniquedStringImpl* key, VM&);
 658 GlobalVariableID uniqueIDForOffset(const ConcurrentJSLocker&, VarOffset, VM&);
 659 RefPtr<TypeSet> globalTypeSetForOffset(const ConcurrentJSLocker&, VarOffset, VM&);
 660 RefPtr<TypeSet> globalTypeSetForVariable(const ConcurrentJSLocker&, UniquedStringImpl* key, VM&);
661661
662662 bool usesNonStrictEval() const { return m_usesNonStrictEval; }
663663 void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; }

@@public:
677677
678678 SymbolTable* cloneScopePart(VM&);
679679
680  void prepareForTypeProfiling(const ConcurrentJITLocker&);
 680 void prepareForTypeProfiling(const ConcurrentJSLocker&);
681681
682682 CodeBlock* rareDataCodeBlock();
683683 void setRareDataCodeBlock(CodeBlock*);

@@private:
715715 std::unique_ptr<LocalToEntryVec> m_localToEntry;
716716
717717public:
718  mutable ConcurrentJITLock m_lock;
 718 mutable ConcurrentJSLock m_lock;
719719};
720720
721721} // namespace JSC
208754

Source/JavaScriptCore/runtime/TypeSet.cpp

@@void TypeSet::addTypeInformation(Runtime
4949 if (structure && newShape && !runtimeTypeIsPrimitive(type)) {
5050 if (!m_structureSet.contains(structure)) {
5151 {
52  ConcurrentJITLocker locker(m_lock);
 52 ConcurrentJSLocker locker(m_lock);
5353 m_structureSet.add(structure);
5454 }
5555 // Make one more pass making sure that:

@@void TypeSet::addTypeInformation(Runtime
8383
8484void TypeSet::invalidateCache()
8585{
86  ConcurrentJITLocker locker(m_lock);
 86 ConcurrentJSLocker locker(m_lock);
8787 auto keepMarkedStructuresFilter = [] (Structure* structure) -> bool { return Heap::isMarked(structure); };
8888 m_structureSet.genericFilter(keepMarkedStructuresFilter);
8989}
208754

Source/JavaScriptCore/runtime/TypeSet.h

2525
2626#pragma once
2727
28 #include "ConcurrentJITLock.h"
 28#include "ConcurrentJSLock.h"
2929#include "RuntimeType.h"
3030#include "StructureSet.h"
3131#include <wtf/HashSet.h>

@@public:
9797 bool isEmpty() const { return m_seenTypes == TypeNothing; }
9898 bool doesTypeConformTo(RuntimeTypeMask test) const;
9999 RuntimeTypeMask seenTypes() const { return m_seenTypes; }
100  StructureSet structureSet(const ConcurrentJITLocker&) const { return m_structureSet; }
 100 StructureSet structureSet(const ConcurrentJSLocker&) const { return m_structureSet; }
101101
102  ConcurrentJITLock m_lock;
 102 ConcurrentJSLock m_lock;
103103private:
104104 bool m_isOverflown;
105105 RuntimeTypeMask m_seenTypes;
208754

Source/JavaScriptCore/runtime/VM.h

2929#pragma once
3030
3131#include "CallData.h"
32 #include "ConcurrentJITLock.h"
 32#include "ConcurrentJSLock.h"
3333#include "ControlFlowProfiler.h"
3434#include "DateInstanceCache.h"
3535#include "ExceptionEventLocation.h"

@@public:
557557 RefPtr<TypedArrayController> m_typedArrayController;
558558 RegExpCache* m_regExpCache;
559559 BumpPointerAllocator m_regExpAllocator;
560  ConcurrentJITLock m_regExpAllocatorLock;
 560 ConcurrentJSLock m_regExpAllocatorLock;
561561
562562 std::unique_ptr<HasOwnPropertyCache> m_hasOwnPropertyCache;
563563 ALWAYS_INLINE HasOwnPropertyCache* hasOwnPropertyCache() { return m_hasOwnPropertyCache.get(); }
208754

Source/JavaScriptCore/runtime/WriteBarrierInlines.h

@@template <typename T>
3434inline void WriteBarrierBase<T>::set(VM& vm, const JSCell* owner, T* value)
3535{
3636 ASSERT(value);
37  ASSERT(!Options::useConcurrentJIT() || !isCompilationThread());
 37 ASSERT(!Options::useConcurrentJS() || !isCompilationThread());
3838 validateCell(value);
3939 setEarlyValue(vm, owner, value);
4040}

@@inline void WriteBarrierBase<T>::setEarl
5656
5757inline void WriteBarrierBase<Unknown>::set(VM& vm, const JSCell* owner, JSValue value)
5858{
59  ASSERT(!Options::useConcurrentJIT() || !isCompilationThread());
 59 ASSERT(!Options::useConcurrentJS() || !isCompilationThread());
6060 m_value = JSValue::encode(value);
6161 vm.heap.writeBarrier(owner, value);
6262}
208754

Source/JavaScriptCore/yarr/YarrInterpreter.cpp

@@public:
15881588 m_currentAlternativeIndex = 0;
15891589 }
15901590
1591  std::unique_ptr<BytecodePattern> compile(BumpPointerAllocator* allocator, ConcurrentJITLock* lock)
 1591 std::unique_ptr<BytecodePattern> compile(BumpPointerAllocator* allocator, ConcurrentJSLock* lock)
15921592 {
15931593 regexBegin(m_pattern.m_numSubpatterns, m_pattern.m_body->m_callFrameSize, m_pattern.m_body->m_alternatives[0]->onceThrough());
15941594 emitDisjunction(m_pattern.m_body);

@@private:
20422042 Vector<std::unique_ptr<ByteDisjunction>> m_allParenthesesInfo;
20432043};
20442044
2045 std::unique_ptr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator, ConcurrentJITLock* lock)
 2045std::unique_ptr<BytecodePattern> byteCompile(YarrPattern& pattern, BumpPointerAllocator* allocator, ConcurrentJSLock* lock)
20462046{
20472047 return ByteCompiler(pattern).compile(allocator, lock);
20482048}
208754

Source/JavaScriptCore/yarr/YarrInterpreter.h

2525
2626#pragma once
2727
28 #include "ConcurrentJITLock.h"
 28#include "ConcurrentJSLock.h"
2929#include "YarrPattern.h"
3030
3131namespace WTF {

@@public:
337337struct BytecodePattern {
338338 WTF_MAKE_FAST_ALLOCATED;
339339public:
340  BytecodePattern(std::unique_ptr<ByteDisjunction> body, Vector<std::unique_ptr<ByteDisjunction>>& parenthesesInfoToAdopt, YarrPattern& pattern, BumpPointerAllocator* allocator, ConcurrentJITLock* lock)
 340 BytecodePattern(std::unique_ptr<ByteDisjunction> body, Vector<std::unique_ptr<ByteDisjunction>>& parenthesesInfoToAdopt, YarrPattern& pattern, BumpPointerAllocator* allocator, ConcurrentJSLock* lock)
341341 : m_body(WTFMove(body))
342342 , m_flags(pattern.m_flags)
343343 , m_allocator(allocator)

@@public:
370370 // Each BytecodePattern is associated with a RegExp, each RegExp is associated
371371 // with a VM. Cache a pointer to out VM's m_regExpAllocator.
372372 BumpPointerAllocator* m_allocator;
373  ConcurrentJITLock* m_lock;
 373 ConcurrentJSLock* m_lock;
374374
375375 CharacterClass* newlineCharacterClass;
376376 CharacterClass* wordcharCharacterClass;

@@private:
380380 Vector<std::unique_ptr<CharacterClass>> m_userCharacterClasses;
381381};
382382
383 JS_EXPORT_PRIVATE std::unique_ptr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*, ConcurrentJITLock* = nullptr);
 383JS_EXPORT_PRIVATE std::unique_ptr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*, ConcurrentJSLock* = nullptr);
384384JS_EXPORT_PRIVATE unsigned interpret(BytecodePattern*, const String& input, unsigned start, unsigned* output);
385385unsigned interpret(BytecodePattern*, const LChar* input, unsigned length, unsigned start, unsigned* output);
386386unsigned interpret(BytecodePattern*, const UChar* input, unsigned length, unsigned start, unsigned* output);
208754

Source/WTF/ChangeLog

 12016-11-15 Filip Pizlo <fpizlo@apple.com>
 2
 3 Rename CONCURRENT_JIT/ConcurrentJIT to CONCURRENT_JS/ConcurrentJS
 4 https://bugs.webkit.org/show_bug.cgi?id=164791
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Both the concurrent GC and the concurrent JIT rely on concurrency support in fundamental
 9 JSC runtime components like JSValue. So, the thing that guards it should be a "feature"
 10 called CONCURRENT_JS not CONCURRENT_JIT.
 11
 12 * wtf/Platform.h:
 13
1142016-11-15 Filip Pizlo <fpizlo@apple.com>
215
316 The concurrent GC should have a timeslicing controller
208754

Source/WTF/wtf/Platform.h

744744#endif
745745#endif
746746
747 /* Concurrent JIT only works on 64-bit platforms because it requires that
 747/* Concurrent JS only works on 64-bit platforms because it requires that
748748 values get stored to atomically. This is trivially true on 64-bit platforms,
749749 but not true at all on 32-bit platforms where values are composed of two
750750 separate sub-values. */
751751#if ENABLE(DFG_JIT) && USE(JSVALUE64)
752 #define ENABLE_CONCURRENT_JIT 1
 752#define ENABLE_CONCURRENT_JS 1
753753#endif
754754
755755/* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */
208754