Spam static branch prediction hints on JS bindings.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Mar 2014 22:42:53 +0000 (22:42 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Mar 2014 22:42:53 +0000 (22:42 +0000)
commit9d89b13c142abb857bfb5be17587faf96ec01799
treefcc77ff2ac68f98539a6fc2eab8d4f7e8fc90191
parent40bc0f683d9bfd7869e319eb2643d3bce5aa7ddc
Spam static branch prediction hints on JS bindings.
<https://webkit.org/b/129703>

Source/JavaScriptCore:

Add LIKELY hint to jsDynamicCast since it's always used in a context
where we expect it to succeed and takes an error path when it doesn't.

Reviewed by Geoff Garen.

* runtime/JSCell.h:
(JSC::jsDynamicCast):

Source/WebCore:

Add UNLIKELY hints to all !castedThis and exec->hadException() paths
in the JS bindings since they are almost always going to get skipped.

Reviewed by Geoff Garen.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSCell.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp