Skip to content

[JSC] Use same allocator for Subspaces #47238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Constellation
Copy link
Member

@Constellation Constellation commented Jun 26, 2025

edd7ee9

[JSC] Use same allocator for Subspaces
https://bugs.webkit.org/show_bug.cgi?id=295029
rdar://154396224

Reviewed by NOBODY (OOPS!).

This patch shares the same FastMallocAlignedMemoryAllocator between
IsoSubspaces so that we enable empty block stealing again.

* Source/JavaScriptCore/heap/AlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/CompleteSubspace.cpp:
(JSC::CompleteSubspace::CompleteSubspace):
* Source/JavaScriptCore/heap/CompleteSubspace.h:
* Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/GigacageAlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::Heap):
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/heap/IsoSubspace.cpp:
(JSC::IsoSubspace::IsoSubspace):
* Source/JavaScriptCore/heap/IsoSubspace.h:
* Source/JavaScriptCore/heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
* Source/JavaScriptCore/heap/PreciseSubspace.cpp:
(JSC::PreciseSubspace::PreciseSubspace):
* Source/JavaScriptCore/heap/PreciseSubspace.h:
* Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/Subspace.cpp:
(JSC::Subspace::Subspace):
(JSC::Subspace::initialize):
* Source/JavaScriptCore/heap/Subspace.h:
(JSC::Subspace::alignedMemoryAllocator const):
* Source/JavaScriptCore/runtime/DirectArguments.h:
* Source/JavaScriptCore/runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
* Source/JavaScriptCore/runtime/VM.h:
(JSC::VM::cellSpace):
(JSC::VM::variableSizedCellSpace): Deleted.
* Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.h:
* Source/WebCore/bindings/js/WebCoreJSClientData.h:

edd7ee9

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ❌ 🛠 mac-safer-cpp ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@Constellation Constellation self-assigned this Jun 26, 2025
@Constellation Constellation added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Jun 26, 2025
@Constellation Constellation force-pushed the eng/JSC-Use-same-allocator-for-Subspaces branch from e17fb36 to ccef4fb Compare June 26, 2025 14:52
@Constellation Constellation force-pushed the eng/JSC-Use-same-allocator-for-Subspaces branch from ccef4fb to e124b00 Compare June 26, 2025 15:33
https://bugs.webkit.org/show_bug.cgi?id=295029
rdar://154396224

Reviewed by NOBODY (OOPS!).

This patch shares the same FastMallocAlignedMemoryAllocator between
IsoSubspaces so that we enable empty block stealing again.

* Source/JavaScriptCore/heap/AlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/CompleteSubspace.cpp:
(JSC::CompleteSubspace::CompleteSubspace):
* Source/JavaScriptCore/heap/CompleteSubspace.h:
* Source/JavaScriptCore/heap/FastMallocAlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/GigacageAlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::Heap):
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/heap/IsoSubspace.cpp:
(JSC::IsoSubspace::IsoSubspace):
* Source/JavaScriptCore/heap/IsoSubspace.h:
* Source/JavaScriptCore/heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
* Source/JavaScriptCore/heap/PreciseSubspace.cpp:
(JSC::PreciseSubspace::PreciseSubspace):
* Source/JavaScriptCore/heap/PreciseSubspace.h:
* Source/JavaScriptCore/heap/StructureAlignedMemoryAllocator.h:
* Source/JavaScriptCore/heap/Subspace.cpp:
(JSC::Subspace::Subspace):
(JSC::Subspace::initialize):
* Source/JavaScriptCore/heap/Subspace.h:
(JSC::Subspace::alignedMemoryAllocator const):
* Source/JavaScriptCore/runtime/DirectArguments.h:
* Source/JavaScriptCore/runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::subspaceFor):
* Source/JavaScriptCore/runtime/VM.h:
(JSC::VM::cellSpace):
(JSC::VM::variableSizedCellSpace): Deleted.
* Source/JavaScriptCore/wasm/js/JSWebAssemblyArray.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.h:
* Source/WebCore/bindings/js/WebCoreJSClientData.h:
@Constellation Constellation force-pushed the eng/JSC-Use-same-allocator-for-Subspaces branch from e124b00 to edd7ee9 Compare June 26, 2025 16:26
@webkit-ews-buildbot
Copy link
Collaborator

Safer C++ Build #41688 (e124b00)

❌ Found 2 failing files with 2 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot
Copy link
Collaborator

Safer C++ Build #41696 (edd7ee9)

❌ Found 2 failing files with 2 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants