Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
https://bugs.webkit.org/show_bug.cgi?id=144848
Reviewed by Darin Adler.
Source/JavaScriptCore:
Use UniquedStringImpl, SymbolImpl and AtomicStringImpl.
- API/JSCallbackObject.h:
- builtins/BuiltinNames.h:
(JSC::BuiltinNames::isPrivateName):
- bytecode/BytecodeIntrinsicRegistry.h:
- bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
- bytecode/ComplexGetStatus.cpp:
(JSC::ComplexGetStatus::computeFor):
- bytecode/ComplexGetStatus.h:
- bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
(JSC::GetByIdStatus::computeFor):
(JSC::GetByIdStatus::computeForStubInfo):
- bytecode/GetByIdStatus.h:
- bytecode/Instruction.h:
(JSC::Instruction::Instruction):
- bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFromLLInt):
(JSC::PutByIdStatus::computeFor):
(JSC::PutByIdStatus::computeForStubInfo):
- bytecode/PutByIdStatus.h:
- bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::visibleNameForParameter):
(JSC::BytecodeGenerator::hasConstant):
(JSC::BytecodeGenerator::addConstant):
- bytecompiler/BytecodeGenerator.h:
- bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
- dfg/DFGDesiredIdentifiers.cpp:
(JSC::DFG::DesiredIdentifiers::addLazily):
(JSC::DFG::DesiredIdentifiers::at):
(JSC::DFG::DesiredIdentifiers::reallyAdd):
- dfg/DFGDesiredIdentifiers.h:
(JSC::DFG::DesiredIdentifiers::operator[]):
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::isStringPrototypeMethodSane):
- dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIn):
(JSC::DFG::SpeculativeJIT::identifierUID):
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::FTL::mmAllocateDataSection):
- ftl/FTLInlineCacheDescriptor.h:
(JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor):
(JSC::FTL::InlineCacheDescriptor::uid):
(JSC::FTL::GetByIdDescriptor::GetByIdDescriptor):
(JSC::FTL::PutByIdDescriptor::PutByIdDescriptor):
(JSC::FTL::CheckInDescriptor::CheckInDescriptor):
- ftl/FTLIntrinsicRepository.h:
- ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compilePutById):
(JSC::FTL::LowerDFGToLLVM::compileIn):
(JSC::FTL::LowerDFGToLLVM::compileMaterializeCreateActivation):
(JSC::FTL::LowerDFGToLLVM::getById):
(JSC::FTL::operationMaterializeObjectInOSR):
(JSC::FTL::callOperation):
- ftl/FTLSlowPathCall.h:
- jit/JIT.h:
- jit/JITInlines.h:
(JSC::JIT::callOperation):
- jit/JITOperations.cpp:
- jit/JITOperations.h:
- parser/Nodes.cpp:
(JSC::ProgramNode::setClosedVariables):
(JSC::ScopeNode::captures):
(JSC::ScopeNode::setClosedVariables):
(JSC::ProgramNode::closedVariables):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::didFinishParsing):
(JSC::Parser<LexerType>::parseContinueStatement):
(JSC::Scope::Scope):
(JSC::Scope::pushLabel):
(JSC::Scope::getLabel):
(JSC::Scope::declareCallee):
(JSC::Scope::declareVariable):
(JSC::Scope::declareParameter):
(JSC::Scope::declareBoundParameter):
(JSC::Scope::useVariable):
(JSC::Scope::copyCapturedVariablesToVector):
(JSC::Parser::closedVariables):
(JSC::ScopeLabelInfo::ScopeLabelInfo): Deleted.
- parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::usedVariables):
(JSC::SourceProviderCacheItem::writtenVariables):
(JSC::SourceProviderCacheItem::create):
- runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::isPrivateName):
- runtime/CommonIdentifiers.h:
- runtime/Identifier.h:
(JSC::Identifier::impl):
(JSC::Identifier::Identifier):
(JSC::parseIndex):
(JSC::IdentifierRepHash::hash):
- runtime/IdentifierInlines.h:
(JSC::Identifier::fromUid):
- runtime/IntendedStructureChain.cpp:
(JSC::IntendedStructureChain::mayInterceptStoreTo):
- runtime/IntendedStructureChain.h:
- runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::HashTable::entry):
- runtime/MapData.h:
- runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertySymbols):
(JSC::PrivateName::PrivateName):
(JSC::PrivateName::uid):
- runtime/PropertyMapHashTable.h:
- runtime/PropertyName.h:
(JSC::PropertyName::PropertyName):
(JSC::PropertyName::uid):
(JSC::PropertyName::publicName):
(JSC::parseIndex):
- runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::addKnownUnique):
(JSC::PropertyNameArray::add):
(JSC::StructureTransitionTable::contains):
(JSC::StructureTransitionTable::get):
(JSC::StructureTransitionTable::add):
(JSC::Structure::addPropertyTransitionToExistingStructureImpl):
(JSC::Structure::addPropertyTransitionToExistingStructureConcurrently):
(JSC::Structure::getConcurrently):
(JSC::Structure::add):
(JSC::Structure::remove):
(JSC::Structure::toStructureShape):
(JSC::PropertyMapEntry::PropertyMapEntry):
- runtime/StructureInlines.h:
(JSC::Structure::getConcurrently):
- runtime/StructureTransitionTable.h:
(JSC::StructureTransitionTable::Hash::hash):
(JSC::Symbol::Symbol):
- runtime/Symbol.h:
- runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorFor):
(JSC::symbolConstructorKeyFor):
(JSC::SymbolTable::uniqueIDForVariable):
(JSC::SymbolTable::globalTypeSetForVariable):
- runtime/SymbolTable.h:
- runtime/TypeSet.cpp:
(JSC::StructureShape::addProperty):
(JSC::StructureShape::propertyHash):
Source/WebCore:
Use UniquedStringImpl, SymbolImpl and AtomicStringImpl.
- bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
- bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
Source/WTF:
he current AtomicStringImpl accidentally means the symbol OR atomic StringImpl.
t's not correct to its name and it's error prone.
In this patch, we'll introduce/changes classes into WTF.
- UniquedStringImpl
It's derived class from StringImpl. And it represents symbol atomic StringImpl.
|
- SymbolImpl
It's derived class from UniquedStringImpl. Only symbol strings can become this.
It ensures the given StringImpl is symbol in compile time.
- AtomicStringImpl
It's derived class from UniquedStringImpl. Only atomic (non-normal && non-symbol) strings can become this.
It ensures the given StringImpl is atomic in compile time.
And, in this time, I just accept UniqueStringImpl in AtomicString. As the result,
- Now AtomicStringImpl issue is fixed. Its SymbolImpl is separated and UniquedStringImpl is introduced.
- But AtomicString still have both symbol and atomic strings.
This should be solved in the separated patch.
- WTF.vcxproj/WTF.vcxproj:
- WTF.vcxproj/WTF.vcxproj.filters:
- WTF.xcodeproj/project.pbxproj:
- wtf/CMakeLists.txt:
- wtf/PrintStream.cpp:
- wtf/PrintStream.h:
(WTF::printInternal):
(WTF::AtomicString::AtomicString):
- wtf/text/AtomicStringImpl.h:
- wtf/text/StringImpl.cpp:
(WTF::StringImpl::~StringImpl):
(WTF::StringImpl::createSymbol):
(WTF::StringImpl::createSymbolEmpty):
- wtf/text/StringImpl.h:
- wtf/text/SymbolImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
- wtf/text/SymbolRegistry.cpp:
(WTF::SymbolRegistry::symbolForKey):
(WTF::SymbolRegistry::keyForSymbol):
(WTF::SymbolRegistry::remove):
- wtf/text/SymbolRegistry.h:
- wtf/text/UniquedStringImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
Tools:
Use UniquedStringImpl, SymbolImpl and AtomicStringImpl.
- TestWebKitAPI/Tests/WTF/StringImpl.cpp: