Ignore:
Timestamp:
May 7, 2015, 11:01:46 AM (10 years ago)
Author:
[email protected]
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r183615 r183935  
    14531453}
    14541454
    1455 ALWAYS_INLINE JSObject* Register::function() const
    1456 {
    1457     if (!jsValue())
    1458         return 0;
     1455ALWAYS_INLINE JSObject* Register::object() const
     1456{
    14591457    return asObject(jsValue());
    14601458}
    14611459
    1462 ALWAYS_INLINE Register Register::withCallee(JSObject* callee)
    1463 {
    1464     Register r;
    1465     r = JSValue(callee);
    1466     return r;
     1460ALWAYS_INLINE Register& Register::operator=(JSObject* object)
     1461{
     1462    u.value = JSValue::encode(JSValue(object));
     1463    return *this;
    14671464}
    14681465
Note: See TracChangeset for help on using the changeset viewer.