Use the default hash value for Symbolized StringImpl
https://bugs.webkit.org/show_bug.cgi?id=144347
Reviewed by Darin Adler.
Source/JavaScriptCore:
Before this patch, symbolized StringImpl* has a special hash value
to avoid the hash collision with the other normal StringImpl*.
I guess that it is introduced when private symbols are introduced.
However, it prevents using symbolized StringImpl* in the other place
For example, using it as WTFString cause a problem because of its special hash value.
When only using private symbols, they are not exposed to the outside of JSC,
so we can handle it carefully. But now, it's extended to symbols.
So I think storing a special hash value in StringImpl* causes an error.
To avoid this, I propose using the usual hash value in symbolized StringImpl*.
And to provide significantly different hash value when using it as symbol,
store the additional hash value in symbolized StringImpl*. It is used when
the hash value is required by IdentifierRepHash.
(JSC::IdentifierRepHash::hash):
(JSC::HashTable::entry):
- runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::find):
(JSC::PropertyTable::get):
(JSC::PropertyTable::checkConsistency):
Source/WTF:
Use a default hash value calculation for symbolized StringImpl.
(WTF::StringImpl::createSymbol):
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::symbolAwareHash):
(WTF::StringImpl::existingSymbolAwareHash):
(WTF::StringImpl::hashForSymbol):
- wtf/text/StringStatics.cpp:
(WTF::StringImpl::nextHashForSymbol):
(WTF::StringImpl::hashAndFlagsForSymbol): Deleted.