Fast-path for casting JS wrappers to JSElement.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Apr 2014 04:42:21 +0000 (04:42 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Apr 2014 04:42:21 +0000 (04:42 +0000)
commit9caaf79ff87825ecda152f01681630bd8a289006
tree573a3f4be771b55d86ed6fd6ef34d21b4c6c18f5
parent8b855315518761358d68a1193a86f0e000c0dda4
Fast-path for casting JS wrappers to JSElement.
<https://webkit.org/b/131210>

Add an extended JSType for Element wrappers so we can avoid walking
the ClassInfo chain in those bindings as well.

Generalized the code to select a casting helper in the bindings
generator into a function (GetCastingHelperForThisObject.)
Updated all the jsDynamicCast call sites to go through this, in case
there's an optimized cast available for the desired type.

Reviewed by Benjamin Poulain.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSElementCustom.h: Added.
(WebCore::jsElementCast):
* bindings/js/JSNodeCustom.h:
(WebCore::jsNodeCast):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GetCastingHelperForThisObject):
(GenerateImplementation):
* dom/Element.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMWrapper.h
Source/WebCore/bindings/js/JSElementCustom.h [new file with mode: 0644]
Source/WebCore/bindings/js/JSNodeCustom.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/dom/Element.idl