WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-140435-20150118190134.patch (text/plain), 117.84 KB, created by
Yusuke Suzuki
on 2015-01-18 02:01:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2015-01-18 02:01:28 PST
Size:
117.84 KB
patch
obsolete
>Subversion Revision: 178630 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index a21fea37fc1365620388957c16e015d443a6f922..f80e2cc201cf70d3301782839ab4fd532c81b3f1 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,140 @@ >+2015-01-18 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ Implement ES6 Symbol >+ https://bugs.webkit.org/show_bug.cgi?id=140435 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * JavaScriptCore.order: >+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: >+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: >+ * JavaScriptCore.xcodeproj/project.pbxproj: >+ * builtins/BuiltinExecutables.cpp: >+ (JSC::BuiltinExecutables::createBuiltinExecutable): >+ * builtins/BuiltinNames.h: >+ * dfg/DFGOperations.cpp: >+ (JSC::DFG::operationPutByValInternal): >+ * interpreter/Interpreter.cpp: >+ * jit/JITOperations.cpp: >+ (JSC::getByVal): >+ * llint/LLIntData.cpp: >+ (JSC::LLInt::Data::performAssertions): >+ * llint/LLIntSlowPaths.cpp: >+ (JSC::LLInt::getByVal): >+ (JSC::LLInt::LLINT_SLOW_PATH_DECL): >+ * llint/LowLevelInterpreter.asm: >+ * runtime/CommonIdentifiers.h: >+ * runtime/CommonSlowPaths.cpp: >+ (JSC::SLOW_PATH_DECL): >+ * runtime/CommonSlowPaths.h: >+ (JSC::CommonSlowPaths::opIn): >+ * runtime/ExceptionHelpers.cpp: >+ (JSC::createUndefinedVariableError): >+ * runtime/JSCJSValue.cpp: >+ (JSC::JSValue::dumpInContextAssumingStructure): >+ (JSC::JSValue::toStringSlowCase): >+ * runtime/JSCJSValue.h: >+ * runtime/JSCJSValueInlines.h: >+ (JSC::JSValue::isSymbol): >+ (JSC::JSValue::isPrimitive): >+ (JSC::JSValue::toPropertyKey): >+ (JSC::JSValue::equalSlowCaseInline): >+ (JSC::JSValue::strictEqualSlowCaseInline): >+ * runtime/JSCell.cpp: >+ (JSC::JSCell::put): >+ (JSC::JSCell::putByIndex): >+ (JSC::JSCell::toPrimitive): >+ (JSC::JSCell::getPrimitiveNumber): >+ (JSC::JSCell::toNumber): >+ (JSC::JSCell::toObject): >+ * runtime/JSCell.h: >+ * runtime/JSCellInlines.h: >+ (JSC::JSCell::isSymbol): >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): >+ (JSC::JSGlobalObject::visitChildren): >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::symbolPrototype): >+ (JSC::JSGlobalObject::symbolObjectStructure): >+ * runtime/JSONObject.cpp: >+ (JSC::Stringifier::Stringifier): >+ * runtime/JSSymbolTableObject.cpp: >+ (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): >+ * runtime/JSType.h: >+ * runtime/JSTypeInfo.h: >+ (JSC::TypeInfo::isName): Deleted. >+ * runtime/ObjectConstructor.cpp: >+ (JSC::objectConstructorGetOwnPropertyDescriptor): >+ (JSC::objectConstructorDefineProperty): >+ * runtime/ObjectPrototype.cpp: >+ (JSC::objectProtoFuncHasOwnProperty): >+ (JSC::objectProtoFuncDefineGetter): >+ (JSC::objectProtoFuncDefineSetter): >+ (JSC::objectProtoFuncLookupGetter): >+ (JSC::objectProtoFuncLookupSetter): >+ (JSC::objectProtoFuncPropertyIsEnumerable): >+ * runtime/Operations.cpp: >+ (JSC::jsTypeStringForValue): >+ (JSC::jsIsObjectType): >+ * runtime/PrivateName.h: >+ (JSC::PrivateName::PrivateName): >+ * runtime/PropertyMapHashTable.h: >+ (JSC::PropertyTable::find): >+ (JSC::PropertyTable::get): >+ * runtime/PropertyName.h: >+ (JSC::PropertyName::PropertyName): >+ (JSC::PropertyName::publicName): >+ * runtime/SmallStrings.h: >+ * runtime/Structure.cpp: >+ (JSC::Structure::getPropertyNamesFromStructure): >+ * runtime/StructureInlines.h: >+ (JSC::Structure::prototypeForLookup): >+ * runtime/Symbol.cpp: Renamed from Source/JavaScriptCore/runtime/NamePrototype.cpp. >+ (JSC::Symbol::Symbol): >+ (JSC::SymbolObject::create): >+ (JSC::Symbol::toPrimitive): >+ (JSC::Symbol::getPrimitiveNumber): >+ (JSC::Symbol::toObject): >+ (JSC::Symbol::toNumber): >+ (JSC::Symbol::destroy): >+ * runtime/Symbol.h: Renamed from Source/JavaScriptCore/runtime/NameInstance.h. >+ (JSC::Symbol::createStructure): >+ (JSC::Symbol::create): >+ (JSC::Symbol::privateName): >+ (JSC::Symbol::finishCreation): >+ (JSC::asSymbol): >+ * runtime/SymbolConstructor.cpp: Renamed from Source/JavaScriptCore/runtime/NameConstructor.cpp. >+ (JSC::SymbolConstructor::SymbolConstructor): >+ (JSC::SymbolConstructor::finishCreation): >+ (JSC::callSymbol): >+ (JSC::constructSymbol): >+ (JSC::SymbolConstructor::getConstructData): >+ (JSC::SymbolConstructor::getCallData): >+ * runtime/SymbolConstructor.h: Renamed from Source/JavaScriptCore/runtime/NameConstructor.h. >+ (JSC::SymbolConstructor::create): >+ (JSC::SymbolConstructor::createStructure): >+ * runtime/SymbolObject.cpp: Renamed from Source/JavaScriptCore/runtime/NameInstance.cpp. >+ (JSC::SymbolObject::SymbolObject): >+ (JSC::SymbolObject::finishCreation): >+ * runtime/SymbolObject.h: Added. >+ (JSC::SymbolObject::create): >+ (JSC::SymbolObject::internalValue): >+ (JSC::SymbolObject::createStructure): >+ * runtime/SymbolPrototype.cpp: Added. >+ (JSC::SymbolPrototype::SymbolPrototype): >+ (JSC::SymbolPrototype::finishCreation): >+ (JSC::SymbolPrototype::getOwnPropertySlot): >+ (JSC::symbolProtoFuncToString): >+ (JSC::symbolProtoFuncValueOf): >+ * runtime/SymbolPrototype.h: Renamed from Source/JavaScriptCore/runtime/NamePrototype.h. >+ (JSC::SymbolPrototype::create): >+ (JSC::SymbolPrototype::createStructure): >+ * runtime/VM.cpp: >+ (JSC::VM::VM): >+ * runtime/VM.h: >+ > 2015-01-17 Michael Saboff <msaboff@apple.com> > > Crash in JSScope::resolve() on tools.ups.com >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 9eade76c3e8deeebf124eaddcd3e340cac4951c7..10a25d764e2c78102e53943040393406581ac333 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,26 @@ >+2015-01-18 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ Implement ES6 Symbol >+ https://bugs.webkit.org/show_bug.cgi?id=140435 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/text/StringImpl.cpp: >+ (WTF::StringImpl::~StringImpl): >+ * wtf/text/StringImpl.h: >+ (WTF::StringImpl::StringImpl): >+ (WTF::StringImpl::createUniqueEmpty): >+ (WTF::StringImpl::createUniqueFromLiteral): >+ (WTF::StringImpl::createUnique): >+ (WTF::StringImpl::flagIsUnique): >+ (WTF::StringImpl::isUnique): >+ (WTF::StringImpl::setIsAtomic): >+ (WTF::StringImpl::createEmptyUnique): Deleted. >+ (WTF::StringImpl::isEmptyUnique): Deleted. >+ * wtf/text/StringStatics.cpp: >+ (WTF::StringImpl::hashAndFlagsForUnique): >+ (WTF::StringImpl::hashAndFlagsForEmptyUnique): Deleted. >+ > 2015-01-16 Myles C. Maxfield <mmaxfield@apple.com> > > WeakPtr functions crash when created with default constructor >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index 6b21520ff2ac8bf5265eb35800162f6f912c97c0..419380a10d78b3593829ea00ffe4670a584ee174 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -508,9 +508,6 @@ set(JavaScriptCore_RUNTIME_SOURCES > runtime/MapPrototype.cpp > runtime/MathObject.cpp > runtime/MemoryStatistics.cpp >- runtime/NameConstructor.cpp >- runtime/NameInstance.cpp >- runtime/NamePrototype.cpp > runtime/NativeErrorConstructor.cpp > runtime/NativeErrorPrototype.cpp > runtime/NullGetterFunction.cpp >@@ -550,6 +547,10 @@ set(JavaScriptCore_RUNTIME_SOURCES > runtime/StructureChain.cpp > runtime/StructureIDTable.cpp > runtime/StructureRareData.cpp >+ runtime/Symbol.cpp >+ runtime/SymbolObject.cpp >+ runtime/SymbolPrototype.cpp >+ runtime/SymbolConstructor.cpp > runtime/SymbolTable.cpp > runtime/TestRunnerUtils.cpp > runtime/TypeLocationCache.cpp >@@ -583,7 +584,6 @@ set(JavaScriptCore_LUT_FILES > runtime/JSONObject.cpp > runtime/JSPromiseConstructor.cpp > runtime/JSPromisePrototype.cpp >- runtime/NamePrototype.cpp > runtime/NumberConstructor.cpp > runtime/NumberPrototype.cpp > runtime/ObjectConstructor.cpp >@@ -591,6 +591,7 @@ set(JavaScriptCore_LUT_FILES > runtime/RegExpObject.cpp > runtime/RegExpPrototype.cpp > runtime/StringConstructor.cpp >+ runtime/SymbolPrototype.cpp > ) > > set(JavaScriptCore_LIBRARIES >diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make >index 52421ec881151b16a93d545fd9c5449ac1987097..17fa9bec946d396de985abc4281b768aed98aa9b 100644 >--- a/Source/JavaScriptCore/DerivedSources.make >+++ b/Source/JavaScriptCore/DerivedSources.make >@@ -48,7 +48,6 @@ all : \ > JSPromiseConstructor.lut.h \ > KeywordLookup.h \ > Lexer.lut.h \ >- NamePrototype.lut.h \ > NumberConstructor.lut.h \ > NumberPrototype.lut.h \ > ObjectConstructor.lut.h \ >@@ -57,6 +56,7 @@ all : \ > RegExpJitTables.h \ > RegExpObject.lut.h \ > StringConstructor.lut.h \ >+ SymbolPrototype.lut.h \ > udis86_itab.h \ > Bytecodes.h \ > InitBytecodes.asm \ >diff --git a/Source/JavaScriptCore/JavaScriptCore.order b/Source/JavaScriptCore/JavaScriptCore.order >index fd684f6f0039c5929d0b133a3057bac3cc916c0b..26be0ee276e0ee5c86e610999f2d476b0dd806de 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.order >+++ b/Source/JavaScriptCore/JavaScriptCore.order >@@ -4599,14 +4599,8 @@ __ZN3JSCL24regExpConstructorDollar6EPNS_9ExecStateENS_7JSValueENS_12PropertyName > __ZN3JSC5LexerIhE23parseIdentifierSlowCaseILb1EEENS_11JSTokenTypeEPNS_11JSTokenDataEjb > __ZN3JSC4Yarr13YarrGeneratorILNS0_18YarrJITCompileModeE1EE33generatePatternCharacterNonGreedyEm > __ZN3JSC4Yarr13YarrGeneratorILNS0_18YarrJITCompileModeE1EE34backtrackPatternCharacterNonGreedyEm >-__ZN3JSC13NamePrototypeC1EPNS_9ExecStateEPNS_9StructureE >-__ZN3JSC12NameInstanceC2ERNS_2VMEPNS_9StructureEPNS_8JSStringE >-__ZN3JSC13NamePrototype14finishCreationEPNS_9ExecStateE >-__ZN3JSC15NameConstructorC1EPNS_14JSGlobalObjectEPNS_9StructureE >-__ZN3JSC15NameConstructor14finishCreationEPNS_9ExecStateEPNS_13NamePrototypeE > _JSStringIsEqualToUTF8CString > _JSStringIsEqual >-__ZN3JSC12NameInstance7destroyEPNS_6JSCellE > __ZN3WTF3MD5C1Ev > __ZN3WTF3MD58addBytesEPKhm > __ZN3WTFL12MD5TransformEPjPKj >@@ -4756,9 +4750,7 @@ __ZN3JSC22createOutOfMemoryErrorEPNS_14JSGlobalObjectE > __ZN3JSCL17mathProtoFuncACosEPNS_9ExecStateE > __ZN3JSC11JSNameScope3putEPNS_6JSCellEPNS_9ExecStateENS_12PropertyNameENS_7JSValueERNS_15PutPropertySlotE > __ZN3JSC14symbolTablePutINS_11JSNameScopeEEEbPT_PNS_9ExecStateENS_12PropertyNameENS_7JSValueEb >-__ZN3JSC15NameConstructor11getCallDataEPNS_6JSCellERNS_8CallDataE > __ZN3JSCL20constructPrivateNameEPNS_9ExecStateE >-__ZN3JSC12NameInstanceC1ERNS_2VMEPNS_9StructureEPNS_8JSStringE > __ZN3JSCL29objectProtoFuncToLocaleStringEPNS_9ExecStateE > __ZN3JSC13JSNotAnObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_18PropertyDescriptorE > __ZN3JSCL20isNonLatin1IdentPartEi >diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj >index e2c2c6da39e622605698c691a6ef7a07e4e8c57d..50a52ae02b4fc0577e81df2dc5157d7a2eb4c918 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj >@@ -773,9 +773,6 @@ > <ClCompile Include="..\runtime\MapPrototype.cpp" /> > <ClCompile Include="..\runtime\MathObject.cpp" /> > <ClCompile Include="..\runtime\MemoryStatistics.cpp" /> >- <ClCompile Include="..\runtime\NameConstructor.cpp" /> >- <ClCompile Include="..\runtime\NameInstance.cpp" /> >- <ClCompile Include="..\runtime\NamePrototype.cpp" /> > <ClCompile Include="..\runtime\NativeErrorConstructor.cpp" /> > <ClCompile Include="..\runtime\NativeErrorPrototype.cpp" /> > <ClCompile Include="..\runtime\NullGetterFunction.cpp" /> >@@ -815,6 +812,10 @@ > <ClCompile Include="..\runtime\StructureChain.cpp" /> > <ClCompile Include="..\runtime\StructureIDTable.cpp" /> > <ClCompile Include="..\runtime\StructureRareData.cpp" /> >+ <ClCompile Include="..\runtime\Symbol.cpp" /> >+ <ClCompile Include="..\runtime\SymbolConstructor.cpp" /> >+ <ClCompile Include="..\runtime\SymbolObject.cpp" /> >+ <ClCompile Include="..\runtime\SymbolPrototype.cpp" /> > <ClCompile Include="..\runtime\SymbolTable.cpp" /> > <ClCompile Include="..\runtime\TestRunnerUtils.cpp" /> > <ClCompile Include="..\runtime\TypedArrayController.cpp" /> >@@ -862,7 +863,6 @@ > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSPromisePrototype.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\KeywordLookup.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\Lexer.lut.h" /> >- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\NamePrototype.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\NumberConstructor.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\NumberPrototype.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ObjectConstructor.lut.h" /> >@@ -871,6 +871,7 @@ > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\RegExpObject.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\RegExpPrototype.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\StringConstructor.lut.h" /> >+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SymbolPrototype.lut.h" /> > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCBuiltins.h" /> > </ItemGroup> > <ItemGroup> >@@ -1567,9 +1568,6 @@ > <ClInclude Include="..\runtime\MathObject.h" /> > <ClInclude Include="..\runtime\MemoryStatistics.h" /> > <ClInclude Include="..\runtime\Microtask.h" /> >- <ClInclude Include="..\runtime\NameConstructor.h" /> >- <ClInclude Include="..\runtime\NameInstance.h" /> >- <ClInclude Include="..\runtime\NamePrototype.h" /> > <ClInclude Include="..\runtime\NativeErrorConstructor.h" /> > <ClInclude Include="..\runtime\NativeErrorPrototype.h" /> > <ClInclude Include="..\runtime\NullGetterFunction.h" /> >@@ -1623,6 +1621,10 @@ > <ClInclude Include="..\runtime\StructureRareData.h" /> > <ClInclude Include="..\runtime\StructureRareDataInlines.h" /> > <ClInclude Include="..\runtime\StructureTransitionTable.h" /> >+ <ClInclude Include="..\runtime\Symbol.h" /> >+ <ClInclude Include="..\runtime\SymbolConstructor.h" /> >+ <ClInclude Include="..\runtime\SymbolObject.h" /> >+ <ClInclude Include="..\runtime\SymbolPrototype.h" /> > <ClInclude Include="..\runtime\SymbolTable.h" /> > <ClInclude Include="..\runtime\TestRunnerUtils.h" /> > <ClInclude Include="..\runtime\Tracing.h" /> >diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters >index 37883ac6c20c6dc7813df6f7966f74b764dea88a..b502dc6e40021b3e9d2e32018a4a358aac355b7d 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters >+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters >@@ -741,15 +741,6 @@ > <ClCompile Include="..\runtime\MathObject.cpp"> > <Filter>runtime</Filter> > </ClCompile> >- <ClCompile Include="..\runtime\NameConstructor.cpp"> >- <Filter>runtime</Filter> >- </ClCompile> >- <ClCompile Include="..\runtime\NameInstance.cpp"> >- <Filter>runtime</Filter> >- </ClCompile> >- <ClCompile Include="..\runtime\NamePrototype.cpp"> >- <Filter>runtime</Filter> >- </ClCompile> > <ClCompile Include="..\runtime\NativeErrorConstructor.cpp"> > <Filter>runtime</Filter> > </ClCompile> >@@ -858,6 +849,18 @@ > <ClCompile Include="..\runtime\StructureIDTable.cpp"> > <Filter>runtime</Filter> > </ClCompile> >+ <ClCompile Include="..\runtime\Symbol.cpp"> >+ <Filter>runtime</Filter> >+ </ClInclude> >+ <ClCompile Include="..\runtime\SymbolConstructor.cpp"> >+ <Filter>runtime</Filter> >+ </ClCompile> >+ <ClCompile Include="..\runtime\SymbolObject.cpp"> >+ <Filter>runtime</Filter> >+ </ClCompile> >+ <ClCompile Include="..\runtime\SymbolPrototype.cpp"> >+ <Filter>runtime</Filter> >+ </ClCompile> > <ClCompile Include="..\runtime\SymbolTable.cpp"> > <Filter>runtime</Filter> > </ClCompile> >@@ -2756,15 +2759,6 @@ > <ClInclude Include="..\runtime\MathObject.h"> > <Filter>runtime</Filter> > </ClInclude> >- <ClInclude Include="..\runtime\NameConstructor.h"> >- <Filter>runtime</Filter> >- </ClInclude> >- <ClInclude Include="..\runtime\NameInstance.h"> >- <Filter>runtime</Filter> >- </ClInclude> >- <ClInclude Include="..\runtime\NamePrototype.h"> >- <Filter>runtime</Filter> >- </ClInclude> > <ClInclude Include="..\runtime\NativeErrorConstructor.h"> > <Filter>runtime</Filter> > </ClInclude> >@@ -2897,6 +2891,18 @@ > <ClInclude Include="..\runtime\StructureTransitionTable.h"> > <Filter>runtime</Filter> > </ClInclude> >+ <ClInclude Include="..\runtime\Symbol.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> >+ <ClInclude Include="..\runtime\SymbolConstructor.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> >+ <ClInclude Include="..\runtime\SymbolObject.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> >+ <ClInclude Include="..\runtime\SymbolPrototype.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> > <ClInclude Include="..\runtime\SymbolTable.h"> > <Filter>runtime</Filter> > </ClInclude> >@@ -3243,7 +3249,7 @@ > <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\RegExpObject.lut.h"> > <Filter>Derived Sources</Filter> > </ClInclude> >- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\NamePrototype.lut.h"> >+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SymbolPrototype.lut.h"> > <Filter>Derived Sources</Filter> > </ClInclude> > <ClInclude Include="..\heap\CodeBlockSet.h"> >diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >index e7d423174f37519a026fa0a86597695a2a8019c5..3fa02202add91ea87e262dbcd7ce7bea5bf60847 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >@@ -1016,8 +1016,6 @@ > 86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E85538111B9968001AF51E /* JSStringBuilder.h */; }; > 86EBF2FF1560F06A008E9222 /* NameConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2F91560F036008E9222 /* NameConstructor.cpp */; }; > 86EBF3001560F06A008E9222 /* NameConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FA1560F036008E9222 /* NameConstructor.h */; }; >- 86EBF3011560F06A008E9222 /* NameInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2FB1560F036008E9222 /* NameInstance.cpp */; }; >- 86EBF3021560F06A008E9222 /* NameInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FC1560F036008E9222 /* NameInstance.h */; }; > 86EBF3031560F06A008E9222 /* NamePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2FD1560F036008E9222 /* NamePrototype.cpp */; }; > 86EBF3041560F06A008E9222 /* NamePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FE1560F036008E9222 /* NamePrototype.h */; }; > 86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DB41328DF82002B2AD7 /* DFGByteCodeParser.cpp */; }; >@@ -2692,8 +2690,6 @@ > 86E85538111B9968001AF51E /* JSStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringBuilder.h; sourceTree = "<group>"; }; > 86EBF2F91560F036008E9222 /* NameConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameConstructor.cpp; sourceTree = "<group>"; }; > 86EBF2FA1560F036008E9222 /* NameConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NameConstructor.h; sourceTree = "<group>"; }; >- 86EBF2FB1560F036008E9222 /* NameInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameInstance.cpp; sourceTree = "<group>"; }; >- 86EBF2FC1560F036008E9222 /* NameInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NameInstance.h; sourceTree = "<group>"; }; > 86EBF2FD1560F036008E9222 /* NamePrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NamePrototype.cpp; sourceTree = "<group>"; }; > 86EBF2FE1560F036008E9222 /* NamePrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NamePrototype.h; sourceTree = "<group>"; }; > 86EC9DB41328DF82002B2AD7 /* DFGByteCodeParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGByteCodeParser.cpp; path = dfg/DFGByteCodeParser.cpp; sourceTree = "<group>"; }; >@@ -4434,8 +4430,6 @@ > 7C008CE5187631B600955C24 /* Microtask.h */, > 86EBF2F91560F036008E9222 /* NameConstructor.cpp */, > 86EBF2FA1560F036008E9222 /* NameConstructor.h */, >- 86EBF2FB1560F036008E9222 /* NameInstance.cpp */, >- 86EBF2FC1560F036008E9222 /* NameInstance.h */, > 86EBF2FD1560F036008E9222 /* NamePrototype.cpp */, > 86EBF2FE1560F036008E9222 /* NamePrototype.h */, > BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */, >@@ -6045,7 +6039,6 @@ > 7C008CE7187631B600955C24 /* Microtask.h in Headers */, > 86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */, > 86EBF3001560F06A008E9222 /* NameConstructor.h in Headers */, >- 86EBF3021560F06A008E9222 /* NameInstance.h in Headers */, > 86EBF3041560F06A008E9222 /* NamePrototype.h in Headers */, > BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */, > BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */, >@@ -7172,7 +7165,6 @@ > 90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */, > 0FB5467D14F5CFD6002C2989 /* MethodOfGettingAValueProfile.cpp in Sources */, > 86EBF2FF1560F06A008E9222 /* NameConstructor.cpp in Sources */, >- 86EBF3011560F06A008E9222 /* NameInstance.cpp in Sources */, > 86EBF3031560F06A008E9222 /* NamePrototype.cpp in Sources */, > 14469DE0107EC7E700650446 /* NativeErrorConstructor.cpp in Sources */, > 14469DE1107EC7E700650446 /* NativeErrorPrototype.cpp in Sources */, >diff --git a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >index ef6737ee2c7e775bffd056a512dc3c23b0e885ed..9fcdaa1e38dc6575bb791399a8e3aadc01913328 100644 >--- a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >+++ b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >@@ -75,7 +75,7 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createBuiltinExecutable(const So > > if (closedVariable == m_vm.propertyNames->undefinedKeyword.impl()) > continue; >- RELEASE_ASSERT(closedVariable->isEmptyUnique()); >+ RELEASE_ASSERT(closedVariable->isUnique()); > } > body->overrideName(name); > UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&m_vm, source, body, UnlinkedBuiltinFunction); >diff --git a/Source/JavaScriptCore/builtins/BuiltinNames.h b/Source/JavaScriptCore/builtins/BuiltinNames.h >index 67e1f563bca018d03209cf81052623601ba4405b..9b8896b968014913f46b32c480e057896379dfa4 100644 >--- a/Source/JavaScriptCore/builtins/BuiltinNames.h >+++ b/Source/JavaScriptCore/builtins/BuiltinNames.h >@@ -31,7 +31,7 @@ > > namespace JSC { > >-#define INITIALISE_BUILTIN_NAMES(name) , m_##name(vm, #name), m_##name##PrivateName(Identifier::from(PrivateName())) >+#define INITIALISE_BUILTIN_NAMES(name) , m_##name(vm, #name), m_##name##PrivateName(Identifier::from(PrivateName(ASCIILiteral("Symbol." #name)))) > #define DECLARE_BUILTIN_NAMES(name) const Identifier m_##name; const Identifier m_##name##PrivateName;; > #define DECLARE_BUILTIN_IDENTIFIER_ACCESSOR(name) \ > const Identifier& name##PublicName() const { return m_##name; } \ >diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp >index 795e60583526c37603c31872877522b8fd8b7892..92e9cc219067ea42916f1454b15e4ba0ce3a4da2 100644 >--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp >@@ -48,11 +48,11 @@ > #include "JSLexicalEnvironment.h" > #include "VM.h" > #include "JSNameScope.h" >-#include "NameInstance.h" > #include "ObjectConstructor.h" > #include "JSCInlines.h" > #include "Repatch.h" > #include "StringConstructor.h" >+#include "Symbol.h" > #include "TypeProfilerLog.h" > #include "TypedArrayInlines.h" > #include <wtf/InlineASM.h> >@@ -110,25 +110,15 @@ ALWAYS_INLINE static void JIT_OPERATION operationPutByValInternal(ExecState* exe > } > } > >- if (isName(property)) { >- PutPropertySlot slot(baseValue, strict); >- if (direct) { >- RELEASE_ASSERT(baseValue.isObject()); >- asObject(baseValue)->putDirect(*vm, jsCast<NameInstance*>(property.asCell())->privateName(), value, slot); >- } else >- baseValue.put(exec, jsCast<NameInstance*>(property.asCell())->privateName(), value, slot); >- return; >- } >- > // Don't put to an object if toString throws an exception. >- Identifier ident = property.toString(exec)->toIdentifier(exec); >+ PropertyName propertyName = property.toPropertyKey(exec); > if (!vm->exception()) { > PutPropertySlot slot(baseValue, strict); > if (direct) { > RELEASE_ASSERT(baseValue.isObject()); >- asObject(baseValue)->putDirect(*vm, ident, value, slot); >+ asObject(baseValue)->putDirect(*vm, propertyName, value, slot); > } else >- baseValue.put(exec, ident, value, slot); >+ baseValue.put(exec, propertyName, value, slot); > } > } > >@@ -306,11 +296,8 @@ EncodedJSValue JIT_OPERATION operationGetByVal(ExecState* exec, EncodedJSValue e > } > } > >- if (isName(property)) >- return JSValue::encode(baseValue.get(exec, jsCast<NameInstance*>(property.asCell())->privateName())); >- >- Identifier ident = property.toString(exec)->toIdentifier(exec); >- return JSValue::encode(baseValue.get(exec, ident)); >+ PropertyName propertyName = property.toPropertyKey(exec); >+ return JSValue::encode(baseValue.get(exec, propertyName)); > } > > EncodedJSValue JIT_OPERATION operationGetByValCell(ExecState* exec, JSCell* base, EncodedJSValue encodedProperty) >@@ -337,11 +324,8 @@ EncodedJSValue JIT_OPERATION operationGetByValCell(ExecState* exec, JSCell* base > } > } > >- if (isName(property)) >- return JSValue::encode(JSValue(base).get(exec, jsCast<NameInstance*>(property.asCell())->privateName())); >- >- Identifier ident = property.toString(exec)->toIdentifier(exec); >- return JSValue::encode(JSValue(base).get(exec, ident)); >+ PropertyName propertyName = property.toPropertyKey(exec); >+ return JSValue::encode(JSValue(base).get(exec, propertyName)); > } > > ALWAYS_INLINE EncodedJSValue getByValCellInt(ExecState* exec, JSCell* base, int32_t index) >diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp >index cd9160686d8c5f84dae7a793c8776d7572531db4..7f142af5b208ac2feca9535d66cc88fc7bb3feb8 100644 >--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp >+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp >@@ -54,7 +54,6 @@ > #include "LLIntThunks.h" > #include "LegacyProfiler.h" > #include "LiteralParser.h" >-#include "NameInstance.h" > #include "ObjectPrototype.h" > #include "JSCInlines.h" > #include "Parser.h" >@@ -67,6 +66,7 @@ > #include "StackVisitor.h" > #include "StrictEvalActivation.h" > #include "StrongInlines.h" >+#include "Symbol.h" > #include "VMEntryScope.h" > #include "VirtualRegister.h" > >diff --git a/Source/JavaScriptCore/jit/JITOperations.cpp b/Source/JavaScriptCore/jit/JITOperations.cpp >index 37aa45d5363911a5963f0c90c0d1cedfbbe322dd..3885c06a0f5cba9ddecab52846c576150365d067 100644 >--- a/Source/JavaScriptCore/jit/JITOperations.cpp >+++ b/Source/JavaScriptCore/jit/JITOperations.cpp >@@ -159,7 +159,7 @@ EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState* exec, Structure > { > VM* vm = &exec->vm(); > NativeCallFrameTracer tracer(vm, exec); >- Identifier ident = uid->isEmptyUnique() ? Identifier::from(PrivateName(uid)) : Identifier(vm, uid); >+ Identifier ident = uid->isUnique() ? Identifier::from(PrivateName(uid)) : Identifier(vm, uid); > > JSValue baseValue = JSValue::decode(base); > PropertySlot slot(baseValue); >@@ -466,11 +466,8 @@ static void putByVal(CallFrame* callFrame, JSValue baseValue, JSValue subscript, > object->methodTable(vm)->putByIndex(object, callFrame, i, value, callFrame->codeBlock()->isStrictMode()); > } else > baseValue.putByIndex(callFrame, i, value, callFrame->codeBlock()->isStrictMode()); >- } else if (isName(subscript)) { >- PutPropertySlot slot(baseValue, callFrame->codeBlock()->isStrictMode()); >- baseValue.put(callFrame, jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot); > } else { >- Identifier property = subscript.toString(callFrame)->toIdentifier(callFrame); >+ PropertyName property = subscript.toPropertyKey(callFrame); > if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception. > PutPropertySlot slot(baseValue, callFrame->codeBlock()->isStrictMode()); > baseValue.put(callFrame, property, value, slot); >@@ -483,11 +480,8 @@ static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue s > if (LIKELY(subscript.isUInt32())) { > uint32_t i = subscript.asUInt32(); > baseObject->putDirectIndex(callFrame, i, value); >- } else if (isName(subscript)) { >- PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode()); >- baseObject->putDirect(callFrame->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot); > } else { >- Identifier property = subscript.toString(callFrame)->toIdentifier(callFrame); >+ PropertyName property = subscript.toPropertyKey(callFrame); > if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception. > PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode()); > baseObject->putDirect(callFrame->vm(), property, value, slot); >@@ -1467,10 +1461,7 @@ static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, R > return baseValue.get(exec, i); > } > >- if (isName(subscript)) >- return baseValue.get(exec, jsCast<NameInstance*>(subscript.asCell())->privateName()); >- >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ PropertyName property = subscript.toPropertyKey(exec); > return baseValue.get(exec, property); > } > >@@ -1605,10 +1596,8 @@ EncodedJSValue JIT_OPERATION operationGetByValString(ExecState* exec, EncodedJSV > if (!isJSString(baseValue)) > ctiPatchCallByReturnAddress(exec->codeBlock(), ReturnAddressPtr(OUR_RETURN_ADDRESS), FunctionPtr(operationGetByValDefault)); > } >- } else if (isName(subscript)) >- result = baseValue.get(exec, jsCast<NameInstance*>(subscript.asCell())->privateName()); >- else { >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ } else { >+ PropertyName property = subscript.toPropertyKey(exec); > result = baseValue.get(exec, property); > } > >diff --git a/Source/JavaScriptCore/llint/LLIntData.cpp b/Source/JavaScriptCore/llint/LLIntData.cpp >index 6919aeab00a1b25c475bbf9dd25c688f0aa58a72..d8655fa5476a0566c61ac0b5211c0fe03405efa9 100644 >--- a/Source/JavaScriptCore/llint/LLIntData.cpp >+++ b/Source/JavaScriptCore/llint/LLIntData.cpp >@@ -133,8 +133,8 @@ void Data::performAssertions(VM& vm) > ASSERT(maxFrameExtentForSlowPathCall == 64); > #endif > ASSERT(StringType == 6); >- ASSERT(ObjectType == 17); >- ASSERT(FinalObjectType == 18); >+ ASSERT(ObjectType == 18); >+ ASSERT(FinalObjectType == 19); > ASSERT(MasqueradesAsUndefined == 1); > ASSERT(ImplementsHasInstance == 2); > ASSERT(ImplementsDefaultHasInstance == 8); >diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >index 85bac2603a7b2157b9559b2fe185a677652d2d5e..a3022cba19d916d0f0849307a7b72d83c9cdde3e 100644 >--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >@@ -744,10 +744,7 @@ inline JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript) > return baseValue.get(exec, i); > } > >- if (isName(subscript)) >- return baseValue.get(exec, jsCast<NameInstance*>(subscript.asCell())->privateName()); >- >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ PropertyName property = subscript.toPropertyKey(exec); > return baseValue.get(exec, property); > } > >@@ -797,13 +794,7 @@ inline JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript) > LLINT_END(); > } > >- if (isName(subscript)) { >- PutPropertySlot slot(baseValue, exec->codeBlock()->isStrictMode()); >- baseValue.put(exec, jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot); >- LLINT_END(); >- } >- >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ PropertyName property = subscript.toPropertyKey(exec); > LLINT_CHECK_EXCEPTION(); > PutPropertySlot slot(baseValue, exec->codeBlock()->isStrictMode()); > baseValue.put(exec, property, value, slot); >@@ -822,11 +813,8 @@ inline JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript) > if (LIKELY(subscript.isUInt32())) { > uint32_t i = subscript.asUInt32(); > baseObject->putDirectIndex(exec, i, value); >- } else if (isName(subscript)) { >- PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode()); >- baseObject->putDirect(exec->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot); > } else { >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ PropertyName property = subscript.toPropertyKey(exec); > if (!exec->vm().exception()) { // Don't put to an object if toString threw an exception. > PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode()); > baseObject->putDirect(exec->vm(), property, value, slot); >@@ -848,11 +836,9 @@ inline JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript) > uint32_t i; > if (subscript.getUInt32(i)) > couldDelete = baseObject->methodTable()->deletePropertyByIndex(baseObject, exec, i); >- else if (isName(subscript)) >- couldDelete = baseObject->methodTable()->deleteProperty(baseObject, exec, jsCast<NameInstance*>(subscript.asCell())->privateName()); > else { > LLINT_CHECK_EXCEPTION(); >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ PropertyName property = subscript.toPropertyKey(exec); > LLINT_CHECK_EXCEPTION(); > couldDelete = baseObject->methodTable()->deleteProperty(baseObject, exec, property); > } >diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm >index 704747fabbaed3dc61765a8349b72b4062528104..07fff63eecbd2629d6550e2c2f4ce64ed986a347 100644 >--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm >+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm >@@ -154,8 +154,8 @@ const SlowPutArrayStorageShape = 30 > > # Type constants. > const StringType = 6 >-const ObjectType = 17 >-const FinalObjectType = 18 >+const ObjectType = 18 >+const FinalObjectType = 19 > > # Type flags constants. > const MasqueradesAsUndefined = 1 >diff --git a/Source/JavaScriptCore/runtime/CommonIdentifiers.h b/Source/JavaScriptCore/runtime/CommonIdentifiers.h >index 569ee4ff38c9dbec8e4bae82a9ec58c9dc2c43b8..65815cc9a1e9f7c6210392203ac8f18107df8a70 100644 >--- a/Source/JavaScriptCore/runtime/CommonIdentifiers.h >+++ b/Source/JavaScriptCore/runtime/CommonIdentifiers.h >@@ -52,6 +52,7 @@ > macro(Set)\ > macro(SetIterator)\ > macro(String) \ >+ macro(Symbol) \ > macro(SyntaxError) \ > macro(TypeError) \ > macro(URIError) \ >@@ -219,8 +220,21 @@ > macro(with) \ > macro(yield) > >-#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ >+#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(macro) \ >+ macro(hasInstance) \ >+ macro(isConcatSpreadable) \ > macro(iterator) \ >+ macro(match) \ >+ macro(replace) \ >+ macro(search) \ >+ macro(species) \ >+ macro(split) \ >+ macro(toPrimitive) \ >+ macro(toStringTag) \ >+ macro(unscopable) >+ >+#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ >+ JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(macro) \ > macro(iteratorNext) \ > macro(resolve) \ > macro(reject) \ >diff --git a/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp b/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp >index 08091a87e09d1f1ee98f4c0cc6b27bf50db15434..dfb94121690dc37e6015654bebad7404d1c363d7 100644 >--- a/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp >+++ b/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp >@@ -486,11 +486,9 @@ static CommonSlowPaths::ArityCheckData* setupArityCheckData(VM& vm, int slotsToA > uint32_t i; > if (subscript.getUInt32(i)) > couldDelete = baseObject->methodTable()->deletePropertyByIndex(baseObject, exec, i); >- else if (isName(subscript)) >- couldDelete = baseObject->methodTable()->deleteProperty(baseObject, exec, jsCast<NameInstance*>(subscript.asCell())->privateName()); > else { > CHECK_EXCEPTION(); >- Identifier property = subscript.toString(exec)->toIdentifier(exec); >+ PropertyName property = subscript.toPropertyKey(exec); > CHECK_EXCEPTION(); > couldDelete = baseObject->methodTable()->deleteProperty(baseObject, exec, property); > } >@@ -575,7 +573,7 @@ static CommonSlowPaths::ArityCheckData* setupArityCheckData(VM& vm, int slotsToA > JSValue baseValue = OP_C(2).jsValue(); > JSValue property = OP(3).jsValue(); > ASSERT(property.isString()); >- RETURN(baseValue.get(exec, property.toString(exec)->toIdentifier(exec))); >+ RETURN(baseValue.get(exec, property.toPropertyKey(exec))); > } > > SLOW_PATH_DECL(slow_path_get_structure_property_enumerator) >diff --git a/Source/JavaScriptCore/runtime/CommonSlowPaths.h b/Source/JavaScriptCore/runtime/CommonSlowPaths.h >index a56358cd6e0977743e87b3c165e2cea1aa47eda6..bfe483df6f98bf15c7df506e14f27fafd36a75a6 100644 >--- a/Source/JavaScriptCore/runtime/CommonSlowPaths.h >+++ b/Source/JavaScriptCore/runtime/CommonSlowPaths.h >@@ -30,8 +30,8 @@ > #include "CodeSpecializationKind.h" > #include "ExceptionHelpers.h" > #include "JSStackInlines.h" >-#include "NameInstance.h" > #include "StackAlignment.h" >+#include "Symbol.h" > #include "VM.h" > #include <wtf/StdLibExtras.h> > >@@ -82,10 +82,7 @@ inline bool opIn(ExecState* exec, JSValue propName, JSValue baseVal) > if (propName.getUInt32(i)) > return baseObj->hasProperty(exec, i); > >- if (isName(propName)) >- return baseObj->hasProperty(exec, jsCast<NameInstance*>(propName.asCell())->privateName()); >- >- Identifier property = propName.toString(exec)->toIdentifier(exec); >+ PropertyName property = propName.toPropertyKey(exec); > if (exec->vm().exception()) > return false; > return baseObj->hasProperty(exec, property); >diff --git a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp >index 5555395f32732582647bc9e57c62f0660da62ea3..105aaef7f09aae152b85f3208b14bbf90a1f5ac3 100644 >--- a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp >+++ b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp >@@ -82,7 +82,7 @@ JSObject* createStackOverflowError(JSGlobalObject* globalObject) > JSObject* createUndefinedVariableError(ExecState* exec, const Identifier& ident) > { > >- if (ident.impl()->isEmptyUnique()) { >+ if (ident.impl()->isUnique()) { > String message(makeString("Can't find private variable: @", exec->propertyNames().getPublicName(ident).string())); > return createReferenceError(exec, message); > } >diff --git a/Source/JavaScriptCore/runtime/JSCJSValue.cpp b/Source/JavaScriptCore/runtime/JSCJSValue.cpp >index c233f4c70021cd78532859e15b0cb63076c9e95a..8008bc68d44cef0f3e170af90a98960f79c05437 100644 >--- a/Source/JavaScriptCore/runtime/JSCJSValue.cpp >+++ b/Source/JavaScriptCore/runtime/JSCJSValue.cpp >@@ -231,7 +231,7 @@ void JSValue::dumpInContextAssumingStructure( > out.print(" (atomic)"); > if (impl->isAtomic()) > out.print(" (identifier)"); >- if (impl->isEmptyUnique()) >+ if (impl->isUnique()) > out.print(" (unique)"); > } else > out.print(" (unresolved)"); >@@ -364,6 +364,10 @@ JSString* JSValue::toStringSlowCase(ExecState* exec) const > return vm.smallStrings.nullString(); > if (isUndefined()) > return vm.smallStrings.undefinedString(); >+ if (isSymbol()) { >+ throwTypeError(exec); >+ return jsEmptyString(exec); >+ } > > ASSERT(isCell()); > JSValue value = asCell()->toPrimitive(exec, PreferString); >diff --git a/Source/JavaScriptCore/runtime/JSCJSValue.h b/Source/JavaScriptCore/runtime/JSCJSValue.h >index c1fa0d12bebf113c6ebb444d78e5cc2af0181891..fa6bba56c3e8460682e7adf032a648de8e395633 100644 >--- a/Source/JavaScriptCore/runtime/JSCJSValue.h >+++ b/Source/JavaScriptCore/runtime/JSCJSValue.h >@@ -217,6 +217,7 @@ class JSValue { > bool isMachineInt() const; > bool isNumber() const; > bool isString() const; >+ bool isSymbol() const; > bool isPrimitive() const; > bool isGetterSetter() const; > bool isCustomGetterSetter() const; >@@ -242,6 +243,7 @@ class JSValue { > // been set in the ExecState already. > double toNumber(ExecState*) const; > JSString* toString(ExecState*) const; >+ PropertyName toPropertyKey(ExecState*) const; > WTF::String toWTFString(ExecState*) const; > WTF::String toWTFStringInline(ExecState*) const; > JSObject* toObject(ExecState*) const; >diff --git a/Source/JavaScriptCore/runtime/JSCJSValueInlines.h b/Source/JavaScriptCore/runtime/JSCJSValueInlines.h >index 1510b4185274e8a27e1d3bdf4ef8d8c713fa0ae8..e1fbeedbda57ae852ed4d5d16d2ced75f70af82f 100644 >--- a/Source/JavaScriptCore/runtime/JSCJSValueInlines.h >+++ b/Source/JavaScriptCore/runtime/JSCJSValueInlines.h >@@ -27,6 +27,7 @@ > #define JSValueInlines_h > > #include "InternalFunction.h" >+#include "Identifier.h" > #include "JSCJSValue.h" > #include "JSCellInlines.h" > #include "JSFunction.h" >@@ -549,9 +550,14 @@ inline bool JSValue::isString() const > return isCell() && asCell()->isString(); > } > >+inline bool JSValue::isSymbol() const >+{ >+ return isCell() && asCell()->isSymbol(); >+} >+ > inline bool JSValue::isPrimitive() const > { >- return !isCell() || asCell()->isString(); >+ return !isCell() || asCell()->isString() || asCell()->isSymbol(); > } > > inline bool JSValue::isGetterSetter() const >@@ -604,6 +610,17 @@ ALWAYS_INLINE bool JSValue::getUInt32(uint32_t& v) const > return false; > } > >+inline PropertyName JSValue::toPropertyKey(ExecState* exec) const >+{ >+ if (isString()) >+ return asString(*this)->toIdentifier(exec); >+ >+ JSValue primitive = toPrimitive(exec, PreferString); >+ if (primitive.isSymbol()) >+ return asSymbol(primitive)->privateName(); >+ return primitive.toString(exec)->toIdentifier(exec); >+} >+ > inline JSValue JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const > { > return isCell() ? asCell()->toPrimitive(exec, preferredType) : asValue(); >@@ -806,6 +823,14 @@ ALWAYS_INLINE bool JSValue::equalSlowCaseInline(ExecState* exec, JSValue v1, JSV > continue; > } > >+ bool sym1 = v1.isSymbol(); >+ bool sym2 = v2.isSymbol(); >+ if (sym1 || sym2) { >+ if (sym1 && sym2) >+ return asSymbol(v1)->privateName().uid() == asSymbol(v2)->privateName().uid(); >+ return false; >+ } >+ > if (s1 || s2) { > double d1 = v1.toNumber(exec); > double d2 = v2.toNumber(exec); >@@ -831,6 +856,8 @@ ALWAYS_INLINE bool JSValue::strictEqualSlowCaseInline(ExecState* exec, JSValue v > > if (v1.asCell()->isString() && v2.asCell()->isString()) > return WTF::equal(*asString(v1)->value(exec).impl(), *asString(v2)->value(exec).impl()); >+ if (v1.asCell()->isSymbol() && v2.asCell()->isSymbol()) >+ return asSymbol(v1)->privateName().uid() == asSymbol(v2)->privateName().uid(); > > return v1 == v2; > } >diff --git a/Source/JavaScriptCore/runtime/JSCell.cpp b/Source/JavaScriptCore/runtime/JSCell.cpp >index 694081db5f17784a54a48e085bad6e13d89f09c8..2c403c813fb38568b0e60ce78989ddea4c953c12 100644 >--- a/Source/JavaScriptCore/runtime/JSCell.cpp >+++ b/Source/JavaScriptCore/runtime/JSCell.cpp >@@ -96,7 +96,7 @@ ConstructType JSCell::getConstructData(JSCell*, ConstructData& constructData) > > void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue value, PutPropertySlot& slot) > { >- if (cell->isString()) { >+ if (cell->isString() || cell->isSymbol()) { > JSValue(cell).putToPrimitive(exec, identifier, value, slot); > return; > } >@@ -106,7 +106,7 @@ void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue > > void JSCell::putByIndex(JSCell* cell, ExecState* exec, unsigned identifier, JSValue value, bool shouldThrow) > { >- if (cell->isString()) { >+ if (cell->isString() || cell->isSymbol()) { > PutPropertySlot slot(cell, shouldThrow); > JSValue(cell).putToPrimitive(exec, Identifier::from(exec, identifier), value, slot); > return; >@@ -138,6 +138,8 @@ JSValue JSCell::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredTyp > { > if (isString()) > return static_cast<const JSString*>(this)->toPrimitive(exec, preferredType); >+ if (isSymbol()) >+ return static_cast<const Symbol*>(this)->toPrimitive(exec, preferredType); > return static_cast<const JSObject*>(this)->toPrimitive(exec, preferredType); > } > >@@ -145,6 +147,8 @@ bool JSCell::getPrimitiveNumber(ExecState* exec, double& number, JSValue& value) > { > if (isString()) > return static_cast<const JSString*>(this)->getPrimitiveNumber(exec, number, value); >+ if (isSymbol()) >+ return static_cast<const Symbol*>(this)->getPrimitiveNumber(exec, number, value); > return static_cast<const JSObject*>(this)->getPrimitiveNumber(exec, number, value); > } > >@@ -152,6 +156,8 @@ double JSCell::toNumber(ExecState* exec) const > { > if (isString()) > return static_cast<const JSString*>(this)->toNumber(exec); >+ if (isSymbol()) >+ return static_cast<const Symbol*>(this)->toNumber(exec); > return static_cast<const JSObject*>(this)->toNumber(exec); > } > >@@ -159,6 +165,8 @@ JSObject* JSCell::toObject(ExecState* exec, JSGlobalObject* globalObject) const > { > if (isString()) > return static_cast<const JSString*>(this)->toObject(exec, globalObject); >+ if (isSymbol()) >+ return static_cast<const Symbol*>(this)->toObject(exec, globalObject); > ASSERT(isObject()); > return jsCast<JSObject*>(const_cast<JSCell*>(this)); > } >diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h >index f57a5c87995ca4c332e28a3657205a2d5c5e101e..4839f64fa1a820eeacb709f98c30b7af7c4e8194 100644 >--- a/Source/JavaScriptCore/runtime/JSCell.h >+++ b/Source/JavaScriptCore/runtime/JSCell.h >@@ -85,6 +85,7 @@ class JSCell { > public: > // Querying the type. > bool isString() const; >+ bool isSymbol() const; > bool isObject() const; > bool isGetterSetter() const; > bool isCustomGetterSetter() const; >diff --git a/Source/JavaScriptCore/runtime/JSCellInlines.h b/Source/JavaScriptCore/runtime/JSCellInlines.h >index 151ae77adbd9003d974c0376fb6e2080d54cb75e..5284c975b070613ccb8066b4a5cc47b9abd028ed 100644 >--- a/Source/JavaScriptCore/runtime/JSCellInlines.h >+++ b/Source/JavaScriptCore/runtime/JSCellInlines.h >@@ -164,6 +164,11 @@ inline bool JSCell::isString() const > return m_type == StringType; > } > >+inline bool JSCell::isSymbol() const >+{ >+ return m_type == SymbolType; >+} >+ > inline bool JSCell::isGetterSetter() const > { > return m_type == GetterSetterType; >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >index dbeebe88ec14636d191215ffeb33b875c4910a8c..7aae9f27b938d26b03f04b19019eff7986b31617 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >@@ -94,9 +94,6 @@ > #include "MapPrototype.h" > #include "MathObject.h" > #include "Microtask.h" >-#include "NameConstructor.h" >-#include "NameInstance.h" >-#include "NamePrototype.h" > #include "NativeErrorConstructor.h" > #include "NativeErrorPrototype.h" > #include "NullGetterFunction.h" >@@ -117,6 +114,9 @@ > #include "StrictEvalActivation.h" > #include "StringConstructor.h" > #include "StringPrototype.h" >+#include "Symbol.h" >+#include "SymbolPrototype.h" >+#include "SymbolConstructor.h" > #include "VariableWatchpointSetInlines.h" > #include "WeakMapConstructor.h" > #include "WeakMapPrototype.h" >@@ -423,15 +423,6 @@ void JSGlobalObject::init(VM& vm) > JSConsole* consoleObject = JSConsole::create(vm, m_consoleStructure.get()); > putDirectWithoutTransition(vm, Identifier(exec, "console"), consoleObject, DontEnum); > >- if (m_experimentsEnabled) { >- NamePrototype* privateNamePrototype = NamePrototype::create(exec, NamePrototype::createStructure(vm, this, m_objectPrototype.get())); >- m_privateNameStructure.set(vm, this, NameInstance::createStructure(vm, this, privateNamePrototype)); >- >- JSCell* privateNameConstructor = NameConstructor::create(vm, NameConstructor::createStructure(vm, this, m_functionPrototype.get()), privateNamePrototype); >- privateNamePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, privateNameConstructor, DontEnum); >- putDirectWithoutTransition(vm, Identifier(exec, "Name"), privateNameConstructor, DontEnum); >- } >- > resetPrototype(vm, prototype()); > } > >@@ -692,7 +683,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > visitor.append(&thisObject->m_functionStructure); > visitor.append(&thisObject->m_boundFunctionStructure); > visitor.append(&thisObject->m_namedFunctionStructure); >- visitor.append(&thisObject->m_privateNameStructure); >+ visitor.append(&thisObject->m_symbolObjectStructure); > visitor.append(&thisObject->m_regExpMatchesArrayStructure); > visitor.append(&thisObject->m_regExpStructure); > visitor.append(&thisObject->m_consoleStructure); >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h >index 4f640781afb5eaed2b8ba500e72768cb46b81b4d..8274c79acb2f1746e08a4e694ef9e2f7ecf096cc 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h >@@ -33,6 +33,7 @@ > #include "NumberPrototype.h" > #include "SpecialPointer.h" > #include "StringPrototype.h" >+#include "SymbolPrototype.h" > #include "StructureChain.h" > #include "StructureRareDataInlines.h" > #include "VM.h" >@@ -90,6 +91,7 @@ > macro(Map, map, map, JSMap, Map) \ > macro(Date, date, date, DateInstance, Date) \ > macro(String, string, stringObject, StringObject, String) \ >+ macro(Symbol, symbol, symbolObject, SymbolObject, Symbol) \ > macro(Boolean, boolean, booleanObject, BooleanObject, Boolean) \ > macro(Number, number, numberObject, NumberObject, Number) \ > macro(Error, error, error, ErrorInstance, Error) \ >@@ -390,6 +392,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { > ArrayPrototype* arrayPrototype() const { return m_arrayPrototype.get(); } > BooleanPrototype* booleanPrototype() const { return m_booleanPrototype.get(); } > StringPrototype* stringPrototype() const { return m_stringPrototype.get(); } >+ SymbolPrototype* symbolPrototype() const { return m_symbolPrototype.get(); } > NumberPrototype* numberPrototype() const { return m_numberPrototype.get(); } > DatePrototype* datePrototype() const { return m_datePrototype.get(); } > RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); } >@@ -448,6 +451,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { > Structure* regExpStructure() const { return m_regExpStructure.get(); } > Structure* setStructure() const { return m_setStructure.get(); } > Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); } >+ Structure* symbolObjectStructure() const { return m_symbolObjectStructure.get(); } > Structure* iteratorResultStructure() const { return m_iteratorResultStructure.get(); } > static ptrdiff_t iteratorResultStructureOffset() { return OBJECT_OFFSETOF(JSGlobalObject, m_iteratorResultStructure); } > >diff --git a/Source/JavaScriptCore/runtime/JSONObject.cpp b/Source/JavaScriptCore/runtime/JSONObject.cpp >index 4974e882dc88ff2482d5a33d38ea02ac3140ad3b..6bcf6e54321961f4e33a6b4c421ec39587195bda 100644 >--- a/Source/JavaScriptCore/runtime/JSONObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSONObject.cpp >@@ -228,7 +228,9 @@ JSValue PropertyNameForFunctionCall::value(ExecState* exec) const > continue; > } > >- m_arrayReplacerPropertyNames.add(name.toString(exec)->toIdentifier(exec)); >+ // Don't insert Symbol into m_arrayReplacerPropertyNames. >+ if (name.isNumber() || name.isString()) >+ m_arrayReplacerPropertyNames.add(name.toString(exec)->toIdentifier(exec)); > } > return; > } >diff --git a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp >index 38d8b7fb30fa5185d006b645c5fe6d138f052c44..b8fb2282afae87ecc4110245ce9bb873e950f0ff 100644 >--- a/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSSymbolTableObject.cpp >@@ -61,7 +61,7 @@ void JSSymbolTableObject::getOwnNonIndexPropertyNames(JSObject* object, ExecStat > ConcurrentJITLocker locker(thisObject->symbolTable()->m_lock); > SymbolTable::Map::iterator end = thisObject->symbolTable()->end(locker); > for (SymbolTable::Map::iterator it = thisObject->symbolTable()->begin(locker); it != end; ++it) { >- if (it->key->isEmptyUnique()) >+ if (it->key->isUnique()) > continue; > if (!(it->value.getAttributes() & DontEnum) || shouldIncludeDontEnumProperties(mode)) > propertyNames.add(Identifier(exec, it->key.get())); >diff --git a/Source/JavaScriptCore/runtime/JSType.h b/Source/JavaScriptCore/runtime/JSType.h >index ab14172b0c019fa2c58d67add68e9050a52eae2d..f86b54cf762d29bc3b78f5a247e912ed0688a325 100644 >--- a/Source/JavaScriptCore/runtime/JSType.h >+++ b/Source/JavaScriptCore/runtime/JSType.h >@@ -33,6 +33,7 @@ enum JSType : uint8_t { > // The CellType value must come before any JSType that is a JSCell. > CellType, > StringType, >+ SymbolType, > > GetterSetterType, > CustomGetterSetterType, >@@ -52,7 +53,6 @@ enum JSType : uint8_t { > FinalObjectType, > JSCalleeType, > JSFunctionType, >- NameInstanceType, > NumberObjectType, > ErrorInstanceType, > PureForwardingProxyType, >diff --git a/Source/JavaScriptCore/runtime/JSTypeInfo.h b/Source/JavaScriptCore/runtime/JSTypeInfo.h >index 49118f34cb8111fc1798796bd4815884a6c7d024..f69596890922e5f426e11e57da2515962a6392d7 100644 >--- a/Source/JavaScriptCore/runtime/JSTypeInfo.h >+++ b/Source/JavaScriptCore/runtime/JSTypeInfo.h >@@ -77,7 +77,6 @@ class TypeInfo { > static bool isObject(JSType type) { return type >= ObjectType; } > bool isFinalObject() const { return type() == FinalObjectType; } > bool isNumberObject() const { return type() == NumberObjectType; } >- bool isName() const { return type() == NameInstanceType; } > > unsigned flags() const { return (static_cast<unsigned>(m_flags2) << 8) | static_cast<unsigned>(m_flags); } > bool masqueradesAsUndefined() const { return isSetOnFlags1(MasqueradesAsUndefined); } >diff --git a/Source/JavaScriptCore/runtime/NameConstructor.cpp b/Source/JavaScriptCore/runtime/NameConstructor.cpp >deleted file mode 100644 >index e497a96ecc37ada4918c4c03e822b59e4cf23255..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/NameConstructor.cpp >+++ /dev/null >@@ -1,69 +0,0 @@ >-/* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >- * >- * 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. >- */ >- >-#include "config.h" >-#include "NameConstructor.h" >- >-#include "JSGlobalObject.h" >-#include "NamePrototype.h" >-#include "JSCInlines.h" >- >-namespace JSC { >- >-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(NameConstructor); >- >-const ClassInfo NameConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(NameConstructor) }; >- >-NameConstructor::NameConstructor(VM& vm, Structure* structure) >- : InternalFunction(vm, structure) >-{ >-} >- >-void NameConstructor::finishCreation(VM& vm, NamePrototype* prototype) >-{ >- Base::finishCreation(vm, prototype->classInfo()->className); >- putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); >- putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); >-} >- >-static EncodedJSValue JSC_HOST_CALL constructPrivateName(ExecState* exec) >-{ >- JSValue publicName = exec->argument(0); >- return JSValue::encode(NameInstance::create(exec->vm(), exec->lexicalGlobalObject()->privateNameStructure(), publicName.toString(exec))); >-} >- >-ConstructType NameConstructor::getConstructData(JSCell*, ConstructData& constructData) >-{ >- constructData.native.function = constructPrivateName; >- return ConstructTypeHost; >-} >- >-CallType NameConstructor::getCallData(JSCell*, CallData& callData) >-{ >- callData.native.function = constructPrivateName; >- return CallTypeHost; >-} >- >-} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/NameConstructor.h b/Source/JavaScriptCore/runtime/NameConstructor.h >deleted file mode 100644 >index 8e20f28fc88e5a06029463095a54c039551d4592..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/NameConstructor.h >+++ /dev/null >@@ -1,65 +0,0 @@ >-/* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >- * >- * 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 NameConstructor_h >-#define NameConstructor_h >- >-#include "InternalFunction.h" >-#include "NameInstance.h" >- >-namespace JSC { >- >-class NamePrototype; >- >-class NameConstructor : public InternalFunction { >-public: >- typedef InternalFunction Base; >- >- static NameConstructor* create(VM& vm, Structure* structure, NamePrototype* prototype) >- { >- NameConstructor* constructor = new (NotNull, allocateCell<NameConstructor>(vm.heap)) NameConstructor(vm, structure); >- constructor->finishCreation(vm, prototype); >- return constructor; >- } >- >- DECLARE_INFO; >- >- static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >- { >- return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >- } >- >-protected: >- void finishCreation(VM&, NamePrototype*); >- >-private: >- NameConstructor(VM&, Structure*); >- static ConstructType getConstructData(JSCell*, ConstructData&); >- static CallType getCallData(JSCell*, CallData&); >-}; >- >-} // namespace JSC >- >-#endif // NameConstructor_h >diff --git a/Source/JavaScriptCore/runtime/NameInstance.cpp b/Source/JavaScriptCore/runtime/NameInstance.cpp >deleted file mode 100644 >index f6d7f7808542194663ecc87eff5dfe770581b0f6..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/NameInstance.cpp >+++ /dev/null >@@ -1,47 +0,0 @@ >-/* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >- * >- * 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. >- */ >- >-#include "config.h" >-#include "NameInstance.h" >- >-#include "JSScope.h" >-#include "JSCInlines.h" >- >-namespace JSC { >- >-const ClassInfo NameInstance::s_info = { "Name", &Base::s_info, 0, CREATE_METHOD_TABLE(NameInstance) }; >- >-NameInstance::NameInstance(VM& vm, Structure* structure, JSString* nameString) >- : Base(vm, structure) >-{ >- m_nameString.set(vm, this, nameString); >-} >- >-void NameInstance::destroy(JSCell* cell) >-{ >- static_cast<NameInstance*>(cell)->NameInstance::~NameInstance(); >-} >- >-} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/NameInstance.h b/Source/JavaScriptCore/runtime/NameInstance.h >deleted file mode 100644 >index 55842d52b89d3de7082713ab1d8dee7b318c057c..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/NameInstance.h >+++ /dev/null >@@ -1,77 +0,0 @@ >-/* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >- * >- * 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 NameInstance_h >-#define NameInstance_h >- >-#include "JSDestructibleObject.h" >-#include "PrivateName.h" >- >-namespace JSC { >- >-class NameInstance : public JSDestructibleObject { >-public: >- typedef JSDestructibleObject Base; >- >- DECLARE_INFO; >- >- static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >- { >- return Structure::create(vm, globalObject, prototype, TypeInfo(NameInstanceType, StructureFlags), info()); >- } >- >- static NameInstance* create(VM& vm, Structure* structure, JSString* nameString) >- { >- NameInstance* name = new (NotNull, allocateCell<NameInstance>(vm.heap)) NameInstance(vm, structure, nameString); >- name->finishCreation(vm); >- return name; >- } >- >- const PrivateName& privateName() { return m_privateName; } >- JSString* nameString() { return m_nameString.get(); } >- >-protected: >- static void destroy(JSCell*); >- >- NameInstance(VM&, Structure*, JSString*); >- >- void finishCreation(VM& vm) >- { >- Base::finishCreation(vm); >- ASSERT(inherits(info())); >- } >- >- PrivateName m_privateName; >- WriteBarrier<JSString> m_nameString; >-}; >- >-inline bool isName(JSValue v) >-{ >- return v.isCell() && v.asCell()->type() == NameInstanceType; >-} >- >-} // namespace JSC >- >-#endif // NameInstance_h >diff --git a/Source/JavaScriptCore/runtime/NamePrototype.cpp b/Source/JavaScriptCore/runtime/NamePrototype.cpp >deleted file mode 100644 >index bf08d9aaea396932994f47e5f80d7b94f1521d1c..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/NamePrototype.cpp >+++ /dev/null >@@ -1,81 +0,0 @@ >-/* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >- * >- * 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. >- */ >- >-#include "config.h" >-#include "NamePrototype.h" >- >-#include "Error.h" >-#include "JSCInlines.h" >- >-namespace JSC { >- >-static EncodedJSValue JSC_HOST_CALL privateNameProtoFuncToString(ExecState*); >- >-} >- >-#include "NamePrototype.lut.h" >- >-namespace JSC { >- >-const ClassInfo NamePrototype::s_info = { "Name", &Base::s_info, &privateNamePrototypeTable, CREATE_METHOD_TABLE(NamePrototype) }; >- >-/* Source for NamePrototype.lut.h >-@begin privateNamePrototypeTable >- toString privateNameProtoFuncToString DontEnum|Function 0 >-@end >-*/ >- >-NamePrototype::NamePrototype(ExecState* exec, Structure* structure) >- : Base(exec->vm(), structure, jsEmptyString(exec)) >-{ >-} >- >-void NamePrototype::finishCreation(VM& vm) >-{ >- Base::finishCreation(vm); >- ASSERT(inherits(info())); >-} >- >-bool NamePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) >-{ >- return getStaticFunctionSlot<Base>(exec, privateNamePrototypeTable, jsCast<NamePrototype*>(object), propertyName, slot); >-} >- >-// ------------------------------ Functions --------------------------- >- >-EncodedJSValue JSC_HOST_CALL privateNameProtoFuncToString(ExecState* exec) >-{ >- JSValue thisValue = exec->thisValue(); >- if (!thisValue.isObject()) >- return throwVMTypeError(exec); >- >- JSObject* thisObject = asObject(thisValue); >- if (!thisObject->inherits(NameInstance::info())) >- return throwVMTypeError(exec); >- >- return JSValue::encode(jsCast<NameInstance*>(thisObject)->nameString()); >-} >- >-} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/NamePrototype.h b/Source/JavaScriptCore/runtime/NamePrototype.h >deleted file mode 100644 >index d4b947f72d3b03cfeaf0177f15d7e55b38aa6946..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/NamePrototype.h >+++ /dev/null >@@ -1,64 +0,0 @@ >-/* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >- * >- * 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 NamePrototype_h >-#define NamePrototype_h >- >-#include "NameInstance.h" >- >-namespace JSC { >- >-class NamePrototype : public NameInstance { >-public: >- typedef NameInstance Base; >- >- static NamePrototype* create(ExecState* exec, Structure* structure) >- { >- VM& vm = exec->vm(); >- NamePrototype* prototype = new (NotNull, allocateCell<NamePrototype>(vm.heap)) NamePrototype(exec, structure); >- prototype->finishCreation(vm); >- return prototype; >- } >- >- DECLARE_INFO; >- >- static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >- { >- return Structure::create(vm, globalObject, prototype, TypeInfo(NameInstanceType, StructureFlags), info()); >- } >- >-protected: >- NamePrototype(ExecState*, Structure*); >- void finishCreation(VM&); >- >- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NameInstance::StructureFlags; >- >-private: >- static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); >-}; >- >-} // namespace JSC >- >-#endif // NamePrototype_h >diff --git a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp >index a87a4fc3cc906de05c0103083b25d3ddc2c8b2ba..602e575289e16cdc16a0bba349785f2e27ef17dd 100644 >--- a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp >+++ b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp >@@ -173,7 +173,7 @@ EncodedJSValue JSC_HOST_CALL objectConstructorGetOwnPropertyDescriptor(ExecState > { > if (!exec->argument(0).isObject()) > return throwVMError(exec, createTypeError(exec, ASCIILiteral("Requested property descriptor of a value that is not an object."))); >- Identifier propertyName = exec->argument(1).toString(exec)->toIdentifier(exec); >+ PropertyName propertyName = exec->argument(1).toPropertyKey(exec); > if (exec->hadException()) > return JSValue::encode(jsNull()); > JSObject* object = asObject(exec->argument(0)); >@@ -316,7 +316,7 @@ EncodedJSValue JSC_HOST_CALL objectConstructorDefineProperty(ExecState* exec) > if (!exec->argument(0).isObject()) > return throwVMError(exec, createTypeError(exec, ASCIILiteral("Properties can only be defined on Objects."))); > JSObject* O = asObject(exec->argument(0)); >- Identifier propertyName = exec->argument(1).toString(exec)->toIdentifier(exec); >+ PropertyName propertyName = exec->argument(1).toPropertyKey(exec); > if (exec->hadException()) > return JSValue::encode(jsNull()); > PropertyDescriptor descriptor; >diff --git a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp >index 33b4420fbccf8b4002d451f3a00db4948f5fb84c..a74b2a55fc4c96a7f23693fcd06107a6fb4a0688 100644 >--- a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp >@@ -85,7 +85,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState* exec) > EncodedJSValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(ExecState* exec) > { > JSValue thisValue = exec->thisValue().toThis(exec, StrictMode); >- return JSValue::encode(jsBoolean(thisValue.toObject(exec)->hasOwnProperty(exec, exec->argument(0).toString(exec)->toIdentifier(exec)))); >+ return JSValue::encode(jsBoolean(thisValue.toObject(exec)->hasOwnProperty(exec, exec->argument(0).toPropertyKey(exec)))); > } > > EncodedJSValue JSC_HOST_CALL objectProtoFuncIsPrototypeOf(ExecState* exec) >@@ -122,7 +122,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncDefineGetter(ExecState* exec) > descriptor.setGetter(get); > descriptor.setEnumerable(true); > descriptor.setConfigurable(true); >- thisObject->methodTable(exec->vm())->defineOwnProperty(thisObject, exec, exec->argument(0).toString(exec)->toIdentifier(exec), descriptor, false); >+ thisObject->methodTable(exec->vm())->defineOwnProperty(thisObject, exec, exec->argument(0).toPropertyKey(exec), descriptor, false); > > return JSValue::encode(jsUndefined()); > } >@@ -142,7 +142,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncDefineSetter(ExecState* exec) > descriptor.setSetter(set); > descriptor.setEnumerable(true); > descriptor.setConfigurable(true); >- thisObject->methodTable(exec->vm())->defineOwnProperty(thisObject, exec, exec->argument(0).toString(exec)->toIdentifier(exec), descriptor, false); >+ thisObject->methodTable(exec->vm())->defineOwnProperty(thisObject, exec, exec->argument(0).toPropertyKey(exec), descriptor, false); > > return JSValue::encode(jsUndefined()); > } >@@ -154,7 +154,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncLookupGetter(ExecState* exec) > return JSValue::encode(jsUndefined()); > > PropertySlot slot(thisObject); >- if (thisObject->getPropertySlot(exec, exec->argument(0).toString(exec)->toIdentifier(exec), slot) >+ if (thisObject->getPropertySlot(exec, exec->argument(0).toPropertyKey(exec), slot) > && slot.isAccessor()) { > GetterSetter* getterSetter = slot.getterSetter(); > return getterSetter->isGetterNull() ? JSValue::encode(jsUndefined()) : JSValue::encode(getterSetter->getter()); >@@ -170,7 +170,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncLookupSetter(ExecState* exec) > return JSValue::encode(jsUndefined()); > > PropertySlot slot(thisObject); >- if (thisObject->getPropertySlot(exec, exec->argument(0).toString(exec)->toIdentifier(exec), slot) >+ if (thisObject->getPropertySlot(exec, exec->argument(0).toPropertyKey(exec), slot) > && slot.isAccessor()) { > GetterSetter* getterSetter = slot.getterSetter(); > return getterSetter->isSetterNull() ? JSValue::encode(jsUndefined()) : JSValue::encode(getterSetter->setter()); >@@ -182,7 +182,7 @@ EncodedJSValue JSC_HOST_CALL objectProtoFuncLookupSetter(ExecState* exec) > EncodedJSValue JSC_HOST_CALL objectProtoFuncPropertyIsEnumerable(ExecState* exec) > { > JSObject* thisObject = exec->thisValue().toThis(exec, StrictMode).toObject(exec); >- Identifier propertyName = exec->argument(0).toString(exec)->toIdentifier(exec); >+ PropertyName propertyName = exec->argument(0).toPropertyKey(exec); > > PropertyDescriptor descriptor; > bool enumerable = thisObject->getOwnPropertyDescriptor(exec, propertyName, descriptor) && descriptor.enumerable(); >diff --git a/Source/JavaScriptCore/runtime/Operations.cpp b/Source/JavaScriptCore/runtime/Operations.cpp >index 36d832f4420b73e316ad81820c4fc34bb177146a..0c9ccb6e39dd12dc0ea60d9dcad38d846c4a18c7 100644 >--- a/Source/JavaScriptCore/runtime/Operations.cpp >+++ b/Source/JavaScriptCore/runtime/Operations.cpp >@@ -65,6 +65,8 @@ JSValue jsTypeStringForValue(VM& vm, JSGlobalObject* globalObject, JSValue v) > return vm.smallStrings.numberString(); > if (v.isString()) > return vm.smallStrings.stringString(); >+ if (v.isSymbol()) >+ return vm.smallStrings.symbolString(); > if (v.isObject()) { > // Return "undefined" for objects that should be treated > // as null when doing comparisons. >@@ -89,7 +91,7 @@ bool jsIsObjectType(CallFrame* callFrame, JSValue v) > return v.isNull(); > > JSType type = v.asCell()->type(); >- if (type == StringType) >+ if (type == StringType || type == SymbolType) > return false; > if (type >= ObjectType) { > if (asObject(v)->structure(callFrame->vm())->masqueradesAsUndefined(callFrame->lexicalGlobalObject())) >diff --git a/Source/JavaScriptCore/runtime/PrivateName.h b/Source/JavaScriptCore/runtime/PrivateName.h >index 55ee634d2a93a5952c71eb0ffd625c7581c0eb16..8272c7a472361b99aba37aa1bf13f72e92361dc4 100644 >--- a/Source/JavaScriptCore/runtime/PrivateName.h >+++ b/Source/JavaScriptCore/runtime/PrivateName.h >@@ -33,13 +33,19 @@ > class PrivateName { > public: > PrivateName() >- : m_impl(StringImpl::createEmptyUnique()) >+ : m_impl(StringImpl::createUniqueEmpty()) > { >+ ASSERT(m_impl->isUnique()); >+ } >+ PrivateName(const String& description) >+ : m_impl(StringImpl::createUnique(description.impl())) >+ { >+ ASSERT(m_impl->isUnique()); > } > explicit PrivateName(StringImpl* uid) > : m_impl(uid) > { >- ASSERT(m_impl->isEmptyUnique()); >+ ASSERT(m_impl->isUnique()); > } > > AtomicStringImpl* uid() const { return static_cast<AtomicStringImpl*>(m_impl.get()); } >diff --git a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h b/Source/JavaScriptCore/runtime/PropertyMapHashTable.h >index d7334c0aedc0fea55ecd1743cf4e9281045b7616..0370a3548da986d0411313e04dac2d15c6ba0904 100644 >--- a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h >+++ b/Source/JavaScriptCore/runtime/PropertyMapHashTable.h >@@ -271,7 +271,7 @@ inline PropertyTable::const_iterator PropertyTable::end() const > inline PropertyTable::find_iterator PropertyTable::find(const KeyType& key) > { > ASSERT(key); >- ASSERT(key->isAtomic() || key->isEmptyUnique()); >+ ASSERT(key->isAtomic() || key->isUnique()); > unsigned hash = key->existingHash(); > unsigned step = 0; > >@@ -305,7 +305,7 @@ inline PropertyTable::find_iterator PropertyTable::find(const KeyType& key) > inline PropertyTable::ValueType* PropertyTable::get(const KeyType& key) > { > ASSERT(key); >- ASSERT(key->isAtomic() || key->isEmptyUnique()); >+ ASSERT(key->isAtomic() || key->isUnique()); > > if (!m_keyCount) > return nullptr; >diff --git a/Source/JavaScriptCore/runtime/PropertyName.h b/Source/JavaScriptCore/runtime/PropertyName.h >index 22a8ff850fe04b6ed400a1edfdbe2bbfddad2e58..3074c72e1070133b97b03b1dff4a43de132fc0a6 100644 >--- a/Source/JavaScriptCore/runtime/PropertyName.h >+++ b/Source/JavaScriptCore/runtime/PropertyName.h >@@ -93,7 +93,7 @@ class PropertyName { > : m_impl(static_cast<AtomicStringImpl*>(propertyName.uid())) > { > ASSERT(m_impl); >- ASSERT(m_impl->isEmptyUnique()); >+ ASSERT(m_impl->isUnique()); > ASSERT(m_impl->isAtomic()); > } > >@@ -104,7 +104,7 @@ class PropertyName { > > AtomicStringImpl* publicName() const > { >- return m_impl->isEmptyUnique() ? nullptr : m_impl; >+ return m_impl->isUnique() ? nullptr : m_impl; > } > > static const uint32_t NotAnIndex = UINT_MAX; >diff --git a/Source/JavaScriptCore/runtime/SmallStrings.h b/Source/JavaScriptCore/runtime/SmallStrings.h >index 36c5782f99ed45e26a9ac2f10eaaebac1a91fb00..9ca0015a05e0a02d91005ddd2b1616819b6f6cae 100644 >--- a/Source/JavaScriptCore/runtime/SmallStrings.h >+++ b/Source/JavaScriptCore/runtime/SmallStrings.h >@@ -38,6 +38,7 @@ > macro(object) \ > macro(undefined) \ > macro(string) \ >+ macro(symbol) \ > macro(true) > > namespace WTF { >diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp >index 86d0b6fbdaece3832cc362fb834098dbcee083a4..3fcb426cda0d5bbac3170a8bcb466175f29c7425 100644 >--- a/Source/JavaScriptCore/runtime/Structure.cpp >+++ b/Source/JavaScriptCore/runtime/Structure.cpp >@@ -947,7 +947,7 @@ void Structure::getPropertyNamesFromStructure(VM& vm, PropertyNameArray& propert > PropertyTable::iterator end = propertyTable()->end(); > for (PropertyTable::iterator iter = propertyTable()->begin(); iter != end; ++iter) { > ASSERT(hasNonEnumerableProperties() || !(iter->attributes & DontEnum)); >- if (!iter->key->isEmptyUnique() && (!(iter->attributes & DontEnum) || shouldIncludeDontEnumProperties(mode))) { >+ if (!iter->key->isUnique() && (!(iter->attributes & DontEnum) || shouldIncludeDontEnumProperties(mode))) { > if (knownUnique) > propertyNames.addKnownUnique(iter->key); > else >diff --git a/Source/JavaScriptCore/runtime/StructureInlines.h b/Source/JavaScriptCore/runtime/StructureInlines.h >index 269292b7d3eac0408ccc79369c64d4e242231fd2..f17bc1b17a401c0dc8918c6db8339c5331085230 100644 >--- a/Source/JavaScriptCore/runtime/StructureInlines.h >+++ b/Source/JavaScriptCore/runtime/StructureInlines.h >@@ -168,6 +168,8 @@ inline JSValue Structure::prototypeForLookup(JSGlobalObject* globalObject) const > { > if (isObject()) > return m_prototype.get(); >+ if (typeInfo().type() == SymbolType) >+ return globalObject->symbolPrototype(); > > ASSERT(typeInfo().type() == StringType); > return globalObject->stringPrototype(); >diff --git a/Source/JavaScriptCore/runtime/Symbol.cpp b/Source/JavaScriptCore/runtime/Symbol.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..4e9b3fcc429b507d5197aa38ba310ef619424c04 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/Symbol.cpp >@@ -0,0 +1,91 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * 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. >+ */ >+ >+#include "config.h" >+#include "Symbol.h" >+ >+#include "Error.h" >+#include "JSScope.h" >+#include "JSCInlines.h" >+#include "SymbolObject.h" >+ >+namespace JSC { >+ >+const ClassInfo Symbol::s_info = { "Symbol", nullptr, nullptr, CREATE_METHOD_TABLE(Symbol) }; >+ >+Symbol::Symbol(VM& vm) >+ : Base(vm, vm.symbolStructure.get()) >+ , m_privateName() >+{ >+} >+ >+Symbol::Symbol(VM& vm, const String& string) >+ : Base(vm, vm.symbolStructure.get()) >+ , m_privateName(string) >+{ >+} >+ >+Symbol::Symbol(VM& vm, AtomicStringImpl* uid) >+ : Base(vm, vm.symbolStructure.get()) >+ , m_privateName(uid) >+{ >+} >+ >+inline SymbolObject* SymbolObject::create(VM& vm, JSGlobalObject* globalObject, Symbol* symbol) >+{ >+ SymbolObject* object = new (NotNull, allocateCell<SymbolObject>(vm.heap)) SymbolObject(vm, globalObject->symbolObjectStructure()); >+ object->finishCreation(vm, symbol); >+ return object; >+} >+ >+JSValue Symbol::toPrimitive(ExecState*, PreferredPrimitiveType) const >+{ >+ return const_cast<Symbol*>(this); >+} >+ >+bool Symbol::getPrimitiveNumber(ExecState* exec, double&, JSValue&) const >+{ >+ throwTypeError(exec); >+ return true; >+} >+ >+JSObject* Symbol::toObject(ExecState* exec, JSGlobalObject* globalObject) const >+{ >+ return SymbolObject::create(exec->vm(), globalObject, const_cast<Symbol*>(this)); >+} >+ >+double Symbol::toNumber(ExecState* exec) const >+{ >+ throwTypeError(exec); >+ return 0.0; >+} >+ >+void Symbol::destroy(JSCell* cell) >+{ >+ static_cast<Symbol*>(cell)->Symbol::~Symbol(); >+} >+ >+} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/Symbol.h b/Source/JavaScriptCore/runtime/Symbol.h >new file mode 100644 >index 0000000000000000000000000000000000000000..009b23397e914493dff642739b7d95a1419e19df >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/Symbol.h >@@ -0,0 +1,109 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * 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 Symbol_h >+#define Symbol_h >+ >+#include "JSCell.h" >+#include "JSString.h" >+#include "PrivateName.h" >+ >+namespace JSC { >+ >+class Symbol : public JSCell { >+public: >+ typedef JSCell Base; >+ >+ DECLARE_INFO; >+ >+ static const bool needsDestruction = true; >+ static const bool hasImmortalStructure = true; >+ >+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+ { >+ return Structure::create(vm, globalObject, prototype, TypeInfo(SymbolType, StructureFlags), info()); >+ } >+ >+ static Symbol* create(VM& vm) >+ { >+ Symbol* symbol = new (NotNull, allocateCell<Symbol>(vm.heap)) Symbol(vm); >+ symbol->finishCreation(vm); >+ return symbol; >+ } >+ >+ static Symbol* create(ExecState* exec, JSString* description) >+ { >+ VM& vm = exec->vm(); >+ String desc = description->value(exec); >+ Symbol* symbol = new (NotNull, allocateCell<Symbol>(vm.heap)) Symbol(vm, desc); >+ symbol->finishCreation(vm); >+ return symbol; >+ } >+ >+ static Symbol* create(VM& vm, AtomicStringImpl* uid) >+ { >+ Symbol* symbol = new (NotNull, allocateCell<Symbol>(vm.heap)) Symbol(vm, uid); >+ symbol->finishCreation(vm); >+ return symbol; >+ } >+ >+ const PrivateName& privateName() { return m_privateName; } >+ >+ JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const; >+ bool getPrimitiveNumber(ExecState*, double& number, JSValue&) const; >+ JSObject* toObject(ExecState*, JSGlobalObject*) const; >+ double toNumber(ExecState*) const; >+ >+protected: >+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | StructureIsImmortal; >+ >+ static void destroy(JSCell*); >+ >+ Symbol(VM&); >+ Symbol(VM&, const String&); >+ Symbol(VM&, AtomicStringImpl* uid); >+ >+ void finishCreation(VM& vm) >+ { >+ Base::finishCreation(vm); >+ ASSERT(inherits(info())); >+ } >+ >+ PrivateName m_privateName; >+}; >+ >+Symbol* asSymbol(JSValue); >+ >+inline Symbol* asSymbol(JSValue value) >+{ >+ ASSERT(value.asCell()->isSymbol()); >+ return jsCast<Symbol*>(value.asCell()); >+} >+ >+} // namespace JSC >+ >+#endif // Symbol_h >diff --git a/Source/JavaScriptCore/runtime/SymbolConstructor.cpp b/Source/JavaScriptCore/runtime/SymbolConstructor.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..fd3ac8a80f940f1ab3ff69208c2820d9d0e7ef6c >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/SymbolConstructor.cpp >@@ -0,0 +1,83 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * 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. >+ */ >+ >+#include "config.h" >+#include "SymbolConstructor.h" >+ >+#include "Error.h" >+#include "JSGlobalObject.h" >+#include "SymbolPrototype.h" >+#include "JSCInlines.h" >+ >+namespace JSC { >+ >+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(SymbolConstructor); >+ >+const ClassInfo SymbolConstructor::s_info = { "Function", &Base::s_info, 0, CREATE_METHOD_TABLE(SymbolConstructor) }; >+ >+SymbolConstructor::SymbolConstructor(VM& vm, Structure* structure) >+ : InternalFunction(vm, structure) >+{ >+} >+ >+#define INITIALIZE_WELL_KNOWN_SYMBOLS(name) \ >+ putDirectWithoutTransition(vm, Identifier(&vm, #name), Symbol::create(vm, vm.propertyNames->name##PrivateName.impl()), DontEnum | DontDelete | ReadOnly); >+ >+void SymbolConstructor::finishCreation(VM& vm, SymbolPrototype* prototype) >+{ >+ Base::finishCreation(vm, prototype->classInfo()->className); >+ putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); >+ putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontDelete | ReadOnly | DontEnum); >+ >+ JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_WELL_KNOWN_SYMBOLS) >+} >+ >+static EncodedJSValue JSC_HOST_CALL callSymbol(ExecState* exec) >+{ >+ JSValue description = exec->argument(0); >+ if (description.isUndefined()) >+ return JSValue::encode(Symbol::create(exec->vm())); >+ return JSValue::encode(Symbol::create(exec, description.toString(exec))); >+} >+ >+static EncodedJSValue JSC_HOST_CALL constructSymbol(ExecState* exec) >+{ >+ return JSValue::encode(throwTypeError(exec)); >+} >+ >+ConstructType SymbolConstructor::getConstructData(JSCell*, ConstructData& constructData) >+{ >+ constructData.native.function = constructSymbol; >+ return ConstructTypeHost; >+} >+ >+CallType SymbolConstructor::getCallData(JSCell*, CallData& callData) >+{ >+ callData.native.function = callSymbol; >+ return CallTypeHost; >+} >+ >+} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/SymbolConstructor.h b/Source/JavaScriptCore/runtime/SymbolConstructor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0ae12d7fdd5c424bb69a26d1dc13ae08084a6839 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/SymbolConstructor.h >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * 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 SymbolConstructor_h >+#define SymbolConstructor_h >+ >+#include "InternalFunction.h" >+#include "Symbol.h" >+ >+namespace JSC { >+ >+class SymbolPrototype; >+ >+class SymbolConstructor : public InternalFunction { >+public: >+ typedef InternalFunction Base; >+ >+ static SymbolConstructor* create(VM& vm, Structure* structure, SymbolPrototype* prototype) >+ { >+ SymbolConstructor* constructor = new (NotNull, allocateCell<SymbolConstructor>(vm.heap)) SymbolConstructor(vm, structure); >+ constructor->finishCreation(vm, prototype); >+ return constructor; >+ } >+ >+ DECLARE_INFO; >+ >+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+ { >+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >+ } >+ >+protected: >+ void finishCreation(VM&, SymbolPrototype*); >+ >+private: >+ SymbolConstructor(VM&, Structure*); >+ static ConstructType getConstructData(JSCell*, ConstructData&); >+ static CallType getCallData(JSCell*, CallData&); >+}; >+ >+} // namespace JSC >+ >+#endif // SymbolConstructor_h >diff --git a/Source/JavaScriptCore/runtime/SymbolObject.cpp b/Source/JavaScriptCore/runtime/SymbolObject.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..8d908e9af273cdcb6834a24e657ca8e3d112b0be >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/SymbolObject.cpp >@@ -0,0 +1,51 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * 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. >+ */ >+ >+#include "config.h" >+#include "SymbolObject.h" >+ >+#include "JSScope.h" >+#include "JSCInlines.h" >+ >+namespace JSC { >+ >+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(SymbolObject); >+ >+const ClassInfo SymbolObject::s_info = { "Symbol", &JSWrapperObject::s_info, 0, CREATE_METHOD_TABLE(SymbolObject) }; >+ >+SymbolObject::SymbolObject(VM& vm, Structure* structure) >+ : JSWrapperObject(vm, structure) >+{ >+} >+ >+void SymbolObject::finishCreation(VM& vm, Symbol* symbol) >+{ >+ Base::finishCreation(vm); >+ ASSERT(inherits(info())); >+ setInternalValue(vm, symbol); >+} >+ >+} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/SymbolObject.h b/Source/JavaScriptCore/runtime/SymbolObject.h >new file mode 100644 >index 0000000000000000000000000000000000000000..4f3c598d9f8c23dbcdeb6b43520f739a92e472d3 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/SymbolObject.h >@@ -0,0 +1,65 @@ >+/* >+ * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) >+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. >+ * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Lesser General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Lesser General Public License for more details. >+ * >+ * You should have received a copy of the GNU Lesser General Public >+ * License along with this library; if not, write to the Free Software >+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+ * >+ */ >+ >+#ifndef SymbolObject_h >+#define SymbolObject_h >+ >+#include "JSWrapperObject.h" >+#include "Symbol.h" >+ >+namespace JSC { >+ >+class SymbolObject : public JSWrapperObject { >+public: >+ typedef JSWrapperObject Base; >+ >+ static SymbolObject* create(VM& vm, Structure* structure) >+ { >+ Symbol* symbol = Symbol::create(vm); >+ SymbolObject* object = new (NotNull, allocateCell<SymbolObject>(vm.heap)) SymbolObject(vm, structure); >+ object->finishCreation(vm, symbol); >+ return object; >+ } >+ static SymbolObject* create(VM& vm, Structure* structure, Symbol* symbol) >+ { >+ SymbolObject* object = new (NotNull, allocateCell<SymbolObject>(vm.heap)) SymbolObject(vm, structure); >+ object->finishCreation(vm, symbol); >+ return object; >+ } >+ static SymbolObject* create(VM&, JSGlobalObject*, Symbol*); >+ >+ DECLARE_EXPORT_INFO; >+ >+ Symbol* internalValue() const { return asSymbol(JSWrapperObject::internalValue());} >+ >+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+ { >+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >+ } >+ >+protected: >+ JS_EXPORT_PRIVATE void finishCreation(VM&, Symbol*); >+ JS_EXPORT_PRIVATE SymbolObject(VM&, Structure*); >+}; >+ >+} // namespace JSC >+ >+#endif // SymbolObject_h >diff --git a/Source/JavaScriptCore/runtime/SymbolPrototype.cpp b/Source/JavaScriptCore/runtime/SymbolPrototype.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..102d62e6f0af17e1e2a01674e4b98bc3bad7047d >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/SymbolPrototype.cpp >@@ -0,0 +1,110 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * 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. >+ */ >+ >+#include "config.h" >+#include "SymbolPrototype.h" >+ >+#include "Error.h" >+#include "JSCInlines.h" >+ >+namespace JSC { >+ >+static EncodedJSValue JSC_HOST_CALL symbolProtoFuncToString(ExecState*); >+static EncodedJSValue JSC_HOST_CALL symbolProtoFuncValueOf(ExecState*); >+ >+} >+ >+#include "SymbolPrototype.lut.h" >+ >+namespace JSC { >+ >+const ClassInfo SymbolPrototype::s_info = { "Symbol", &Base::s_info, &symbolPrototypeTable, CREATE_METHOD_TABLE(SymbolPrototype) }; >+ >+/* Source for SymbolPrototype.lut.h >+@begin symbolPrototypeTable >+ toString symbolProtoFuncToString DontEnum|Function 0 >+ valueOf symbolProtoFuncValueOf DontEnum|Function 0 >+@end >+*/ >+ >+SymbolPrototype::SymbolPrototype(VM& vm, Structure* structure) >+ : Base(vm, structure) >+{ >+} >+ >+void SymbolPrototype::finishCreation(VM& vm) >+{ >+ Base::finishCreation(vm); >+ ASSERT(inherits(info())); >+} >+ >+bool SymbolPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot &slot) >+{ >+ return getStaticFunctionSlot<Base>(exec, symbolPrototypeTable, jsCast<SymbolPrototype*>(object), propertyName, slot); >+} >+ >+// ------------------------------ Functions --------------------------- >+ >+EncodedJSValue JSC_HOST_CALL symbolProtoFuncToString(ExecState* exec) >+{ >+ JSValue thisValue = exec->thisValue(); >+ Symbol* symbol = nullptr; >+ if (thisValue.isSymbol()) >+ symbol = asSymbol(thisValue); >+ else if (!thisValue.isObject()) >+ return throwVMTypeError(exec); >+ else { >+ JSObject* thisObject = asObject(thisValue); >+ if (!thisObject->inherits(SymbolObject::info())) >+ return throwVMTypeError(exec); >+ symbol = asSymbol(jsCast<SymbolObject*>(thisObject)->internalValue()); >+ } >+ >+ String description = symbol->privateName().uid(); >+ StringBuilder builder; >+ builder.appendLiteral("Symbol("); >+ builder.append(description); >+ builder.append(')'); >+ return JSValue::encode(jsString(exec, builder.toString())); >+} >+ >+EncodedJSValue JSC_HOST_CALL symbolProtoFuncValueOf(ExecState* exec) >+{ >+ JSValue thisValue = exec->thisValue(); >+ if (thisValue.isSymbol()) >+ return JSValue::encode(thisValue); >+ >+ if (!thisValue.isObject()) >+ return throwVMTypeError(exec); >+ >+ JSObject* thisObject = asObject(thisValue); >+ if (!thisObject->inherits(SymbolObject::info())) >+ return throwVMTypeError(exec); >+ >+ return JSValue::encode(jsCast<SymbolObject*>(thisObject)->internalValue()); >+} >+ >+} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/SymbolPrototype.h b/Source/JavaScriptCore/runtime/SymbolPrototype.h >new file mode 100644 >index 0000000000000000000000000000000000000000..85a93d3bb07235fda1b9c67ee9b497730fafa32d >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/SymbolPrototype.h >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * 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 SymbolPrototype_h >+#define SymbolPrototype_h >+ >+#include "Symbol.h" >+#include "SymbolObject.h" >+ >+namespace JSC { >+ >+// In the ES6 spec, Symbol.prototype object is an ordinary JS object, not one of the symbol wrapper object instance. >+class SymbolPrototype : public JSDestructibleObject { >+public: >+ typedef JSDestructibleObject Base; >+ >+ static SymbolPrototype* create(VM& vm, JSGlobalObject*, Structure* structure) >+ { >+ SymbolPrototype* prototype = new (NotNull, allocateCell<SymbolPrototype>(vm.heap)) SymbolPrototype(vm, structure); >+ prototype->finishCreation(vm); >+ return prototype; >+ } >+ >+ DECLARE_INFO; >+ >+ static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+ { >+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >+ } >+ >+protected: >+ SymbolPrototype(VM&, Structure*); >+ void finishCreation(VM&); >+ >+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | Base::StructureFlags; >+ >+private: >+ static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); >+}; >+ >+} // namespace JSC >+ >+#endif // SymbolPrototype_h >diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp >index 7a883446078185a19e86b6ec9055e9e5734448f2..80ed9ca517455f17f6af5ff837d868687aad795e 100644 >--- a/Source/JavaScriptCore/runtime/VM.cpp >+++ b/Source/JavaScriptCore/runtime/VM.cpp >@@ -220,6 +220,7 @@ static bool enableAssembler(ExecutableAllocator& executableAllocator) > programExecutableStructure.set(*this, ProgramExecutable::createStructure(*this, 0, jsNull())); > functionExecutableStructure.set(*this, FunctionExecutable::createStructure(*this, 0, jsNull())); > regExpStructure.set(*this, RegExp::createStructure(*this, 0, jsNull())); >+ symbolStructure.set(*this, Symbol::createStructure(*this, 0, jsNull())); > symbolTableStructure.set(*this, SymbolTable::createStructure(*this, 0, jsNull())); > structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull())); > sparseArrayValueMapStructure.set(*this, SparseArrayValueMap::createStructure(*this, 0, jsNull())); >diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h >index f8842821761f6ad8abea098d28aa76b0942b6e0f..ce337b8b2417244a6b3b1e45fb845835c3491847 100644 >--- a/Source/JavaScriptCore/runtime/VM.h >+++ b/Source/JavaScriptCore/runtime/VM.h >@@ -264,6 +264,7 @@ class VM : public ThreadSafeRefCounted<VM> { > Strong<Structure> programExecutableStructure; > Strong<Structure> functionExecutableStructure; > Strong<Structure> regExpStructure; >+ Strong<Structure> symbolStructure; > Strong<Structure> symbolTableStructure; > Strong<Structure> structureChainStructure; > Strong<Structure> sparseArrayValueMapStructure; >diff --git a/Source/WTF/wtf/text/StringImpl.cpp b/Source/WTF/wtf/text/StringImpl.cpp >index 28a23b42398f98c035c183996357b8260f7bccc2..fd4dcb7b8e07dbdcf9f3257bae7f825c62501e85 100644 >--- a/Source/WTF/wtf/text/StringImpl.cpp >+++ b/Source/WTF/wtf/text/StringImpl.cpp >@@ -109,7 +109,7 @@ void StringStats::printStats() > > STRING_STATS_REMOVE_STRING(*this); > >- if (isAtomic() && m_length) >+ if (isAtomic() && length() && !isUnique()) > AtomicString::remove(this); > > BufferOwnership ownership = bufferOwnership(); >diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h >index b66b0cc6c52f0891ffa08d3c6959ddf017e39cd8..fd9e216c8fa961bcf35b4b13f862f2e993d7e080 100644 >--- a/Source/WTF/wtf/text/StringImpl.h >+++ b/Source/WTF/wtf/text/StringImpl.h >@@ -280,7 +280,7 @@ class StringImpl { > // We expect m_length to be initialized to 0 as we use it > // to represent a null terminated buffer. > , m_data8(reinterpret_cast<const LChar*>(&m_length)) >- , m_hashAndFlags(hashAndFlagsForEmptyUnique()) >+ , m_hashAndFlags(hashAndFlagsForUnique(s_hashFlag8BitBuffer | BufferInternal)) > { > ASSERT(m_data8); > >@@ -378,11 +378,28 @@ class StringImpl { > return constructInternal<T>(resultImpl, length); > } > >- static Ref<StringImpl> createEmptyUnique() >+ ALWAYS_INLINE static Ref<StringImpl> createUniqueEmpty() > { > return adoptRef(*new StringImpl(CreateEmptyUnique)); > } > >+ template<unsigned charactersCount> >+ ALWAYS_INLINE static Ref<StringImpl> createUniqueFromLiteral(const char (&characters)[charactersCount]) >+ { >+ Ref<StringImpl> string = createFromLiteral<charactersCount>(characters); >+ string->m_hashAndFlags = hashAndFlagsForUnique(string->m_hashAndFlags); >+ return string; >+ } >+ >+ ALWAYS_INLINE static Ref<StringImpl> createUnique(PassRefPtr<StringImpl> rep) >+ { >+ Ref<StringImpl> string = createSubstringSharingImpl(rep, 0, rep->length()); >+ if (!string->length()) >+ return createUniqueEmpty(); >+ string->m_hashAndFlags = hashAndFlagsForUnique(string->m_hashAndFlags); >+ return string; >+ } >+ > // 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(), > // the originalString can't be used after this function. >@@ -392,6 +409,7 @@ class StringImpl { > static unsigned flagsOffset() { return OBJECT_OFFSETOF(StringImpl, m_hashAndFlags); } > static unsigned flagIs8Bit() { return s_hashFlag8BitBuffer; } > static unsigned flagIsAtomic() { return s_hashFlagIsAtomic; } >+ static unsigned flagIsUnique() { return s_hashFlagIsUnique; } > static unsigned dataOffset() { return OBJECT_OFFSETOF(StringImpl, m_data8); } > > template<typename CharType, size_t inlineCapacity, typename OverflowHandler> >@@ -451,16 +469,13 @@ class StringImpl { > > WTF_EXPORT_STRING_API size_t sizeInBytes() const; > >- bool isEmptyUnique() const >- { >- return !length() && !isStatic(); >- } >+ bool isUnique() const { return m_hashAndFlags & s_hashFlagIsUnique; } > > bool isAtomic() const { return m_hashAndFlags & s_hashFlagIsAtomic; } > void setIsAtomic(bool isAtomic) > { > ASSERT(!isStatic()); >- ASSERT(!isEmptyUnique()); >+ ASSERT(!isUnique()); > if (isAtomic) > m_hashAndFlags |= s_hashFlagIsAtomic; > else >@@ -772,17 +787,18 @@ class StringImpl { > template <typename CharType> static Ref<StringImpl> reallocateInternal(PassRefPtr<StringImpl>, unsigned, CharType*&); > template <typename CharType> static Ref<StringImpl> createInternal(const CharType*, unsigned); > WTF_EXPORT_PRIVATE NEVER_INLINE unsigned hashSlowCase() const; >- WTF_EXPORT_PRIVATE unsigned hashAndFlagsForEmptyUnique(); >+ WTF_EXPORT_PRIVATE static unsigned hashAndFlagsForUnique(unsigned flags); > > // The bottom bit in the ref count indicates a static (immortal) string. > static const unsigned s_refCountFlagIsStaticString = 0x1; > static const unsigned s_refCountIncrement = 0x2; // This allows us to ref / deref without disturbing the static string flag. > > // The bottom 6 bits in the hash are flags. >- static const unsigned s_flagCount = 6; >+ static const unsigned s_flagCount = 7; > static const unsigned s_flagMask = (1u << s_flagCount) - 1; > COMPILE_ASSERT(s_flagCount <= StringHasher::flagCount, StringHasher_reserves_enough_bits_for_StringImpl_flags); > >+ static const unsigned s_hashFlagIsUnique = 1u << 6; > static const unsigned s_hashFlag8BitBuffer = 1u << 5; > static const unsigned s_hashFlagIsAtomic = 1u << 4; > static const unsigned s_hashFlagDidReportCost = 1u << 3; >diff --git a/Source/WTF/wtf/text/StringStatics.cpp b/Source/WTF/wtf/text/StringStatics.cpp >index a234ffd2936e67e6a2fc8eeffae09b74195f37f9..e67f87c68c18ce77b04fd7f8ec8c8247cc0fb898 100644 >--- a/Source/WTF/wtf/text/StringStatics.cpp >+++ b/Source/WTF/wtf/text/StringStatics.cpp >@@ -47,17 +47,17 @@ StringImpl* StringImpl::empty() > return &emptyString.get(); > } > >-// Set the hash early, so that all empty unique StringImpls have a hash, >+// Set the hash early, so that all unique StringImpls have a hash, > // and don't use the normal hashing algorithm - the unique nature of these > // keys means that we don't need them to match any other string (in fact, > // that's exactly the oposite of what we want!), and the normal hash would > // lead to lots of conflicts. >-unsigned StringImpl::hashAndFlagsForEmptyUnique() >+unsigned StringImpl::hashAndFlagsForUnique(unsigned flags) > { >- static unsigned s_nextHashAndFlagsForEmptyUnique = BufferInternal | s_hashFlag8BitBuffer | s_hashFlagIsAtomic; >- s_nextHashAndFlagsForEmptyUnique += 1 << s_flagCount; >- s_nextHashAndFlagsForEmptyUnique |= 1 << 31; >- return s_nextHashAndFlagsForEmptyUnique; >+ static unsigned s_nextHashAndFlagsForUnique = (flags & s_flagMask) | s_hashFlagIsAtomic | s_hashFlagIsUnique; >+ s_nextHashAndFlagsForUnique += 1 << s_flagCount; >+ s_nextHashAndFlagsForUnique |= 1 << 31; >+ return s_nextHashAndFlagsForUnique; > } > > WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, nullAtom)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 140435
:
244603
|
244858
|
244859
|
244860
|
245298
|
245299
|
245300
|
245303
|
245304
|
245400
|
245401
|
245407
|
245409
|
245420
|
245455
|
245457
|
245458
|
245590
|
245591
|
245592
|
245594
|
245600
|
245601
|
245602
|
245636
|
245728