Optimize constructing JSC::Identifier from AtomicString.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 02:21:16 +0000 (02:21 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 02:21:16 +0000 (02:21 +0000)
commit4b64333543e61d17150713a185d028fa3d93ffda
treee5ca31c6df97d1b50949d62278e78bf76e97139d
parent79d84413a7a055a0fce4c74904a09f0a97db9063
Optimize constructing JSC::Identifier from AtomicString.
<https://webkit.org/b/139157>

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Add constructors for Identifier taking AtomicString and AtomicStringImpl.
This avoids branching on the string's isAtomic flag, which is obviously
always true for AtomicString & AtomicStringImpl.

Had to add a Identifier(const char*) constructor to resolve implicit
ambiguity between String / AtomicString.

Also made PrivateName::uid() return AtomicStringImpl* to take advantage
of the new constructor in a few places.

* runtime/Identifier.h:
(JSC::Identifier::Identifier):
* runtime/IdentifierInlines.h:
(JSC::Identifier::Identifier):
* runtime/PrivateName.h:
(JSC::PrivateName::uid):

Source/WTF:

Make AtomicString::isInAtomicStringTable() public so it can be used
in some Identifier assertions.

* wtf/text/AtomicString.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Identifier.h
Source/JavaScriptCore/runtime/IdentifierInlines.h
Source/JavaScriptCore/runtime/PrivateName.h
Source/WTF/ChangeLog
Source/WTF/wtf/text/AtomicString.h