[webkit-changes] [WebKit/WebKit] 0fdf99: [JSC] Make Object.values faster

Yusuke Suzuki noreply at github.com
Mon Dec 5 14:39:04 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0fdf9960015a8210d00f65256142db6bd125adf1
      https://github.com/WebKit/WebKit/commit/0fdf9960015a8210d00f65256142db6bd125adf1
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2022-12-05 (Mon, 05 Dec 2022)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGOperations.cpp
    M Source/JavaScriptCore/runtime/JSONObject.cpp
    M Source/JavaScriptCore/runtime/JSObject.h
    M Source/JavaScriptCore/runtime/JSObjectInlines.h
    M Source/JavaScriptCore/runtime/ObjectConstructor.cpp
    M Source/JavaScriptCore/runtime/ObjectConstructorInlines.h
    M Source/JavaScriptCore/runtime/Structure.h
    M Source/JavaScriptCore/runtime/StructureInlines.h

  Log Message:
  -----------
  [JSC] Make Object.values faster
https://bugs.webkit.org/show_bug.cgi?id=248749
rdar://102966742

Reviewed by Justin Michaud.

This patch adds JSObject::fastForEachPropertyWithSideEffectFreeFunctor, and apply this to Object.values
to accelerate performance. It makes Object.values 3x faster.

                               ToT                     Patched

    object-values        17.2415+-0.0379     ^      5.6210+-0.0133        ^ definitely 3.0673x faster

* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::FastStringifier::append):
* Source/JavaScriptCore/runtime/JSObject.h:
* Source/JavaScriptCore/runtime/JSObjectInlines.h:
(JSC::JSObject::fastForEachPropertyWithSideEffectFreeFunctor):
* Source/JavaScriptCore/runtime/ObjectConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/ObjectConstructorInlines.h:
(JSC::objectAssignFast):
(JSC::canPerformFastPropertyEnumerationForObjectAssign): Deleted.
(JSC::canPerformFastPropertyEnumerationForJSONStringify): Deleted.
(JSC::canPerformFastPropertyEnumerationForObjectEntries): Deleted.
* Source/JavaScriptCore/runtime/Structure.h:
* Source/JavaScriptCore/runtime/StructureInlines.h:
(JSC::Structure::canPerformFastPropertyEnumeration const):

Canonical link: https://commits.webkit.org/257382@main




More information about the webkit-changes mailing list