WebKit Bugzilla
Attachment 361178 Details for
Bug 194281
: [JSC] Shrink sizeof(UnlinkedCodeBlock)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194281-20190205015916.patch (text/plain), 31.60 KB, created by
Yusuke Suzuki
on 2019-02-05 01:59:16 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-02-05 01:59:16 PST
Size:
31.60 KB
patch
obsolete
>Subversion Revision: 240968 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 17fc4efc0e2b12455432f4f88187635cf22e4b81..949deaedcabce6151c86bd0260323302a9894aa5 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,53 @@ >+2019-02-05 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Shrink sizeof(UnlinkedCodeBlock) >+ https://bugs.webkit.org/show_bug.cgi?id=194281 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch first attempts to reduce the size of UnlinkedCodeBlock in a relatively simpler way. Reordering members, remove unused member, and >+ move rarely used members to RareData. This changes sizeof(UnlinkedCodeBlock) from 312 to 256. >+ >+ Still we have several chances to reduce sizeof(UnlinkedCodeBlock). Making more Vectors to RefCountedArrays can be done with some restructuring >+ of generatorification phase. It would be possible to remove m_sourceURLDirective and m_sourceMappingURLDirective from UnlinkedCodeBlock since >+ they should be in SourceProvider and that should be enough. These changes require some intrusive modifications and we make them as a future work. >+ >+ * bytecode/CodeBlock.cpp: >+ (JSC::CodeBlock::finishCreation): >+ * bytecode/CodeBlock.h: >+ (JSC::CodeBlock::bitVectors const): Deleted. >+ * bytecode/CodeType.h: >+ * bytecode/UnlinkedCodeBlock.cpp: >+ (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): >+ (JSC::UnlinkedCodeBlock::shrinkToFit): >+ * bytecode/UnlinkedCodeBlock.h: >+ (JSC::UnlinkedCodeBlock::bitVector): >+ (JSC::UnlinkedCodeBlock::addBitVector): >+ (JSC::UnlinkedCodeBlock::addSetConstant): >+ (JSC::UnlinkedCodeBlock::constantRegisters): >+ (JSC::UnlinkedCodeBlock::numberOfConstantIdentifierSets const): >+ (JSC::UnlinkedCodeBlock::constantIdentifierSets): >+ (JSC::UnlinkedCodeBlock::codeType const): >+ (JSC::UnlinkedCodeBlock::didOptimize const): >+ (JSC::UnlinkedCodeBlock::setDidOptimize): >+ (JSC::UnlinkedCodeBlock::usesGlobalObject const): Deleted. >+ (JSC::UnlinkedCodeBlock::setGlobalObjectRegister): Deleted. >+ (JSC::UnlinkedCodeBlock::globalObjectRegister const): Deleted. >+ (JSC::UnlinkedCodeBlock::bitVectors const): Deleted. >+ * bytecompiler/BytecodeGenerator.cpp: >+ (JSC::BytecodeGenerator::emitLoad): >+ (JSC::BytecodeGenerator::emitLoadGlobalObject): Deleted. >+ * bytecompiler/BytecodeGenerator.h: >+ * runtime/CachedTypes.cpp: >+ (JSC::CachedCodeBlockRareData::encode): >+ (JSC::CachedCodeBlockRareData::decode const): >+ (JSC::CachedCodeBlock::scopeRegister const): >+ (JSC::CachedCodeBlock::codeType const): >+ (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): >+ (JSC::CachedCodeBlock<CodeBlockType>::decode const): >+ (JSC::CachedCodeBlock<CodeBlockType>::encode): >+ (JSC::CachedCodeBlock::globalObjectRegister const): Deleted. >+ > 2019-02-04 Yusuke Suzuki <ysuzuki@apple.com> > > Unreviewed, add missing exception checks after r240637 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 8f0f5d3405395dd3141e56f1fb82850d831ff33d..0eaeee2cd719db7a1d8c003c15a559fbe523e36d 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-05 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Shrink sizeof(UnlinkedCodeBlock) >+ https://bugs.webkit.org/show_bug.cgi?id=194281 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/TriState.h: >+ > 2019-02-04 Ms2ger <Ms2ger@igalia.com> > > [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >index 3837d11e69b7876436dafcf033d73fa5d5e80fc0..b4f228cca8cc59f1798d11566169f07981e85d9b 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >@@ -416,12 +416,6 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > setConstantRegisters(unlinkedCodeBlock->constantRegisters(), unlinkedCodeBlock->constantsSourceCodeRepresentation()); > RETURN_IF_EXCEPTION(throwScope, false); > >- setConstantIdentifierSetRegisters(vm, unlinkedCodeBlock->constantIdentifierSets()); >- RETURN_IF_EXCEPTION(throwScope, false); >- >- if (unlinkedCodeBlock->usesGlobalObject()) >- m_constantRegisters[unlinkedCodeBlock->globalObjectRegister().toConstantIndex()].set(vm, this, m_globalObject.get()); >- > for (unsigned i = 0; i < LinkTimeConstantCount; i++) { > LinkTimeConstant type = static_cast<LinkTimeConstant>(i); > if (unsigned registerIndex = unlinkedCodeBlock->registerIndexForLinkTimeConstant(type)) >@@ -458,6 +452,10 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > > if (unlinkedCodeBlock->hasRareData()) { > createRareDataIfNecessary(); >+ >+ setConstantIdentifierSetRegisters(vm, unlinkedCodeBlock->constantIdentifierSets()); >+ RETURN_IF_EXCEPTION(throwScope, false); >+ > if (size_t count = unlinkedCodeBlock->numberOfExceptionHandlers()) { > m_rareData->m_exceptionHandlers.resizeToFit(count); > for (size_t i = 0; i < count; i++) { >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h >index d5a232b61447ad48c738c2bccd31df2dd3de2fde..2b380db2babbf5b9848f3d3157e45847fc8dbb08 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h >@@ -569,7 +569,6 @@ class CodeBlock : public JSCell { > int numberOfFunctionDecls() { return m_functionDecls.size(); } > FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); } > >- const Vector<BitVector>& bitVectors() const { return m_unlinkedCode->bitVectors(); } > const BitVector& bitVector(size_t i) { return m_unlinkedCode->bitVector(i); } > > Heap* heap() const { return &m_vm->heap; } >diff --git a/Source/JavaScriptCore/bytecode/CodeType.h b/Source/JavaScriptCore/bytecode/CodeType.h >index 3c38ca21a9095f4b3c19fbef720cec7fe005e17e..d4bda79de7d54572c5431941ddd45b633082e030 100644 >--- a/Source/JavaScriptCore/bytecode/CodeType.h >+++ b/Source/JavaScriptCore/bytecode/CodeType.h >@@ -27,7 +27,7 @@ > > namespace JSC { > >-enum CodeType { GlobalCode, EvalCode, FunctionCode, ModuleCode }; >+enum CodeType : uint8_t { GlobalCode, EvalCode, FunctionCode, ModuleCode }; > > } // namespace JSC > >diff --git a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp >index 6095d589df8495de113bb329600fb3c7f528535f..7fba73d7341ef6247d9619e8e2c9cf224985b675 100644 >--- a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp >+++ b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp >@@ -56,8 +56,6 @@ const ClassInfo UnlinkedCodeBlock::s_info = { "UnlinkedCodeBlock", nullptr, null > > UnlinkedCodeBlock::UnlinkedCodeBlock(VM* vm, Structure* structure, CodeType codeType, const ExecutableInfo& info, DebuggerMode debuggerMode) > : Base(*vm, structure) >- , m_globalObjectRegister(VirtualRegister()) >- , m_metadata(UnlinkedMetadataTable::create()) > , m_usesEval(info.usesEval()) > , m_isStrictMode(info.isStrictMode()) > , m_isConstructor(info.isConstructor()) >@@ -72,14 +70,16 @@ UnlinkedCodeBlock::UnlinkedCodeBlock(VM* vm, Structure* structure, CodeType code > , m_derivedContextType(static_cast<unsigned>(info.derivedContextType())) > , m_evalContextType(static_cast<unsigned>(info.evalContextType())) > , m_hasTailCalls(false) >- , m_features(0) >- , m_didOptimize(MixedTriState) >+ , m_codeType(static_cast<unsigned>(codeType)) >+ , m_didOptimize(static_cast<unsigned>(MixedTriState)) > , m_parseMode(info.parseMode()) >- , m_codeType(codeType) >+ , m_metadata(UnlinkedMetadataTable::create()) > { > for (auto& constantRegisterIndex : m_linkTimeConstants) > constantRegisterIndex = 0; > ASSERT(m_constructorKind == static_cast<unsigned>(info.constructorKind())); >+ ASSERT(m_codeType == static_cast<unsigned>(codeType)); >+ ASSERT(m_didOptimize == static_cast<unsigned>(MixedTriState)); > } > > void UnlinkedCodeBlock::visitChildren(JSCell* cell, SlotVisitor& visitor) >@@ -381,9 +381,7 @@ void UnlinkedCodeBlock::shrinkToFit() > m_jumpTargets.shrinkToFit(); > m_propertyAccessInstructions.shrinkToFit(); > m_identifiers.shrinkToFit(); >- m_bitVectors.shrinkToFit(); > m_constantRegisters.shrinkToFit(); >- m_constantIdentifierSets.shrinkToFit(); > m_constantsSourceCodeRepresentation.shrinkToFit(); > m_functionDecls.shrinkToFit(); > m_functionExprs.shrinkToFit(); >@@ -395,6 +393,8 @@ void UnlinkedCodeBlock::shrinkToFit() > m_rareData->m_stringSwitchJumpTables.shrinkToFit(); > m_rareData->m_expressionInfoFatPositions.shrinkToFit(); > m_rareData->m_opProfileControlFlowBytecodeOffsets.shrinkToFit(); >+ m_rareData->m_bitVectors.shrinkToFit(); >+ m_rareData->m_constantIdentifierSets.shrinkToFit(); > } > } > >diff --git a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h >index d0bb0c7ef9994abe635ebaa3d4075a4600fbbf8f..8dc676978c6206ee6913d2894823b9f47227a39e 100644 >--- a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h >@@ -140,10 +140,6 @@ class UnlinkedCodeBlock : public JSCell { > void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; } > void setScopeRegister(VirtualRegister scopeRegister) { m_scopeRegister = scopeRegister; } > >- bool usesGlobalObject() const { return m_globalObjectRegister.isValid(); } >- void setGlobalObjectRegister(VirtualRegister globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; } >- VirtualRegister globalObjectRegister() const { return m_globalObjectRegister; } >- > // Parameter information > void setNumParameters(int newValue) { m_numParameters = newValue; } > void addParameter() { m_numParameters++; } >@@ -156,22 +152,23 @@ class UnlinkedCodeBlock : public JSCell { > const Identifier& identifier(int index) const { return m_identifiers[index]; } > const Vector<Identifier>& identifiers() const { return m_identifiers; } > >- const Vector<BitVector>& bitVectors() const { return m_bitVectors; } >- BitVector& bitVector(size_t i) { return m_bitVectors[i]; } >+ BitVector& bitVector(size_t i) { ASSERT(m_rareData); return m_rareData->m_bitVectors[i]; } > unsigned addBitVector(BitVector&& bitVector) > { >- m_bitVectors.append(WTFMove(bitVector)); >- return m_bitVectors.size() - 1; >+ createRareDataIfNecessary(); >+ m_rareData->m_bitVectors.append(WTFMove(bitVector)); >+ return m_rareData->m_bitVectors.size() - 1; > } > > void addSetConstant(IdentifierSet& set) > { >+ createRareDataIfNecessary(); > VM& vm = *this->vm(); > auto locker = lockDuringMarking(vm.heap, cellLock()); > unsigned result = m_constantRegisters.size(); > m_constantRegisters.append(WriteBarrier<Unknown>()); > m_constantsSourceCodeRepresentation.append(SourceCodeRepresentation::Other); >- m_constantIdentifierSets.append(ConstantIdentifierSetEntry(set, result)); >+ m_rareData->m_constantIdentifierSets.append(ConstantIdentifierSetEntry(set, result)); > } > > unsigned addConstant(JSValue v, SourceCodeRepresentation sourceCodeRepresentation = SourceCodeRepresentation::Other) >@@ -204,13 +201,16 @@ class UnlinkedCodeBlock : public JSCell { > ASSERT(index < LinkTimeConstantCount); > return m_linkTimeConstants[index]; > } >+ > const Vector<WriteBarrier<Unknown>>& constantRegisters() { return m_constantRegisters; } >- const Vector<ConstantIdentifierSetEntry>& constantIdentifierSets() { return m_constantIdentifierSets; } > const WriteBarrier<Unknown>& constantRegister(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex]; } > ALWAYS_INLINE bool isConstantRegisterIndex(int index) const { return index >= FirstConstantRegisterIndex; } > ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].get(); } > const Vector<SourceCodeRepresentation>& constantsSourceCodeRepresentation() { return m_constantsSourceCodeRepresentation; } > >+ unsigned numberOfConstantIdentifierSets() const { return m_rareData ? m_rareData->m_constantIdentifierSets.size() : 0; } >+ const Vector<ConstantIdentifierSetEntry>& constantIdentifierSets() { ASSERT(m_rareData); return m_rareData->m_constantIdentifierSets; } >+ > // Jumps > size_t numberOfJumpTargets() const { return m_jumpTargets.size(); } > void addJumpTarget(unsigned jumpTarget) { m_jumpTargets.append(jumpTarget); } >@@ -272,7 +272,7 @@ class UnlinkedCodeBlock : public JSCell { > void addExceptionHandler(const UnlinkedHandlerInfo& handler) { createRareDataIfNecessary(); return m_rareData->m_exceptionHandlers.append(handler); } > UnlinkedHandlerInfo& exceptionHandler(int index) { ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; } > >- CodeType codeType() const { return m_codeType; } >+ CodeType codeType() const { return static_cast<CodeType>(m_codeType); } > > VirtualRegister thisRegister() const { return m_thisRegister; } > VirtualRegister scopeRegister() const { return m_scopeRegister; } >@@ -333,8 +333,8 @@ class UnlinkedCodeBlock : public JSCell { > > bool wasCompiledWithDebuggingOpcodes() const { return m_wasCompiledWithDebuggingOpcodes; } > >- TriState didOptimize() const { return m_didOptimize; } >- void setDidOptimize(TriState didOptimize) { m_didOptimize = didOptimize; } >+ TriState didOptimize() const { return static_cast<TriState>(m_didOptimize); } >+ void setDidOptimize(TriState didOptimize) { m_didOptimize = static_cast<unsigned>(didOptimize); } > > void dump(PrintStream&) const; > >@@ -401,20 +401,10 @@ class UnlinkedCodeBlock : public JSCell { > void getLineAndColumn(const ExpressionRangeInfo&, unsigned& line, unsigned& column) const; > BytecodeLivenessAnalysis& livenessAnalysisSlow(CodeBlock*); > >- std::unique_ptr<InstructionStream> m_instructions; >- std::unique_ptr<BytecodeLivenessAnalysis> m_liveness; >- > VirtualRegister m_thisRegister; > VirtualRegister m_scopeRegister; >- VirtualRegister m_globalObjectRegister; >- >- String m_sourceURLDirective; >- String m_sourceMappingURLDirective; >- Ref<UnlinkedMetadataTable> m_metadata; > >-#if ENABLE(DFG_JIT) >- DFG::ExitProfile m_exitProfile; >-#endif >+ std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants; > > unsigned m_usesEval : 1; > unsigned m_isStrictMode : 1; >@@ -430,6 +420,13 @@ class UnlinkedCodeBlock : public JSCell { > unsigned m_derivedContextType : 2; > unsigned m_evalContextType : 2; > unsigned m_hasTailCalls : 1; >+ unsigned m_codeType : 2; >+ unsigned m_didOptimize : 2; >+public: >+ ConcurrentJSLock m_lock; >+private: >+ CodeFeatures m_features { 0 }; >+ SourceParseMode m_parseMode; > > unsigned m_lineCount { 0 }; > unsigned m_endColumn { UINT_MAX }; >@@ -438,33 +435,34 @@ class UnlinkedCodeBlock : public JSCell { > int m_numCalleeLocals { 0 }; > int m_numParameters { 0 }; > >-public: >- ConcurrentJSLock m_lock; >-private: >- CodeFeatures m_features { 0 }; >- TriState m_didOptimize; >- SourceParseMode m_parseMode; >- CodeType m_codeType; >+ String m_sourceURLDirective; >+ String m_sourceMappingURLDirective; > > Vector<InstructionStream::Offset> m_jumpTargets; >+ Ref<UnlinkedMetadataTable> m_metadata; >+ std::unique_ptr<InstructionStream> m_instructions; >+ std::unique_ptr<BytecodeLivenessAnalysis> m_liveness; >+ >+ >+#if ENABLE(DFG_JIT) >+ DFG::ExitProfile m_exitProfile; >+#endif >+ > > Vector<InstructionStream::Offset> m_propertyAccessInstructions; > > // Constant Pools > Vector<Identifier> m_identifiers; >- Vector<BitVector> m_bitVectors; > Vector<WriteBarrier<Unknown>> m_constantRegisters; >- Vector<ConstantIdentifierSetEntry> m_constantIdentifierSets; > Vector<SourceCodeRepresentation> m_constantsSourceCodeRepresentation; > typedef Vector<WriteBarrier<UnlinkedFunctionExecutable>> FunctionExpressionVector; > FunctionExpressionVector m_functionDecls; > FunctionExpressionVector m_functionExprs; >- std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants; > > public: > struct RareData { >- WTF_MAKE_FAST_ALLOCATED; >- public: >+ WTF_MAKE_STRUCT_FAST_ALLOCATED; >+ > Vector<UnlinkedHandlerInfo> m_exceptionHandlers; > > // Jump Tables >@@ -479,6 +477,8 @@ class UnlinkedCodeBlock : public JSCell { > }; > HashMap<unsigned, TypeProfilerExpressionRange> m_typeProfilerInfoMap; > Vector<InstructionStream::Offset> m_opProfileControlFlowBytecodeOffsets; >+ Vector<BitVector> m_bitVectors; >+ Vector<ConstantIdentifierSetEntry> m_constantIdentifierSets; > }; > > void addOutOfLineJumpTarget(InstructionStream::Offset, int target); >diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >index d6e131bf81328be49511e9b920f0fe0ab575e7f3..cc76f23236daf11c1233d249815fb4fddafb3b11 100644 >--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >@@ -1869,11 +1869,13 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, JSValue v, SourceCodeRe > > RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, IdentifierSet& set) > { >- for (const auto& entry : m_codeBlock->constantIdentifierSets()) { >- if (entry.first != set) >- continue; >- >- return &m_constantPoolRegisters[entry.second]; >+ if (m_codeBlock->numberOfConstantIdentifierSets()) { >+ for (const auto& entry : m_codeBlock->constantIdentifierSets()) { >+ if (entry.first != set) >+ continue; >+ >+ return &m_constantPoolRegisters[entry.second]; >+ } > } > > unsigned index = addConstantIndex(); >@@ -1886,19 +1888,6 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, IdentifierSet& set) > return m_setRegister; > } > >-RegisterID* BytecodeGenerator::emitLoadGlobalObject(RegisterID* dst) >-{ >- if (!m_globalObjectRegister) { >- int index = addConstantIndex(); >- m_codeBlock->addConstant(JSValue()); >- m_globalObjectRegister = &m_constantPoolRegisters[index]; >- m_codeBlock->setGlobalObjectRegister(VirtualRegister(index)); >- } >- if (dst) >- move(dst, m_globalObjectRegister); >- return m_globalObjectRegister; >-} >- > template<typename LookUpVarKindFunctor> > bool BytecodeGenerator::instantiateLexicalVariables(const VariableEnvironment& lexicalVariables, SymbolTable* symbolTable, ScopeRegisterType scopeRegisterType, LookUpVarKindFunctor lookUpVarKind) > { >diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h >index 6ad716eebd28fad7ca02affeb344026eedb94376..e31f06e6b29db4ae1bcd82ebb3761ddfefae426b 100644 >--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h >+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h >@@ -671,7 +671,6 @@ namespace JSC { > RegisterID* emitLoad(RegisterID* dst, const Identifier&); > RegisterID* emitLoad(RegisterID* dst, JSValue, SourceCodeRepresentation = SourceCodeRepresentation::Other); > RegisterID* emitLoad(RegisterID* dst, IdentifierSet& excludedList); >- RegisterID* emitLoadGlobalObject(RegisterID* dst); > > template<typename UnaryOp, typename = std::enable_if_t<UnaryOp::opcodeID != op_negate>> > RegisterID* emitUnaryOp(RegisterID* dst, RegisterID* src) >@@ -1241,7 +1240,6 @@ namespace JSC { > RegisterID* m_lexicalEnvironmentRegister { nullptr }; > RegisterID* m_generatorRegister { nullptr }; > RegisterID* m_emptyValueRegister { nullptr }; >- RegisterID* m_globalObjectRegister { nullptr }; > RegisterID* m_newTargetRegister { nullptr }; > RegisterID* m_isDerivedConstuctor { nullptr }; > RegisterID* m_linkTimeConstantRegisters[LinkTimeConstantCount]; >diff --git a/Source/JavaScriptCore/runtime/CachedTypes.cpp b/Source/JavaScriptCore/runtime/CachedTypes.cpp >index c67e17df483550806ac6da26bf45346c9452f5b7..b53dfd62aac4fd2511935f2f45f08e34c09370da 100644 >--- a/Source/JavaScriptCore/runtime/CachedTypes.cpp >+++ b/Source/JavaScriptCore/runtime/CachedTypes.cpp >@@ -733,39 +733,6 @@ class CachedStringJumpTable : public CachedObject<UnlinkedStringJumpTable> { > CachedHashMap<CachedRefPtr<CachedStringImpl>, UnlinkedStringJumpTable:: OffsetLocation> m_offsetTable; > }; > >-class CachedCodeBlockRareData : public CachedObject<UnlinkedCodeBlock::RareData> { >-public: >- void encode(Encoder& encoder, const UnlinkedCodeBlock::RareData& rareData) >- { >- m_exceptionHandlers.encode(encoder, rareData.m_exceptionHandlers); >- m_switchJumpTables.encode(encoder, rareData.m_switchJumpTables); >- m_stringSwitchJumpTables.encode(encoder, rareData.m_stringSwitchJumpTables); >- m_expressionInfoFatPositions.encode(encoder, rareData.m_expressionInfoFatPositions); >- m_typeProfilerInfoMap.encode(encoder, rareData.m_typeProfilerInfoMap); >- m_opProfileControlFlowBytecodeOffsets.encode(encoder, rareData.m_opProfileControlFlowBytecodeOffsets); >- } >- >- UnlinkedCodeBlock::RareData* decode(Decoder& decoder) const >- { >- UnlinkedCodeBlock::RareData* rareData = new UnlinkedCodeBlock::RareData { }; >- m_exceptionHandlers.decode(decoder, rareData->m_exceptionHandlers); >- m_switchJumpTables.decode(decoder, rareData->m_switchJumpTables); >- m_stringSwitchJumpTables.decode(decoder, rareData->m_stringSwitchJumpTables); >- m_expressionInfoFatPositions.decode(decoder, rareData->m_expressionInfoFatPositions); >- m_typeProfilerInfoMap.decode(decoder, rareData->m_typeProfilerInfoMap); >- m_opProfileControlFlowBytecodeOffsets.decode(decoder, rareData->m_opProfileControlFlowBytecodeOffsets); >- return rareData; >- } >- >-private: >- CachedVector<UnlinkedHandlerInfo> m_exceptionHandlers; >- CachedVector<CachedSimpleJumpTable> m_switchJumpTables; >- CachedVector<CachedStringJumpTable> m_stringSwitchJumpTables; >- CachedVector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions; >- CachedHashMap<unsigned, UnlinkedCodeBlock::RareData::TypeProfilerExpressionRange> m_typeProfilerInfoMap; >- CachedVector<InstructionStream::Offset> m_opProfileControlFlowBytecodeOffsets; >-}; >- > class CachedBitVector : public VariableLengthObject<BitVector> { > public: > void encode(Encoder& encoder, const BitVector& bitVector) >@@ -828,6 +795,45 @@ class CachedConstantIdentifierSetEntry : public VariableLengthObject<ConstantIde > CachedHashSet<CachedRefPtr<CachedUniquedStringImpl>, IdentifierRepHash> m_set; > }; > >+class CachedCodeBlockRareData : public CachedObject<UnlinkedCodeBlock::RareData> { >+public: >+ void encode(Encoder& encoder, const UnlinkedCodeBlock::RareData& rareData) >+ { >+ m_exceptionHandlers.encode(encoder, rareData.m_exceptionHandlers); >+ m_switchJumpTables.encode(encoder, rareData.m_switchJumpTables); >+ m_stringSwitchJumpTables.encode(encoder, rareData.m_stringSwitchJumpTables); >+ m_expressionInfoFatPositions.encode(encoder, rareData.m_expressionInfoFatPositions); >+ m_typeProfilerInfoMap.encode(encoder, rareData.m_typeProfilerInfoMap); >+ m_opProfileControlFlowBytecodeOffsets.encode(encoder, rareData.m_opProfileControlFlowBytecodeOffsets); >+ m_bitVectors.encode(encoder, rareData.m_bitVectors); >+ m_constantIdentifierSets.encode(encoder, rareData.m_constantIdentifierSets); >+ } >+ >+ UnlinkedCodeBlock::RareData* decode(Decoder& decoder) const >+ { >+ UnlinkedCodeBlock::RareData* rareData = new UnlinkedCodeBlock::RareData { }; >+ m_exceptionHandlers.decode(decoder, rareData->m_exceptionHandlers); >+ m_switchJumpTables.decode(decoder, rareData->m_switchJumpTables); >+ m_stringSwitchJumpTables.decode(decoder, rareData->m_stringSwitchJumpTables); >+ m_expressionInfoFatPositions.decode(decoder, rareData->m_expressionInfoFatPositions); >+ m_typeProfilerInfoMap.decode(decoder, rareData->m_typeProfilerInfoMap); >+ m_opProfileControlFlowBytecodeOffsets.decode(decoder, rareData->m_opProfileControlFlowBytecodeOffsets); >+ m_bitVectors.decode(decoder, rareData->m_bitVectors); >+ m_constantIdentifierSets.decode(decoder, rareData->m_constantIdentifierSets); >+ return rareData; >+ } >+ >+private: >+ CachedVector<UnlinkedHandlerInfo> m_exceptionHandlers; >+ CachedVector<CachedSimpleJumpTable> m_switchJumpTables; >+ CachedVector<CachedStringJumpTable> m_stringSwitchJumpTables; >+ CachedVector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions; >+ CachedHashMap<unsigned, UnlinkedCodeBlock::RareData::TypeProfilerExpressionRange> m_typeProfilerInfoMap; >+ CachedVector<InstructionStream::Offset> m_opProfileControlFlowBytecodeOffsets; >+ CachedVector<CachedBitVector> m_bitVectors; >+ CachedVector<CachedConstantIdentifierSetEntry> m_constantIdentifierSets; >+}; >+ > class CachedVariableEnvironment : public CachedObject<VariableEnvironment> { > public: > void encode(Encoder& encoder, const VariableEnvironment& env) >@@ -1472,7 +1478,6 @@ class CachedCodeBlock : public CachedObject<CodeBlockType> { > > VirtualRegister thisRegister() const { return m_thisRegister; } > VirtualRegister scopeRegister() const { return m_scopeRegister; } >- VirtualRegister globalObjectRegister() const { return m_globalObjectRegister; } > > String sourceURLDirective(Decoder& decoder) const { return m_sourceURLDirective.decode(decoder); } > String sourceMappingURLDirective(Decoder& decoder) const { return m_sourceMappingURLDirective.decode(decoder); } >@@ -1502,14 +1507,14 @@ class CachedCodeBlock : public CachedObject<CodeBlockType> { > > CodeFeatures features() const { return m_features; } > SourceParseMode parseMode() const { return m_parseMode; } >- CodeType codeType() const { return m_codeType; } >+ unsigned codeType() const { return m_codeType; } > > UnlinkedCodeBlock::RareData* rareData(Decoder& decoder) const { return m_rareData.decodeAsPtr(decoder); } > > private: > VirtualRegister m_thisRegister; > VirtualRegister m_scopeRegister; >- VirtualRegister m_globalObjectRegister; >+ std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants; > > unsigned m_usesEval : 1; > unsigned m_isStrictMode : 1; >@@ -1525,6 +1530,10 @@ class CachedCodeBlock : public CachedObject<CodeBlockType> { > unsigned m_derivedContextType : 2; > unsigned m_evalContextType : 2; > unsigned m_hasTailCalls : 1; >+ unsigned m_codeType : 2; >+ >+ CodeFeatures m_features; >+ SourceParseMode m_parseMode; > > unsigned m_lineCount; > unsigned m_endColumn; >@@ -1533,11 +1542,6 @@ class CachedCodeBlock : public CachedObject<CodeBlockType> { > int m_numCalleeLocals; > int m_numParameters; > >- CodeFeatures m_features; >- SourceParseMode m_parseMode; >- CodeType m_codeType; >- >- std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants; > CachedMetadataTable m_metadata; > > CachedOptional<CachedCodeBlockRareData> m_rareData; >@@ -1553,9 +1557,7 @@ class CachedCodeBlock : public CachedObject<CodeBlockType> { > CachedVector<ExpressionRangeInfo> m_expressionInfo; > CachedHashMap<InstructionStream::Offset, int> m_outOfLineJumpTargets; > >- CachedVector<CachedConstantIdentifierSetEntry> m_constantIdentifierSets; > CachedVector<CachedIdentifier> m_identifiers; >- CachedVector<CachedBitVector> m_bitVectors; > CachedVector<CachedWriteBarrier<CachedFunctionExecutable>> m_functionDecls; > CachedVector<CachedWriteBarrier<CachedFunctionExecutable>> m_functionExprs; > }; >@@ -1691,16 +1693,8 @@ using CachedCodeBlockType = typename CachedCodeBlockTypeImpl<T>::type; > template<typename CodeBlockType> > ALWAYS_INLINE UnlinkedCodeBlock::UnlinkedCodeBlock(Decoder& decoder, Structure* structure, const CachedCodeBlock<CodeBlockType>& cachedCodeBlock) > : Base(decoder.vm(), structure) >- , m_instructions(cachedCodeBlock.instructions(decoder)) >- , m_liveness(nullptr) > , m_thisRegister(cachedCodeBlock.thisRegister()) > , m_scopeRegister(cachedCodeBlock.scopeRegister()) >- , m_globalObjectRegister(cachedCodeBlock.globalObjectRegister()) >- >- , m_sourceURLDirective(cachedCodeBlock.sourceURLDirective(decoder)) >- , m_sourceMappingURLDirective(cachedCodeBlock.sourceMappingURLDirective(decoder)) >- >- , m_metadata(cachedCodeBlock.metadata(decoder)) > > , m_usesEval(cachedCodeBlock.usesEval()) > , m_isStrictMode(cachedCodeBlock.isStrictMode()) >@@ -1716,14 +1710,23 @@ ALWAYS_INLINE UnlinkedCodeBlock::UnlinkedCodeBlock(Decoder& decoder, Structure* > , m_derivedContextType(cachedCodeBlock.derivedContextType()) > , m_evalContextType(cachedCodeBlock.evalContextType()) > , m_hasTailCalls(cachedCodeBlock.hasTailCalls()) >+ , m_codeType(cachedCodeBlock.codeType()) >+ >+ , m_features(cachedCodeBlock.features()) >+ , m_parseMode(cachedCodeBlock.parseMode()) >+ > , m_lineCount(cachedCodeBlock.lineCount()) > , m_endColumn(cachedCodeBlock.endColumn()) > , m_numVars(cachedCodeBlock.numVars()) > , m_numCalleeLocals(cachedCodeBlock.numCalleeLocals()) > , m_numParameters(cachedCodeBlock.numParameters()) >- , m_features(cachedCodeBlock.features()) >- , m_parseMode(cachedCodeBlock.parseMode()) >- , m_codeType(cachedCodeBlock.codeType()) >+ >+ , m_sourceURLDirective(cachedCodeBlock.sourceURLDirective(decoder)) >+ , m_sourceMappingURLDirective(cachedCodeBlock.sourceMappingURLDirective(decoder)) >+ >+ , m_metadata(cachedCodeBlock.metadata(decoder)) >+ , m_instructions(cachedCodeBlock.instructions(decoder)) >+ > , m_rareData(cachedCodeBlock.rareData(decoder)) > { > } >@@ -1740,9 +1743,7 @@ ALWAYS_INLINE void CachedCodeBlock<CodeBlockType>::decode(Decoder& decoder, Unli > m_expressionInfo.decode(decoder, codeBlock.m_expressionInfo); > m_outOfLineJumpTargets.decode(decoder, codeBlock.m_outOfLineJumpTargets); > m_jumpTargets.decode(decoder, codeBlock.m_jumpTargets); >- m_constantIdentifierSets.decode(decoder, codeBlock.m_constantIdentifierSets); > m_identifiers.decode(decoder, codeBlock.m_identifiers); >- m_bitVectors.decode(decoder, codeBlock.m_bitVectors); > m_functionDecls.decode(decoder, codeBlock.m_functionDecls, &codeBlock); > m_functionExprs.decode(decoder, codeBlock.m_functionExprs, &codeBlock); > } >@@ -1856,7 +1857,6 @@ ALWAYS_INLINE void CachedCodeBlock<CodeBlockType>::encode(Encoder& encoder, cons > { > m_thisRegister = codeBlock.m_thisRegister; > m_scopeRegister = codeBlock.m_scopeRegister; >- m_globalObjectRegister = codeBlock.m_globalObjectRegister; > m_usesEval = codeBlock.m_usesEval; > m_isStrictMode = codeBlock.m_isStrictMode; > m_isConstructor = codeBlock.m_isConstructor; >@@ -1897,9 +1897,7 @@ ALWAYS_INLINE void CachedCodeBlock<CodeBlockType>::encode(Encoder& encoder, cons > m_jumpTargets.encode(encoder, codeBlock.m_jumpTargets); > m_outOfLineJumpTargets.encode(encoder, codeBlock.m_outOfLineJumpTargets); > >- m_constantIdentifierSets.encode(encoder, codeBlock.m_constantIdentifierSets); > m_identifiers.encode(encoder, codeBlock.m_identifiers); >- m_bitVectors.encode(encoder, codeBlock.m_bitVectors); > m_functionDecls.encode(encoder, codeBlock.m_functionDecls); > m_functionExprs.encode(encoder, codeBlock.m_functionExprs); > } >diff --git a/Source/WTF/wtf/TriState.h b/Source/WTF/wtf/TriState.h >index 24ace5410f8993992abbfdb825646de027953d5a..5ae785d3b9d80d83aa074fe821cd06857d661ca0 100644 >--- a/Source/WTF/wtf/TriState.h >+++ b/Source/WTF/wtf/TriState.h >@@ -27,7 +27,7 @@ > > namespace WTF { > >-enum TriState : int8_t { >+enum TriState : uint8_t { > FalseTriState, > TrueTriState, > MixedTriState
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
msaboff
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194281
:
361163
|
361171
|
361174
|
361175
|
361177
| 361178