Allocate the whole RegExpMatchesArray backing store up front.
<https://webkit.org/b/135217>

We were using the generic array backing store allocation path for
RegExpMatchesArray which meant starting with 4 slots and then growing
it dynamically as we append. Since we always know the final number of
entries up front, allocate a perfectly-sized backing store right away.

~2% progression on Octane/regexp.

Reviewed by Geoffrey Garen.

* runtime/JSArray.h:
(JSC::createArrayButterflyWithExactLength):
* runtime/RegExpMatchesArray.cpp:
(JSC::RegExpMatchesArray::create):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS JIT: compile the :empty pseudo class
https://bugs.webkit.org/show_bug.cgi?id=135958

Reviewed by Andreas Kling.

Source/WebCore:

Compile :empty, nothing fancy.

Tests: fast/selectors/empty-basics.html
       fast/selectors/empty-long-adjacent-backtracking.html
       fast/selectors/empty-adjacent-style-update.html
       fast/selectors/empty-style-update.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
(WebCore::SelectorCompiler::setElementStyleIsAffectedByEmpty):
(WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
(WebCore::SelectorCompiler::setElementStyleIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsEmpty):
* dom/CharacterData.h:
(WebCore::CharacterData::dataMemoryOffset):
* dom/ContainerNode.h:
(WebCore::ContainerNode::firstChildMemoryOffset):
* dom/Node.h:
(WebCore::Node::flagIsText):

Source/WTF:

* wtf/text/StringImpl.h:
(WTF::StringImpl::lengthMemoryOffset):

LayoutTests:

Add some test coverage, :empty had very little testing.

The test empty-adjacent-style-update expose some problems with style update,
I will look into them separately.

* fast/selectors/empty-adjacent-style-update-expected.txt: Added.
* fast/selectors/empty-adjacent-style-update.html: Added.
* fast/selectors/empty-basics-expected.txt: Added.
* fast/selectors/empty-basics.html: Added.
* fast/selectors/empty-long-adjacent-backtracking-expected.txt: Added.
* fast/selectors/empty-long-adjacent-backtracking.html: Added.
* fast/selectors/empty-style-update-expected.txt: Added.
* fast/selectors/empty-style-update.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172619 268f45cc-cd09-0410-ab3c-d52691b4dbfc