}
private:
- typedef HashMap<RefPtr<StringImpl>, WriteBarrier<Unknown>, IdentifierRepHash> PrivatePropertyMap;
+ typedef HashMap<RefPtr<UniquedStringImpl>, WriteBarrier<Unknown>, IdentifierRepHash> PrivatePropertyMap;
PrivatePropertyMap m_propertyMap;
};
std::unique_ptr<JSPrivatePropertyMap> m_privateProperties;
+2015-05-23 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=144848
+
+ Reviewed by Darin Adler.
+
+ 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:
+
2015-05-21 Filip Pizlo <fpizlo@apple.com>
Arguments elimination phase mishandles arity check failure in its reduction of LoadVarargs to GetStack/PutStacks
const Identifier& name##PublicName() const { return m_##name; } \
const Identifier& name##PrivateName() const { return m_##name##PrivateName; }
-#define INITIALISE_BUILTIN_SYMBOLS(name) INITIALISE_BUILTIN_NAMES(name), m_##name##Symbol(Identifier::fromUid(PrivateName(ASCIILiteral("Symbol." #name))))
+#define INITIALISE_BUILTIN_SYMBOLS(name) INITIALISE_BUILTIN_NAMES(name), m_##name##Symbol(Identifier::fromUid(PrivateName(PrivateName::Description, ASCIILiteral("Symbol." #name))))
#define DECLARE_BUILTIN_SYMBOLS(name) DECLARE_BUILTIN_NAMES(name) const Identifier m_##name##Symbol;
#define DECLARE_BUILTIN_SYMBOL_ACCESSOR(name) \
DECLARE_BUILTIN_IDENTIFIER_ACCESSOR(name) \
JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALISE_PUBLIC_TO_PRIVATE_ENTRY)
}
- bool isPrivateName(StringImpl* uid) const;
+ bool isPrivateName(SymbolImpl& uid) const;
+ bool isPrivateName(UniquedStringImpl& uid) const;
bool isPrivateName(const Identifier&) const;
const Identifier* getPrivateName(const Identifier&) const;
const Identifier& getPublicName(const Identifier&) const;
JSC_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(DECLARE_BUILTIN_NAMES)
JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(DECLARE_BUILTIN_SYMBOLS)
- typedef HashMap<RefPtr<StringImpl>, const Identifier*, IdentifierRepHash> BuiltinNamesMap;
+ typedef HashMap<RefPtr<UniquedStringImpl>, const Identifier*, IdentifierRepHash> BuiltinNamesMap;
BuiltinNamesMap m_publicToPrivateMap;
BuiltinNamesMap m_privateToPublicMap;
};
#undef INITIALISE_BUILTIN_SYMBOLS
#undef DECLARE_BUILTIN_SYMBOL_ACCESSOR
-inline bool BuiltinNames::isPrivateName(StringImpl* uid) const
+inline bool BuiltinNames::isPrivateName(SymbolImpl& uid) const
{
- if (!uid->isSymbol())
+ return m_privateToPublicMap.contains(&uid);
+}
+
+inline bool BuiltinNames::isPrivateName(UniquedStringImpl& uid) const
+{
+ if (!uid.isSymbol())
return false;
- return m_privateToPublicMap.contains(uid);
+ return m_privateToPublicMap.contains(&uid);
}
inline bool BuiltinNames::isPrivateName(const Identifier& ident) const
{
- return isPrivateName(ident.impl());
+ if (ident.isNull())
+ return false;
+ return isPrivateName(*ident.impl());
}
inline const Identifier* BuiltinNames::getPrivateName(const Identifier& ident) const
private:
const CommonIdentifiers& m_propertyNames;
- HashMap<RefPtr<StringImpl>, EmitterType, IdentifierRepHash> m_bytecodeIntrinsicMap;
+ HashMap<RefPtr<UniquedStringImpl>, EmitterType, IdentifierRepHash> m_bytecodeIntrinsicMap;
};
} // namespace JSC
#include <wtf/CommaPrinter.h>
#include <wtf/StringExtras.h>
#include <wtf/StringPrintStream.h>
+#include <wtf/text/UniquedStringImpl.h>
#if ENABLE(DFG_JIT)
#include "DFGOperations.h"
if (static_cast<unsigned>(pc[2].u.operand) != UINT_MAX) {
RELEASE_ASSERT(didCloneSymbolTable);
const Identifier& ident = identifier(pc[2].u.operand);
- StringImpl* uid = ident.impl();
ConcurrentJITLocker locker(m_symbolTable->m_lock);
- SymbolTable::Map::iterator iter = m_symbolTable->find(locker, uid);
+ SymbolTable::Map::iterator iter = m_symbolTable->find(locker, ident.impl());
ASSERT(iter != m_symbolTable->end(locker));
iter->value.prepareToWatch();
instructions[i + 5].u.watchpointSet = iter->value.watchpointSet();
ComplexGetStatus ComplexGetStatus::computeFor(
CodeBlock* profiledBlock, Structure* headStructure, StructureChain* chain,
- unsigned chainCount, AtomicStringImpl* uid)
+ unsigned chainCount, UniquedStringImpl* uid)
{
// FIXME: We should assert that we never see a structure that
// hasImpureGetOwnPropertySlot() but for which we don't
static ComplexGetStatus computeFor(
CodeBlock* profiledBlock, Structure* headStructure, StructureChain* chain,
- unsigned chainCount, AtomicStringImpl* uid);
+ unsigned chainCount, UniquedStringImpl* uid);
Kind kind() const { return m_kind; }
unsigned attributes() const { return m_attributes; }
}
#endif
-GetByIdStatus GetByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned bytecodeIndex, AtomicStringImpl* uid)
+GetByIdStatus GetByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned bytecodeIndex, UniquedStringImpl* uid)
{
UNUSED_PARAM(profiledBlock);
UNUSED_PARAM(bytecodeIndex);
return GetByIdStatus(Simple, false, GetByIdVariant(StructureSet(structure), offset));
}
-GetByIdStatus GetByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& map, unsigned bytecodeIndex, AtomicStringImpl* uid)
+GetByIdStatus GetByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& map, unsigned bytecodeIndex, UniquedStringImpl* uid)
{
ConcurrentJITLocker locker(profiledBlock->m_lock);
#if ENABLE(JIT)
GetByIdStatus GetByIdStatus::computeForStubInfo(
- const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, AtomicStringImpl* uid,
+ const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, UniquedStringImpl* uid,
CallLinkStatus::ExitSiteData callExitSiteData)
{
if (!stubInfo || !stubInfo->seen)
GetByIdStatus GetByIdStatus::computeFor(
CodeBlock* profiledBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap,
- StubInfoMap& dfgMap, CodeOrigin codeOrigin, AtomicStringImpl* uid)
+ StubInfoMap& dfgMap, CodeOrigin codeOrigin, UniquedStringImpl* uid)
{
#if ENABLE(DFG_JIT)
if (dfgBlock) {
return computeFor(profiledBlock, baselineMap, codeOrigin.bytecodeIndex, uid);
}
-GetByIdStatus GetByIdStatus::computeFor(const StructureSet& set, AtomicStringImpl* uid)
+GetByIdStatus GetByIdStatus::computeFor(const StructureSet& set, UniquedStringImpl* uid)
{
// For now we only handle the super simple self access case. We could handle the
// prototype case in the future.
m_variants.append(variant);
}
- static GetByIdStatus computeFor(CodeBlock*, StubInfoMap&, unsigned bytecodeIndex, AtomicStringImpl* uid);
- static GetByIdStatus computeFor(const StructureSet&, AtomicStringImpl* uid);
+ static GetByIdStatus computeFor(CodeBlock*, StubInfoMap&, unsigned bytecodeIndex, UniquedStringImpl* uid);
+ static GetByIdStatus computeFor(const StructureSet&, UniquedStringImpl* uid);
- static GetByIdStatus computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin, AtomicStringImpl* uid);
+ static GetByIdStatus computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin, UniquedStringImpl* uid);
State state() const { return m_state; }
#if ENABLE(JIT)
static GetByIdStatus computeForStubInfo(
const ConcurrentJITLocker&, CodeBlock* profiledBlock, StructureStubInfo*,
- AtomicStringImpl* uid, CallLinkStatus::ExitSiteData);
+ UniquedStringImpl* uid, CallLinkStatus::ExitSiteData);
#endif
- static GetByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, AtomicStringImpl* uid);
+ static GetByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, UniquedStringImpl* uid);
bool appendVariant(const GetByIdVariant&);
Instruction(ObjectAllocationProfile* profile) { u.objectAllocationProfile = profile; }
Instruction(WriteBarrier<Unknown>* variablePointer) { u.variablePointer = variablePointer; }
Instruction(Special::Pointer pointer) { u.specialPointer = pointer; }
- Instruction(StringImpl* uid) { u.uid = uid; }
+ Instruction(UniquedStringImpl* uid) { u.uid = uid; }
Instruction(bool* predicatePointer) { u.predicatePointer = predicatePointer; }
union {
Special::Pointer specialPointer;
PropertySlot::GetValueFunc getterFunc;
LLIntCallLinkInfo* callLinkInfo;
- StringImpl* uid;
+ UniquedStringImpl* uid;
ValueProfile* profile;
ArrayProfile* arrayProfile;
ArrayAllocationProfile* arrayAllocationProfile;
}
#endif
-PutByIdStatus PutByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned bytecodeIndex, AtomicStringImpl* uid)
+PutByIdStatus PutByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned bytecodeIndex, UniquedStringImpl* uid)
{
UNUSED_PARAM(profiledBlock);
UNUSED_PARAM(bytecodeIndex);
return PutByIdVariant::transition(structure, newStructure, intendedChain.get(), offset);
}
-PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& map, unsigned bytecodeIndex, AtomicStringImpl* uid)
+PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& map, unsigned bytecodeIndex, UniquedStringImpl* uid)
{
ConcurrentJITLocker locker(profiledBlock->m_lock);
#if ENABLE(JIT)
PutByIdStatus PutByIdStatus::computeForStubInfo(
const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo,
- AtomicStringImpl* uid, CallLinkStatus::ExitSiteData callExitSiteData)
+ UniquedStringImpl* uid, CallLinkStatus::ExitSiteData callExitSiteData)
{
if (!stubInfo || !stubInfo->seen)
return PutByIdStatus();
}
#endif
-PutByIdStatus PutByIdStatus::computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin codeOrigin, AtomicStringImpl* uid)
+PutByIdStatus PutByIdStatus::computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin codeOrigin, UniquedStringImpl* uid)
{
#if ENABLE(DFG_JIT)
if (dfgBlock) {
return computeFor(baselineBlock, baselineMap, codeOrigin.bytecodeIndex, uid);
}
-PutByIdStatus PutByIdStatus::computeFor(JSGlobalObject* globalObject, const StructureSet& set, AtomicStringImpl* uid, bool isDirect)
+PutByIdStatus PutByIdStatus::computeFor(JSGlobalObject* globalObject, const StructureSet& set, UniquedStringImpl* uid, bool isDirect)
{
if (parseIndex(*uid))
return PutByIdStatus(TakesSlowPath);
m_variants.append(variant);
}
- static PutByIdStatus computeFor(CodeBlock*, StubInfoMap&, unsigned bytecodeIndex, AtomicStringImpl* uid);
- static PutByIdStatus computeFor(JSGlobalObject*, const StructureSet&, AtomicStringImpl* uid, bool isDirect);
+ static PutByIdStatus computeFor(CodeBlock*, StubInfoMap&, unsigned bytecodeIndex, UniquedStringImpl* uid);
+ static PutByIdStatus computeFor(JSGlobalObject*, const StructureSet&, UniquedStringImpl* uid, bool isDirect);
- static PutByIdStatus computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin, AtomicStringImpl* uid);
+ static PutByIdStatus computeFor(CodeBlock* baselineBlock, CodeBlock* dfgBlock, StubInfoMap& baselineMap, StubInfoMap& dfgMap, CodeOrigin, UniquedStringImpl* uid);
State state() const { return m_state; }
#endif
#if ENABLE(JIT)
static PutByIdStatus computeForStubInfo(
- const ConcurrentJITLocker&, CodeBlock*, StructureStubInfo*, AtomicStringImpl* uid,
+ const ConcurrentJITLocker&, CodeBlock*, StructureStubInfo*, UniquedStringImpl* uid,
CallLinkStatus::ExitSiteData);
#endif
- static PutByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, AtomicStringImpl* uid);
+ static PutByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, UniquedStringImpl* uid);
bool appendVariant(const PutByIdVariant&);
bool shouldCaptureAllOfTheThings = m_shouldEmitDebugHooks || codeBlock->usesEval();
bool needsArguments = functionNode->usesArguments() || codeBlock->usesEval();
- auto captures = [&] (StringImpl* uid) -> bool {
+ auto captures = [&] (UniquedStringImpl* uid) -> bool {
if (shouldCaptureAllOfTheThings)
return true;
if (!shouldCaptureSomeOfTheThings)
}
return functionNode->captures(uid);
};
- auto varKind = [&] (StringImpl* uid) -> VarKind {
+ auto varKind = [&] (UniquedStringImpl* uid) -> VarKind {
return captures(uid) ? VarKind::Scope : VarKind::Stack;
};
for (unsigned i = 0; i < parameters.size(); ++i) {
ScopeOffset offset = m_symbolTable->takeNextScopeOffset();
m_symbolTable->setArgumentOffset(vm, i, offset);
- if (StringImpl* name = visibleNameForParameter(parameters.at(i))) {
+ if (UniquedStringImpl* name = visibleNameForParameter(parameters.at(i))) {
VarOffset varOffset(offset);
SymbolTableEntry entry(varOffset);
// Stores to these variables via the ScopedArguments object will not do
// We're going to put all parameters into the DirectArguments object. First ensure
// that the symbol table knows that this is happening.
for (unsigned i = 0; i < parameters.size(); ++i) {
- if (StringImpl* name = visibleNameForParameter(parameters.at(i)))
+ if (UniquedStringImpl* name = visibleNameForParameter(parameters.at(i)))
m_symbolTable->set(name, SymbolTableEntry(VarOffset(DirectArgumentsOffset(i))));
}
// Create the formal parameters the normal way. Any of them could be captured, or not. If
// captured, lift them into the scope.
for (unsigned i = 0; i < parameters.size(); ++i) {
- StringImpl* name = visibleNameForParameter(parameters.at(i));
+ UniquedStringImpl* name = visibleNameForParameter(parameters.at(i));
if (!name)
continue;
bool haveParameterNamedArguments = false;
for (unsigned i = 0; i < parameters.size(); ++i) {
- StringImpl* name = visibleNameForParameter(parameters.at(i));
+ UniquedStringImpl* name = visibleNameForParameter(parameters.at(i));
if (name == propertyNames().arguments.impl()) {
haveParameterNamedArguments = true;
break;
return ¶meter;
}
-StringImpl* BytecodeGenerator::visibleNameForParameter(DeconstructionPatternNode* pattern)
+UniquedStringImpl* BytecodeGenerator::visibleNameForParameter(DeconstructionPatternNode* pattern)
{
if (pattern->isBindingNode()) {
const Identifier& ident = static_cast<const BindingNode*>(pattern)->boundProperty();
bool BytecodeGenerator::hasConstant(const Identifier& ident) const
{
- StringImpl* rep = ident.impl();
+ UniquedStringImpl* rep = ident.impl();
return m_identifierMap.contains(rep);
}
unsigned BytecodeGenerator::addConstant(const Identifier& ident)
{
- StringImpl* rep = ident.impl();
+ UniquedStringImpl* rep = ident.impl();
IdentifierMap::AddResult result = m_identifierMap.add(rep, m_codeBlock->numberOfIdentifiers());
if (result.isNewEntry)
m_codeBlock->addIdentifier(ident);
void emitComplexPopScopes(RegisterID*, ControlFlowContext* topScope, ControlFlowContext* bottomScope);
typedef HashMap<double, JSValue> NumberMap;
- typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
+ typedef HashMap<UniquedStringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
typedef HashMap<TemplateRegistryKey, JSTemplateRegistryKey*> TemplateRegistryKeyMap;
// Helper for emitCall() and emitConstruct(). This works because the set of
// Initializes the stack form the parameter; does nothing for the symbol table.
RegisterID* initializeNextParameter();
- StringImpl* visibleNameForParameter(DeconstructionPatternNode*);
+ UniquedStringImpl* visibleNameForParameter(DeconstructionPatternNode*);
RegisterID& registerFor(VirtualRegister reg)
{
// Some of these objects keep pointers to one another. They are arranged
// to ensure a sane destruction order that avoids references to freed memory.
- HashSet<RefPtr<StringImpl>, IdentifierRepHash> m_functions;
+ HashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> m_functions;
RegisterID m_ignoredResultRegister;
RegisterID m_thisRegister;
RegisterID m_calleeRegister;
bool hasComputedProperty = false;
typedef std::pair<PropertyNode*, PropertyNode*> GetterSetterPair;
- typedef HashMap<StringImpl*, GetterSetterPair> GetterSetterMap;
+ typedef HashMap<UniquedStringImpl*, GetterSetterPair, IdentifierRepHash> GetterSetterMap;
GetterSetterMap map;
// Build a map, pairing get/set values together.
Node* base = get(VirtualRegister(currentInstruction[2].u.operand));
unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand];
- AtomicStringImpl* uid = m_graph.identifiers()[identifierNumber];
+ UniquedStringImpl* uid = m_graph.identifiers()[identifierNumber];
GetByIdStatus getByIdStatus = GetByIdStatus::computeFor(
m_inlineStackTop->m_profiledBlock, m_dfgCodeBlock,
m_inlineStackTop->m_stubInfos, m_dfgStubInfos,
int dst = currentInstruction[1].u.operand;
int scope = currentInstruction[2].u.operand;
unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand];
- AtomicStringImpl* uid = m_graph.identifiers()[identifierNumber];
+ UniquedStringImpl* uid = m_graph.identifiers()[identifierNumber];
ResolveType resolveType = ResolveModeAndType(currentInstruction[4].u.operand).type();
Structure* structure = 0;
identifierNumber = m_inlineStackTop->m_identifierRemap[identifierNumber];
unsigned value = currentInstruction[3].u.operand;
ResolveType resolveType = ResolveModeAndType(currentInstruction[4].u.operand).type();
- AtomicStringImpl* uid;
+ UniquedStringImpl* uid;
if (identifierNumber != UINT_MAX)
uid = m_graph.identifiers()[identifierNumber];
else
m_switchRemap.resize(codeBlock->numberOfSwitchJumpTables());
for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i) {
- AtomicStringImpl* rep = codeBlock->identifier(i).impl();
+ UniquedStringImpl* rep = codeBlock->identifier(i).impl();
BorrowedIdentifierMap::AddResult result = byteCodeParser->m_identifierMap.add(rep, byteCodeParser->m_graph.identifiers().numberOfIdentifiers());
if (result.isNewEntry)
byteCodeParser->m_graph.identifiers().addLazily(rep);
return m_codeBlock->numberOfIdentifiers() + m_addedIdentifiers.size();
}
-void DesiredIdentifiers::addLazily(AtomicStringImpl* rep)
+void DesiredIdentifiers::addLazily(UniquedStringImpl* rep)
{
m_addedIdentifiers.append(rep);
}
-AtomicStringImpl* DesiredIdentifiers::at(unsigned index) const
+UniquedStringImpl* DesiredIdentifiers::at(unsigned index) const
{
- AtomicStringImpl* result;
+ UniquedStringImpl* result;
if (index < m_codeBlock->numberOfIdentifiers())
result = m_codeBlock->identifier(index).impl();
else
void DesiredIdentifiers::reallyAdd(VM& vm, CommonData* commonData)
{
for (unsigned i = 0; i < m_addedIdentifiers.size(); ++i) {
- StringImpl* rep = m_addedIdentifiers[i];
+ auto rep = m_addedIdentifiers[i];
ASSERT(rep->hasAtLeastOneRef());
commonData->dfgIdentifiers.append(Identifier::fromUid(&vm, rep));
}
~DesiredIdentifiers();
unsigned numberOfIdentifiers();
- void addLazily(AtomicStringImpl*);
+ void addLazily(UniquedStringImpl*);
- AtomicStringImpl* at(unsigned index) const;
+ UniquedStringImpl* at(unsigned index) const;
- AtomicStringImpl* operator[](unsigned index) const { return at(index); }
+ UniquedStringImpl* operator[](unsigned index) const { return at(index); }
void reallyAdd(VM&, CommonData*);
private:
CodeBlock* m_codeBlock;
- Vector<AtomicStringImpl*> m_addedIdentifiers;
+ Vector<UniquedStringImpl*> m_addedIdentifiers;
};
} } // namespace JSC::DFG
if (!m_graph.hasExitSite(node->origin.semantic, BadCache)
&& !m_graph.hasExitSite(node->origin.semantic, BadIndexingType)
&& !m_graph.hasExitSite(node->origin.semantic, ExoticObjectMode)) {
- StringImpl* impl = m_graph.identifiers()[node->identifierNumber()];
- if (impl == vm().propertyNames->length.impl()) {
+ auto uid = m_graph.identifiers()[node->identifierNumber()];
+ if (uid == vm().propertyNames->length.impl()) {
attemptToMakeGetArrayLength(node);
break;
}
- if (impl == vm().propertyNames->byteLength.impl()) {
+ if (uid == vm().propertyNames->byteLength.impl()) {
attemptToMakeGetTypedArrayByteLength(node);
break;
}
- if (impl == vm().propertyNames->byteOffset.impl()) {
+ if (uid == vm().propertyNames->byteOffset.impl()) {
attemptToMakeGetTypedArrayByteOffset(node);
break;
}
}
bool isStringPrototypeMethodSane(
- JSObject* stringPrototype, Structure* stringPrototypeStructure, AtomicStringImpl* uid)
+ JSObject* stringPrototype, Structure* stringPrototypeStructure, UniquedStringImpl* uid)
{
unsigned attributesUnused;
PropertyOffset offset =
MacroAssembler::PatchableJump jump = m_jit.patchableJump();
MacroAssembler::Label done = m_jit.label();
+ // Since this block is executed only when the result of string->tryGetValueImpl() is atomic,
+ // we can cast it to const AtomicStringImpl* safely.
auto slowPath = slowPathCall(
jump.m_jump, this, operationInOptimize,
JSValueRegs::payloadOnly(resultGPR), stubInfo, baseGPR,
- string->tryGetValueImpl());
+ static_cast<const AtomicStringImpl*>(string->tryGetValueImpl()));
stubInfo->codeOrigin = node->origin.semantic;
stubInfo->patch.baseGPR = static_cast<int8_t>(baseGPR);
bool isKnownNotNumber(Node* node) { return !(m_state.forNode(node).m_type & SpecFullNumber); }
bool isKnownNotCell(Node* node) { return !(m_state.forNode(node).m_type & SpecCell); }
- StringImpl* identifierUID(unsigned index)
+ UniquedStringImpl* identifierUID(unsigned index)
{
return m_jit.graph().identifiers()[index];
}
m_jit.setupArguments(arg1, arg2);
return appendCallSetResult(operation, result);
}
- JITCompiler::Call callOperation(I_JITOperation_EJss operation, GPRReg result, GPRReg arg1)
+ JITCompiler::Call callOperation(T_JITOperation_EJss operation, GPRReg result, GPRReg arg1)
{
m_jit.setupArgumentsWithExecState(arg1);
return appendCallWithExceptionCheckSetResult(operation, result);
m_jit.setupArguments(value);
return appendCallSetResult(operation, result);
}
- JITCompiler::Call callOperation(J_JITOperation_EI operation, GPRReg result, StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_EI operation, GPRReg result, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, result);
m_jit.setupArgumentsWithExecState(arg1, arg2);
return appendCallWithExceptionCheckSetResult(operation, result);
}
- JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, const StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, const UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, result);
}
- JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg result, StructureStubInfo* stubInfo, GPRReg arg1, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, result);
m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(pointer));
return appendCallWithExceptionCheck(operation);
}
- JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg arg1, GPRReg arg2, StringImpl* uid)
+ JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg arg1, GPRReg arg2, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, arg2, TrustedImmPtr(uid));
return appendCallWithExceptionCheck(operation);
m_jit.setupArgumentsWithExecState(arg1);
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
- JITCompiler::Call callOperation(J_JITOperation_EI operation, GPRReg resultTag, GPRReg resultPayload, StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_EI operation, GPRReg resultTag, GPRReg resultPayload, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(cell));
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
- JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, GPRReg arg1, const StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_ESsiCI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, GPRReg arg1, const UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
- JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, arg1Tag, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
}
- JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, StringImpl* uid)
+ JITCompiler::Call callOperation(J_JITOperation_ESsiJI operation, GPRReg resultTag, GPRReg resultPayload, StructureStubInfo* stubInfo, int32_t arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, TrustedImm32(arg1Tag), TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetResult(operation, resultPayload, resultTag);
m_jit.setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2, TrustedImmPtr(pointer));
return appendCallWithExceptionCheck(operation);
}
- JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2Payload, StringImpl* uid)
+ JITCompiler::Call callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2Payload, UniquedStringImpl* uid)
{
m_jit.setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, arg1Tag, arg2Payload, TrustedImm32(JSValue::CellTag), TrustedImmPtr(uid));
return appendCallWithExceptionCheck(operation);
MacroAssembler::Call slowCall = callOperation(
state, usedRegisters, slowPathJIT, checkIn.codeOrigin(), &exceptionTarget,
- operationInOptimize, result, stubInfo, obj, checkIn.m_id);
+ operationInOptimize, result, stubInfo, obj, checkIn.m_uid);
checkIn.m_slowPathDone.append(slowPathJIT.jump());
#include "CodeOrigin.h"
#include "JITInlineCacheGenerator.h"
#include "MacroAssembler.h"
-#include <wtf/text/StringImpl.h>
+#include <wtf/text/UniquedStringImpl.h>
namespace JSC { namespace FTL {
public:
InlineCacheDescriptor() { }
- InlineCacheDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid)
+ InlineCacheDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, UniquedStringImpl* uid)
: m_stackmapID(stackmapID)
, m_codeOrigin(codeOrigin)
, m_uid(uid)
unsigned stackmapID() const { return m_stackmapID; }
CodeOrigin codeOrigin() const { return m_codeOrigin; }
- StringImpl* uid() const { return m_uid; }
+ UniquedStringImpl* uid() const { return m_uid; }
private:
unsigned m_stackmapID;
CodeOrigin m_codeOrigin;
- StringImpl* m_uid;
+ UniquedStringImpl* m_uid;
public:
Vector<MacroAssembler::Jump> m_slowPathDone;
public:
GetByIdDescriptor() { }
- GetByIdDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid)
+ GetByIdDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, UniquedStringImpl* uid)
: InlineCacheDescriptor(stackmapID, codeOrigin, uid)
{
}
PutByIdDescriptor() { }
PutByIdDescriptor(
- unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid,
+ unsigned stackmapID, CodeOrigin codeOrigin, UniquedStringImpl* uid,
ECMAMode ecmaMode, PutKind putKind)
: InlineCacheDescriptor(stackmapID, codeOrigin, uid)
, m_ecmaMode(ecmaMode)
public:
CheckInDescriptor() { }
- CheckInDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, const StringImpl* id)
+ CheckInDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, const UniquedStringImpl* uid)
: InlineCacheDescriptor(stackmapID, codeOrigin, nullptr)
- , m_id(id)
+ , m_uid(uid)
{
}
- const StringImpl* m_id;
+ const UniquedStringImpl* m_uid;
Vector<CheckInGenerator> m_generators;
};
macro(C_JITOperation_EStZZ, functionType(intPtr, intPtr, intPtr, int32, int32)) \
macro(C_JITOperation_EZ, functionType(intPtr, intPtr, int32)) \
macro(D_JITOperation_D, functionType(doubleType, doubleType)) \
- macro(I_JITOperation_EJss, functionType(intPtr, intPtr, intPtr)) \
+ macro(T_JITOperation_EJss, functionType(intPtr, intPtr, intPtr)) \
macro(J_JITOperation_E, functionType(int64, intPtr)) \
macro(J_JITOperation_EA, functionType(int64, intPtr, intPtr)) \
macro(J_JITOperation_EAZ, functionType(int64, intPtr, intPtr, int32)) \
LValue base = lowCell(m_node->child1());
LValue value = lowJSValue(m_node->child2());
- StringImpl* uid = m_graph.identifiers()[m_node->identifierNumber()];
+ auto uid = m_graph.identifiers()[m_node->identifierNumber()];
// Arguments: id, bytes, target, numArgs, args...
unsigned stackmapID = m_stackmapIDs++;
if (JSString* string = m_node->child1()->dynamicCastConstant<JSString*>()) {
if (string->tryGetValueImpl() && string->tryGetValueImpl()->isAtomic()) {
- const StringImpl* str = string->tryGetValueImpl();
+ const auto str = static_cast<const AtomicStringImpl*>(string->tryGetValueImpl());
unsigned stackmapID = m_stackmapIDs++;
LValue call = m_out.call(
break;
}
}
- ASSERT(found);
+ ASSERT_UNUSED(found, found);
}
}
LValue getById(LValue base)
{
- StringImpl* uid = m_graph.identifiers()[m_node->identifierNumber()];
+ auto uid = m_graph.identifiers()[m_node->identifierNumber()];
// Arguments: id, bytes, target, numArgs, args...
unsigned stackmapID = m_stackmapIDs++;
break;
}
}
- ASSERT(found);
+ ASSERT_UNUSED(found, found);
}
unsigned numberOfClosureVarPloc = 0;
for (unsigned i = materialization->properties().size(); i--;) {
State& state, const RegisterSet& usedRegisters, CCallHelpers& jit,
CodeOrigin codeOrigin, MacroAssembler::JumpList* exceptionTarget,
J_JITOperation_ESsiCI operation, GPRReg result, StructureStubInfo* stubInfo,
- GPRReg object, const StringImpl* uid)
+ GPRReg object, const UniquedStringImpl* uid)
{
storeCodeOrigin(state, jit, codeOrigin);
CallContext context(state, usedRegisters, jit, 4, result);
State& state, const RegisterSet& usedRegisters, CCallHelpers& jit,
CodeOrigin codeOrigin, MacroAssembler::JumpList* exceptionTarget,
J_JITOperation_ESsiJI operation, GPRReg result, StructureStubInfo* stubInfo,
- GPRReg object, StringImpl* uid)
+ GPRReg object, UniquedStringImpl* uid)
{
storeCodeOrigin(state, jit, codeOrigin);
CallContext context(state, usedRegisters, jit, 4, result);
State& state, const RegisterSet& usedRegisters, CCallHelpers& jit,
CodeOrigin codeOrigin, MacroAssembler::JumpList* exceptionTarget,
V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, GPRReg value,
- GPRReg object, StringImpl* uid)
+ GPRReg object, UniquedStringImpl* uid)
{
storeCodeOrigin(state, jit, codeOrigin);
CallContext context(state, usedRegisters, jit, 5, InvalidGPRReg);
MacroAssembler::Call callOperation(
State&, const RegisterSet&, CCallHelpers&, CodeOrigin, CCallHelpers::JumpList*,
J_JITOperation_ESsiCI, GPRReg, StructureStubInfo*, GPRReg,
- const StringImpl*);
+ const UniquedStringImpl* uid);
MacroAssembler::Call callOperation(
State&, const RegisterSet&, CCallHelpers&, CodeOrigin, CCallHelpers::JumpList*,
J_JITOperation_ESsiJI, GPRReg result, StructureStubInfo*, GPRReg object,
- StringImpl* uid);
+ UniquedStringImpl* uid);
MacroAssembler::Call callOperation(
State&, const RegisterSet&, CCallHelpers&, CodeOrigin, CCallHelpers::JumpList*,
V_JITOperation_ESsiJJI, StructureStubInfo*, GPRReg value, GPRReg object,
- StringImpl* uid);
+ UniquedStringImpl* uid);
} } // namespace JSC::FTL
MacroAssembler::Call callOperation(V_JITOperation_EC, JSCell*);
MacroAssembler::Call callOperation(J_JITOperation_EJ, int, GPRReg);
#if USE(JSVALUE64)
- MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_ESsiJI, int, StructureStubInfo*, GPRReg, StringImpl*);
+ MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_ESsiJI, int, StructureStubInfo*, GPRReg, UniquedStringImpl*);
#else
- MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_ESsiJI, int, StructureStubInfo*, GPRReg, GPRReg, StringImpl*);
+ MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_ESsiJI, int, StructureStubInfo*, GPRReg, GPRReg, UniquedStringImpl*);
#endif
MacroAssembler::Call callOperation(J_JITOperation_EJIdc, int, GPRReg, const Identifier*);
MacroAssembler::Call callOperation(J_JITOperation_EJJ, int, GPRReg, GPRReg);
MacroAssembler::Call callOperation(V_JITOperation_EJIdJJ, RegisterID, const Identifier*, RegisterID, RegisterID);
#if USE(JSVALUE64)
MacroAssembler::Call callOperation(F_JITOperation_EFJZZ, RegisterID, RegisterID, int32_t, RegisterID);
- MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, StringImpl*);
+ MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, UniquedStringImpl*);
#else
- MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, RegisterID, RegisterID, StringImpl*);
+ MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, RegisterID, RegisterID, UniquedStringImpl*);
#endif
MacroAssembler::Call callOperation(V_JITOperation_EJJJ, RegisterID, RegisterID, RegisterID);
MacroAssembler::Call callOperation(V_JITOperation_EJZJ, RegisterID, int32_t, RegisterID);
return appendCallWithExceptionCheck(operation);
}
-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, RegisterID regOp1, RegisterID regOp2, StringImpl* uid)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, RegisterID regOp1, RegisterID regOp2, UniquedStringImpl* uid)
{
setupArgumentsWithExecState(TrustedImmPtr(stubInfo), regOp1, regOp2, TrustedImmPtr(uid));
return appendCallWithExceptionCheck(operation);
return appendCallWithExceptionCheck(operation);
}
-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(JIT::WithProfileTag, J_JITOperation_ESsiJI operation, int dst, StructureStubInfo* stubInfo, GPRReg arg1, StringImpl* uid)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(JIT::WithProfileTag, J_JITOperation_ESsiJI operation, int dst, StructureStubInfo* stubInfo, GPRReg arg1, UniquedStringImpl* uid)
{
setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetJSValueResultWithProfile(operation, dst);
return appendCallWithExceptionCheckSetJSValueResult(operation, dst);
}
-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(JIT::WithProfileTag, J_JITOperation_ESsiJI operation, int dst, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, StringImpl* uid)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(JIT::WithProfileTag, J_JITOperation_ESsiJI operation, int dst, StructureStubInfo* stubInfo, GPRReg arg1Tag, GPRReg arg1Payload, UniquedStringImpl* uid)
{
setupArgumentsWithExecState(TrustedImmPtr(stubInfo), arg1Payload, arg1Tag, TrustedImmPtr(uid));
return appendCallWithExceptionCheckSetJSValueResultWithProfile(operation, dst);
return appendCallWithExceptionCheck(operation);
}
-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, RegisterID regOp1Tag, RegisterID regOp1Payload, RegisterID regOp2Tag, RegisterID regOp2Payload, StringImpl* uid)
+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, RegisterID regOp1Tag, RegisterID regOp1Payload, RegisterID regOp2Tag, RegisterID regOp2Payload, UniquedStringImpl* uid)
{
setupArgumentsWithExecState(TrustedImmPtr(stubInfo), regOp1Payload, regOp1Tag, regOp2Payload, regOp2Tag, TrustedImmPtr(uid));
return appendCallWithExceptionCheck(operation);
return missingArgCount;
}
-EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo*, EncodedJSValue base, StringImpl* uid)
+EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo*, EncodedJSValue base, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
return JSValue::encode(baseValue.get(exec, ident, slot));
}
-EncodedJSValue JIT_OPERATION operationGetByIdBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, StringImpl* uid)
+EncodedJSValue JIT_OPERATION operationGetByIdBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
return JSValue::encode(hasResult? slot.getValue(exec, ident) : jsUndefined());
}
-EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, StringImpl* uid)
+EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
}
-EncodedJSValue JIT_OPERATION operationInOptimize(ExecState* exec, StructureStubInfo* stubInfo, JSCell* base, StringImpl* key)
+EncodedJSValue JIT_OPERATION operationInOptimize(ExecState* exec, StructureStubInfo* stubInfo, JSCell* base, UniquedStringImpl* key)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
return JSValue::encode(jsBoolean(result));
}
-EncodedJSValue JIT_OPERATION operationIn(ExecState* exec, StructureStubInfo*, JSCell* base, StringImpl* key)
+EncodedJSValue JIT_OPERATION operationIn(ExecState* exec, StructureStubInfo*, JSCell* base, UniquedStringImpl* key)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
return JSValue::encode(jsBoolean(CommonSlowPaths::opIn(exec, JSValue::decode(key), base)));
}
-void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
JSValue::decode(encodedBase).put(exec, ident, JSValue::decode(encodedValue), slot);
}
-void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
JSValue::decode(encodedBase).put(exec, ident, JSValue::decode(encodedValue), slot);
}
-void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
asObject(JSValue::decode(encodedBase))->putDirect(exec->vm(), ident, JSValue::decode(encodedValue), slot);
}
-void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
asObject(JSValue::decode(encodedBase))->putDirect(exec->vm(), ident, JSValue::decode(encodedValue), slot);
}
-void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
stubInfo->seen = true;
}
-void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
stubInfo->seen = true;
}
-void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
stubInfo->seen = true;
}
-void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
stubInfo->seen = true;
}
-void JIT_OPERATION operationPutByIdStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
buildPutByIdList(exec, baseValue, structure, ident, slot, *stubInfo, NotDirect);
}
-void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
buildPutByIdList(exec, baseValue, structure, ident, slot, *stubInfo, NotDirect);
}
-void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
buildPutByIdList(exec, baseObject, structure, ident, slot, *stubInfo, Direct);
}
-void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl* uid)
+void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl* uid)
{
VM* vm = &exec->vm();
NativeCallFrameTracer tracer(vm, exec);
E: ExecState*
F: CallFrame*
G: JSGlobalObject*
- I: StringImpl*
+ I: UniquedStringImpl*
Icf: InlineCallFrame*
Idc: const Identifier*
J: EncodedJSValue
Ssi: StructureStubInfo*
St: Structure*
Symtab: SymbolTable*
+ T: StringImpl*
V: void
Vm: VM*
Ws: WatchpointSet*
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EAapJcpZ)(ExecState*, ArrayAllocationProfile*, const JSValue*, int32_t);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EC)(ExecState*, JSCell*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ECC)(ExecState*, JSCell*, JSCell*);
-typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ECI)(ExecState*, JSCell*, StringImpl*);
+typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ECI)(ExecState*, JSCell*, UniquedStringImpl*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ECJ)(ExecState*, JSCell*, EncodedJSValue);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ECZ)(ExecState*, JSCell*, int32_t);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EDA)(ExecState*, double, JSArray*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EE)(ExecState*, ExecState*);
-typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EI)(ExecState*, StringImpl*);
+typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EI)(ExecState*, UniquedStringImpl*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EJ)(ExecState*, EncodedJSValue);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EJZ)(ExecState*, EncodedJSValue, int32_t);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EJC)(ExecState*, EncodedJSValue, JSCell*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EPc)(ExecState*, Instruction*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EJscC)(ExecState*, JSScope*, JSCell*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESS)(ExecState*, size_t, size_t);
-typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESsiCI)(ExecState*, StructureStubInfo*, JSCell*, StringImpl*);
-typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESsiJI)(ExecState*, StructureStubInfo*, EncodedJSValue, StringImpl*);
+typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESsiCI)(ExecState*, StructureStubInfo*, JSCell*, UniquedStringImpl*);
+typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_ESsiJI)(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZ)(ExecState*, int32_t);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZIcfZ)(ExecState*, int32_t, InlineCallFrame*, int32_t);
typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EZZ)(ExecState*, int32_t, int32_t);
typedef void JIT_OPERATION (*V_JITOperation_ECC)(ExecState*, JSCell*, JSCell*);
typedef void JIT_OPERATION (*V_JITOperation_EZSymtabJ)(ExecState*, int32_t, SymbolTable*, EncodedJSValue);
typedef void JIT_OPERATION (*V_JITOperation_EJ)(ExecState*, EncodedJSValue);
-typedef void JIT_OPERATION (*V_JITOperation_EJCI)(ExecState*, EncodedJSValue, JSCell*, StringImpl*);
+typedef void JIT_OPERATION (*V_JITOperation_EJCI)(ExecState*, EncodedJSValue, JSCell*, UniquedStringImpl*);
typedef void JIT_OPERATION (*V_JITOperation_EJIdJ)(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue);
typedef void JIT_OPERATION (*V_JITOperation_EJIdJJ)(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue, EncodedJSValue);
typedef void JIT_OPERATION (*V_JITOperation_EJJJ)(ExecState*, EncodedJSValue, EncodedJSValue, EncodedJSValue);
typedef void JIT_OPERATION (*V_JITOperation_EOZJ)(ExecState*, JSObject*, int32_t, EncodedJSValue);
typedef void JIT_OPERATION (*V_JITOperation_EPc)(ExecState*, Instruction*);
typedef void JIT_OPERATION (*V_JITOperation_EPZJ)(ExecState*, void*, int32_t, EncodedJSValue);
-typedef void JIT_OPERATION (*V_JITOperation_ESsiJJI)(ExecState*, StructureStubInfo*, EncodedJSValue, EncodedJSValue, StringImpl*);
+typedef void JIT_OPERATION (*V_JITOperation_ESsiJJI)(ExecState*, StructureStubInfo*, EncodedJSValue, EncodedJSValue, UniquedStringImpl*);
typedef void JIT_OPERATION (*V_JITOperation_EWs)(ExecState*, WatchpointSet*);
typedef void JIT_OPERATION (*V_JITOperation_EZ)(ExecState*, int32_t);
typedef void JIT_OPERATION (*V_JITOperation_EZJ)(ExecState*, int32_t, EncodedJSValue);
typedef char* JIT_OPERATION (*P_JITOperation_EStSS)(ExecState*, Structure*, size_t, size_t);
typedef char* JIT_OPERATION (*P_JITOperation_EStZ)(ExecState*, Structure*, int32_t);
typedef char* JIT_OPERATION (*P_JITOperation_EZZ)(ExecState*, int32_t, int32_t);
-typedef StringImpl* JIT_OPERATION (*I_JITOperation_EJss)(ExecState*, JSString*);
+typedef StringImpl* JIT_OPERATION (*T_JITOperation_EJss)(ExecState*, JSString*);
typedef JSString* JIT_OPERATION (*Jss_JITOperation_EZ)(ExecState*, int32_t);
// This method is used to lookup an exception hander, keyed by faultLocation, which is
void JIT_OPERATION operationThrowStackOverflowError(ExecState*, CodeBlock*) WTF_INTERNAL;
int32_t JIT_OPERATION operationCallArityCheck(ExecState*) WTF_INTERNAL;
int32_t JIT_OPERATION operationConstructArityCheck(ExecState*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationGetById(ExecState*, StructureStubInfo*, EncodedJSValue, StringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationGetByIdBuildList(ExecState*, StructureStubInfo*, EncodedJSValue, StringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState*, StructureStubInfo*, EncodedJSValue, StringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationInOptimize(ExecState*, StructureStubInfo*, JSCell*, StringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationIn(ExecState*, StructureStubInfo*, JSCell*, StringImpl*) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetById(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetByIdBuildList(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationInOptimize(ExecState*, StructureStubInfo*, JSCell*, UniquedStringImpl*) WTF_INTERNAL;
+EncodedJSValue JIT_OPERATION operationIn(ExecState*, StructureStubInfo*, JSCell*, UniquedStringImpl*) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGenericIn(ExecState*, JSCell*, EncodedJSValue) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdNonStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdDirectStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
-void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, StringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdNonStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdDirectStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
+void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState*, StructureStubInfo*, EncodedJSValue encodedValue, EncodedJSValue encodedBase, UniquedStringImpl*) WTF_INTERNAL;
void JIT_OPERATION operationReallocateStorageAndFinishPut(ExecState*, JSObject*, Structure*, PropertyOffset, EncodedJSValue) WTF_INTERNAL;
void JIT_OPERATION operationPutByVal(ExecState*, EncodedJSValue, EncodedJSValue, EncodedJSValue) WTF_INTERNAL;
void JIT_OPERATION operationDirectPutByVal(ExecState*, EncodedJSValue, EncodedJSValue, EncodedJSValue) WTF_INTERNAL;
{
}
-void ProgramNode::setClosedVariables(Vector<RefPtr<StringImpl>>&& closedVariables)
+void ProgramNode::setClosedVariables(Vector<RefPtr<UniquedStringImpl>>&& closedVariables)
{
m_closedVariables = WTF::move(closedVariables);
}
};
inline FallThroughMode invert(FallThroughMode fallThroughMode) { return static_cast<FallThroughMode>(!fallThroughMode); }
- typedef HashSet<RefPtr<StringImpl>, IdentifierRepHash> IdentifierSet;
+ typedef HashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> IdentifierSet;
namespace DeclarationStacks {
enum VarAttrs { IsConstant = 1, HasInitializer = 2 };
bool hasCapturedVariables() const { return !!m_capturedVariables.size(); }
size_t capturedVariableCount() const { return m_capturedVariables.size(); }
const IdentifierSet& capturedVariables() const { return m_capturedVariables; }
- bool captures(StringImpl* uid) { return m_capturedVariables.contains(uid); }
+ bool captures(UniquedStringImpl* uid) { return m_capturedVariables.contains(uid); }
bool captures(const Identifier& ident) { return captures(ident.impl()); }
VarStack& varStack() { return m_varStack; }
void emitStatementsBytecode(BytecodeGenerator&, RegisterID* destination);
- void setClosedVariables(Vector<RefPtr<StringImpl>>&&) { }
+ void setClosedVariables(Vector<RefPtr<UniquedStringImpl>>&&) { }
protected:
int m_startLineNumber;
static const bool scopeIsFunction = false;
- void setClosedVariables(Vector<RefPtr<StringImpl>>&&);
- const Vector<RefPtr<StringImpl>>& closedVariables() const { return m_closedVariables; }
+ void setClosedVariables(Vector<RefPtr<UniquedStringImpl>>&&);
+ const Vector<RefPtr<UniquedStringImpl>>& closedVariables() const { return m_closedVariables; }
private:
virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
- Vector<RefPtr<StringImpl>> m_closedVariables;
+ Vector<RefPtr<UniquedStringImpl>> m_closedVariables;
unsigned m_startColumn;
unsigned m_endColumn;
};
features |= ModifiedParameterFeature;
if (modifiedArguments)
features |= ModifiedArgumentsFeature;
- Vector<RefPtr<StringImpl>> closedVariables;
+ Vector<RefPtr<UniquedStringImpl>> closedVariables;
if (m_parsingBuiltin) {
IdentifierSet usedVariables;
scope->getUsedVariables(usedVariables);
template <typename LexerType>
void Parser<LexerType>::didFinishParsing(SourceElements* sourceElements, DeclarationStacks::VarStack& varStack,
- DeclarationStacks::FunctionStack& funcStack, CodeFeatures features, int numConstants, IdentifierSet& capturedVars, const Vector<RefPtr<StringImpl>>&& closedVariables)
+ DeclarationStacks::FunctionStack& funcStack, CodeFeatures features, int numConstants, IdentifierSet& capturedVars, const Vector<RefPtr<UniquedStringImpl>>&& closedVariables)
{
m_sourceElements = sourceElements;
m_varDeclarations.swap(varStack);
const Identifier* ident = m_token.m_data.ident;
ScopeLabelInfo* label = getLabel(ident);
semanticFailIfFalse(label, "Cannot use the undeclared label '", ident->impl(), "'");
- semanticFailIfFalse(label->m_isLoop, "Cannot continue to the label '", ident->impl(), "' as it is not targeting a loop");
+ semanticFailIfFalse(label->isLoop, "Cannot continue to the label '", ident->impl(), "' as it is not targeting a loop");
end = tokenEndPosition();
next();
failIfFalse(autoSemiColon(), "Expected a ';' following a targeted continue statement");
template <> inline bool isEvalNode<EvalNode>() { return true; }
struct ScopeLabelInfo {
- ScopeLabelInfo(StringImpl* ident, bool isLoop)
- : m_ident(ident)
- , m_isLoop(isLoop)
- {
- }
-
- StringImpl* m_ident;
- bool m_isLoop;
+ UniquedStringImpl* uid;
+ bool isLoop;
};
struct Scope {
typedef LabelStack::const_iterator iterator;
iterator end = rhs.m_labels->end();
for (iterator it = rhs.m_labels->begin(); it != end; ++it)
- m_labels->append(ScopeLabelInfo(it->m_ident, it->m_isLoop));
+ m_labels->append(ScopeLabelInfo { it->uid, it->isLoop });
}
}
{
if (!m_labels)
m_labels = std::make_unique<LabelStack>();
- m_labels->append(ScopeLabelInfo(label->impl(), isLoop));
+ m_labels->append(ScopeLabelInfo { label->impl(), isLoop });
}
void popLabel()
if (!m_labels)
return 0;
for (int i = m_labels->size(); i > 0; i--) {
- if (m_labels->at(i - 1).m_ident == label->impl())
+ if (m_labels->at(i - 1).uid == label->impl())
return &m_labels->at(i - 1);
}
return 0;
void declareCallee(const Identifier* ident)
{
- m_declaredVariables.add(ident->string().impl());
+ m_declaredVariables.add(ident->impl());
}
bool declareVariable(const Identifier* ident)
{
bool isValidStrictMode = m_vm->propertyNames->eval != *ident && m_vm->propertyNames->arguments != *ident;
m_isValidStrictMode = m_isValidStrictMode && isValidStrictMode;
- m_declaredVariables.add(ident->string().impl());
+ m_declaredVariables.add(ident->impl());
return isValidStrictMode;
}
bool declareParameter(const Identifier* ident)
{
bool isArguments = m_vm->propertyNames->arguments == *ident;
- bool isValidStrictMode = m_declaredVariables.add(ident->string().impl()).isNewEntry && m_vm->propertyNames->eval != *ident && !isArguments;
+ bool isValidStrictMode = m_declaredVariables.add(ident->impl()).isNewEntry && m_vm->propertyNames->eval != *ident && !isArguments;
m_isValidStrictMode = m_isValidStrictMode && isValidStrictMode;
- m_declaredParameters.add(ident->string().impl());
+ m_declaredParameters.add(ident->impl());
if (isArguments)
m_shadowsArguments = true;
BindingResult declareBoundParameter(const Identifier* ident)
{
bool isArguments = m_vm->propertyNames->arguments == *ident;
- bool newEntry = m_declaredVariables.add(ident->string().impl()).isNewEntry;
+ bool newEntry = m_declaredVariables.add(ident->impl()).isNewEntry;
bool isValidStrictMode = newEntry && m_vm->propertyNames->eval != *ident && !isArguments;
m_isValidStrictMode = m_isValidStrictMode && isValidStrictMode;
void useVariable(const Identifier* ident, bool isEval)
{
m_usesEval |= isEval;
- m_usedVariables.add(ident->string().impl());
+ m_usedVariables.add(ident->impl());
}
void setNeedsFullActivation() { m_needsFullActivation = true; }
bool isValidStrictMode() const { return m_isValidStrictMode; }
bool shadowsArguments() const { return m_shadowsArguments; }
- void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector<RefPtr<StringImpl>>& vector)
+ void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector<RefPtr<UniquedStringImpl>>& vector)
{
IdentifierSet::iterator end = capturedVariables.end();
for (IdentifierSet::iterator it = capturedVariables.begin(); it != end; ++it) {
std::unique_ptr<ParsedNode> parse(ParserError&);
JSTextPosition positionBeforeLastNewline() const { return m_lexer->positionBeforeLastNewline(); }
- Vector<RefPtr<StringImpl>>&& closedVariables() { return WTF::move(m_closedVariables); }
+ Vector<RefPtr<UniquedStringImpl>>&& closedVariables() { return WTF::move(m_closedVariables); }
private:
struct AllowInOverride {
String parseInner();
void didFinishParsing(SourceElements*, DeclarationStacks::VarStack&,
- DeclarationStacks::FunctionStack&, CodeFeatures, int, IdentifierSet&, const Vector<RefPtr<StringImpl>>&&);
+ DeclarationStacks::FunctionStack&, CodeFeatures, int, IdentifierSet&, const Vector<RefPtr<UniquedStringImpl>>&&);
// Used to determine type of error to report.
bool isFunctionBodyNode(ScopeNode*) { return false; }
DeclarationStacks::VarStack m_varDeclarations;
DeclarationStacks::FunctionStack m_funcDeclarations;
IdentifierSet m_capturedVariables;
- Vector<RefPtr<StringImpl>> m_closedVariables;
+ Vector<RefPtr<UniquedStringImpl>> m_closedVariables;
CodeFeatures m_features;
int m_numConstants;
#include "ParserTokens.h"
#include <wtf/Vector.h>
+#include <wtf/text/UniquedStringImpl.h>
#include <wtf/text/WTFString.h>
namespace JSC {
bool needsFullActivation;
bool usesEval;
bool strictMode;
- Vector<RefPtr<StringImpl>> usedVariables;
- Vector<RefPtr<StringImpl>> writtenVariables;
+ Vector<RefPtr<UniquedStringImpl>> usedVariables;
+ Vector<RefPtr<UniquedStringImpl>> writtenVariables;
};
#if COMPILER(MSVC)
unsigned usedVariablesCount;
unsigned writtenVariablesCount;
- StringImpl** usedVariables() const { return const_cast<StringImpl**>(m_variables); }
- StringImpl** writtenVariables() const { return const_cast<StringImpl**>(&m_variables[usedVariablesCount]); }
+ UniquedStringImpl** usedVariables() const { return const_cast<UniquedStringImpl**>(m_variables); }
+ UniquedStringImpl** writtenVariables() const { return const_cast<UniquedStringImpl**>(&m_variables[usedVariablesCount]); }
private:
SourceProviderCacheItem(const SourceProviderCacheItemCreationParameters&);
- StringImpl* m_variables[0];
+ UniquedStringImpl* m_variables[0];
};
inline SourceProviderCacheItem::~SourceProviderCacheItem()
inline std::unique_ptr<SourceProviderCacheItem> SourceProviderCacheItem::create(const SourceProviderCacheItemCreationParameters& parameters)
{
size_t variableCount = parameters.writtenVariables.size() + parameters.usedVariables.size();
- size_t objectSize = sizeof(SourceProviderCacheItem) + sizeof(StringImpl*) * variableCount;
+ size_t objectSize = sizeof(SourceProviderCacheItem) + sizeof(UniquedStringImpl*) * variableCount;
void* slot = fastMalloc(objectSize);
return std::unique_ptr<SourceProviderCacheItem>(new (slot) SourceProviderCacheItem(parameters));
}
{
}
-bool CommonIdentifiers::isPrivateName(StringImpl* uid) const
+bool CommonIdentifiers::isPrivateName(SymbolImpl& uid) const
+{
+ return m_builtinNames->isPrivateName(uid);
+}
+
+bool CommonIdentifiers::isPrivateName(UniquedStringImpl& uid) const
{
return m_builtinNames->isPrivateName(uid);
}
JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(JSC_IDENTIFIER_DECLARE_PRIVATE_WELL_KNOWN_SYMBOL_GLOBAL)
#undef JSC_IDENTIFIER_DECLARE_PRIVATE_WELL_KNOWN_SYMBOL_GLOBAL
- bool isPrivateName(StringImpl* uid) const;
+ bool isPrivateName(SymbolImpl& uid) const;
+ bool isPrivateName(UniquedStringImpl& uid) const;
bool isPrivateName(const Identifier&) const;
const Identifier* getPrivateName(const Identifier&) const;
#include <wtf/ThreadSpecific.h>
#include <wtf/WTFThreadData.h>
#include <wtf/text/CString.h>
+#include <wtf/text/UniquedStringImpl.h>
#include <wtf/text/WTFString.h>
namespace JSC {
Identifier(EmptyIdentifierFlag) : m_string(StringImpl::empty()) { ASSERT(m_string.impl()->isAtomic()); }
const String& string() const { return m_string; }
- AtomicStringImpl* impl() const { return static_cast<AtomicStringImpl*>(m_string.impl()); }
+ UniquedStringImpl* impl() const { return static_cast<UniquedStringImpl*>(m_string.impl()); }
int length() const { return m_string.length(); }
static Identifier fromString(ExecState*, const String&);
static Identifier fromString(ExecState*, const char*);
- static Identifier fromUid(VM*, StringImpl* uid);
- static Identifier fromUid(ExecState*, StringImpl* uid);
+ static Identifier fromUid(VM*, UniquedStringImpl* uid);
+ static Identifier fromUid(ExecState*, UniquedStringImpl* uid);
static Identifier fromUid(const PrivateName&);
static Identifier createLCharFromUChar(VM* vm, const UChar* s, int length) { return Identifier(vm, add8(vm, s, length)); }
Identifier(VM* vm, const String& string) : m_string(add(vm, string.impl())) { ASSERT(m_string.impl()->isAtomic()); }
Identifier(VM* vm, StringImpl* rep) : m_string(add(vm, rep)) { ASSERT(m_string.impl()->isAtomic()); }
- enum UniqueIdentifierFlag { UniqueIdentifier };
- Identifier(UniqueIdentifierFlag, StringImpl* uid) : m_string(uid) { ASSERT(m_string.impl()->isSymbol()); }
+ Identifier(SymbolImpl& uid)
+ : m_string(&uid)
+ {
+ }
template <typename CharType>
ALWAYS_INLINE static uint32_t toUInt32FromCharacters(const CharType* characters, unsigned length, bool& ok);
ALWAYS_INLINE Optional<uint32_t> parseIndex(const Identifier& identifier)
{
- AtomicStringImpl* uid = identifier.impl();
+ auto uid = identifier.impl();
if (!uid)
return Nullopt;
if (uid->isSymbol())
return parseIndex(*uid);
}
-struct IdentifierRepHash : PtrHash<RefPtr<StringImpl>> {
- static unsigned hash(const RefPtr<StringImpl>& key) { return key->existingSymbolAwareHash(); }
- static unsigned hash(StringImpl* key) { return key->existingSymbolAwareHash(); }
+struct IdentifierRepHash : PtrHash<RefPtr<UniquedStringImpl>> {
+ static unsigned hash(const RefPtr<UniquedStringImpl>& key) { return key->existingSymbolAwareHash(); }
+ static unsigned hash(UniquedStringImpl* key) { return key->existingSymbolAwareHash(); }
};
struct IdentifierMapIndexHashTraits : HashTraits<int> {
static const bool emptyValueIsZero = false;
};
-typedef HashMap<RefPtr<StringImpl>, int, IdentifierRepHash, HashTraits<RefPtr<StringImpl>>, IdentifierMapIndexHashTraits> IdentifierMap;
-typedef HashMap<StringImpl*, int, IdentifierRepHash, HashTraits<StringImpl*>, IdentifierMapIndexHashTraits> BorrowedIdentifierMap;
+typedef HashMap<RefPtr<UniquedStringImpl>, int, IdentifierRepHash, HashTraits<RefPtr<UniquedStringImpl>>, IdentifierMapIndexHashTraits> IdentifierMap;
+typedef HashMap<UniquedStringImpl*, int, IdentifierRepHash, HashTraits<UniquedStringImpl*>, IdentifierMapIndexHashTraits> BorrowedIdentifierMap;
} // namespace JSC
return *AtomicStringImpl::addWithStringTableProvider(*vm, r);
}
-inline Identifier Identifier::fromUid(VM* vm, StringImpl* uid)
+inline Identifier Identifier::fromUid(VM* vm, UniquedStringImpl* uid)
{
if (!uid || !uid->isSymbol())
return Identifier(vm, uid);
- return Identifier(UniqueIdentifier, uid);
+ return static_cast<SymbolImpl&>(*uid);
}
-inline Identifier Identifier::fromUid(ExecState* exec, StringImpl* uid)
+inline Identifier Identifier::fromUid(ExecState* exec, UniquedStringImpl* uid)
{
return fromUid(&exec->vm(), uid);
}
inline Identifier Identifier::fromUid(const PrivateName& name)
{
- return Identifier(UniqueIdentifier, name.uid());
+ return *name.uid();
}
template<unsigned charactersCount>
return true;
}
-bool IntendedStructureChain::mayInterceptStoreTo(AtomicStringImpl* uid)
+bool IntendedStructureChain::mayInterceptStoreTo(UniquedStringImpl* uid)
{
for (unsigned i = 0; i < m_vector.size(); ++i) {
unsigned attributes;
bool isStillValid() const;
bool matches(StructureChain*) const;
- bool mayInterceptStoreTo(AtomicStringImpl* uid);
+ bool mayInterceptStoreTo(UniquedStringImpl* uid);
bool isNormalized();
bool takesSlowPathInDFGForImpureProperty();
GlobalPropertyInfo(vm.propertyNames->arrayIterationKindKeyPrivateName, jsNumber(ArrayIterateKey), DontEnum | DontDelete | ReadOnly),
GlobalPropertyInfo(vm.propertyNames->arrayIterationKindValuePrivateName, jsNumber(ArrayIterateValue), DontEnum | DontDelete | ReadOnly),
GlobalPropertyInfo(vm.propertyNames->arrayIterationKindKeyValuePrivateName, jsNumber(ArrayIterateKeyValue), DontEnum | DontDelete | ReadOnly),
- GlobalPropertyInfo(vm.propertyNames->symbolIteratorPrivateName, Symbol::create(vm, vm.propertyNames->iteratorSymbol.impl()), DontEnum | DontDelete | ReadOnly),
+ GlobalPropertyInfo(vm.propertyNames->symbolIteratorPrivateName, Symbol::create(vm, static_cast<SymbolImpl&>(*vm.propertyNames->iteratorSymbol.impl())), DontEnum | DontDelete | ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().ToLengthPrivateName(), privateFuncToLength, DontEnum | DontDelete | ReadOnly),
GlobalPropertyInfo(vm.propertyNames->builtinNames().ToIntegerPrivateName(), privateFuncToInteger, DontEnum | DontDelete | ReadOnly),
};
if (propertyName.isSymbol())
return nullptr;
- StringImpl* uid = propertyName.uid();
+ auto uid = propertyName.uid();
if (!uid)
return nullptr;
typedef HashMap<JSCell*, int32_t, typename WTF::DefaultHash<JSCell*>::Hash, WTF::HashTraits<JSCell*>, IndexTraits> CellKeyedMap;
typedef HashMap<EncodedJSValue, int32_t, EncodedJSValueHash, EncodedJSValueHashTraits, IndexTraits> ValueKeyedMap;
typedef HashMap<StringImpl*, int32_t, typename WTF::DefaultHash<StringImpl*>::Hash, WTF::HashTraits<StringImpl*>, IndexTraits> StringKeyedMap;
- typedef HashMap<AtomicStringImpl*, int32_t, typename WTF::DefaultHash<AtomicStringImpl*>::Hash, WTF::HashTraits<AtomicStringImpl*>, IndexTraits> SymbolKeyedMap;
+ typedef HashMap<SymbolImpl*, int32_t, typename WTF::PtrHash<SymbolImpl*>, WTF::HashTraits<SymbolImpl*>, IndexTraits> SymbolKeyedMap;
size_t capacityInBytes() { return m_capacity * sizeof(Entry); }
JSArray* names = constructEmptyArray(exec, 0);
size_t numProperties = properties.size();
for (size_t i = 0; i < numProperties; i++) {
- AtomicStringImpl* impl = properties[i].impl();
- if (impl->isSymbol() && !exec->propertyNames().isPrivateName(impl))
- names->push(exec, Symbol::create(exec->vm(), impl));
+ auto impl = properties[i].impl();
+ if (impl->isSymbol() && !exec->propertyNames().isPrivateName(*impl))
+ names->push(exec, Symbol::create(exec->vm(), static_cast<SymbolImpl&>(*impl)));
}
return JSValue::encode(names);
}
#ifndef PrivateName_h
#define PrivateName_h
-#include <wtf/text/StringImpl.h>
+#include <wtf/text/SymbolImpl.h>
namespace JSC {
class PrivateName {
public:
PrivateName()
- : m_impl(StringImpl::createSymbolEmpty())
+ : m_uid(StringImpl::createSymbolEmpty())
{
}
- explicit PrivateName(StringImpl* uid)
- : m_impl(uid)
+ explicit PrivateName(SymbolImpl& uid)
+ : m_uid(&uid)
{
- ASSERT(m_impl->isSymbol());
}
- explicit PrivateName(const String& description)
- : m_impl(StringImpl::createSymbol(description.impl()))
+ enum DescriptionTag { Description };
+ explicit PrivateName(DescriptionTag, const String& description)
+ : m_uid(StringImpl::createSymbol(description.impl()))
{
}
- AtomicStringImpl* uid() const { return static_cast<AtomicStringImpl*>(m_impl.get()); }
+ SymbolImpl* uid() const { return m_uid.get(); }
bool operator==(const PrivateName& other) const { return uid() == other.uid(); }
bool operator!=(const PrivateName& other) const { return uid() != other.uid(); }
private:
- RefPtr<StringImpl> m_impl;
+ RefPtr<SymbolImpl> m_uid;
};
}
#define DUMP_PROPERTYMAP_STATS 0
#define DUMP_PROPERTYMAP_COLLISIONS 0
-#define PROPERTY_MAP_DELETED_ENTRY_KEY ((AtomicStringImpl*)1)
+#define PROPERTY_MAP_DELETED_ENTRY_KEY ((UniquedStringImpl*)1)
namespace JSC {
return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info());
}
- typedef AtomicStringImpl* KeyType;
+ typedef UniquedStringImpl* KeyType;
typedef PropertyMapEntry ValueType;
// The in order iterator provides overloaded * and -> to access the Value at the current position.
class PropertyName {
public:
- PropertyName(AtomicStringImpl* propertyName)
+ PropertyName(UniquedStringImpl* propertyName)
: m_impl(propertyName)
{
- ASSERT(!m_impl || m_impl->isAtomic() || m_impl->isSymbol());
}
PropertyName(const Identifier& propertyName)
- : PropertyName(static_cast<AtomicStringImpl*>(propertyName.impl()))
+ : PropertyName(propertyName.impl())
{
}
PropertyName(const PrivateName& propertyName)
- : m_impl(static_cast<AtomicStringImpl*>(propertyName.uid()))
+ : m_impl(propertyName.uid())
{
ASSERT(m_impl);
ASSERT(m_impl->isSymbol());
return m_impl && m_impl->isSymbol();
}
- AtomicStringImpl* uid() const
+ UniquedStringImpl* uid() const
{
return m_impl;
}
AtomicStringImpl* publicName() const
{
- return (!m_impl || m_impl->isSymbol()) ? nullptr : m_impl;
+ return (!m_impl || m_impl->isSymbol()) ? nullptr : static_cast<AtomicStringImpl*>(m_impl);
}
void dump(PrintStream& out) const
}
private:
- AtomicStringImpl* m_impl;
+ UniquedStringImpl* m_impl;
};
inline bool operator==(PropertyName a, const Identifier& b)
ALWAYS_INLINE Optional<uint32_t> parseIndex(PropertyName propertyName)
{
- AtomicStringImpl* uid = propertyName.uid();
+ auto uid = propertyName.uid();
if (!uid)
return Nullopt;
if (uid->isSymbol())
}
void add(const Identifier&);
- void add(AtomicStringImpl*);
- void addKnownUnique(AtomicStringImpl*);
+ void add(UniquedStringImpl*);
+ void addKnownUnique(UniquedStringImpl*);
Identifier& operator[](unsigned i) { return m_data->propertyNameVector()[i]; }
const Identifier& operator[](unsigned i) const { return m_data->propertyNameVector()[i]; }
private:
RefPtr<PropertyNameArrayData> m_data;
- HashSet<AtomicStringImpl*> m_set;
+ HashSet<UniquedStringImpl*> m_set;
VM* m_vm;
};
add(identifier.impl());
}
-ALWAYS_INLINE void PropertyNameArray::addKnownUnique(AtomicStringImpl* identifier)
+ALWAYS_INLINE void PropertyNameArray::addKnownUnique(UniquedStringImpl* identifier)
{
m_data->propertyNameVector().append(Identifier::fromUid(m_vm, identifier));
}
-ALWAYS_INLINE void PropertyNameArray::add(AtomicStringImpl* identifier)
+ALWAYS_INLINE void PropertyNameArray::add(UniquedStringImpl* identifier)
{
static const unsigned setThreshold = 20;
static HashSet<Structure*>& liveStructureSet = *(new HashSet<Structure*>);
#endif
-bool StructureTransitionTable::contains(AtomicStringImpl* rep, unsigned attributes) const
+bool StructureTransitionTable::contains(UniquedStringImpl* rep, unsigned attributes) const
{
if (isUsingSingleSlot()) {
Structure* transition = singleTransition();
return map()->get(std::make_pair(rep, attributes));
}
-inline Structure* StructureTransitionTable::get(AtomicStringImpl* rep, unsigned attributes) const
+Structure* StructureTransitionTable::get(UniquedStringImpl* rep, unsigned attributes) const
{
if (isUsingSingleSlot()) {
Structure* transition = singleTransition();
return map()->get(std::make_pair(rep, attributes));
}
-inline void StructureTransitionTable::add(VM& vm, Structure* structure)
+void StructureTransitionTable::add(VM& vm, Structure* structure)
{
if (isUsingSingleSlot()) {
Structure* existingTransition = singleTransition();
checkOffsetConsistency();
}
-Structure* Structure::addPropertyTransitionToExistingStructureImpl(Structure* structure, AtomicStringImpl* uid, unsigned attributes, PropertyOffset& offset)
+Structure* Structure::addPropertyTransitionToExistingStructureImpl(Structure* structure, UniquedStringImpl* uid, unsigned attributes, PropertyOffset& offset)
{
ASSERT(!structure->isDictionary());
ASSERT(structure->isObject());
return addPropertyTransitionToExistingStructureImpl(structure, propertyName.uid(), attributes, offset);
}
-Structure* Structure::addPropertyTransitionToExistingStructureConcurrently(Structure* structure, AtomicStringImpl* uid, unsigned attributes, PropertyOffset& offset)
+Structure* Structure::addPropertyTransitionToExistingStructureConcurrently(Structure* structure, UniquedStringImpl* uid, unsigned attributes, PropertyOffset& offset)
{
ConcurrentJITLocker locker(structure->m_lock);
return addPropertyTransitionToExistingStructureImpl(structure, uid, attributes, offset);
return PropertyTable::create(vm, numberOfSlotsForLastOffset(m_offset, m_inlineCapacity));
}
-PropertyOffset Structure::getConcurrently(AtomicStringImpl* uid, unsigned& attributes)
+PropertyOffset Structure::getConcurrently(UniquedStringImpl* uid, unsigned& attributes)
{
PropertyOffset result = invalidOffset;
if (attributes & DontEnum)
setHasNonEnumerableProperties(true);
- AtomicStringImpl* rep = propertyName.uid();
+ auto rep = propertyName.uid();
if (!propertyTable())
createPropertyMap(locker, vm);
checkConsistency();
- AtomicStringImpl* rep = propertyName.uid();
+ auto rep = propertyName.uid();
if (!propertyTable())
return invalidOffset;
PropertyTable::iterator iter = table->begin();
PropertyTable::iterator end = table->end();
for (; iter != end; ++iter)
- curShape->addProperty(iter->key);
+ curShape->addProperty(*iter->key);
structure->m_lock.unlock();
}
for (unsigned i = structures.size(); i--;) {
Structure* structure = structures[i];
if (structure->m_nameInPrevious)
- curShape->addProperty(structure->m_nameInPrevious.get());
+ curShape->addProperty(*structure->m_nameInPrevious);
}
if (JSObject* curObject = curValue.getObject())
#include <wtf/PassRefPtr.h>
#include <wtf/PrintStream.h>
#include <wtf/RefCounted.h>
-#include <wtf/text/AtomicStringImpl.h>
+
+namespace WTF {
+
+class UniquedStringImpl;
+
+} // namespace WTF
namespace JSC {
static const unsigned outOfLineGrowthFactor = 2;
struct PropertyMapEntry {
- AtomicStringImpl* key;
+ UniquedStringImpl* key;
PropertyOffset offset;
unsigned attributes;
{
}
- PropertyMapEntry(AtomicStringImpl* key, PropertyOffset offset, unsigned attributes)
+ PropertyMapEntry(UniquedStringImpl* key, PropertyOffset offset, unsigned attributes)
: key(key)
, offset(offset)
, attributes(attributes)
static void dumpStatistics();
JS_EXPORT_PRIVATE static Structure* addPropertyTransition(VM&, Structure*, PropertyName, unsigned attributes, PropertyOffset&, PutPropertySlot::Context = PutPropertySlot::UnknownContext);
- static Structure* addPropertyTransitionToExistingStructureConcurrently(Structure*, AtomicStringImpl* uid, unsigned attributes, PropertyOffset&);
+ static Structure* addPropertyTransitionToExistingStructureConcurrently(Structure*, UniquedStringImpl* uid, unsigned attributes, PropertyOffset&);
JS_EXPORT_PRIVATE static Structure* addPropertyTransitionToExistingStructure(Structure*, PropertyName, unsigned attributes, PropertyOffset&);
static Structure* removePropertyTransition(VM&, Structure*, PropertyName, PropertyOffset&);
JS_EXPORT_PRIVATE static Structure* changePrototypeTransition(VM&, Structure*, JSValue prototype);
template<typename Functor>
void forEachPropertyConcurrently(const Functor&);
- PropertyOffset getConcurrently(AtomicStringImpl* uid);
- PropertyOffset getConcurrently(AtomicStringImpl* uid, unsigned& attributes);
+ PropertyOffset getConcurrently(UniquedStringImpl* uid);
+ PropertyOffset getConcurrently(UniquedStringImpl* uid, unsigned& attributes);
Vector<PropertyMapEntry> getPropertiesConcurrently();
static Structure* create(VM&, Structure*);
- static Structure* addPropertyTransitionToExistingStructureImpl(Structure*, AtomicStringImpl* uid, unsigned attributes, PropertyOffset&);
+ static Structure* addPropertyTransitionToExistingStructureImpl(Structure*, UniquedStringImpl* uid, unsigned attributes, PropertyOffset&);
// This will return the structure that has a usable property table, that property table,
// and the list of structures that we visited before we got to it. If it returns a
WriteBarrier<JSCell> m_previousOrRareData;
- RefPtr<AtomicStringImpl> m_nameInPrevious;
+ RefPtr<UniquedStringImpl> m_nameInPrevious;
const ClassInfo* m_classInfo;
}
}
-inline PropertyOffset Structure::getConcurrently(AtomicStringImpl* uid)
+inline PropertyOffset Structure::getConcurrently(UniquedStringImpl* uid)
{
unsigned attributesIgnored;
return getConcurrently(uid, attributesIgnored);
#include "IndexingType.h"
#include "WeakGCMap.h"
#include <wtf/HashFunctions.h>
-#include <wtf/text/AtomicStringImpl.h>
+#include <wtf/text/UniquedStringImpl.h>
namespace JSC {
struct Hash {
- typedef std::pair<AtomicStringImpl*, unsigned> Key;
+ typedef std::pair<UniquedStringImpl*, unsigned> Key;
static unsigned hash(const Key& p)
{
- return PtrHash<AtomicStringImpl*>::hash(p.first) + p.second;
+ return PtrHash<UniquedStringImpl*>::hash(p.first) + p.second;
}
static bool equal(const Key& a, const Key& b)
WeakSet::deallocate(impl);
}
- inline void add(VM&, Structure*);
- inline bool contains(AtomicStringImpl* rep, unsigned attributes) const;
- inline Structure* get(AtomicStringImpl* rep, unsigned attributes) const;
+ void add(VM&, Structure*);
+ bool contains(UniquedStringImpl*, unsigned attributes) const;
+ Structure* get(UniquedStringImpl*, unsigned attributes) const;
private:
bool isUsingSingleSlot() const
Symbol::Symbol(VM& vm, const String& string)
: Base(vm, vm.symbolStructure.get())
- , m_privateName(string)
+ , m_privateName(PrivateName::Description, string)
{
}
-Symbol::Symbol(VM& vm, AtomicStringImpl* uid)
+Symbol::Symbol(VM& vm, SymbolImpl& uid)
: Base(vm, vm.symbolStructure.get())
, m_privateName(uid)
{
return symbol;
}
- static Symbol* create(VM& vm, AtomicStringImpl* uid)
+ static Symbol* create(VM& vm, SymbolImpl& uid)
{
Symbol* symbol = new (NotNull, allocateCell<Symbol>(vm.heap)) Symbol(vm, uid);
symbol->finishCreation(vm);
Symbol(VM&);
Symbol(VM&, const String&);
- Symbol(VM&, AtomicStringImpl* uid);
+ Symbol(VM&, SymbolImpl& uid);
void finishCreation(VM& vm)
{
}
#define INITIALIZE_WELL_KNOWN_SYMBOLS(name) \
- putDirectWithoutTransition(vm, Identifier::fromString(&vm, #name), Symbol::create(vm, vm.propertyNames->name##Symbol.impl()), DontEnum | DontDelete | ReadOnly);
+ putDirectWithoutTransition(vm, Identifier::fromString(&vm, #name), Symbol::create(vm, static_cast<SymbolImpl&>(*vm.propertyNames->name##Symbol.impl())), DontEnum | DontDelete | ReadOnly);
void SymbolConstructor::finishCreation(VM& vm, SymbolPrototype* prototype)
{
if (exec->hadException())
return JSValue::encode(jsUndefined());
- Ref<StringImpl> uid = exec->vm().symbolRegistry().symbolForKey(string);
- return JSValue::encode(Symbol::create(exec->vm(), static_cast<AtomicStringImpl*>(&uid.get())));
+ return JSValue::encode(Symbol::create(exec->vm(), exec->vm().symbolRegistry().symbolForKey(string)));
}
EncodedJSValue JSC_HOST_CALL symbolConstructorKeyFor(ExecState* exec)
if (!symbolValue.isSymbol())
return JSValue::encode(throwTypeError(exec));
- AtomicStringImpl* uid = asSymbol(symbolValue)->privateName().uid();
- ASSERT(uid->isSymbol());
+ SymbolImpl* uid = asSymbol(symbolValue)->privateName().uid();
if (!uid->symbolRegistry())
return JSValue::encode(jsUndefined());
ASSERT(uid->symbolRegistry() == &exec->vm().symbolRegistry());
- return JSValue::encode(jsString(exec, exec->vm().symbolRegistry().keyForSymbol(uid)));
+ return JSValue::encode(jsString(exec, exec->vm().symbolRegistry().keyForSymbol(*uid)));
}
} // namespace JSC
}
}
-GlobalVariableID SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&, StringImpl* key, VM& vm)
+GlobalVariableID SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&, UniquedStringImpl* key, VM& vm)
{
RELEASE_ASSERT(m_typeProfilingRareData);
return globalTypeSetForVariable(locker, iter->value.get(), vm);
}
-RefPtr<TypeSet> SymbolTable::globalTypeSetForVariable(const ConcurrentJITLocker& locker, StringImpl* key, VM& vm)
+RefPtr<TypeSet> SymbolTable::globalTypeSetForVariable(const ConcurrentJITLocker& locker, UniquedStringImpl* key, VM& vm)
{
RELEASE_ASSERT(m_typeProfilingRareData);
#include "Watchpoint.h"
#include <memory>
#include <wtf/HashTraits.h>
-#include <wtf/text/StringImpl.h>
+#include <wtf/text/UniquedStringImpl.h>
namespace JSC {
typedef JSCell Base;
static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
- typedef HashMap<RefPtr<StringImpl>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<StringImpl>>, SymbolTableIndexHashTraits> Map;
- typedef HashMap<RefPtr<StringImpl>, GlobalVariableID, IdentifierRepHash> UniqueIDMap;
- typedef HashMap<RefPtr<StringImpl>, RefPtr<TypeSet>, IdentifierRepHash> UniqueTypeSetMap;
- typedef HashMap<VarOffset, RefPtr<StringImpl>> OffsetToVariableMap;
+ typedef HashMap<RefPtr<UniquedStringImpl>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<UniquedStringImpl>>, SymbolTableIndexHashTraits> Map;
+ typedef HashMap<RefPtr<UniquedStringImpl>, GlobalVariableID, IdentifierRepHash> UniqueIDMap;
+ typedef HashMap<RefPtr<UniquedStringImpl>, RefPtr<TypeSet>, IdentifierRepHash> UniqueTypeSetMap;
+ typedef HashMap<VarOffset, RefPtr<UniquedStringImpl>> OffsetToVariableMap;
typedef Vector<SymbolTableEntry*> LocalToEntryVec;
static SymbolTable* create(VM& vm)
}
// You must hold the lock until after you're done with the iterator.
- Map::iterator find(const ConcurrentJITLocker&, StringImpl* key)
+ Map::iterator find(const ConcurrentJITLocker&, UniquedStringImpl* key)
{
return m_map.find(key);
}
- Map::iterator find(const GCSafeConcurrentJITLocker&, StringImpl* key)
+ Map::iterator find(const GCSafeConcurrentJITLocker&, UniquedStringImpl* key)
{
return m_map.find(key);
}
- SymbolTableEntry get(const ConcurrentJITLocker&, StringImpl* key)
+ SymbolTableEntry get(const ConcurrentJITLocker&, UniquedStringImpl* key)
{
return m_map.get(key);
}
- SymbolTableEntry get(StringImpl* key)
+ SymbolTableEntry get(UniquedStringImpl* key)
{
ConcurrentJITLocker locker(m_lock);
return get(locker, key);
}
- SymbolTableEntry inlineGet(const ConcurrentJITLocker&, StringImpl* key)
+ SymbolTableEntry inlineGet(const ConcurrentJITLocker&, UniquedStringImpl* key)
{
return m_map.inlineGet(key);
}
- SymbolTableEntry inlineGet(StringImpl* key)
+ SymbolTableEntry inlineGet(UniquedStringImpl* key)
{
ConcurrentJITLocker locker(m_lock);
return inlineGet(locker, key);
return takeNextScopeOffset(locker);
}
- void add(const ConcurrentJITLocker&, StringImpl* key, const SymbolTableEntry& entry)
+ void add(const ConcurrentJITLocker&, UniquedStringImpl* key, const SymbolTableEntry& entry)
{
RELEASE_ASSERT(!m_localToEntry);
didUseVarOffset(entry.varOffset());
ASSERT_UNUSED(result, result.isNewEntry);
}
- void add(StringImpl* key, const SymbolTableEntry& entry)
+ void add(UniquedStringImpl* key, const SymbolTableEntry& entry)
{
ConcurrentJITLocker locker(m_lock);
add(locker, key, entry);
}
- void set(const ConcurrentJITLocker&, StringImpl* key, const SymbolTableEntry& entry)
+ void set(const ConcurrentJITLocker&, UniquedStringImpl* key, const SymbolTableEntry& entry)
{
RELEASE_ASSERT(!m_localToEntry);
didUseVarOffset(entry.varOffset());
m_map.set(key, entry);
}
- void set(StringImpl* key, const SymbolTableEntry& entry)
+ void set(UniquedStringImpl* key, const SymbolTableEntry& entry)
{
ConcurrentJITLocker locker(m_lock);
set(locker, key, entry);
}
- bool contains(const ConcurrentJITLocker&, StringImpl* key)
+ bool contains(const ConcurrentJITLocker&, UniquedStringImpl* key)
{
return m_map.contains(key);
}
- bool contains(StringImpl* key)
+ bool contains(UniquedStringImpl* key)
{
ConcurrentJITLocker locker(m_lock);
return contains(locker, key);
const LocalToEntryVec& localToEntry(const ConcurrentJITLocker&);
SymbolTableEntry* entryFor(const ConcurrentJITLocker&, ScopeOffset);
- GlobalVariableID uniqueIDForVariable(const ConcurrentJITLocker&, StringImpl* key, VM&);
+ GlobalVariableID uniqueIDForVariable(const ConcurrentJITLocker&, UniquedStringImpl* key, VM&);
GlobalVariableID uniqueIDForOffset(const ConcurrentJITLocker&, VarOffset, VM&);
RefPtr<TypeSet> globalTypeSetForOffset(const ConcurrentJITLocker&, VarOffset, VM&);
- RefPtr<TypeSet> globalTypeSetForVariable(const ConcurrentJITLocker&, StringImpl* key, VM&);
+ RefPtr<TypeSet> globalTypeSetForVariable(const ConcurrentJITLocker&, UniquedStringImpl* key, VM&);
bool usesNonStrictEval() { return m_usesNonStrictEval; }
void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; }
m_final = true;
}
-void StructureShape::addProperty(RefPtr<StringImpl> impl)
+void StructureShape::addProperty(UniquedStringImpl& uid)
{
ASSERT(!m_final);
- m_fields.add(impl);
+ m_fields.add(&uid);
}
-String StructureShape::propertyHash()
+String StructureShape::propertyHash()
{
ASSERT(m_final);
if (m_propertyHash)
builder.append(':');
builder.append(m_constructorName);
builder.append(':');
-
- for (auto iter = m_fields.begin(), end = m_fields.end(); iter != end; ++iter) {
- String property = iter->get();
+ for (auto& key : m_fields) {
+ String property = key.get();
property.replace(":", "\\:"); // Ensure that hash({"foo:", "bar"}) != hash({"foo", ":bar"}) because we're using colons as a separator and colons are legal characters in field names in JS.
builder.append(property);
}
static PassRefPtr<StructureShape> create() { return adoptRef(new StructureShape); }
String propertyHash();
void markAsFinal();
- void addProperty(RefPtr<StringImpl>);
+ void addProperty(UniquedStringImpl&);
String stringRepresentation();
String toJSONString() const;
Ref<Inspector::Protocol::Runtime::StructureDescription> inspectorRepresentation();
static PassRefPtr<StructureShape> merge(const PassRefPtr<StructureShape>, const PassRefPtr<StructureShape>);
bool hasSamePrototypeChain(PassRefPtr<StructureShape>);
- HashSet<RefPtr<StringImpl>> m_fields;
- HashSet<RefPtr<StringImpl>> m_optionalFields;
+ HashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> m_fields;
+ HashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> m_optionalFields;
RefPtr<StructureShape> m_proto;
std::unique_ptr<String> m_propertyHash;
String m_constructorName;
+2015-05-23 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=144848
+
+ Reviewed by Darin Adler.
+
+ 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.
+
+ 2. SymbolImpl
+ It's derived class from UniquedStringImpl. Only symbol strings can become this.
+ It ensures the given StringImpl is symbol in compile time.
+
+ 3. 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.
+
2015-05-20 Zan Dobersek <zdobersek@igalia.com>
[GTK] Move MainThreadGtk, RunLoopGtk, WorkQueueGtk under Source/WTF/wtf/glib/
<ClInclude Include="..\wtf\text\StringImpl.h" />
<ClInclude Include="..\wtf\text\StringOperators.h" />
<ClInclude Include="..\wtf\text\StringView.h" />
+ <ClInclude Include="..\wtf\text\SymbolImpl.h" />
<ClInclude Include="..\wtf\text\SymbolRegistry.h" />
+ <ClInclude Include="..\wtf\text\UniquedStringImpl.h" />
<ClInclude Include="..\wtf\text\WTFString.h" />
<ClInclude Include="..\wtf\Threading.h" />
<ClInclude Include="..\wtf\ThreadingPrimitives.h" />
<ClInclude Include="..\wtf\text\StringView.h">
<Filter>wtf</Filter>
</ClInclude>
+ <ClInclude Include="..\wtf\text\SymbolImpl.h">
+ <Filter>text</Filter>
+ </ClInclude>
<ClInclude Include="..\wtf\text\SymbolRegistry.h">
<Filter>text</Filter>
</ClInclude>
+ <ClInclude Include="..\wtf\text\UniquedStringImpl.h">
+ <Filter>text</Filter>
+ </ClInclude>
<ClInclude Include="..\wtf\text\WTFString.h">
<Filter>text</Filter>
</ClInclude>
70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */; };
70A993FF1AD7151300FA615B /* SymbolRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 70A993FD1AD7151300FA615B /* SymbolRegistry.h */; };
70ECA60D1B02426800449739 /* AtomicStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70ECA60A1B02426800449739 /* AtomicStringImpl.cpp */; };
+ 70ECA60E1B02426800449739 /* SymbolImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 70ECA60B1B02426800449739 /* SymbolImpl.h */; };
+ 70ECA60F1B02426800449739 /* UniquedStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 70ECA60C1B02426800449739 /* UniquedStringImpl.h */; };
7CBBA07419BB7FDC00BBF025 /* OSObjectPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */; };
7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; };
7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; };
70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolRegistry.cpp; sourceTree = "<group>"; };
70A993FD1AD7151300FA615B /* SymbolRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolRegistry.h; sourceTree = "<group>"; };
70ECA60A1B02426800449739 /* AtomicStringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicStringImpl.cpp; sourceTree = "<group>"; };
+ 70ECA60B1B02426800449739 /* SymbolImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolImpl.h; sourceTree = "<group>"; };
+ 70ECA60C1B02426800449739 /* UniquedStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniquedStringImpl.h; sourceTree = "<group>"; };
7CBBA07319BB7FDC00BBF025 /* OSObjectPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSObjectPtr.h; sourceTree = "<group>"; };
7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = "<group>"; };
7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = "<group>"; };
93F1993D19D7958D00C2390B /* StringView.cpp */,
A8A4732A151A825B004123FF /* StringOperators.h */,
A8A4732B151A825B004123FF /* StringStatics.cpp */,
+ 70ECA60B1B02426800449739 /* SymbolImpl.h */,
70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */,
70A993FD1AD7151300FA615B /* SymbolRegistry.h */,
A8A4732C151A825B004123FF /* TextPosition.h */,
+ 70ECA60C1B02426800449739 /* UniquedStringImpl.h */,
A8A4732D151A825B004123FF /* WTFString.cpp */,
A8A4732E151A825B004123FF /* WTFString.h */,
);
A8A47438151A825B004123FF /* AtomicStringImpl.h in Headers */,
9BD8F40B176C2B470002D865 /* AtomicStringTable.h in Headers */,
1469419C16EAB10A0024E146 /* AutodrainedPool.h in Headers */,
+ 70ECA60F1B02426800449739 /* UniquedStringImpl.h in Headers */,
8134013915B092FD001FF0B8 /* Base64.h in Headers */,
A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */,
A8A473AB151A825B004123FF /* bignum.h in Headers */,
1A6BB769162F300500DD16DB /* StreamBuffer.h in Headers */,
A8A4743B151A825B004123FF /* StringBuffer.h in Headers */,
A8A4743D151A825B004123FF /* StringBuilder.h in Headers */,
+ 70ECA60E1B02426800449739 /* SymbolImpl.h in Headers */,
A8A4743E151A825B004123FF /* StringConcatenate.h in Headers */,
FE91E8811AB2A0200099895F /* SpinLock.h in Headers */,
A8A4742C151A825B004123FF /* StringExtras.h in Headers */,
text/StringHash.h
text/StringImpl.h
text/StringView.h
+ text/SymbolImpl.h
text/SymbolRegistry.h
+ text/UniquedStringImpl.h
text/WTFString.h
threads/BinarySemaphore.h
#include <stdio.h>
#include <wtf/text/CString.h>
+#include <wtf/text/UniquedStringImpl.h>
#include <wtf/text/WTFString.h>
namespace WTF {
class CString;
class String;
class StringImpl;
+class UniquedStringImpl;
class PrintStream {
WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(PrintStream);
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const String&);
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, const StringImpl*);
inline void printInternal(PrintStream& out, const AtomicStringImpl* value) { printInternal(out, bitwise_cast<const StringImpl*>(value)); }
+inline void printInternal(PrintStream& out, const UniquedStringImpl* value) { printInternal(out, bitwise_cast<const StringImpl*>(value)); }
inline void printInternal(PrintStream& out, char* value) { printInternal(out, static_cast<const char*>(value)); }
inline void printInternal(PrintStream& out, CString& value) { printInternal(out, static_cast<const CString&>(value)); }
inline void printInternal(PrintStream& out, String& value) { printInternal(out, static_cast<const String&>(value)); }
inline void printInternal(PrintStream& out, StringImpl* value) { printInternal(out, static_cast<const StringImpl*>(value)); }
inline void printInternal(PrintStream& out, AtomicStringImpl* value) { printInternal(out, static_cast<const AtomicStringImpl*>(value)); }
+inline void printInternal(PrintStream& out, UniquedStringImpl* value) { printInternal(out, static_cast<const UniquedStringImpl*>(value)); }
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, bool);
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, signed char); // NOTE: this prints as a number, not as a character; use CharacterDump if you want the character
WTF_EXPORT_PRIVATE void printInternal(PrintStream&, unsigned char); // NOTE: see above.
ATOMICSTRING_CONVERSION AtomicString(const String&);
AtomicString(StringImpl* baseString, unsigned start, unsigned length);
+ // FIXME: AtomicString doesn’t always have AtomicStringImpl, so one of those two names needs to change..
+ AtomicString(UniquedStringImpl* uid);
+
enum ConstructFromLiteralTag { ConstructFromLiteral };
AtomicString(const char* characters, unsigned length, ConstructFromLiteralTag)
: m_string(AtomicStringImpl::addLiteral(characters, length))
{
}
+inline AtomicString::AtomicString(UniquedStringImpl* uid)
+ : m_string(uid)
+{
+}
+
#if USE(CF)
inline AtomicString::AtomicString(CFStringRef s)
: m_string(AtomicStringImpl::add(s))
#ifndef AtomicStringImpl_h
#define AtomicStringImpl_h
-#include <wtf/text/StringImpl.h>
+#include <wtf/text/UniquedStringImpl.h>
namespace WTF {
class AtomicStringTable;
-class AtomicStringImpl : public StringImpl {
+class AtomicStringImpl : public UniquedStringImpl {
public:
static AtomicStringImpl* lookUp(LChar* characters, unsigned length)
{
#include <wtf/WTFThreadData.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringView.h>
+#include <wtf/text/SymbolImpl.h>
#include <wtf/text/SymbolRegistry.h>
#include <wtf/unicode/CharacterNames.h>
#include <wtf/unicode/UTF8.h>
AtomicStringImpl::remove(static_cast<AtomicStringImpl*>(this));
if (isSymbol() && symbolRegistry())
- symbolRegistry()->remove(this);
+ symbolRegistry()->remove(static_cast<SymbolImpl&>(*this));
BufferOwnership ownership = bufferOwnership();
return create(string, length);
}
-Ref<StringImpl> StringImpl::createSymbol(PassRefPtr<StringImpl> rep)
+Ref<SymbolImpl> StringImpl::createSymbol(PassRefPtr<StringImpl> rep)
{
StringImpl* ownerRep = (rep->bufferOwnership() == BufferSubstring) ? rep->substringBuffer() : rep.get();
// 4. the placeholder for symbol aware hash value (allocated size is pointer size, but only 4 bytes are used)
StringImpl* stringImpl = static_cast<StringImpl*>(fastMalloc(allocationSize<StringImpl*>(3)));
if (rep->is8Bit())
- return adoptRef(*new (NotNull, stringImpl) StringImpl(CreateSymbol, rep->m_data8, rep->length(), ownerRep));
- return adoptRef(*new (NotNull, stringImpl) StringImpl(CreateSymbol, rep->m_data16, rep->length(), ownerRep));
+ return adoptRef(static_cast<SymbolImpl&>(*new (NotNull, stringImpl) StringImpl(CreateSymbol, rep->m_data8, rep->length(), ownerRep)));
+ return adoptRef(static_cast<SymbolImpl&>(*new (NotNull, stringImpl) StringImpl(CreateSymbol, rep->m_data16, rep->length(), ownerRep)));
}
-Ref<StringImpl> StringImpl::createSymbolEmpty()
+Ref<SymbolImpl> StringImpl::createSymbolEmpty()
{
return createSymbol(empty());
}
struct SubstringTranslator;
struct UCharBufferTranslator;
template<typename> class RetainPtr;
+class SymbolImpl;
class SymbolRegistry;
enum TextCaseSensitivity {
return constructInternal<T>(resultImpl, length);
}
- WTF_EXPORT_STRING_API static Ref<StringImpl> createSymbolEmpty();
- WTF_EXPORT_STRING_API static Ref<StringImpl> createSymbol(PassRefPtr<StringImpl> rep);
+ WTF_EXPORT_STRING_API static Ref<SymbolImpl> createSymbolEmpty();
+ WTF_EXPORT_STRING_API static Ref<SymbolImpl> createSymbol(PassRefPtr<StringImpl> rep);
// Reallocate the StringImpl. The originalString must be only owned by the PassRefPtr,
// and the buffer ownership must be BufferInternal. Just like the input pointer of realloc(),
--- /dev/null
+/*
+ * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SymbolImpl_h
+#define SymbolImpl_h
+
+#include <wtf/text/UniquedStringImpl.h>
+
+namespace WTF {
+
+// SymbolImpl is used to represent the symbol string impl.
+// It is uniqued string impl, but is not registered in Atomic String tables, so it's not atomic.
+class SymbolImpl : public UniquedStringImpl {
+private:
+ SymbolImpl() = delete;
+};
+
+#if !ASSERT_DISABLED
+// SymbolImpls created from StaticASCIILiteral will ASSERT
+// in the generic ValueCheck<T>::checkConsistency
+// as they are not allocated by fastMalloc.
+// We don't currently have any way to detect that case
+// so we ignore the consistency check for all SymbolImpls*.
+template<> struct
+ValueCheck<SymbolImpl*> {
+ static void checkConsistency(const SymbolImpl*) { }
+};
+
+template<> struct
+ValueCheck<const SymbolImpl*> {
+ static void checkConsistency(const SymbolImpl*) { }
+};
+#endif
+
+} // namespace WTF
+
+using WTF::SymbolImpl;
+
+#endif // SymbolImpl_h
key.impl()->symbolRegistry() = nullptr;
}
-Ref<StringImpl> SymbolRegistry::symbolForKey(const String& rep)
+Ref<SymbolImpl> SymbolRegistry::symbolForKey(const String& rep)
{
auto addResult = m_table.add(SymbolRegistryKey(rep.impl()));
if (!addResult.isNewEntry)
- return *addResult.iterator->impl();
+ return *static_cast<SymbolImpl*>(addResult.iterator->impl());
- Ref<StringImpl> symbol = StringImpl::createSymbol(rep.impl());
+ Ref<SymbolImpl> symbol = StringImpl::createSymbol(rep.impl());
symbol->symbolRegistry() = this;
*addResult.iterator = SymbolRegistryKey(&symbol.get());
return symbol;
}
-String SymbolRegistry::keyForSymbol(StringImpl* uid)
+String SymbolRegistry::keyForSymbol(SymbolImpl& uid)
{
- ASSERT(uid->isSymbol());
- ASSERT(uid->symbolRegistry() == this);
- return uid->extractFoldedStringInSymbol();
+ ASSERT(uid.symbolRegistry() == this);
+ return uid.extractFoldedStringInSymbol();
}
-void SymbolRegistry::remove(StringImpl* uid)
+void SymbolRegistry::remove(SymbolImpl& uid)
{
- ASSERT(uid->isSymbol());
- ASSERT(uid->symbolRegistry() == this);
- auto iterator = m_table.find(SymbolRegistryKey(uid));
+ ASSERT(uid.symbolRegistry() == this);
+ auto iterator = m_table.find(SymbolRegistryKey(&uid));
ASSERT_WITH_MESSAGE(iterator != m_table.end(), "The string being removed is registered in the string table of an other thread!");
m_table.remove(iterator);
}
#include <wtf/HashSet.h>
#include <wtf/text/StringHash.h>
+#include <wtf/text/SymbolImpl.h>
#include <wtf/text/WTFString.h>
namespace WTF {
SymbolRegistry() = default;
WTF_EXPORT_PRIVATE ~SymbolRegistry();
- WTF_EXPORT_PRIVATE Ref<StringImpl> symbolForKey(const String&);
- WTF_EXPORT_PRIVATE String keyForSymbol(StringImpl* uid);
+ WTF_EXPORT_PRIVATE Ref<SymbolImpl> symbolForKey(const String&);
+ WTF_EXPORT_PRIVATE String keyForSymbol(SymbolImpl&);
- void remove(StringImpl* uid);
+ void remove(SymbolImpl&);
private:
HashSet<SymbolRegistryKey> m_table;
--- /dev/null
+/*
+ * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UniquedStringImpl_h
+#define UniquedStringImpl_h
+
+#include <wtf/text/StringImpl.h>
+
+namespace WTF {
+
+// It represents that the string impl is uniqued in some ways.
+// When the given 2 string impls are both uniqued string impls, we can compare it just using pointer comparison.
+class UniquedStringImpl : public StringImpl {
+private:
+ UniquedStringImpl() = delete;
+};
+
+#if !ASSERT_DISABLED
+// UniquedStringImpls created from StaticASCIILiteral will ASSERT
+// in the generic ValueCheck<T>::checkConsistency
+// as they are not allocated by fastMalloc.
+// We don't currently have any way to detect that case
+// so we ignore the consistency check for all UniquedStringImpls*.
+template<> struct
+ValueCheck<UniquedStringImpl*> {
+ static void checkConsistency(const UniquedStringImpl*) { }
+};
+
+template<> struct
+ValueCheck<const UniquedStringImpl*> {
+ static void checkConsistency(const UniquedStringImpl*) { }
+};
+#endif
+
+} // namespace WTF
+
+using WTF::UniquedStringImpl;
+
+#endif // UniquedStringImpl_h
+2015-05-23 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=144848
+
+ Reviewed by Darin Adler.
+
+ Use UniquedStringImpl, SymbolImpl and AtomicStringImpl.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneSerializer::write):
+
2015-05-23 Zalan Bujtas <zalan@apple.com>
Simple line layout: Ignore -webkit-flow-*content while collecting text content for innerText.
// Allow shortcuts like 'Image1' instead of document.images.Image1
Document* document = thisObject->impl().frame()->document();
if (is<HTMLDocument>(*document)) {
- AtomicStringImpl* atomicPropertyName = propertyName.impl();
+ // This propertyName is generated by Identifier::from.
+ // This function generates Identifier from String and always returns the non-symbol Identifier.
+ ASSERT(!propertyName.isSymbol());
+ auto atomicPropertyName = static_cast<AtomicStringImpl*>(propertyName.impl());
if (atomicPropertyName && downcast<HTMLDocument>(*document).hasWindowNamedItem(*atomicPropertyName)) {
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, namedItemGetter);
return true;
void write(const Identifier& ident)
{
const String& str = ident.string();
- StringConstantPool::AddResult addResult = m_constantPool.add(str.impl(), m_constantPool.size());
+ StringConstantPool::AddResult addResult = m_constantPool.add(ident.impl(), m_constantPool.size());
if (!addResult.isNewEntry) {
write(StringPoolTag);
writeStringIndex(addResult.iterator->value);
ObjectPool m_objectPool;
ObjectPool m_transferredMessagePorts;
ObjectPool m_transferredArrayBuffers;
- typedef HashMap<RefPtr<StringImpl>, uint32_t, IdentifierRepHash> StringConstantPool;
+ typedef HashMap<RefPtr<UniquedStringImpl>, uint32_t, IdentifierRepHash> StringConstantPool;
StringConstantPool m_constantPool;
Identifier m_emptyIdentifier;
};
+2015-05-23 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
+ https://bugs.webkit.org/show_bug.cgi?id=144848
+
+ Reviewed by Darin Adler.
+
+ Use UniquedStringImpl, SymbolImpl and AtomicStringImpl.
+
+ * TestWebKitAPI/Tests/WTF/StringImpl.cpp:
+
2015-05-22 Alexey Proskuryakov <ap@apple.com>
Fix one more merge error in static analyzer support.
#include "config.h"
-#include <wtf/text/StringImpl.h>
+#include <wtf/text/SymbolImpl.h>
#include <wtf/text/WTFString.h>
namespace TestWebKitAPI {