Tags: NativeScript/v8-buildscripts
Tags
fix(ios): export the public V8 API from the prebuilt archives The matrix build sets v8_monolithic=false, which stopped triggering the gni/v8.gni swap from Chromium's default -fvisibility=hidden to default visibility. Every symbol in the shipped archives became private-external, so NativeScript.framework exports no v8:: symbols and plugins that link the public V8 API through it (e.g. @nativescript/canvas) fail the app link with undefined v8::* symbols on runtime 9.x. v8_expose_public_symbols=true defines BUILDING_V8_SHARED, giving the V8_EXPORT surface (~2.7k symbols incl. cppgc and the v8::internal helpers referenced by inline header code) default visibility while keeping internals hidden and dead-strippable: ~+0.5 MB per slice versus ~+3.4 MB for restoring global default visibility. Android is unaffected: it builds with v8_monolithic=true, which still triggers the visibility swap.
fix(patch): skip stale queue entries when rooting pending finalizers * IterateFinalizerHandlesAsRoots visited every queued node unconditionally, but an entry can go stale between queueing and the drain: callbacks running outside the pause may reset or re-arm a queued handle, clearing the pending bit -- and a reset frees the node, whose zapped location must never be visited as a root. * Mirror the drain's re-check of the pending bit and compact stale entries out of the queue while iterating.
fix(ios): disable the cppgc caged heap cppgc_enable_caged_heap defaults to true on arm64 and does not track v8_enable_pointer_compression, so it stayed on despite that being off. Enabling it forces cppgc pointer compression, whose reservation asks for twice the cage to satisfy alignment, and V8::Initialize() calls cppgc::InitializeProcess unconditionally -- so every iOS app reserved 8 GiB of 4 GiB-aligned address space at startup without using cppgc. iOS budgets virtual address space per process by device RAM. On smaller devices no such hole exists, the four reservation attempts all fail, and Oilpan's fatal OOM handler aborts before any JS runs: an iPad Air crashed on launch where an iPad Pro was fine. Costs cppgc pointer compression, its young generation and a write-barrier fast path. Nothing in the cppgc API changes and CppHeap is unaffected. Android keeps the cage; 64-bit has the address space and 32-bit cannot enable it anyway.
fix(patch): allow JS execution in finalizer callbacks V8 14.9 holds a DisallowJavascriptExecution across the whole collection, the epilogue included, and turns entering JS from a GC callback into a GRACEFUL_FATAL. 10.3 ran the second-pass callbacks under an explicit AllowJavascriptExecution, which the iOS runtime relies on: disposing an ObjC wrapper runs -dealloc, and any JS-backed override that teardown reaches re-enters JS through ArgConverter::MethodCallback. The scope is lifted around the finalizer drain alone, so the second-pass callbacks below it still satisfy their own assertion that JS is disallowed. Verified by compiling global-handles.o for arm64-simulator.
V8 14.9.207.39, build 1 First release of the unified matrix: four Android ABIs and five Apple variants, built in CI from a pinned V8 revision with the resurrecting finalizer patch applied. Consumed by NativeScript/android and NativeScript/ns-v8ios-runtime via their download_v8.sh.