Visitar URL original
[mya] List mya images and snapshots by justinmichaud · Pull Request #76311 · WebKit/WebKit · GitHub
Skip to content

[mya] List mya images and snapshots - #76311

Draft
justinmichaud wants to merge 5 commits into
WebKit:mainfrom
justinmichaud:eng/mya-images
Draft

justinmichaud wants to merge 5 commits into
WebKit:mainfrom
justinmichaud:eng/mya-images

Conversation

@justinmichaud

@justinmichaud justinmichaud commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

27c94fe

[mya] List mya images and snapshots
https://bugs.webkit.org/show_bug.cgi?id=326803

Reviewed by NOBODY (OOPS!).

Shuffle some code around to make listing images and snapshots easier.

Linux now supports snapshots via co-operation with the jsc process.

macOS also supports this co-operative style of snapshot so that the heap
can be walked during a safepoint.

fda1784

[mya] Extend error handling and testing to make future additions easier
https://bugs.webkit.org/show_bug.cgi?id=325303

Reviewed by NOBODY (OOPS!).

Some cleanups to make future tests + linux support easier.

ca9776f

[MYA] Add mya_heap and liblldb + rtti as dependencies.
https://bugs.webkit.org/show_bug.cgi?id=325546

Reviewed by NOBODY (OOPS!).

we add an optional dependency to mya, mya_heap:
- liblldb is used to read debug info

This will be useful in the future when we teach mya how to walk the full native heap.

We add a simple test that confirms that we can use both of these from within mya.

* Configurations/CommonBase.xcconfig:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/Configurations/Base.xcconfig:
* Source/JavaScriptCore/Configurations/DebugRelease.xcconfig:
* Source/JavaScriptCore/Configurations/Mya.xcconfig:
* Source/JavaScriptCore/Configurations/TestLibJSCTools.xcconfig:
* Source/JavaScriptCore/Configurations/libJavaScriptCoreTools.xcconfig:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/corpse/CMakeLists.txt:
* Source/JavaScriptCore/corpse/CorpsePlatform.h:
* Source/JavaScriptCore/corpse/CorpseSnapshot.cpp:
* Source/JavaScriptCore/corpse/tests/LibJSCToolsTestUtilities.cpp:
(JSCToolsTest::copiedHeaderConstantInUtilities):
* Source/JavaScriptCore/corpse/tests/LibJSCToolsTestUtilities.h:
* Source/JavaScriptCore/corpse/tests/TypeinfoTest.cpp: Added.
(JSCToolsTest::testTypeinfo):
* Source/JavaScriptCore/corpse/tests/testLibJSCTools.cpp:
(main):
* Source/JavaScriptCore/shell/CMakeLists.txt:
* Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig:
* Source/ThirdParty/gmock/Configurations/DebugRelease.xcconfig:
* Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig:
* Source/WTF/Configurations/DebugRelease.xcconfig:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WebCore/Configurations/DebugRelease.xcconfig:
* Source/WebCore/PAL/Configurations/DebugRelease.xcconfig:
* Source/WebCore/PAL/ThirdParty/dav1d/Configurations/DebugRelease.xcconfig:
* Source/WebGPU/Configurations/DebugRelease.xcconfig:
* Source/WebInspectorUI/Configurations/DebugRelease.xcconfig:
* Source/WebKit/Configurations/DebugRelease.xcconfig:
* Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig:
* Source/bmalloc/Configurations/DebugRelease.xcconfig:
* Source/bmalloc/PlatformCocoa.cmake:
* Source/cmake/FindLLDB.cmake: Added.
* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/WebKitMacros.cmake:
* Tools/lldb/lldbWebKitTester/Configurations/DebugRelease.xcconfig:

54147e7

[mya] Build mya on linux
https://bugs.webkit.org/show_bug.cgi?id=325094

Reviewed by NOBODY (OOPS!).

This patch is the first step to getting mya working on linux. We add a stub implementation
that does almost nothing, but it confirms that mya can bulid and run on linux.

mya on macOS with cmake and with xcodebuild still work as expected.

We also re-work the testing code a bit to make it easier to add new tests out-of-process.

* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/corpse/CorpseAddress.h:
(JSC::Corpse::Address::Address):
(JSC::Corpse::Address::toTargetVMAddress const):
(JSC::Corpse::Address::deletedValue):
(WTF::DefaultHash<JSC::Corpse::Address>::hash):
(JSC::Corpse::Address::toMachVMAddress const): Deleted.
* Source/JavaScriptCore/corpse/CorpseByteParser.cpp:
* Source/JavaScriptCore/corpse/CorpseByteParser.h:
* Source/JavaScriptCore/corpse/CorpseClient.cpp:
* Source/JavaScriptCore/corpse/CorpseClient.h:
* Source/JavaScriptCore/corpse/CorpseError.h:
* Source/JavaScriptCore/corpse/CorpseExportsTrie.cpp:
* Source/JavaScriptCore/corpse/CorpseExportsTrie.h:
* Source/JavaScriptCore/corpse/CorpseMachVMSPI.h:
* Source/JavaScriptCore/corpse/CorpseMemory.cpp:
(JSC::Corpse::Memory::Region::create):
(JSC::Corpse::Memory::Region::~Region):
(JSC::Corpse::Memory::pageSize):
(JSC::Corpse::Memory::Memory):
(JSC::Corpse::Memory::map):
(JSC::Corpse::Memory::dump const):
* Source/JavaScriptCore/corpse/CorpseMemory.h:
* Source/JavaScriptCore/corpse/CorpseMemoryPtr.h:
(JSC::Corpse::Memory::Ptr::kernResult const):
* Source/JavaScriptCore/corpse/CorpseMemorySpan.h:
(JSC::Corpse::Memory::Span::kernResult const):
* Source/JavaScriptCore/corpse/CorpsePlatform.h: Added.
(JSC::Corpse::isValidTaskHandle):
(JSC::Corpse::OwnedTaskHandle::adopt):
(JSC::Corpse::OwnedTaskHandle::OwnedTaskHandle):
(JSC::Corpse::OwnedTaskHandle::operator=):
(JSC::Corpse::OwnedTaskHandle::~OwnedTaskHandle):
(JSC::Corpse::OwnedTaskHandle::release):
(JSC::Corpse::OwnedTaskHandle::taskHandle):
* Source/JavaScriptCore/corpse/CorpseProcess.cpp:
(JSC::Corpse::reportIfNoProcess):
(JSC::Corpse::Process::holdsLiveTask const):
(JSC::Corpse::Process::attach):
(JSC::Corpse::Process::executablePath const):
(JSC::Corpse::Process::isTranslated const):
(JSC::Corpse::Process::detach): Deleted.
* Source/JavaScriptCore/corpse/CorpseProcess.h:
* Source/JavaScriptCore/corpse/CorpseRegion.cpp:
(JSC::Corpse::Region::findContaining):
(JSC::Corpse::Region::pageCount const):
* Source/JavaScriptCore/corpse/CorpseRegion.h:
* Source/JavaScriptCore/corpse/CorpseSnapshot.cpp:
(JSC::Corpse::takeSnapshot):
(JSC::Corpse::Snapshot::Snapshot):
(JSC::Corpse::Snapshot::~Snapshot): Deleted.
* Source/JavaScriptCore/corpse/CorpseSnapshot.h:
(JSC::Corpse::Snapshot::isValid const):
(JSC::Corpse::Snapshot::corpsePort const):
* Source/JavaScriptCore/corpse/CorpseSymbol.cpp:
(JSC::Corpse::Symbol::reportFailure const):
(JSC::Corpse::Symbol::resolveInImage):
(JSC::Corpse::Symbol::lookUpName):
* Source/JavaScriptCore/corpse/CorpseSymbol.h:
* Source/JavaScriptCore/corpse/CorpseThread.cpp:
(JSC::Corpse::Thread::runStateDescription const):
(JSC::Corpse::Thread::collect):
* Source/JavaScriptCore/corpse/CorpseThread.h:
* Source/JavaScriptCore/corpse/tests/CorpseAddressTest.cpp:
(JSCToolsTest::testAddress):
* Source/JavaScriptCore/corpse/tests/CorpseAddressTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseByteParserTest.cpp:
* Source/JavaScriptCore/corpse/tests/CorpseByteParserTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseExportsTrieTest.cpp:
(JSCToolsTest::testExportsTrie):
(JSCToolsTest::fuzzExportsTrie):
* Source/JavaScriptCore/corpse/tests/CorpseExportsTrieTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseMemoryTest.cpp:
(JSCToolsTest::testMemory):
* Source/JavaScriptCore/corpse/tests/CorpseMemoryTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseProcessTest.cpp:
(JSCToolsTest::testProcess):
* Source/JavaScriptCore/corpse/tests/CorpseProcessTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseRegionTest.cpp:
(JSCToolsTest::testRegion):
* Source/JavaScriptCore/corpse/tests/CorpseRegionTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseSnapshotTest.cpp:
(JSCToolsTest::testSnapshot):
* Source/JavaScriptCore/corpse/tests/CorpseSnapshotTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseSymbolTest.cpp:
(JSCToolsTest::testSymbol):
* Source/JavaScriptCore/corpse/tests/CorpseSymbolTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseThreadTest.cpp:
(JSCToolsTest::testThreads):
* Source/JavaScriptCore/corpse/tests/CorpseThreadTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseVMTest.cpp: Added.
(JSCToolsTest::testVM):
* Source/JavaScriptCore/corpse/tests/LibJSCToolsTestUtilities.cpp:
(JSCToolsTest::linuxSkip):
(JSCToolsTest::parkThread):
(JSCToolsTest::executableBase):
(JSCToolsTest::runCorpseTarget):
(JSCToolsTest::takeSnapshot):
(JSCToolsTest::spawnAndAnalyze):
(JSCToolsTest::analyzeInAndOutOfProcess):
* Source/JavaScriptCore/corpse/tests/LibJSCToolsTestUtilities.h:
* Source/JavaScriptCore/corpse/tests/testLibJSCTools.cpp:
(main):
* Source/JavaScriptCore/mya/mya.cpp:
(Mya::Shell::listThreads):
(Mya::Shell::handlePrint):
(main):
* Source/JavaScriptCore/shell/CMakeLists.txt:
* Source/cmake/WebKitFeatures.cmake:

8802fda

Fix JSC CMake build and jsc/mya entitlements on public macOS builds
https://bugs.webkit.org/show_bug.cgi?id=325093

Reviewed by NOBODY (OOPS!).

Build fixes for CMAKE on macOS, add entitlements needed for public builds on macOS,
and clean up the mya enablement guards.

af6123b

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   🧪 api-mac-debug   🧪 jsc-wpe
  🧪 jsc-x86-64   🧪 api-ios   🧪 mac-wk2   🛠 gtk3-gcc
  🛠 🧪 jsc-debug-arm64   🛠 ios-safer-cpp   🧪 mac-AS-debug-wk2   🛠 gtk
  🛠 vision   🧪 mac-wk2-stress   🧪 gtk-wk2
  🛠 vision-sim   🧪 mac-intel-wk2   🧪 api-gtk
  🧪 vision-wk2   🛠 mac-safer-cpp   🛠 playstation
  🛠 tv   🧪 mac-site-isolation
  🛠 tv-sim
  🛠 watch
  🛠 watch-sim

@justinmichaud justinmichaud self-assigned this Oct 8, 2026
@justinmichaud justinmichaud added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Oct 8, 2026
@justinmichaud justinmichaud added the skip-ews Applied to prevent a change from being run on EWS label Oct 8, 2026
https://bugs.webkit.org/show_bug.cgi?id=325093

Reviewed by NOBODY (OOPS!).

Build fixes for CMAKE on macOS, add entitlements needed for public builds on macOS,
and clean up the mya enablement guards.
https://bugs.webkit.org/show_bug.cgi?id=325094

Reviewed by NOBODY (OOPS!).

This patch is the first step to getting mya working on linux. We add a stub implementation
that does almost nothing, but it confirms that mya can bulid and run on linux.

mya on macOS with cmake and with xcodebuild still work as expected.

We also re-work the testing code a bit to make it easier to add new tests out-of-process.

* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/corpse/CorpseAddress.h:
(JSC::Corpse::Address::Address):
(JSC::Corpse::Address::toTargetVMAddress const):
(JSC::Corpse::Address::deletedValue):
(WTF::DefaultHash<JSC::Corpse::Address>::hash):
(JSC::Corpse::Address::toMachVMAddress const): Deleted.
* Source/JavaScriptCore/corpse/CorpseByteParser.cpp:
* Source/JavaScriptCore/corpse/CorpseByteParser.h:
* Source/JavaScriptCore/corpse/CorpseClient.cpp:
* Source/JavaScriptCore/corpse/CorpseClient.h:
* Source/JavaScriptCore/corpse/CorpseError.h:
* Source/JavaScriptCore/corpse/CorpseExportsTrie.cpp:
* Source/JavaScriptCore/corpse/CorpseExportsTrie.h:
* Source/JavaScriptCore/corpse/CorpseMachVMSPI.h:
* Source/JavaScriptCore/corpse/CorpseMemory.cpp:
(JSC::Corpse::Memory::Region::create):
(JSC::Corpse::Memory::Region::~Region):
(JSC::Corpse::Memory::pageSize):
(JSC::Corpse::Memory::Memory):
(JSC::Corpse::Memory::map):
(JSC::Corpse::Memory::dump const):
* Source/JavaScriptCore/corpse/CorpseMemory.h:
* Source/JavaScriptCore/corpse/CorpseMemoryPtr.h:
(JSC::Corpse::Memory::Ptr::kernResult const):
* Source/JavaScriptCore/corpse/CorpseMemorySpan.h:
(JSC::Corpse::Memory::Span::kernResult const):
* Source/JavaScriptCore/corpse/CorpsePlatform.h: Added.
(JSC::Corpse::isValidTaskHandle):
(JSC::Corpse::OwnedTaskHandle::adopt):
(JSC::Corpse::OwnedTaskHandle::OwnedTaskHandle):
(JSC::Corpse::OwnedTaskHandle::operator=):
(JSC::Corpse::OwnedTaskHandle::~OwnedTaskHandle):
(JSC::Corpse::OwnedTaskHandle::release):
(JSC::Corpse::OwnedTaskHandle::taskHandle):
* Source/JavaScriptCore/corpse/CorpseProcess.cpp:
(JSC::Corpse::reportIfNoProcess):
(JSC::Corpse::Process::holdsLiveTask const):
(JSC::Corpse::Process::attach):
(JSC::Corpse::Process::executablePath const):
(JSC::Corpse::Process::isTranslated const):
(JSC::Corpse::Process::detach): Deleted.
* Source/JavaScriptCore/corpse/CorpseProcess.h:
* Source/JavaScriptCore/corpse/CorpseRegion.cpp:
(JSC::Corpse::Region::findContaining):
(JSC::Corpse::Region::pageCount const):
* Source/JavaScriptCore/corpse/CorpseRegion.h:
* Source/JavaScriptCore/corpse/CorpseSnapshot.cpp:
(JSC::Corpse::takeSnapshot):
(JSC::Corpse::Snapshot::Snapshot):
(JSC::Corpse::Snapshot::~Snapshot): Deleted.
* Source/JavaScriptCore/corpse/CorpseSnapshot.h:
(JSC::Corpse::Snapshot::isValid const):
(JSC::Corpse::Snapshot::corpsePort const):
* Source/JavaScriptCore/corpse/CorpseSymbol.cpp:
(JSC::Corpse::Symbol::reportFailure const):
(JSC::Corpse::Symbol::resolveInImage):
(JSC::Corpse::Symbol::lookUpName):
* Source/JavaScriptCore/corpse/CorpseSymbol.h:
* Source/JavaScriptCore/corpse/CorpseThread.cpp:
(JSC::Corpse::Thread::runStateDescription const):
(JSC::Corpse::Thread::collect):
* Source/JavaScriptCore/corpse/CorpseThread.h:
* Source/JavaScriptCore/corpse/tests/CorpseAddressTest.cpp:
(JSCToolsTest::testAddress):
* Source/JavaScriptCore/corpse/tests/CorpseAddressTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseByteParserTest.cpp:
* Source/JavaScriptCore/corpse/tests/CorpseByteParserTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseExportsTrieTest.cpp:
(JSCToolsTest::testExportsTrie):
(JSCToolsTest::fuzzExportsTrie):
* Source/JavaScriptCore/corpse/tests/CorpseExportsTrieTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseMemoryTest.cpp:
(JSCToolsTest::testMemory):
* Source/JavaScriptCore/corpse/tests/CorpseMemoryTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseProcessTest.cpp:
(JSCToolsTest::testProcess):
* Source/JavaScriptCore/corpse/tests/CorpseProcessTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseRegionTest.cpp:
(JSCToolsTest::testRegion):
* Source/JavaScriptCore/corpse/tests/CorpseRegionTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseSnapshotTest.cpp:
(JSCToolsTest::testSnapshot):
* Source/JavaScriptCore/corpse/tests/CorpseSnapshotTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseSymbolTest.cpp:
(JSCToolsTest::testSymbol):
* Source/JavaScriptCore/corpse/tests/CorpseSymbolTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseThreadTest.cpp:
(JSCToolsTest::testThreads):
* Source/JavaScriptCore/corpse/tests/CorpseThreadTest.h: Removed.
* Source/JavaScriptCore/corpse/tests/CorpseVMTest.cpp: Added.
(JSCToolsTest::testVM):
* Source/JavaScriptCore/corpse/tests/LibJSCToolsTestUtilities.cpp:
(JSCToolsTest::linuxSkip):
(JSCToolsTest::parkThread):
(JSCToolsTest::executableBase):
(JSCToolsTest::runCorpseTarget):
(JSCToolsTest::takeSnapshot):
(JSCToolsTest::spawnAndAnalyze):
(JSCToolsTest::analyzeInAndOutOfProcess):
* Source/JavaScriptCore/corpse/tests/LibJSCToolsTestUtilities.h:
* Source/JavaScriptCore/corpse/tests/testLibJSCTools.cpp:
(main):
* Source/JavaScriptCore/mya/mya.cpp:
(Mya::Shell::listThreads):
(Mya::Shell::handlePrint):
(main):
* Source/JavaScriptCore/shell/CMakeLists.txt:
* Source/cmake/WebKitFeatures.cmake:
https://bugs.webkit.org/show_bug.cgi?id=325546

Reviewed by NOBODY (OOPS!).

we add an optional dependency to mya, mya_heap:
- liblldb is used to read debug info

This will be useful in the future when we teach mya how to walk the full native heap.

We add a simple test that confirms that we can use both of these from within mya.
https://bugs.webkit.org/show_bug.cgi?id=325303

Reviewed by NOBODY (OOPS!).

Some cleanups to make future tests + linux support easier.
https://bugs.webkit.org/show_bug.cgi?id=326803

Reviewed by NOBODY (OOPS!).

Shuffle some code around to make listing images and snapshots easier.

Linux now supports snapshots via co-operation with the jsc process.

macOS also supports this co-operative style of snapshot so that the heap
can be walked during a safepoint.
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. skip-ews Applied to prevent a change from being run on EWS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants