Ignore:
Timestamp:
Sep 27, 2011, 12:53:49 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Darin Adler.

Changed JSCell::getPrimitiveNumber to manually handle the dispatch for
JSCells (JSObject and JSString in this case).

  • runtime/JSCell.cpp:

(JSC::JSCell::getPrimitiveNumber):

  • runtime/JSCell.h:

Removed JSNotAnObject::getPrimitiveNumber since its return value doesn't
matter and it already implements defaultValue, so JSObject::getPrimitiveNumber
can cover the case for JSNotAnObject.

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

De-virtualized JSObject::getPrimitiveNumber and JSString::getPrimitiveNumber
and changed them to be const. Also made JSString::getPrimitiveNumber public
because it needs to be called from JSCell::getPrimitiveNumber and also since it's
no longer virtual, we want people who have a more specific pointer (JSString*
instead of JSCell*) to not have to pay the cost of a virtual method call.

  • runtime/JSObject.cpp:

(JSC::JSObject::getPrimitiveNumber):

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

(JSC::JSString::getPrimitiveNumber):

  • runtime/JSString.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r96131 r96143  
    260260__ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    261261__ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
    262 __ZN3JSC6JSCell18getPrimitiveNumberEPNS_9ExecStateERdRNS_7JSValueE
    263262__ZN3JSC6JSCell3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
    264263__ZN3JSC6JSCell3putEPNS_9ExecStateEjNS_7JSValueE 
     
    323322__ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateEjNS_7JSValueEj
    324323__ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
    325 __ZN3JSC8JSObject18getPrimitiveNumberEPNS_9ExecStateERdRNS_7JSValueE
    326324__ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
    327325__ZN3JSC8JSObject20visitChildrenVirtualERNS_11SlotVisitorE
Note: See TracChangeset for help on using the changeset viewer.