Repository navigation
Conversation
Downloads the mozillajs-macos release artifact (interpreter-only js185 for aarch64, built from this org's spidermonkey-ff4 source with the pcre regex path, mirroring the mozillajs-linux flow) and stages include/ + lib into build/mozilla_js for the Meson darwin scan. Prerequisite for the Apple Silicon build described in oolite#721; one of the blockers listed in oolite#360.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DRAFT: PR #2, SpiderMonkey js185 arm64 enablement
Base: master @ 8ffe02d. Branch:
pr-2-js185-arm64.Commits in this PR (oolite repo): one,
ShellScripts/Darwin/install_mozilla_js.sh, the darwin twin of the Linux install script. The engine changes themselves are PRs toOoliteProject/spidermonkey-ff4, and the patched build plus release artifact live in a newmozillajs-macosrepo, mirroringmozillajs-linux. Interim note: until that repo is published, the mac CI job vendors the verified artifact tarball (see PR #3); this PR swaps it to the install-script download.What this is
The js185 SpiderMonkey that Oolite pins (mozilla-2.0, via the
spidermonkey-ff4sourcerepo) has never built on aarch64: the configure scripts predate the architecture, the
CPU cases set x86/ARMv7-only defines, the YARR assembler has no arm64 backend, and the
darwin GC allocator placement can violate the 2^47 address assumption in the 64-bit
value layout. oolite#360 named exactly this ("libjs needs to be updated to take
advantage of the ARMv8/ARM64 architecture") as the first blocker for an ARM Mac build.
This is not an engine upgrade. The JS API surface is untouched; the several hundred OXPs
written against js185 keep working. The engine runs as an interpreter on arm64 (there is
no ARM64 JIT backend in this tree to port, and the interpreter is the reference
implementation), with regexes on the bundled pcre engine, following the powerpc/sparc
precedent already in the Makefile.
The patches (filed against
OoliteProject/spidermonkey-ff4, one PR per patch)arm-apple-darwinbecause they useuname -p, which returnsarmon AppleSilicon; config.sub rejects both
arm64andaarch64triplets). Follows the amd64to x86_64 alias precedent.
JS_PUNBOX64defined), plus an empty AVMPLUS case.otherwise the Nitro assembler sources fail with MacroAssembler's hard error.
vm_allocateat descending fixed addressesbelow 2^47 before falling back to
VM_FLAGS_ANYWHERE(the 64-bit value layoutrequires GC chunks below that line for the debug assertions to be sound).
volatile(clang 16+ hard error; needed for thex86_64 reference builds).
x86_64 reference build hits the missing symbol through the YARR assembler headers).
Each patch PR carries its own verification evidence: live config.guess/config.sub
outputs before and after, generated-header greps (JS_PUNBOX64 and HAVE_64BIT_OS present;
zero JIT/IC defines), a GC-stress soak sampling 48,384 live object pointers across 600
waves (all below 2^47), and the js185 test suite run on the arm64 build. The test-suite
delta versus x86_64 is fully classified: four Date harness-environment failures, four
pcre-versus-YARR regexp semantic differences, one allocation-expectation test, one
timeout. No arm64 engine-level failure cluster.
The artifact repo
mozillajs-macos(content ready to transfer to the OoliteProject org, see the designissue) mirrors
mozillajs-linux: the patched js/src tree, a build script, CI on themacos-26 runner, README with the pinned source commit, and a release artifact
(
include/+lib/js_static.a, MPL 2.0 license included). It also publishes thebenchmark numbers and the two documented behavioral notes for darwin:
forces the JIT option bits off).
one powerpc and sparc use).
Measured: the native arm64 interpreter outperforms an x86_64 JIT build running under
Rosetta on every kernel of the benchmark harness (for example 21 ms versus 208 ms on the
strings kernel), so the interpreter-only configuration is not a performance regression
against today's Rosetta-based option.
The oolite-side change
One script,
ShellScripts/Darwin/install_mozilla_js.sh, mirroringShellScripts/Linux/install_mozilla_js.sh: download the release artifact, stage itunder the same
build/mozilla_jslayout the Meson scan expects. Nothing else in theoolite tree changes for the dependency; oolite has no submodules and the js patches
belong in the engine source repo, not here.
Relation to open issues
its spidermonkey-ff4 companions implement. Restriction check: the dependency update
adds no oolite-side platform code, the engine stays a single source tree for all
targets (aarch64 follows the powerpc/sparc fallback precedent), and the consumer
port's adherence to the SDL3/meson/espeak-ng restrictions is covered by PR Memory spike on wormhole chaining #1 and the
design issue.
an engine swap was about breaking OXPs; this series does not touch the JS API.
AI-assistance disclosure: developed with AI assistance (GLM-5.3-Flash); verified by the builds/tests described.
Design issue: #760