Ignore:
Timestamp:
Sep 29, 2011, 7:09:16 PM (14 years ago)
Author:
[email protected]
Message:

De-virtualize JSCell::toObject
https://bugs.webkit.org/show_bug.cgi?id=68937

Reviewed by Darin Adler.

De-virtualized JSCell::toObject and changed its implementation to manually check the
cases for JSString and JSObject rather than leaving it up to the virtual method call.

  • runtime/JSCell.cpp:

(JSC::JSCell::toObject):

  • runtime/JSCell.h:

Removed JSNotAnObject::toObject because the case for JSObject works for it.
Also removed JSObject::toObject because it was essentially the identity function,
which is not necessary since toObject is no longer virtual.

  • runtime/JSNotAnObject.cpp:
  • runtime/JSNotAnObject.h:
  • runtime/JSObject.cpp:
  • runtime/JSObject.h:

De-virtualized JSObject::toObject and JSString::toObject.

  • runtime/JSString.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp

    r96143 r96381  
    5656}
    5757
    58 JSObject* JSNotAnObject::toObject(ExecState* exec, JSGlobalObject*) const
    59 {
    60     ASSERT_UNUSED(exec, exec->hadException());
    61     return const_cast<JSNotAnObject*>(this);
    62 }
    63 
    6458// JSObject methods
    6559bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, const Identifier&, PropertySlot&)
Note: See TracChangeset for help on using the changeset viewer.