Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0071dfd4f18a9cc5230a2814211ab15d3d43822f
      
https://github.com/WebKit/WebKit/commit/0071dfd4f18a9cc5230a2814211ab15d3d43822f
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-06-27 (Sat, 27 Jun 2026)

  Changed paths:
    A JSTests/microbenchmarks/is-prototype-of-deep-hit.js
    A JSTests/microbenchmarks/is-prototype-of-deep-miss.js
    A JSTests/microbenchmarks/is-prototype-of-shallow.js
    A JSTests/microbenchmarks/is-prototype-of-sometimes-hit.js
    A JSTests/stress/object-is-prototype-of-intrinsic.js
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/runtime/Intrinsic.h
    M Source/JavaScriptCore/runtime/ObjectPrototype.cpp

  Log Message:
  -----------
  [JSC] Use `InstanceOf` DFG node for `Object#isPrototypeOf`
https://bugs.webkit.org/show_bug.cgi?id=317821

Reviewed by Yusuke Suzuki.

Object.prototype.isPrototypeOf was registered without an intrinsic, so DFG/FTL
always emitted a native call. When |this| is an object, isPrototypeOf(V) 
performs
exactly the prototype-chain walk of OrdinaryHasInstance, so we can lower it to 
the
existing InstanceOf node and reuse its inline cache. We speculate ObjectUse on
|this| and OSR exit to the C++ slow path for primitive receivers; the BadType 
exit
profile prevents recompilation loops.

                                    Baseline                  Patched

is-prototype-of-deep-hit        30.6899+-5.4560     ^      6.5041+-1.1688   ^ 
definitely 4.7186x faster
is-prototype-of-sometimes-hit   41.9869+-8.2872     ^     13.9098+-0.7257   ^ 
definitely 3.0185x faster
is-prototype-of-deep-miss       35.0449+-2.4496     ^      6.5066+-1.1866   ^ 
definitely 5.3860x faster
is-prototype-of-shallow         41.7880+-11.8943    ^     11.9066+-1.5946   ^ 
definitely 3.5097x faster

Tests: JSTests/microbenchmarks/is-prototype-of-deep-hit.js
       JSTests/microbenchmarks/is-prototype-of-deep-miss.js
       JSTests/microbenchmarks/is-prototype-of-shallow.js
       JSTests/microbenchmarks/is-prototype-of-sometimes-hit.js
       JSTests/stress/object-is-prototype-of-intrinsic.js

* JSTests/microbenchmarks/is-prototype-of-deep-hit.js: Added.
(test):
* JSTests/microbenchmarks/is-prototype-of-deep-miss.js: Added.
(test):
* JSTests/microbenchmarks/is-prototype-of-shallow.js: Added.
(Foo):
(test):
* JSTests/microbenchmarks/is-prototype-of-sometimes-hit.js: Added.
(Foo):
(Bar):
(test):
* JSTests/stress/object-is-prototype-of-intrinsic.js: Added.
(shouldBe):
(shouldThrow):
(A):
(B):
(C):
(miss):
(test):
(Foo):
(Bar):
(getPrototypeOf):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/runtime/Intrinsic.h:
* Source/JavaScriptCore/runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::finishCreation):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to