Changeset 240210 in webkit
- Timestamp:
- Jan 20, 2019 3:20:25 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 39 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r240023 r240210 834 834 runtime/JSGlobalObject.h 835 835 runtime/JSGlobalObjectInlines.h 836 runtime/JSImmutableButterfly.h 836 837 runtime/JSInternalPromise.h 837 838 runtime/JSInternalPromiseDeferred.h … … 849 850 runtime/JSPromiseConstructor.h 850 851 runtime/JSPromiseDeferred.h 852 runtime/JSPropertyNameEnumerator.h 851 853 runtime/JSProxy.h 852 854 runtime/JSRunLoopTimer.h -
trunk/Source/JavaScriptCore/ChangeLog
r240208 r240210 1 2019-01-20 Tadeu Zagallo <tzagallo@apple.com> 2 3 Cache bytecode to disk 4 https://bugs.webkit.org/show_bug.cgi?id=192782 5 <rdar://problem/46084932> 6 7 Reviewed by Keith Miller. 8 9 Add the logic to serialize and deserialize the new JSC bytecode. For now, 10 the cache is only used for tests. 11 12 Each class that can be serialized has a counterpart in CachedTypes, which 13 handles the decoding and encoding. When decoding, the cached objects are 14 mmap'd from disk, but only used for creating instances of the respective 15 in-memory version of each object. Ideally, the mmap'd objects should be 16 used at runtime in the future. 17 18 * CMakeLists.txt: 19 * JavaScriptCore.xcodeproj/project.pbxproj: 20 * Sources.txt: 21 * builtins/BuiltinNames.cpp: 22 (JSC::BuiltinNames::BuiltinNames): 23 * builtins/BuiltinNames.h: 24 * bytecode/CodeBlock.cpp: 25 (JSC::CodeBlock::setConstantIdentifierSetRegisters): 26 * bytecode/CodeBlock.h: 27 * bytecode/HandlerInfo.h: 28 (JSC::UnlinkedHandlerInfo::UnlinkedHandlerInfo): 29 * bytecode/InstructionStream.h: 30 * bytecode/UnlinkedCodeBlock.h: 31 (JSC::UnlinkedCodeBlock::addSetConstant): 32 (JSC::UnlinkedCodeBlock::constantIdentifierSets): 33 * bytecode/UnlinkedEvalCodeBlock.h: 34 * bytecode/UnlinkedFunctionCodeBlock.h: 35 * bytecode/UnlinkedFunctionExecutable.h: 36 * bytecode/UnlinkedGlobalCodeBlock.h: 37 (JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): 38 * bytecode/UnlinkedMetadataTable.h: 39 * bytecode/UnlinkedModuleProgramCodeBlock.h: 40 * bytecode/UnlinkedProgramCodeBlock.h: 41 * interpreter/Interpreter.cpp: 42 * jsc.cpp: 43 (functionQuit): 44 (runJSC): 45 * parser/SourceCode.h: 46 * parser/SourceCodeKey.h: 47 (JSC::SourceCodeKey::operator!= const): 48 * parser/UnlinkedSourceCode.h: 49 * parser/VariableEnvironment.h: 50 * runtime/CachedTypes.cpp: Added. 51 (JSC::Encoder::Allocation::buffer const): 52 (JSC::Encoder::Allocation::offset const): 53 (JSC::Encoder::Allocation::Allocation): 54 (JSC::Encoder::Encoder): 55 (JSC::Encoder::vm): 56 (JSC::Encoder::malloc): 57 (JSC::Encoder::offsetOf): 58 (JSC::Encoder::cachePtr): 59 (JSC::Encoder::offsetForPtr): 60 (JSC::Encoder::release): 61 (JSC::Encoder::Page::Page): 62 (JSC::Encoder::Page::malloc): 63 (JSC::Encoder::Page::buffer const): 64 (JSC::Encoder::Page::size const): 65 (JSC::Encoder::Page::getOffset const): 66 (JSC::Encoder::allocateNewPage): 67 (JSC::Decoder::Decoder): 68 (JSC::Decoder::~Decoder): 69 (JSC::Decoder::vm): 70 (JSC::Decoder::offsetOf): 71 (JSC::Decoder::cacheOffset): 72 (JSC::Decoder::addFinalizer): 73 (JSC::encode): 74 (JSC::decode): 75 (JSC::VariableLengthObject::buffer const): 76 (JSC::VariableLengthObject::allocate): 77 (JSC::CachedPtr::encode): 78 (JSC::CachedPtr::decode const): 79 (JSC::CachedPtr::operator-> const): 80 (JSC::CachedPtr::get const): 81 (JSC::CachedRefPtr::encode): 82 (JSC::CachedRefPtr::decode const): 83 (JSC::CachedWriteBarrier::encode): 84 (JSC::CachedWriteBarrier::decode const): 85 (JSC::CachedVector::encode): 86 (JSC::CachedVector::decode const): 87 (JSC::CachedPair::encode): 88 (JSC::CachedPair::decode const): 89 (JSC::CachedHashMap::encode): 90 (JSC::CachedHashMap::decode const): 91 (JSC::CachedUniquedStringImpl::encode): 92 (JSC::CachedUniquedStringImpl::decode const): 93 (JSC::CachedStringImpl::encode): 94 (JSC::CachedStringImpl::decode const): 95 (JSC::CachedString::encode): 96 (JSC::CachedString::decode const): 97 (JSC::CachedIdentifier::encode): 98 (JSC::CachedIdentifier::decode const): 99 (JSC::CachedOptional::encode): 100 (JSC::CachedOptional::decode const): 101 (JSC::CachedOptional::decodeAsPtr const): 102 (JSC::CachedSimpleJumpTable::encode): 103 (JSC::CachedSimpleJumpTable::decode const): 104 (JSC::CachedStringJumpTable::encode): 105 (JSC::CachedStringJumpTable::decode const): 106 (JSC::CachedCodeBlockRareData::encode): 107 (JSC::CachedCodeBlockRareData::decode const): 108 (JSC::CachedBitVector::encode): 109 (JSC::CachedBitVector::decode const): 110 (JSC::CachedHashSet::encode): 111 (JSC::CachedHashSet::decode const): 112 (JSC::CachedConstantIdentifierSetEntry::encode): 113 (JSC::CachedConstantIdentifierSetEntry::decode const): 114 (JSC::CachedVariableEnvironment::encode): 115 (JSC::CachedVariableEnvironment::decode const): 116 (JSC::CachedArray::encode): 117 (JSC::CachedArray::decode const): 118 (JSC::CachedScopedArgumentsTable::encode): 119 (JSC::CachedScopedArgumentsTable::decode const): 120 (JSC::CachedSymbolTableEntry::encode): 121 (JSC::CachedSymbolTableEntry::decode const): 122 (JSC::CachedSymbolTable::encode): 123 (JSC::CachedSymbolTable::decode const): 124 (JSC::CachedImmutableButterfly::encode): 125 (JSC::CachedImmutableButterfly::decode const): 126 (JSC::CachedRegExp::encode): 127 (JSC::CachedRegExp::decode const): 128 (JSC::CachedTemplateObjectDescriptor::encode): 129 (JSC::CachedTemplateObjectDescriptor::decode const): 130 (JSC::CachedBigInt::encode): 131 (JSC::CachedBigInt::decode const): 132 (JSC::CachedJSValue::encode): 133 (JSC::CachedJSValue::decode const): 134 (JSC::CachedInstructionStream::encode): 135 (JSC::CachedInstructionStream::decode const): 136 (JSC::CachedMetadataTable::encode): 137 (JSC::CachedMetadataTable::decode const): 138 (JSC::CachedSourceOrigin::encode): 139 (JSC::CachedSourceOrigin::decode const): 140 (JSC::CachedTextPosition::encode): 141 (JSC::CachedTextPosition::decode const): 142 (JSC::CachedSourceProviderShape::encode): 143 (JSC::CachedSourceProviderShape::decode const): 144 (JSC::CachedStringSourceProvider::encode): 145 (JSC::CachedStringSourceProvider::decode const): 146 (JSC::CachedWebAssemblySourceProvider::encode): 147 (JSC::CachedWebAssemblySourceProvider::decode const): 148 (JSC::CachedSourceProvider::encode): 149 (JSC::CachedSourceProvider::decode const): 150 (JSC::CachedUnlinkedSourceCodeShape::encode): 151 (JSC::CachedUnlinkedSourceCodeShape::decode const): 152 (JSC::CachedSourceCode::encode): 153 (JSC::CachedSourceCode::decode const): 154 (JSC::CachedFunctionExecutable::firstLineOffset const): 155 (JSC::CachedFunctionExecutable::lineCount const): 156 (JSC::CachedFunctionExecutable::unlinkedFunctionNameStart const): 157 (JSC::CachedFunctionExecutable::unlinkedBodyStartColumn const): 158 (JSC::CachedFunctionExecutable::unlinkedBodyEndColumn const): 159 (JSC::CachedFunctionExecutable::startOffset const): 160 (JSC::CachedFunctionExecutable::sourceLength const): 161 (JSC::CachedFunctionExecutable::parametersStartOffset const): 162 (JSC::CachedFunctionExecutable::typeProfilingStartOffset const): 163 (JSC::CachedFunctionExecutable::typeProfilingEndOffset const): 164 (JSC::CachedFunctionExecutable::parameterCount const): 165 (JSC::CachedFunctionExecutable::features const): 166 (JSC::CachedFunctionExecutable::sourceParseMode const): 167 (JSC::CachedFunctionExecutable::isInStrictContext const): 168 (JSC::CachedFunctionExecutable::hasCapturedVariables const): 169 (JSC::CachedFunctionExecutable::isBuiltinFunction const): 170 (JSC::CachedFunctionExecutable::isBuiltinDefaultClassConstructor const): 171 (JSC::CachedFunctionExecutable::constructAbility const): 172 (JSC::CachedFunctionExecutable::constructorKind const): 173 (JSC::CachedFunctionExecutable::functionMode const): 174 (JSC::CachedFunctionExecutable::scriptMode const): 175 (JSC::CachedFunctionExecutable::superBinding const): 176 (JSC::CachedFunctionExecutable::derivedContextType const): 177 (JSC::CachedFunctionExecutable::name const): 178 (JSC::CachedFunctionExecutable::ecmaName const): 179 (JSC::CachedFunctionExecutable::inferredName const): 180 (JSC::CachedCodeBlock::instructions const): 181 (JSC::CachedCodeBlock::thisRegister const): 182 (JSC::CachedCodeBlock::scopeRegister const): 183 (JSC::CachedCodeBlock::globalObjectRegister const): 184 (JSC::CachedCodeBlock::sourceURLDirective const): 185 (JSC::CachedCodeBlock::sourceMappingURLDirective const): 186 (JSC::CachedCodeBlock::usesEval const): 187 (JSC::CachedCodeBlock::isStrictMode const): 188 (JSC::CachedCodeBlock::isConstructor const): 189 (JSC::CachedCodeBlock::hasCapturedVariables const): 190 (JSC::CachedCodeBlock::isBuiltinFunction const): 191 (JSC::CachedCodeBlock::superBinding const): 192 (JSC::CachedCodeBlock::scriptMode const): 193 (JSC::CachedCodeBlock::isArrowFunctionContext const): 194 (JSC::CachedCodeBlock::isClassContext const): 195 (JSC::CachedCodeBlock::wasCompiledWithDebuggingOpcodes const): 196 (JSC::CachedCodeBlock::constructorKind const): 197 (JSC::CachedCodeBlock::derivedContextType const): 198 (JSC::CachedCodeBlock::evalContextType const): 199 (JSC::CachedCodeBlock::hasTailCalls const): 200 (JSC::CachedCodeBlock::lineCount const): 201 (JSC::CachedCodeBlock::endColumn const): 202 (JSC::CachedCodeBlock::numVars const): 203 (JSC::CachedCodeBlock::numCalleeLocals const): 204 (JSC::CachedCodeBlock::numParameters const): 205 (JSC::CachedCodeBlock::features const): 206 (JSC::CachedCodeBlock::parseMode const): 207 (JSC::CachedCodeBlock::codeType const): 208 (JSC::CachedCodeBlock::rareData const): 209 (JSC::CachedProgramCodeBlock::encode): 210 (JSC::CachedProgramCodeBlock::decode const): 211 (JSC::CachedModuleCodeBlock::encode): 212 (JSC::CachedModuleCodeBlock::decode const): 213 (JSC::CachedEvalCodeBlock::encode): 214 (JSC::CachedEvalCodeBlock::decode const): 215 (JSC::CachedFunctionCodeBlock::encode): 216 (JSC::CachedFunctionCodeBlock::decode const): 217 (JSC::UnlinkedFunctionCodeBlock::UnlinkedFunctionCodeBlock): 218 (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): 219 (JSC::CachedCodeBlock<CodeBlockType>::decode const): 220 (JSC::UnlinkedProgramCodeBlock::UnlinkedProgramCodeBlock): 221 (JSC::UnlinkedModuleProgramCodeBlock::UnlinkedModuleProgramCodeBlock): 222 (JSC::UnlinkedEvalCodeBlock::UnlinkedEvalCodeBlock): 223 (JSC::CachedFunctionExecutable::encode): 224 (JSC::CachedFunctionExecutable::decode const): 225 (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): 226 (JSC::CachedCodeBlock<CodeBlockType>::encode): 227 (JSC::CachedSourceCodeKey::encode): 228 (JSC::CachedSourceCodeKey::decode const): 229 (JSC::CacheEntry::encode): 230 (JSC::CacheEntry:: const): 231 (JSC:: const): 232 (JSC::encodeCodeBlock): 233 (JSC::decodeCodeBlockImpl): 234 * runtime/CachedTypes.h: Copied from Source/JavaScriptCore/bytecode/UnlinkedGlobalCodeBlock.h. 235 (JSC::decodeCodeBlock): 236 * runtime/CodeCache.cpp: 237 (JSC::CodeCacheMap::pruneSlowCase): 238 (JSC::CodeCache::getUnlinkedGlobalCodeBlock): 239 (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable): 240 (JSC::CodeCache::write): 241 * runtime/CodeCache.h: 242 (JSC::CodeCacheMap::begin): 243 (JSC::CodeCacheMap::end): 244 (JSC::CodeCacheMap::fetchFromDiskImpl): 245 (JSC::CodeCacheMap::findCacheAndUpdateAge): 246 (JSC::writeCodeBlock): 247 * runtime/JSBigInt.cpp: 248 * runtime/JSBigInt.h: 249 * runtime/Options.cpp: 250 (JSC::recomputeDependentOptions): 251 * runtime/Options.h: 252 * runtime/RegExp.h: 253 * runtime/ScopedArgumentsTable.h: 254 * runtime/StackFrame.h: 255 * runtime/StructureInlines.h: 256 * runtime/SymbolTable.h: 257 1 258 2019-01-20 Antoine Quint <graouts@apple.com> 2 259 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r240114 r240210 827 827 2684D4381C00161C0081D663 /* AirLiveness.h in Headers */ = {isa = PBXBuildFile; fileRef = 2684D4371C00161C0081D663 /* AirLiveness.h */; }; 828 828 269D636E1BFBE5D100101B1D /* FTLOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = 269D636D1BFBE5D000101B1D /* FTLOutput.h */; }; 829 2A05ABD61961DF2400341750 /* JSPropertyNameEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A05ABD41961DF2400341750 /* JSPropertyNameEnumerator.h */; };829 2A05ABD61961DF2400341750 /* JSPropertyNameEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A05ABD41961DF2400341750 /* JSPropertyNameEnumerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 830 830 2A111246192FCE79005EE18D /* CustomGetterSetter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A111244192FCE79005EE18D /* CustomGetterSetter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 831 831 2A48D1911772365B00C65A5F /* APICallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = C211B574176A224D000E2A23 /* APICallbackFunction.h */; }; … … 1063 1063 53EE01B6218F691600AD1F8D /* JSScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EE01B5218F690F00AD1F8D /* JSScript.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1064 1064 53EE01B8218F7EFF00AD1F8D /* JSScriptInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 53EE01B7218F7EFF00AD1F8D /* JSScriptInternal.h */; }; 1065 53F11F41209138D700E411A7 /* JSImmutableButterfly.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F11F40209138D700E411A7 /* JSImmutableButterfly.h */; };1065 53F11F41209138D700E411A7 /* JSImmutableButterfly.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F11F40209138D700E411A7 /* JSImmutableButterfly.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1066 1066 53F40E851D58F9770099A1B6 /* WasmSections.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F40E841D58F9770099A1B6 /* WasmSections.h */; }; 1067 1067 53F40E8B1D5901BB0099A1B6 /* WasmFunctionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F40E8A1D5901BB0099A1B6 /* WasmFunctionParser.h */; }; … … 3129 3129 14386A761DD6989C008652C4 /* IndirectEvalExecutable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndirectEvalExecutable.cpp; sourceTree = "<group>"; }; 3130 3130 14386A771DD6989C008652C4 /* IndirectEvalExecutable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndirectEvalExecutable.h; sourceTree = "<group>"; }; 3131 143BE26521C857770020CD17 /* CachedTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTypes.h; sourceTree = "<group>"; }; 3131 3132 1440051F0A531D3B0005F061 /* Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Node.h; path = tests/Node.h; sourceTree = "<group>"; }; 3132 3133 144005200A531D3B0005F061 /* Node.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Node.c; path = tests/Node.c; sourceTree = "<group>"; }; … … 3243 3244 14DA818E0D99FD2000B0A4FB /* JSLexicalEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLexicalEnvironment.h; sourceTree = "<group>"; }; 3244 3245 14DA818F0D99FD2000B0A4FB /* JSLexicalEnvironment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLexicalEnvironment.cpp; sourceTree = "<group>"; }; 3246 14DAFA4521E3B871004B68F7 /* CachedTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTypes.cpp; sourceTree = "<group>"; }; 3245 3247 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = JSGlobalObject.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 3246 3248 14DF04D916B3996D0016A513 /* StaticPropertyAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPropertyAnalysis.h; sourceTree = "<group>"; }; … … 6601 6603 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */, 6602 6604 0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */, 6605 14DAFA4521E3B871004B68F7 /* CachedTypes.cpp */, 6606 143BE26521C857770020CD17 /* CachedTypes.h */, 6603 6607 0FEC3C5F1F379F5300F59B6C /* CagedBarrierPtr.h */, 6604 6608 BCA62DFE0E2826230004F30D /* CallData.cpp */, -
trunk/Source/JavaScriptCore/Sources.txt
r240023 r240210 714 714 runtime/BooleanPrototype.cpp 715 715 runtime/CallData.cpp 716 runtime/CachedTypes.cpp 716 717 runtime/CatchScope.cpp 717 718 runtime/ClassInfo.cpp -
trunk/Source/JavaScriptCore/builtins/BuiltinNames.cpp
r231565 r240210 64 64 JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY) 65 65 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY) 66 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_SYMBOL_PRIVATE_TO_PUBLIC_ENTRY) 66 67 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY) 67 68 m_privateToPublicMap.add(m_dollarVMPrivateName.impl(), &m_dollarVMName); -
trunk/Source/JavaScriptCore/builtins/BuiltinNames.h
r231565 r240210 214 214 // e.g. @iteratorSymbol points to Symbol.iterator in this map rather than to a an actual private name. 215 215 // FIXME: This is a weird hack and we shouldn't need to do this. 216 #define INITIALIZE_SYMBOL_PRIVATE_TO_PUBLIC_ENTRY(name) m_privateToPublicMap.add(m_##name##Symbol.impl(), &m_##name##SymbolPrivateIdentifier); 216 217 #define INITIALIZE_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY(name) m_publicToPrivateMap.add(m_##name##SymbolPrivateIdentifier.impl(), &m_##name##Symbol); 217 218 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r240138 r240210 870 870 } 871 871 872 void CodeBlock::setConstantIdentifierSetRegisters(VM& vm, const Vector<ConstantI ndentifierSetEntry>& constants)872 void CodeBlock::setConstantIdentifierSetRegisters(VM& vm, const Vector<ConstantIdentifierSetEntry>& constants) 873 873 { 874 874 auto scope = DECLARE_THROW_SCOPE(vm); -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r239879 r240210 891 891 void updateAllPredictionsAndCountLiveness(unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles); 892 892 893 void setConstantIdentifierSetRegisters(VM&, const Vector<ConstantI ndentifierSetEntry>& constants);893 void setConstantIdentifierSetRegisters(VM&, const Vector<ConstantIdentifierSetEntry>& constants); 894 894 895 895 void setConstantRegisters(const Vector<WriteBarrier<Unknown>>& constants, const Vector<SourceCodeRepresentation>& constantsSourceCodeRepresentation); -
trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h
r230748 r240210 90 90 91 91 struct UnlinkedHandlerInfo : public HandlerInfoBase { 92 UnlinkedHandlerInfo() 93 { 94 } 95 92 96 UnlinkedHandlerInfo(uint32_t start, uint32_t end, uint32_t target, HandlerType handlerType) 93 97 { -
trunk/Source/JavaScriptCore/bytecode/InstructionStream.h
r238414 r240210 40 40 41 41 friend class InstructionStreamWriter; 42 friend class CachedInstructionStream; 42 43 public: 43 44 size_t sizeInBytes() const; -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r237547 r240210 66 66 struct ExecutableInfo; 67 67 68 template<typename CodeBlockType> 69 class CachedCodeBlock; 70 68 71 typedef unsigned UnlinkedValueProfile; 69 72 typedef unsigned UnlinkedArrayProfile; … … 71 74 typedef unsigned UnlinkedObjectAllocationProfile; 72 75 typedef unsigned UnlinkedLLIntCallLinkInfo; 73 using ConstantI ndentifierSetEntry = std::pair<IdentifierSet, unsigned>;76 using ConstantIdentifierSetEntry = std::pair<IdentifierSet, unsigned>; 74 77 75 78 struct UnlinkedStringJumpTable { … … 169 172 m_constantRegisters.append(WriteBarrier<Unknown>()); 170 173 m_constantsSourceCodeRepresentation.append(SourceCodeRepresentation::Other); 171 m_constantIdentifierSets.append(ConstantI ndentifierSetEntry(set, result));174 m_constantIdentifierSets.append(ConstantIdentifierSetEntry(set, result)); 172 175 } 173 176 … … 203 206 } 204 207 const Vector<WriteBarrier<Unknown>>& constantRegisters() { return m_constantRegisters; } 205 const Vector<ConstantI ndentifierSetEntry>& constantIdentifierSets() { return m_constantIdentifierSets; }208 const Vector<ConstantIdentifierSetEntry>& constantIdentifierSets() { return m_constantIdentifierSets; } 206 209 const WriteBarrier<Unknown>& constantRegister(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex]; } 207 210 ALWAYS_INLINE bool isConstantRegisterIndex(int index) const { return index >= FirstConstantRegisterIndex; } … … 368 371 protected: 369 372 UnlinkedCodeBlock(VM*, Structure*, CodeType, const ExecutableInfo&, DebuggerMode); 373 374 template<typename CodeBlockType> 375 UnlinkedCodeBlock(Decoder&, Structure*, const CachedCodeBlock<CodeBlockType>&); 376 370 377 ~UnlinkedCodeBlock(); 371 378 … … 378 385 friend class BytecodeRewriter; 379 386 friend class BytecodeGenerator; 387 388 template<typename CodeBlockType> 389 friend class CachedCodeBlock; 380 390 381 391 void applyModification(BytecodeRewriter&, InstructionStreamWriter&); … … 445 455 Vector<BitVector> m_bitVectors; 446 456 Vector<WriteBarrier<Unknown>> m_constantRegisters; 447 Vector<ConstantI ndentifierSetEntry> m_constantIdentifierSets;457 Vector<ConstantIdentifierSetEntry> m_constantIdentifierSets; 448 458 Vector<SourceCodeRepresentation> m_constantsSourceCodeRepresentation; 449 459 typedef Vector<WriteBarrier<UnlinkedFunctionExecutable>> FunctionExpressionVector; -
trunk/Source/JavaScriptCore/bytecode/UnlinkedEvalCodeBlock.h
r215984 r240210 30 30 namespace JSC { 31 31 32 class CachedEvalCodeBlock; 33 32 34 class UnlinkedEvalCodeBlock final : public UnlinkedGlobalCodeBlock { 33 35 public: … … 60 62 } 61 63 private: 64 friend CachedEvalCodeBlock; 65 62 66 UnlinkedEvalCodeBlock(VM* vm, Structure* structure, const ExecutableInfo& info, DebuggerMode debuggerMode) 63 67 : Base(vm, structure, EvalCode, info, debuggerMode) 64 68 { 65 69 } 70 71 UnlinkedEvalCodeBlock(Decoder&, const CachedEvalCodeBlock&); 66 72 67 73 Vector<Identifier, 0, UnsafeVectorOverflow> m_variables; -
trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionCodeBlock.h
r208312 r240210 30 30 namespace JSC { 31 31 32 class CachedFunctionCodeBlock; 33 32 34 class UnlinkedFunctionCodeBlock final : public UnlinkedCodeBlock { 33 35 public: … … 45 47 46 48 private: 49 friend CachedFunctionCodeBlock; 50 47 51 UnlinkedFunctionCodeBlock(VM* vm, Structure* structure, CodeType codeType, const ExecutableInfo& info, DebuggerMode debuggerMode) 48 52 : Base(vm, structure, codeType, info, debuggerMode) 49 53 { 50 54 } 55 56 UnlinkedFunctionCodeBlock(Decoder&, const CachedFunctionCodeBlock&); 51 57 52 58 public: -
trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
r239427 r240210 40 40 namespace JSC { 41 41 42 class Decoder; 42 43 class FunctionMetadataNode; 43 44 class FunctionExecutable; … … 45 46 class SourceProvider; 46 47 class UnlinkedFunctionCodeBlock; 48 class CachedFunctionExecutable; 47 49 48 50 enum UnlinkedFunctionKind { … … 55 57 friend class CodeCache; 56 58 friend class VM; 59 friend CachedFunctionExecutable; 57 60 58 61 typedef JSCell Base; … … 148 151 private: 149 152 UnlinkedFunctionExecutable(VM*, Structure*, const SourceCode&, FunctionMetadataNode*, UnlinkedFunctionKind, ConstructAbility, JSParserScriptMode, VariableEnvironment&, JSC::DerivedContextType, bool isBuiltinDefaultClassConstructor); 153 UnlinkedFunctionExecutable(Decoder&, VariableEnvironment&, const CachedFunctionExecutable&); 150 154 151 155 unsigned m_firstLineOffset; -
trunk/Source/JavaScriptCore/bytecode/UnlinkedGlobalCodeBlock.h
r208312 r240210 39 39 { 40 40 } 41 42 template<typename CodeBlockType> 43 UnlinkedGlobalCodeBlock(Decoder& decoder, Structure* structure, const CachedCodeBlock<CodeBlockType>& cachedCodeBlock) 44 : Base(decoder, structure, cachedCodeBlock) 45 { 46 } 41 47 }; 42 48 -
trunk/Source/JavaScriptCore/bytecode/UnlinkedMetadataTable.h
r237987 r240210 36 36 friend class LLIntOffsetsExtractor; 37 37 friend class MetadataTable; 38 friend class CachedMetadataTable; 38 39 39 40 public: -
trunk/Source/JavaScriptCore/bytecode/UnlinkedModuleProgramCodeBlock.h
r217645 r240210 29 29 30 30 namespace JSC { 31 32 class Decoder; 33 class CachedModuleCodeBlock; 31 34 32 35 class UnlinkedModuleProgramCodeBlock final : public UnlinkedGlobalCodeBlock { … … 75 78 76 79 private: 80 friend CachedModuleCodeBlock; 81 77 82 UnlinkedModuleProgramCodeBlock(VM* vm, Structure* structure, const ExecutableInfo& info, DebuggerMode debuggerMode) 78 83 : Base(vm, structure, ModuleCode, info, debuggerMode) 79 84 { 80 85 } 86 87 UnlinkedModuleProgramCodeBlock(Decoder&, const CachedModuleCodeBlock&); 81 88 82 89 int m_moduleEnvironmentSymbolTableConstantRegisterOffset { 0 }; -
trunk/Source/JavaScriptCore/bytecode/UnlinkedProgramCodeBlock.h
r217645 r240210 30 30 namespace JSC { 31 31 32 class CachedProgramCodeBlock; 33 32 34 class UnlinkedProgramCodeBlock final : public UnlinkedGlobalCodeBlock { 33 35 public: … … 51 53 52 54 private: 55 friend CachedProgramCodeBlock; 56 53 57 UnlinkedProgramCodeBlock(VM* vm, Structure* structure, const ExecutableInfo& info, DebuggerMode debuggerMode) 54 58 : Base(vm, structure, GlobalCode, info, debuggerMode) 55 59 { 56 60 } 61 62 UnlinkedProgramCodeBlock(Decoder&, const CachedProgramCodeBlock&); 57 63 58 64 VariableEnvironment m_varDeclarations; -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r237547 r240210 36 36 #include "CatchScope.h" 37 37 #include "CodeBlock.h" 38 #include "CodeCache.h" 38 39 #include "DirectArguments.h" 39 40 #include "Heap.h" -
trunk/Source/JavaScriptCore/jsc.cpp
r240113 r240210 29 29 #include "CatchScope.h" 30 30 #include "CodeBlock.h" 31 #include "CodeCache.h" 31 32 #include "Completion.h" 32 33 #include "ConfigFile.h" … … 1989 1990 } 1990 1991 1991 EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*) 1992 { 1992 EncodedJSValue JSC_HOST_CALL functionQuit(ExecState* exec) 1993 { 1994 VM& vm = exec->vm(); 1995 vm.codeCache()->write(vm); 1996 1993 1997 jscExit(EXIT_SUCCESS); 1994 1998 … … 2877 2881 } 2878 2882 2883 vm.codeCache()->write(vm); 2884 2879 2885 if (isWorker) { 2880 2886 JSLockHolder locker(vm); -
trunk/Source/JavaScriptCore/parser/SourceCode.h
r239569 r240210 34 34 35 35 class SourceCode : public UnlinkedSourceCode { 36 friend class CachedSourceCode; 37 36 38 public: 37 39 SourceCode() -
trunk/Source/JavaScriptCore/parser/SourceCodeKey.h
r239461 r240210 38 38 39 39 class SourceCodeFlags { 40 friend class CachedSourceCodeKey; 41 40 42 public: 41 43 SourceCodeFlags() = default; … … 71 73 72 74 class SourceCodeKey { 75 friend class CachedSourceCodeKey; 76 73 77 public: 74 78 SourceCodeKey() … … 115 119 } 116 120 121 bool operator!=(const SourceCodeKey& other) const 122 { 123 return !(*this == other); 124 } 125 117 126 struct Hash { 118 127 static unsigned hash(const SourceCodeKey& key) { return key.hash(); } -
trunk/Source/JavaScriptCore/parser/UnlinkedSourceCode.h
r227527 r240210 36 36 37 37 class UnlinkedSourceCode { 38 template<typename SourceType> 39 friend class CachedUnlinkedSourceCodeShape; 40 38 41 public: 39 42 UnlinkedSourceCode() -
trunk/Source/JavaScriptCore/parser/VariableEnvironment.h
r231477 r240210 117 117 118 118 private: 119 friend class CachedVariableEnvironment; 120 119 121 Map m_map; 120 122 bool m_isEverythingCaptured { false }; -
trunk/Source/JavaScriptCore/runtime/CachedTypes.h
r240209 r240210 1 1 /* 2 * Copyright (C) 201 2-2016 Apple Inc. All Rights Reserved.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "UnlinkedCodeBlock.h" 28 #include "JSCast.h" 29 #include <wtf/MallocPtr.h> 29 30 30 31 namespace JSC { 31 32 32 class UnlinkedGlobalCodeBlock : public UnlinkedCodeBlock { 33 public: 34 typedef UnlinkedCodeBlock Base; 33 class SourceCodeKey; 34 class UnlinkedCodeBlock; 35 35 36 protected: 37 UnlinkedGlobalCodeBlock(VM* vm, Structure* structure, CodeType codeType, const ExecutableInfo& info, DebuggerMode debuggerMode) 38 : Base(vm, structure, codeType, info, debuggerMode) 39 { 40 } 41 }; 36 std::pair<MallocPtr<uint8_t>, size_t> encodeCodeBlock(VM&, const SourceCodeKey&, const UnlinkedCodeBlock*); 37 UnlinkedCodeBlock* decodeCodeBlockImpl(VM&, const SourceCodeKey&, const void*, size_t); 42 38 39 40 template<typename UnlinkedCodeBlockType> 41 UnlinkedCodeBlockType* decodeCodeBlock(VM& vm, const SourceCodeKey& key, const void* buffer, size_t size) 42 { 43 return jsCast<UnlinkedCodeBlockType*>(decodeCodeBlockImpl(vm, key, buffer, size)); 43 44 } 45 46 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r239427 r240210 44 44 while (m_size > m_capacity || !canPruneQuickly()) { 45 45 MapType::iterator it = m_map.begin(); 46 47 writeCodeBlock(*it->value.cell->vm(), it->key, it->value); 48 46 49 m_size -= it->key.length(); 47 50 m_map.remove(it); … … 60 63 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, 61 64 WTF::nullopt); 62 SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); 63 if (cache && Options::useCodeCache()) { 64 UnlinkedCodeBlockType* unlinkedCodeBlock = jsCast<UnlinkedCodeBlockType*>(cache->cell.get()); 65 UnlinkedCodeBlockType* unlinkedCodeBlock = m_sourceCode.findCacheAndUpdateAge<UnlinkedCodeBlockType>(vm, key); 66 if (unlinkedCodeBlock && Options::useCodeCache()) { 65 67 unsigned lineCount = unlinkedCodeBlock->lineCount(); 66 68 unsigned startColumn = unlinkedCodeBlock->startColumn() + source.startColumn().oneBasedInt(); … … 72 74 return unlinkedCodeBlock; 73 75 } 74 76 75 77 VariableEnvironment variablesUnderTDZ; 76 UnlinkedCodeBlockType*unlinkedCodeBlock = generateUnlinkedCodeBlock<UnlinkedCodeBlockType, ExecutableType>(vm, executable, source, strictMode, scriptMode, debuggerMode, error, evalContextType, &variablesUnderTDZ);78 unlinkedCodeBlock = generateUnlinkedCodeBlock<UnlinkedCodeBlockType, ExecutableType>(vm, executable, source, strictMode, scriptMode, debuggerMode, error, evalContextType, &variablesUnderTDZ); 77 79 78 80 if (unlinkedCodeBlock && Options::useCodeCache()) … … 111 113 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, 112 114 functionConstructorParametersEndPosition); 113 SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); 114 if (cache && Options::useCodeCache()) { 115 UnlinkedFunctionExecutable* executable = jsCast<UnlinkedFunctionExecutable*>(cache->cell.get()); 115 UnlinkedFunctionExecutable* executable = m_sourceCode.findCacheAndUpdateAge<UnlinkedFunctionExecutable>(vm, key); 116 if (executable && Options::useCodeCache()) { 116 117 source.provider()->setSourceURLDirective(executable->sourceURLDirective()); 117 118 source.provider()->setSourceMappingURLDirective(executable->sourceMappingURLDirective()); … … 156 157 } 157 158 159 void CodeCache::write(VM& vm) 160 { 161 for (const auto& it : m_sourceCode) 162 writeCodeBlock(vm, it.key, it.value); 158 163 } 164 165 } -
trunk/Source/JavaScriptCore/runtime/CodeCache.h
r239427 r240210 27 27 28 28 #include "BytecodeGenerator.h" 29 #include "CachedTypes.h" 29 30 #include "ExecutableInfo.h" 30 31 #include "JSCInlines.h" … … 38 39 #include "UnlinkedModuleProgramCodeBlock.h" 39 40 #include "UnlinkedProgramCodeBlock.h" 41 #include <sys/stat.h> 40 42 #include <wtf/Forward.h> 41 43 #include <wtf/text/WTFString.h> … … 90 92 } 91 93 92 SourceCodeValue* findCacheAndUpdateAge(const SourceCodeKey& key) 94 iterator begin() { return m_map.begin(); } 95 iterator end() { return m_map.end(); } 96 97 template<typename UnlinkedCodeBlockType> 98 UnlinkedCodeBlockType* fetchFromDiskImpl(VM& vm, const SourceCodeKey& key) 99 { 100 #if OS(DARWIN) 101 const char* cachePath = Options::diskCachePath(); 102 if (!cachePath) 103 return nullptr; 104 105 unsigned hash = key.hash(); 106 char filename[512]; 107 int count = snprintf(filename, 512, "%s/%u.cache", cachePath, hash); 108 if (count < 0 || count > 512) 109 return nullptr; 110 111 int fd = open(filename, O_RDONLY); 112 if (fd == -1) 113 return nullptr; 114 115 int rc = flock(fd, LOCK_SH | LOCK_NB); 116 if (rc) { 117 close(fd); 118 return nullptr; 119 } 120 121 struct stat sb; 122 int res = fstat(fd, &sb); 123 size_t size = static_cast<size_t>(sb.st_size); 124 if (res || !size) 125 return nullptr; 126 127 const void* buffer = mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0); 128 UnlinkedCodeBlockType* unlinkedCodeBlock = decodeCodeBlock<UnlinkedCodeBlockType>(vm, key, buffer, size); 129 130 if (!unlinkedCodeBlock) 131 return nullptr; 132 133 addCache(key, SourceCodeValue(vm, unlinkedCodeBlock, m_age)); 134 return unlinkedCodeBlock; 135 #else 136 UNUSED_PARAM(vm); 137 UNUSED_PARAM(key); 138 return nullptr; 139 #endif 140 } 141 142 template<typename UnlinkedCodeBlockType> 143 std::enable_if_t<std::is_base_of<UnlinkedCodeBlock, UnlinkedCodeBlockType>::value && !std::is_same<UnlinkedCodeBlockType, UnlinkedEvalCodeBlock>::value, UnlinkedCodeBlockType*> 144 fetchFromDisk(VM& vm, const SourceCodeKey& key) 145 { 146 UnlinkedCodeBlockType* codeBlock = fetchFromDiskImpl<UnlinkedCodeBlockType>(vm, key); 147 if (UNLIKELY(Options::forceDiskCache())) 148 RELEASE_ASSERT(codeBlock); 149 return codeBlock; 150 } 151 152 template<typename T> 153 std::enable_if_t<!std::is_base_of<UnlinkedCodeBlock, T>::value || std::is_same<T, UnlinkedEvalCodeBlock>::value, T*> 154 fetchFromDisk(VM&, const SourceCodeKey&) { return nullptr; } 155 156 template<typename UnlinkedCodeBlockType> 157 UnlinkedCodeBlockType* findCacheAndUpdateAge(VM& vm, const SourceCodeKey& key) 93 158 { 94 159 prune(); … … 96 161 iterator findResult = m_map.find(key); 97 162 if (findResult == m_map.end()) 98 return nullptr;163 return fetchFromDisk<UnlinkedCodeBlockType>(vm, key); 99 164 100 165 int64_t age = m_age - findResult->value.age; … … 116 181 m_age += key.length(); 117 182 118 return &findResult->value;183 return jsCast<UnlinkedCodeBlockType*>(findResult->value.cell.get()); 119 184 } 120 185 … … 198 263 199 264 void clear() { m_sourceCode.clear(); } 265 JS_EXPORT_PRIVATE void write(VM&); 200 266 201 267 private: … … 257 323 } 258 324 325 ALWAYS_INLINE static void writeCodeBlock(VM& vm, const SourceCodeKey& key, const SourceCodeValue& value) 326 { 327 #if OS(DARWIN) 328 const char* cachePath = Options::diskCachePath(); 329 if (LIKELY(!cachePath)) 330 return; 331 332 UnlinkedCodeBlock* codeBlock = jsDynamicCast<UnlinkedCodeBlock*>(vm, value.cell.get()); 333 if (!codeBlock) 334 return; 335 336 unsigned hash = key.hash(); 337 char filename[512]; 338 int count = snprintf(filename, 512, "%s/%u.cache", cachePath, hash); 339 if (count < 0 || count > 512) 340 return; 341 342 std::pair<MallocPtr<uint8_t>, size_t> result = encodeCodeBlock(vm, key, codeBlock); 343 344 int fd = open(filename, O_CREAT | O_WRONLY, 0666); 345 int rc = flock(fd, LOCK_EX | LOCK_NB); 346 if (!rc) 347 ::write(fd, result.first.get(), result.second); 348 close(fd); 349 #else 350 UNUSED_PARAM(vm); 351 UNUSED_PARAM(key); 352 UNUSED_PARAM(value); 353 #endif 354 } 355 356 259 357 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSBigInt.cpp
r239427 r240210 1689 1689 } 1690 1690 1691 inline size_t JSBigInt::offsetOfData()1692 {1693 return WTF::roundUpToMultipleOf<sizeof(Digit)>(sizeof(JSBigInt));1694 }1695 1696 1691 template <typename CharType> 1697 1692 JSBigInt* JSBigInt::parseInt(ExecState* exec, CharType* data, unsigned length, ErrorParseMode errorParseMode) … … 1794 1789 1795 1790 return nullptr; 1796 }1797 1798 inline JSBigInt::Digit* JSBigInt::dataStorage()1799 {1800 return reinterpret_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData());1801 1791 } 1802 1792 -
trunk/Source/JavaScriptCore/runtime/JSBigInt.h
r239427 r240210 39 39 using Base = JSCell; 40 40 static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal | OverridesToThis; 41 friend class CachedBigInt; 41 42 42 43 public: … … 229 230 230 231 static size_t allocationSize(unsigned length); 231 static size_t offsetOfData(); 232 Digit* dataStorage(); 232 inline static size_t offsetOfData() 233 { 234 return WTF::roundUpToMultipleOf<sizeof(Digit)>(sizeof(JSBigInt)); 235 } 236 237 inline Digit* dataStorage() 238 { 239 return reinterpret_cast<Digit*>(reinterpret_cast<char*>(this) + offsetOfData()); 240 } 233 241 234 242 Digit digit(unsigned); -
trunk/Source/JavaScriptCore/runtime/Options.cpp
r238564 r240210 518 518 Options::useProbeOSRExit() = false; 519 519 #endif 520 521 if (!Options::useCodeCache()) 522 Options::diskCachePath() = nullptr; 523 524 if (!Options::diskCachePath()) 525 Options::forceDiskCache() = false; 520 526 } 521 527 -
trunk/Source/JavaScriptCore/runtime/Options.h
r239188 r240210 509 509 v(bool, traceLLIntSlowPath, false, Configurable, nullptr) \ 510 510 v(bool, traceBaselineJITExecution, false, Normal, nullptr) \ 511 v(optionString, diskCachePath, nullptr, Restricted, "") \ 512 v(bool, forceDiskCache, false, Restricted, "") \ 511 513 512 514 -
trunk/Source/JavaScriptCore/runtime/RegExp.h
r237763 r240210 42 42 43 43 class RegExp final : public JSCell { 44 friend class CachedRegExp; 45 44 46 public: 45 47 typedef JSCell Base; -
trunk/Source/JavaScriptCore/runtime/ScopedArgumentsTable.h
r228500 r240210 40 40 // "delete arguments[i]" or some variant of defineOwnProperty. 41 41 class ScopedArgumentsTable final : public JSCell { 42 friend class CachedScopedArgumentsTable; 43 42 44 public: 43 45 typedef JSCell Base; -
trunk/Source/JavaScriptCore/runtime/StackFrame.h
r232314 r240210 26 26 #pragma once 27 27 28 #include "Heap.h" 28 29 #include "WasmIndexOrName.h" 29 30 #include "WriteBarrier.h" -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r240023 r240210 32 32 #include "Structure.h" 33 33 #include "StructureChain.h" 34 #include "StructureRareDataInlines.h" 34 35 35 36 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/SymbolTable.h
r233622 r240210 74 74 75 75 struct SymbolTableEntry { 76 friend class CachedSymbolTableEntry; 77 76 78 private: 77 79 static VarOffset varOffsetFromBits(intptr_t bits) … … 437 439 438 440 class SymbolTable final : public JSCell { 441 friend class CachedSymbolTable; 442 439 443 public: 440 444 typedef JSCell Base; -
trunk/Source/WTF/ChangeLog
r240181 r240210 1 2019-01-20 Tadeu Zagallo <tzagallo@apple.com> 2 3 Cache bytecode to disk 4 https://bugs.webkit.org/show_bug.cgi?id=192782 5 <rdar://problem/46084932> 6 7 Reviewed by Keith Miller. 8 9 BitVectors have to be friends with JSC::CacheBitVector to allow 10 serializing its buffer as part of the bytecode cache encoding. 11 12 * wtf/BitVector.h: 13 1 14 2019-01-18 Tim Horton <timothy_horton@apple.com> 2 15 -
trunk/Source/WTF/wtf/BitVector.h
r237099 r240210 34 34 #include <wtf/StdLibExtras.h> 35 35 36 namespace JSC { 37 class CachedBitVector; 38 } 39 36 40 namespace WTF { 37 41 … … 339 343 340 344 private: 345 friend class JSC::CachedBitVector; 346 341 347 static unsigned bitsInPointer() 342 348 { -
trunk/Tools/ChangeLog
r240209 r240210 1 2019-01-20 Tadeu Zagallo <tzagallo@apple.com> 2 3 Cache bytecode to disk 4 https://bugs.webkit.org/show_bug.cgi?id=192782 5 <rdar://problem/46084932> 6 7 Reviewed by Keith Miller. 8 9 Add test helper to execute bytecode-cache tests: it executes each test 10 twice, the first with JSC_diskCachePath set to a temporary directory 11 and second with JSC_forceDiskCache=true (in addition to the cache path) 12 to guarantee that only the disk cache is being used and no new 13 UnlinkedCodeBlocks are being created. 14 15 * Scripts/jsc-stress-test-helpers/bytecode-cache-test-helper: Added. 16 * Scripts/run-jsc-stress-tests: 17 1 18 2019-01-20 chris fleizach <cfleizach@apple.com> 2 19 -
trunk/Tools/Scripts/run-jsc-stress-tests
r240191 r240210 656 656 end 657 657 658 def runBytecodeCache(*optionalTestSpecificOptions) 659 unless $hostOS == "darwin" 660 skip 661 return 662 end 663 options = BASE_OPTIONS + $testSpecificRequiredOptions + FTL_OPTIONS + optionalTestSpecificOptions 664 addRunCommand("bytecode-cache", ["ruby", (pathToHelpers + "bytecode-cache-test-helper").to_s, pathToVM.to_s, $benchmark.to_s] + options, silentOutputHandler, simpleErrorHandler) 665 end 666 658 667 def runBigIntEnabled(*optionalTestSpecificOptions) 659 668 # FIXME: <rdar://problem/40331121> … … 752 761 else 753 762 runDefault 763 runBytecodeCache 754 764 if $jitTests 755 765 runNoLLInt
Note: See TracChangeset
for help on using the changeset viewer.