Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 37413df14c7d3664b678fc94ae2b30b1c1fd5d80
      
https://github.com/WebKit/WebKit/commit/37413df14c7d3664b678fc94ae2b30b1c1fd5d80
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-10-14 (Wed, 14 Oct 2026)

  Changed paths:
    A JSTests/stress/math-pow-base-one.js
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

  Log Message:
  -----------
  [JSC] FTL ArithPow should have a fast path for Math.pow(1, x)
https://bugs.webkit.org/show_bug.cgi?id=327466
rdar://189960465

Reviewed by Sosuke Suzuki.

When Math.pow(1, x) is executed, if x is not NaN and not
Infinity/-Infinity, then the result is 1. We are already checking NaN
and +-Infinity for x, so let's check input is 1 and returning 1 quickly
if true.

Also, ArithPow implementation had many micro basic blocks just returning
a constant. We fold them into a jumping basic block with anchoring.

Test: JSTests/stress/math-pow-base-one.js

* JSTests/stress/math-pow-base-one.js: Added.
(shouldBe):
(pow):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArithPow):

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



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

Reply via email to