Don't branch when accessing the callee
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 18:01:46 +0000 (18:01 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 18:01:46 +0000 (18:01 +0000)
commitc5457c784270a5d5ca78734913f920aef61fd398
tree6ea0c6763afb01f723c4fed96f02df7366602b25
parent3bb786f11679b310067cd1dad267cbade2599929
Don't branch when accessing the callee
https://bugs.webkit.org/show_bug.cgi?id=144645

Reviewed by Michael Saboff.

The branch was added in <http://trac.webkit.org/changeset/81040> without
explanation.

kling found it to be a performance problem. See <https://webkit.org/b/144586>.

Our theory of access to Registers is that it's up to the client to access
them in the right way. So, let's do that.

* interpreter/CallFrame.h:
(JSC::ExecState::callee):
(JSC::ExecState::setCallee): Call the field object instead of function
because nothing guarantees that it's a function.
* interpreter/ProtoCallFrame.h:
(JSC::ProtoCallFrame::callee):
(JSC::ProtoCallFrame::setCallee):
* interpreter/Register.h:
* runtime/JSObject.h:
(JSC::Register::object): Just do a cast like our other accessors do.
(JSC::Register::operator=):
(JSC::Register::function): Deleted.
(JSC::Register::withCallee): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/interpreter/CallFrame.h
Source/JavaScriptCore/interpreter/ProtoCallFrame.h
Source/JavaScriptCore/interpreter/Register.h
Source/JavaScriptCore/runtime/JSObject.h