Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4eddf2b84045deaa718c105edce3201d71960cc0
      
https://github.com/WebKit/WebKit/commit/4eddf2b84045deaa718c105edce3201d71960cc0
  Author: Yusuke Suzuki <[email protected]>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    A JSTests/microbenchmarks/boolean-constructor.js
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/runtime/BooleanConstructor.cpp
    M Source/JavaScriptCore/runtime/BooleanConstructor.h
    M Source/JavaScriptCore/runtime/Intrinsic.h

  Log Message:
  -----------
  [JSC] Make Boolean constructor fast
https://bugs.webkit.org/show_bug.cgi?id=252889
rdar://105873474

Reviewed by Tadeu Zagallo.

Make Boolean constructor to JSFunction to make call faster. Normally, it does 
not matter to constructors since allocation is much slower,
but Boolean constructor is used for a normal call to enforce the result to 
Boolean, and in this case, allocation does not happen.

With disabling DFG,
                                                     ToT                     
Patched

        boolean-constructor                    12.7293+-0.1106     ^     
11.6629+-0.1843        ^ definitely 1.0914x faster

* JSTests/microbenchmarks/boolean-constructor.js: Added.
(shouldBe):
(test):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/runtime/BooleanConstructor.cpp:
(JSC::BooleanConstructor::BooleanConstructor):
(JSC::BooleanConstructor::finishCreation):
(JSC::BooleanConstructor::create):
* Source/JavaScriptCore/runtime/BooleanConstructor.h:
* Source/JavaScriptCore/runtime/Intrinsic.h:

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to