Add a simple register allocator to WebCore for x86_64
https://bugs.webkit.org/show_bug.cgi?id=125771

Reviewed by Geoffrey Garen.

Source/WebCore: 

Add a brain dead register allocator to simplify the use of registers
when writting code generators.

RegisterAllocator has two purposes:
-make it easy to name registers properly.
-make it hard to reuse a register accidentally.

A helper class LocalRegister is also defined to provide an easy
way to work with registers within a C++ scope. For example:
    LocalRegister elementPointer(allocator);
    assembler.load(address, elementPointer);

RegisterAllocator makes no attempt at optimizing register allocations, but it reduces
implicit dependencies by returning used register at the end of the queue, making it less
likely they will be reused before their last instruction is executed.

The current implementation only support unix x86_64, it only uses caller saved registers.

* WebCore.xcodeproj/project.pbxproj:
* cssjit/RegisterAllocator.h: Added.
(WebCore::RegisterAllocator::allocateRegister): Provides any available register.
To restrict runtime exploitation of compiler bugs, the method crashes in release
if the register pool is empty.

(WebCore::RegisterAllocator::reserveRegister): Reserve a particular register.
(WebCore::RegisterAllocator::returnRegister): Return a previously allocated or reserved register.

(WebCore::RegisterAllocator::allocatedRegisters):
(WebCore::LocalRegister::LocalRegister):
(WebCore::LocalRegister::~LocalRegister):
(WebCore::LocalRegister::operator JSC::MacroAssembler::RegisterID):
(WebCore::RegisterAllocator::RegisterAllocator):

Source/WTF: 

* wtf/Platform.h: Add a new flag "CSS_SELECTOR_JIT" to guard
an experimental JIT compiler in WebCore.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove a few more guards mistakenly added in r160367

Reviewed by Martin Robinson.

r160367 was too liberal in hiding APIs from the GObject DOM bindings.

* Modules/battery/NavigatorBattery.idl: Expose NavigatorBattery.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix hit testing for divs with a hierarchy of css transformed and non-transformed elements
https://bugs.webkit.org/show_bug.cgi?id=124777

Patch by Mihai Maerean <mmaerean@adobe.com> on 2013-12-17
Reviewed by Darin Adler.

Source/WebCore:

After bug #124647, the hit test will still behave incorrectly for transformed divs with non
transformed siblings that are all inside a transformed element (tested by the
hover-rotated-with-children-negative-z.html layout test).

The fix is to not take zOffset into account during hit-testing when child layers are in the
same 3D rendering context. Only when preserve3d is true, should hit-testing compute the
zOffset of the layers with transformations and, when two layers overlap, to return the layer
with the highest zOffset.

The patch includes the work of a.renevier from https://codereview.chromium.org/79943002/

Tests: transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html
       transforms/3d/hit-testing/negative-zoffset-hit-test.html
       transforms/3d/hit-testing/overlapping-layers-hit-test.html

* rendering/RenderLayer.cpp:
(WebCore::computeZOffset):
(WebCore::RenderLayer::hitTestLayer):

LayoutTests:

* transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html: Added.
* transforms/3d/hit-testing/hover-rotated-with-children-negative-z-expected.txt: Added.
* transforms/3d/hit-testing/negative-zoffset-hit-test.html: Added.
* transforms/3d/hit-testing/negative-zoffset-hit-test-expected.txt: Added.
* transforms/3d/hit-testing/overlapping-layers-hit-test.html: Added.
* transforms/3d/hit-testing/overlapping-layers-hit-test-expected.txt: Added.

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