Ignore:
Timestamp:
Dec 28, 2018, 8:24:29 PM (7 years ago)
Author:
[email protected]
Message:

[JSC] Remove one indirection in JSObject::toStringName
https://bugs.webkit.org/show_bug.cgi?id=193037

Reviewed by Keith Miller.

Source/JavaScriptCore:

We should not have additional one-level indirection in JSObject::toStringName.
JSObject::toStringName is dispatched through methodTable. Even after that, we
need to call JSObject::className function through methodTable again. But className
function is rarely defined. So instead of introducing this indirection here,
classes having className functions should have toStringName function too. This can
remove one-level indirection in toStringName in major cases.

  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:

(JSC::JSCallbackObject<Parent>::toStringName):

  • debugger/DebuggerScope.cpp:

(JSC::DebuggerScope::toStringName):

  • debugger/DebuggerScope.h:
  • runtime/JSObject.cpp:

(JSC::JSObject::toStringName):

Source/WebCore:

Use old JSObject::toStringName function here.

  • bindings/js/JSDOMConstructorBase.cpp:

(WebCore::JSDOMConstructorBase::className):
(WebCore::JSDOMConstructorBase::toStringName):

  • bindings/js/JSDOMConstructorBase.h:

(WebCore::JSDOMConstructorBase::className): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r237009 r239557  
    141141
    142142template <class Parent>
     143String JSCallbackObject<Parent>::toStringName(const JSObject* object, ExecState* exec)
     144{
     145    VM& vm = exec->vm();
     146    const ClassInfo* info = object->classInfo(vm);
     147    ASSERT(info);
     148    return info->methodTable.className(object, vm);
     149}
     150
     151template <class Parent>
    143152bool JSCallbackObject<Parent>::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    144153{
Note: See TracChangeset for help on using the changeset viewer.