[webkit-changes] [WebKit/WebKit] c7d614: [JSC] Add scavenger hook for scavenging external t...
Marcus Plutowski
noreply at github.com
Mon Feb 24 14:08:42 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c7d6142e894fc9ca22be5151076c5c3e40e99f77
https://github.com/WebKit/WebKit/commit/c7d6142e894fc9ca22be5151076c5c3e40e99f77
Author: Marcus Plutowski <marcus_plutowski at apple.com>
Date: 2025-02-24 (Mon, 24 Feb 2025)
Changed paths:
M Source/bmalloc/libpas/libpas.xcodeproj/project.pbxproj
M Source/bmalloc/libpas/src/libpas/pas_scavenger.c
M Source/bmalloc/libpas/src/libpas/pas_scavenger.h
A Source/bmalloc/libpas/src/test/ScavengerExternalWorkTests.cpp
M Source/bmalloc/libpas/src/test/TestHarness.cpp
Log Message:
-----------
[JSC] Add scavenger hook for scavenging external tasks
https://bugs.webkit.org/show_bug.cgi?id=287984
rdar://145154078
Reviewed by Yusuke Suzuki.
This patch should strike a balance between convenience and performance.
Using a fixed array of callbacks is suitable because we always
know which systems are going to hook into libpas -- it's not like
someone will decide at runtime that they need to fall back on
the scavenger.
Re.: the additional mutex, it's possible to do without it -- we would
just need two atomic integers, "next_open_slot" and
"last_initialized_slot". However, this is a nontrivial amount of
complexity and much easier to mess up.
* Source/WTF/wtf/SequesteredAllocator.h:
* Source/WTF/wtf/SequesteredImmortalHeap.h:
(WTF::SequesteredImmortalHeap::installScavengerHook):
(WTF::SequesteredImmortalHeap::scavenge):
* Source/WTF/wtf/Threading.cpp:
(WTF::initialize):
* Source/bmalloc/libpas/libpas.xcodeproj/project.pbxproj:
* Source/bmalloc/libpas/src/libpas/pas_scavenger.c:
(ensure_data_instance):
(scavenger_thread_main):
(pas_scavenger_try_install_foreign_work_callback):
* Source/bmalloc/libpas/src/libpas/pas_scavenger.h:
* Source/bmalloc/libpas/src/test/ScavengerExternalWorkTests.cpp: Added.
(incrementCounter):
(testCallbacksAreCalledWhenExpected):
(addScavengerExternalWorkTests):
* Source/bmalloc/libpas/src/test/TestHarness.cpp:
Canonical link: https://commits.webkit.org/290978@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list