Ignore:
Timestamp:
Oct 12, 2011, 1:23:08 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Removed toString from JSCallbackObject, since it is no
longer necessary since we now implicitly add toString and valueOf
functions to object prototypes when a convertToType callback
is provided, which is now the standard way to override toString
and valueOf in the JSC C API.

  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

Removed toString from InterruptedExecutionError and
TerminatedExecutionError and replaced it with defaultValue,
which JSObject::toString calls. We'll probably have to de-virtualize
defaultValue eventually, but we'll cross that bridge when we
come to it.

  • runtime/ExceptionHelpers.cpp:

(JSC::InterruptedExecutionError::defaultValue):
(JSC::TerminatedExecutionError::defaultValue):

  • runtime/ExceptionHelpers.h:

Removed toString from JSNotAnObject, since its return value doesn't
actually matter and JSObject::toString can cover it.

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

De-virtualized JSCell::toString, JSObject::toString and JSString::toString.
Added handling of all cases for JSCell to JSCell::toString.

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

(JSC::JSCell::toString):

  • runtime/JSCell.h:

Source/JavaScriptGlue:

Removed UserObjectImp::toString because it's no longer necessary since
clients can provide their own toString callback which will in turn be
called by JSObject::toString.

  • UserObjectImp.cpp:
  • UserObjectImp.h:
File:
1 edited

Legend:

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

    r97015 r97292  
    431431        bool getPrimitiveNumber(ExecState*, double& number, JSValue&) const;
    432432        JSObject* toObject(ExecState*, JSGlobalObject*) const;
     433        UString toString(ExecState*) const;
    433434       
    434435        bool getStringPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     
    503504
    504505        virtual double toNumber(ExecState*) const;
    505         virtual UString toString(ExecState*) const;
    506506
    507507        virtual JSObject* toThisObject(ExecState*) const;
Note: See TracChangeset for help on using the changeset viewer.