Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cffd5ed032c478c1dee5311a89b91e64909e8b90
https://github.com/WebKit/WebKit/commit/cffd5ed032c478c1dee5311a89b91e64909e8b90
Author: Yusuke Suzuki <[email protected]>
Date: 2026-08-21 (Fri, 21 Aug 2026)
Changed paths:
M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp
M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
M Source/JavaScriptCore/wasm/WasmInliningDecision.cpp
M Source/JavaScriptCore/wasm/WasmWorklist.cpp
M Source/JavaScriptCore/wasm/WasmWorklist.h
M Source/WTF/wtf/MathExtras.h
M Source/WTF/wtf/PriorityQueue.h
M Source/WebCore/loader/ResourceMonitorThrottler.h
M Source/WebCore/page/ImageAnalysisQueue.h
M Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
M Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h
M Tools/TestWebKitAPI/Tests/WTF/PriorityQueue.cpp
Log Message:
-----------
[WTF] Align PriorityQueue to std::priority_queue and fix WasmWorklist
https://bugs.webkit.org/show_bug.cgi?id=322303
rdar://185541345
Reviewed by Dan Hecht.
We found that WasmWorklist's PriorityQueue's ordering is opposite and
not correct. The reason is that PriorityQueue and std::priority_queue's
comparator is opposite and when changing std::priority_queue to
PriorityQueue, we didn't change the comparator. But this is error-prone.
This patch fixes that issue and also change PriorityQueue's comparator
to align it to std::priority_queue's one. So by default, taking
std::less, and populating the greatest value first. Doing the same in
PriorityQueue.
Test: Tools/TestWebKitAPI/Tests/WTF/PriorityQueue.cpp
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
(JSC::B3::Air::Greedy::TmpPriority::operator<):
(JSC::B3::Air::Greedy::TmpPriority::isHigherPriority): Deleted.
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::InliningCandidateIsLowerPriority::operator() const):
(JSC::DFG::InliningPlan::build):
(JSC::DFG::isHigherPriorityInliningCandidate): Deleted.
* Source/JavaScriptCore/wasm/WasmInliningDecision.cpp:
(JSC::Wasm::InliningNodeIsLowerPriority::operator() const):
(JSC::Wasm::InliningDecision::expand):
(JSC::Wasm::isHigherPriority): Deleted.
* Source/JavaScriptCore/wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::completePlanSynchronously):
* Source/JavaScriptCore/wasm/WasmWorklist.h:
(JSC::Wasm::Worklist::QueueElementIsLowerPriority::operator() const):
(JSC::Wasm::Worklist::isHigherPriority): Deleted.
* Source/WTF/wtf/MathExtras.h:
(isLessThan): Deleted.
(isLessThanEqual): Deleted.
(isGreaterThan): Deleted.
(isGreaterThanEqual): Deleted.
* Source/WTF/wtf/PriorityQueue.h:
* Source/WebCore/loader/ResourceMonitorThrottler.h:
* Source/WebCore/page/ImageAnalysisQueue.h:
(WebCore::ImageAnalysisQueue::firstIsHigherPriority): Deleted.
* Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::ReadOperationIsLowerPriority::operator() const):
(WebKit::NetworkCache::Storage::isHigherPriority): Deleted.
* Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h:
* Tools/TestWebKitAPI/Tests/WTF/PriorityQueue.cpp:
(enqueue):
(dequeue):
(TEST(WTF_PriorityQueue, Basic)):
(TEST(WTF_PriorityQueue, ReversedComparator)):
(MoveOnlyIsLessThan::operator() const):
(MoveOnlyIsGreaterThan::operator() const):
(TEST(WTF_PriorityQueue, MoveOnly)):
(TEST(WTF_PriorityQueue, DecreaseKey)):
(TEST(WTF_PriorityQueue, IncreaseKey)):
(TEST(WTF_PriorityQueue, IncreaseKeyWithAReversedComparator)):
(TEST(WTF_PriorityQueue, Iteration)):
(TEST(WTF_PriorityQueue, EqualElementsAreAValidHeap)):
(ReversibleComparator::operator() const):
(TEST(WTF_PriorityQueue, IsValidHeapDetectsAGreaterChild)):
(PrioritizedTaskIsLowerPriority::operator() const):
(TEST(WTF_PriorityQueue, IncreaseKeyMovesTowardsTheFront)):
(TEST(WTF_PriorityQueue, RandomActions)):
(isHigherPriority): Deleted.
(TEST(WTF_PriorityQueue, CustomPriorityFunction)): Deleted.
Canonical link: https://commits.webkit.org/319634@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications