HTMLNames should construct strings at compile time
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 00:31:45 +0000 (00:31 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 00:31:45 +0000 (00:31 +0000)
commit7f38315174dd9e0926b30b875e21cea15ae4ac00
tree4124bf2f58e579bc29d968e448a511a19ed3e716
parent9cb056fdf1d27f5c24786c0494d51716e131afcf
HTMLNames should construct strings at compile time
https://bugs.webkit.org/show_bug.cgi?id=112831

Reviewed by Darin Adler.

Source/WebCore:

This patch teaches make_names how to construct strings at compile time,
eliminating a large number of startup mallocs.

* WebCore.gyp/WebCore.gyp:
* WebCore.gyp/scripts/action_makenames.py:
    - Teach the Chromium build how to deal with Perl modules.
* bindings/scripts/StaticString.pm: Added.
    - A Perl module for constructing static strings.
(GenerateStrings):
(GenerateValidateStrings):
* dom/QualifiedName.cpp:
(WebCore::createQualifiedName):
    - createQualifiedName now takes an already-constructed StringImpl
      object.
* dom/QualifiedName.h:
* dom/make_names.pl:
(valueForName):
(namesToStrings):
(printNamesCppFile):
(printDefinitions):
    - Teach make_names how to use StaticString.pm.

Source/WTF:

* wtf/text/StringImpl.h:
(StringImpl):
(StaticASCIILiteral):
    - This struct lets us construct StringImpl objects at compile time.
(WTF::StringImpl::assertValidHash):
    - This function lets us sanity check StringImpl objects created from StaticData.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringImpl.h
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/GNUmakefile.am
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/WebCore.gyp/scripts/action_makenames.py
Source/WebCore/bindings/scripts/StaticString.pm [new file with mode: 0644]
Source/WebCore/dom/QualifiedName.cpp
Source/WebCore/dom/QualifiedName.h
Source/WebCore/dom/make_names.pl