Skip to content
  • mhahnenberg@apple.com's avatar
    De-virtualize JSCell::getPrimitiveNumber · 061133e0
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=68851
    
    Reviewed by Darin Adler.
    
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    
    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:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    061133e0