SelectorCodeGenerator::generateElementIsNthChild() leaks the parent register :nth-child() is non-filtering
https://bugs.webkit.org/show_bug.cgi?id=132311

Reviewed by Andreas Kling.


Source/WebCore: 
In two cases, the parent register was never returned to the register allocator:
-Non filtering selectors (the early return).
-Non marking selectors (at the moment: only querySelector API).

Unfortunately, generateElementIsNthChild() makes function call, which forces us to do this manual allocation
of the parentElement register. Long term, I want RegisterAllocator and FunctionCall to have a special type for that.

Test: fast/selectors/several-nth-child.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):

LayoutTests: 
* fast/selectors/several-nth-child-expected.txt: Added.
* fast/selectors/several-nth-child.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify tryCacheGetById
https://bugs.webkit.org/show_bug.cgi?id=132314

Reviewed by Oliver Hunt and Filip Pizlo.

This is neutral across all benchmarks we track, although it looks like a wee 0.5% progression on sunspider.

* jit/Repatch.cpp:
(JSC::tryCacheGetByID): If we fail to cache on self, we just repatch to call tryBuildGetByIDList next time.


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