Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 804d44f89619bfae3e5e2e21a07669b1fb320d57
      
https://github.com/WebKit/WebKit/commit/804d44f89619bfae3e5e2e21a07669b1fb320d57
  Author: Yusuke Suzuki <ysuz...@apple.com>
  Date:   2024-04-04 (Thu, 04 Apr 2024)

  Changed paths:
    A JSTests/microbenchmarks/clone-objects-via-spread.js
    M Source/JavaScriptCore/builtins/BuiltinNames.h
    M Source/JavaScriptCore/bytecode/LinkTimeConstant.h
    M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
    M Source/JavaScriptCore/parser/Nodes.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
    M Source/JavaScriptCore/runtime/ObjectConstructorInlines.h

  Log Message:
  -----------
  [JSC] Cloning via Object Literal + 1 Spread should be super fast
https://bugs.webkit.org/show_bug.cgi?id=272131
rdar://125883824

Reviewed by Alexey Shvayka.

For the pattern like,

    `{ ...object }`

we can use super fast object cloning since there are no properties. After 
checking object is very specifc conditioned FinalObject,
we can just grab a structure, copy butterfly, and create a new object with them.

                                         ToT                     Patched

    clone-objects-via-spread       96.1927+-0.3467     ^     15.9928+-0.1021    
    ^ definitely 6.0147x faster

* JSTests/microbenchmarks/clone-objects-via-spread.js: Added.
(test):
* JSTests/stress/clone-objects-via-spread.js: Added.
(test):
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::ObjectLiteralNode::emitBytecode):
* Source/JavaScriptCore/parser/Nodes.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h:
* Source/JavaScriptCore/runtime/ObjectConstructorInlines.h:
(JSC::checkStrucureForClone):
(JSC::objectCloneFast):
(JSC::tryCreateObjectViaCloning):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to