Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9427bb870065f7ce29d7690a17ab359e70e178d5
      
https://github.com/WebKit/WebKit/commit/9427bb870065f7ce29d7690a17ab359e70e178d5
  Author: Yusuke Suzuki <ysuz...@apple.com>
  Date:   2025-04-11 (Fri, 11 Apr 2025)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp

  Log Message:
  -----------
  [JSC] Fix accidental partial unrolling enablement
https://bugs.webkit.org/show_bug.cgi?id=291427
rdar://149067411

Reviewed by Yijia Huang.

We accidentally enabled partial unrolling before. This patch fixes it by
reorganizing the code.

1. shouldFullyUnroll() was called before setting initialValue / operand.
   In this case, since they are initialized with CheckedInt32 INT_MIN,
   it always says "true". We should not call it before setting these
   fields.
2. To make (1) more defensive, we add std::monostate to std::variant of
   these fields and initialize them with std::monostate (1st variant).
   So, it means "nothing is set".
3. Change shouldUnrollLoop to isLoopBodyUnrollable to make it more
   explicit.
4. Explicitly checking partial / full unrolling after setting
   initialValue / operand. And stop unrolling when partial unrolling is
   disabled.

* Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp:
(JSC::DFG::LoopUnrollingPhase::tryUnroll):
(JSC::DFG::LoopUnrollingPhase::identifyInductionVariable):
(JSC::DFG::LoopUnrollingPhase::isLoopBodyUnrollable):
(JSC::DFG::LoopUnrollingPhase::LoopData::dump const):
(JSC::DFG::LoopUnrollingPhase::shouldUnrollLoop): Deleted.

Canonical link: https://commits.webkit.org/293587@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