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/ExceptionHelpers.h

    r95901 r97292  
    6363    }
    6464
    65     virtual UString toString(ExecState*) const;
     65    virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
    6666
    6767public:
     
    9090    }
    9191
    92     virtual UString toString(ExecState*) const;
     92    virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
    9393
    9494public:
Note: See TracChangeset for help on using the changeset viewer.