Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bfdfa7afbeb3e92ac37e2200bf6f986145f28f7f
https://github.com/WebKit/WebKit/commit/bfdfa7afbeb3e92ac37e2200bf6f986145f28f7f
Author: Yijia Huang <[email protected]>
Date: 2025-04-14 (Mon, 14 Apr 2025)
Changed paths:
M Source/JavaScriptCore/dfg/DFGCloneHelper.cpp
M Source/JavaScriptCore/dfg/DFGCloneHelper.h
M Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp
Log Message:
-----------
[JSC] Refactor loop unrolling to use CloneHelper with customizable successor
cloning
https://bugs.webkit.org/show_bug.cgi?id=291507
rdar://149186877
Reviewed by Yusuke Suzuki.
This patch refactors the loop unrolling logic to use a generalized CloneHelper
that
supports customizable successor cloning via a template-based functor interface.
Previously, loop unrolling relied on inline logic with separate maps for
cloning nodes
and blocks, along with manual handling of successor updates for the tail block.
This duplication made the logic harder to maintain and less reusable.
With this patch:
- CloneHelper::cloneBlock() now takes a functor to optionally override how
successors are cloned.
- The successor cloning fallback is preserved when the functor returns false.
- Loop unrolling leverages this pattern to cleanly patch the tail block’s
branch without relying on global state or flags.
- The code is now more concise, modular, and generalizable for future passes.
No behavior change is intended, and all CFG reconstruction logic is preserved
via finalize().
* Source/JavaScriptCore/dfg/DFGCloneHelper.cpp:
(JSC::DFG::CloneHelper::blockClone):
(JSC::DFG::CloneHelper::finalize):
(JSC::DFG::CloneHelper::clear):
* Source/JavaScriptCore/dfg/DFGCloneHelper.h:
(JSC::DFG::CloneHelper::CloneHelper):
(JSC::DFG::CloneHelper::cloneBlock):
* Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp:
(JSC::DFG::LoopUnrollingPhase::LoopUnrollingPhase):
(JSC::DFG::LoopUnrollingPhase::unrollLoop):
(JSC::DFG::LoopUnrollingPhase::makeBlock): Deleted.
Canonical link: https://commits.webkit.org/293672@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes