Ignore:
Timestamp:
Sep 19, 2011, 9:33:10 PM (14 years ago)
Author:
[email protected]
Message:

Remove toPrimitive from JSCell
https://bugs.webkit.org/show_bug.cgi?id=67875

Reviewed by Darin Adler.

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:
File:
1 edited

Legend:

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

    r95475 r95516  
    6464
    6565        // JSValue methods
    66         virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
     66        virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
    6767        virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue&);
    6868        virtual bool toBoolean(ExecState*) const;
Note: See TracChangeset for help on using the changeset viewer.