Ignore:
Timestamp:
May 23, 2015, 11:41:53 AM (10 years ago)
Author:
Yusuke Suzuki
Message:

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[]):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::isStringPrototypeMethodSane):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileIn):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::identifierUID):
(JSC::DFG::SpeculativeJIT::callOperation):

  • ftl/FTLCompile.cpp:

(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):

  • ftl/FTLOperations.cpp:

(JSC::FTL::operationMaterializeObjectInOSR):

  • ftl/FTLSlowPathCall.cpp:

(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):

  • parser/Nodes.h:

(JSC::ScopeNode::captures):
(JSC::ScopeNode::setClosedVariables):
(JSC::ProgramNode::closedVariables):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::didFinishParsing):
(JSC::Parser<LexerType>::parseContinueStatement):

  • parser/Parser.h:

(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):

  • runtime/Lookup.h:

(JSC::HashTable::entry):

  • runtime/MapData.h:
  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorGetOwnPropertySymbols):

  • runtime/PrivateName.h:

(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):

  • runtime/Structure.cpp:

(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):

  • runtime/Structure.h:

(JSC::PropertyMapEntry::PropertyMapEntry):

  • runtime/StructureInlines.h:

(JSC::Structure::getConcurrently):

  • runtime/StructureTransitionTable.h:

(JSC::StructureTransitionTable::Hash::hash):

  • runtime/Symbol.cpp:

(JSC::Symbol::Symbol):

  • runtime/Symbol.h:
  • runtime/SymbolConstructor.cpp:

(JSC::symbolConstructorFor):
(JSC::symbolConstructorKeyFor):

  • runtime/SymbolTable.cpp:

(JSC::SymbolTable::uniqueIDForVariable):
(JSC::SymbolTable::globalTypeSetForVariable):

  • runtime/SymbolTable.h:
  • runtime/TypeSet.cpp:

(JSC::StructureShape::addProperty):
(JSC::StructureShape::propertyHash):

  • runtime/TypeSet.h:

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.

  1. UniquedStringImpl
It's derived class from StringImpl. And it represents symbol
atomic StringImpl.
  1. SymbolImpl

It's derived class from UniquedStringImpl. Only symbol strings can become this.
It ensures the given StringImpl is symbol in compile time.

  1. 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,

  1. Now AtomicStringImpl issue is fixed. Its SymbolImpl is separated and UniquedStringImpl is introduced.
  2. 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/text/AtomicString.h:

(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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r184647 r184828  
    148148}
    149149
    150 EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo*, EncodedJSValue base, StringImpl* uid)
     150EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo*, EncodedJSValue base, UniquedStringImpl* uid)
    151151{
    152152    VM* vm = &exec->vm();
     
    159159}
    160160
    161 EncodedJSValue JIT_OPERATION operationGetByIdBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, StringImpl* uid)
     161EncodedJSValue JIT_OPERATION operationGetByIdBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
    162162{
    163163    VM* vm = &exec->vm();
     
    177177}
    178178
    179 EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, StringImpl* uid)
     179EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
    180180{
    181181    VM* vm = &exec->vm();
     
    196196}
    197197
    198 EncodedJSValue JIT_OPERATION operationInOptimize(ExecState* exec, StructureStubInfo* stubInfo, JSCell* base, StringImpl* key)
     198EncodedJSValue JIT_OPERATION operationInOptimize(ExecState* exec, StructureStubInfo* stubInfo, JSCell* base, UniquedStringImpl* key)
    199199{
    200200    VM* vm = &exec->vm();
     
    222222}
    223223
    224 EncodedJSValue JIT_OPERATION operationIn(ExecState* exec, StructureStubInfo*, JSCell* base, StringImpl* key)
     224EncodedJSValue JIT_OPERATION operationIn(ExecState* exec, StructureStubInfo*, JSCell* base, UniquedStringImpl* key)
    225225{
    226226    VM* vm = &exec->vm();
     
    244244}
    245245
    246 void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     246void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    247247{
    248248    VM* vm = &exec->vm();
     
    254254}
    255255
    256 void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     256void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    257257{
    258258    VM* vm = &exec->vm();
     
    264264}
    265265
    266 void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     266void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    267267{
    268268    VM* vm = &exec->vm();
     
    274274}
    275275
    276 void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     276void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    277277{
    278278    VM* vm = &exec->vm();
     
    284284}
    285285
    286 void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     286void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    287287{
    288288    VM* vm = &exec->vm();
     
    308308}
    309309
    310 void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     310void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    311311{
    312312    VM* vm = &exec->vm();
     
    332332}
    333333
    334 void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     334void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    335335{
    336336    VM* vm = &exec->vm();
     
    356356}
    357357
    358 void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     358void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    359359{
    360360    VM* vm = &exec->vm();
     
    380380}
    381381
    382 void JIT_OPERATION operationPutByIdStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     382void JIT_OPERATION operationPutByIdStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    383383{
    384384    VM* vm = &exec->vm();
     
    401401}
    402402
    403 void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     403void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    404404{
    405405    VM* vm = &exec->vm();
     
    422422}
    423423
    424 void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     424void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    425425{
    426426    VM* vm = &exec->vm();
     
    443443}
    444444
    445 void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
     445void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
    446446{
    447447    VM* vm = &exec->vm();
Note: See TracChangeset for help on using the changeset viewer.