Skip to content
  • mhahnenberg@apple.com's avatar
    Remove toPrimitive from JSCell · ff67f6e0
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=67875
    
    Reviewed by Geoffrey Garen.
    
    Part of the refactoring process to un-virtualize JSCell.  We move
    all of the implicit functionality provided by the virtual toPrimitive method
    in JSCell to be explicit in JSValue::toPrimitive and JSCell:toPrimitive while
    also de-virtualizing JSCell::toPrimitive.
    
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * runtime/JSCell.cpp:
    (JSC::JSCell::toPrimitive):
    * runtime/JSCell.h:
    
    We replace JSNotAnObject::toPrimitive with defaultValue, which it overrides from
    JSObject.  This pushes the virtual method further down, enabling us to get rid
    of the virtual call in JSCell.  Eventually we'll probably have to deal with this
    again, but we'll cross that bridge when we come to it.
    * runtime/JSNotAnObject.cpp:
    (JSC::JSNotAnObject::defaultValue):
    * runtime/JSNotAnObject.h:
    * runtime/JSObject.h:
    * runtime/JSString.h:
    (JSC::JSValue::toPrimitive):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ff67f6e0