Skip to content

feat: bump vendored rusty_v8 to v158.0.0 (V8 15.8) - #78

Open
littledivy wants to merge 4 commits into
mainfrom
bump-rusty-v8-158
Open

littledivy wants to merge 4 commits into
mainfrom
bump-rusty-v8-158

Conversation

@littledivy

@littledivy littledivy commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

rusty_v8 158 (denoland/rusty_v8#2098) adds 56 C-ABI symbols that neither backend defined, so no rusty_v8 test binary linked.

In this patch the vendor pin and gen/ bindings move to 158, lib.rs re-exports the new isolate_group module, and both the QuickJS and JSC backends implement every new symbol. No new unimplemented!() stubs.

This stacks on #73 (152.1.0). Only the last commit is new; the diff shrinks once #73 merges.

Cell Before After
quickjs / rusty_v8 303 344 (+42 baselined)
sys-jsc / rusty_v8 47 57 (+10)
jsc / rusty_v8 47 57 (+10, mirrored from sys-jsc and confirmed by CI, as in #73)

Where the engine has no equivalent, the shim takes the closest cheap behaviour:

API Behaviour
IsolateGroup one process-wide default group
Context::DetachGlobal QuickJS marks the context detached; JSC no-op. Neither reuses the global
RegExp::NewWithBacktrackLimit QuickJS uses its interrupt check (coarse); JSC ignores the limit
SetModifyCodeGenerationFromStringsCallback QuickJS best-effort; JSC no-op (no eval hook)
Data::IsCompatibleWithIsolate true (cheap, runs on every deref in debug)
Value::IsWasmNull false

Notes:

  • The escape-slot patch is regenerated for 158. Its context drifted, and Windows has no fuzzy fallback, so the Windows jobs failed to apply it.
  • gen/ comes from the #2098 CI artifacts until v158.0.0 is tagged. I'll repoint it at the release assets then.
  • deno_core at the pinned DENO_REF does not compile against the 152+ API (Global::open is unsafe, interceptor setters and definers take ReturnValue<Boolean>, build_fast needs a 'static slice). This also breaks feat: bump vendored rusty_v8 to v152.1.0 #73. The integration patch now carries the deno_core hunks of chore: bump v8 crate to 152.2.0 deno#36665, Deno's own migration for 152. That touches libs/core/runtime/tests/{misc,ops}.rs, but it only updates API calls and changes no assertions. I left out that PR's heap limit bump and its flag removal. Locally, quickjs/deno_core passes all 429 baselined tests.
  • On sys-jsc, about 20 more tests pass solo but fail in the batch because clear_kept_objects panics while holding the shared test lock. Worth a follow-up.

Moves the `vendor/rusty_v8` pin from v149.4.0 to v152.1.0 and brings the
QuickJS backend up to the C ABI that release declares. The surface moved by
15 added and 5 removed `v8__*` symbols, plus 4 added and 5 removed `crdtp__*`
symbols and 13 added `v8_inspector__*` symbols.

Both `patches/rusty_v8-*` apply unchanged: `scope.rs`, `scope/raw.rs` and
`value_serializer.rs` are byte-identical between the two tags. `gen/` carries
the v152.1.0 release assets; the identical-within-OS-family claim still holds,
now including the `ptrcomp` variants (22 assets, 3 distinct contents).

What the backend gained:

- `v8::Locker` and `v8::Unlocker`, in `src/quickjs/locker.rs`. A JSRuntime can
  move between threads as long as one thread uses it at a time, so the lock is
  a per-isolate mutex plus `JS_UpdateStackTop` whenever the entering thread
  changes, since the runtime's stack-overflow bounds belong to whichever thread
  created it. `IsLocked` reads an atomic rather than taking the mutex because
  it sits on the `Global` clone and drop path.
- `v8__Isolate__TryGetCurrent`, which reports only an entered isolate.
  `current_iso` falls back to the last isolate the thread ran, and `Locker`
  asserts on this before taking the lock, so the fallback would misfire.
- Callable objects (`Object::{IsCallable,IsConstructor,CallAsFunction,
  CallAsConstructor}` and `ObjectTemplate::SetCallAsFunctionHandler`). QuickJS
  does not distinguish a callable object from a function object, so a template
  with a call handler builds its instances as function objects.
- `MicrotaskQueueHandle`, which replaces `MicrotaskQueue::{New,DESTRUCT}`. One
  allocation backs both types here, so `Get` is the identity.
- `Dispatchable` associated data and the crdtp fallthrough callback. The probe
  phase is gone: `BASE__Dispatch` now takes a live `&Dispatchable` and runs the
  command, so calling it twice would send two responses.
- Session `wrapObject`, `releaseObjectGroup` and `addInspectedObject`, over the
  RemoteObject JSON the console path already builds.

`v8::String::ValueView` changed shape rather than gaining a symbol: rusty_v8
now reads the fields straight out of the buffer instead of calling the three
accessors, so both backends lay their state out the way `v8-primitive.h` does.
The JSC backend gets that change and the ICU 77 to 78 rename, but is otherwise
untouched and unverified here.

The `simdutf` Cargo feature becomes a no-op: upstream dropped the split and
`string.rs` now calls `crate::simdutf` unconditionally. The feature stays so
existing dependency declarations keep resolving.

quickjs/rusty_v8 goes from 268 to 303 baselined tests, and `test_api` links
for the first time. Nine tests still fail, all new in this release; the notable
group is the shared-isolate ones, which fail because this backend keeps
per-isolate Rust state (the function dispatch table, module caches, template
registry) in thread-locals, so an isolate that migrates loses its Rust
callbacks. That is its own change.
The bump commit only carried the QuickJS backend, so `check-jsc`,
`check-sys-jsc` and the Windows legs went red.

The JSC backends were missing all 21 new symbols. `src/jsc/locker.rs` is the
QuickJS locker without the `JS_UpdateStackTop` step: JSC serializes heap access
with its own JSLock, so what the shim adds is the ownership shape `v8::Locker`
promises and a home for the per-isolate bookkeeping. Callable objects,
`MicrotaskQueueHandle`, `TryGetCurrent` and the WebAssembly trap handler follow
the QuickJS versions. `ObjectTemplate::SetCallAsFunctionHandler` builds the
instance with `make_function_len` for the same reason QuickJS does: neither
engine can add a [[Call]] slot to an ordinary object afterwards. The inspector
symbols land at this backend's existing level, since it answers the protocol
without an injected script and so cannot wrap a live remote reference.

Windows failed on `v8_String_WriteFlags_kNullTerminate`, which the shim read
instead of the `v8__String__WriteFlags__kNullTerminate` upstream's own
`string.rs` uses. Both spellings appear in the Linux and Apple bindings, but
only the second appears in the MSVC one, so the first happened to work until
this release regenerated the assets. Both backends now read what upstream does.

sys-jsc/rusty_v8 goes from 46 to 47.
`check-jsc` links and runs after the C ABI port, and reports the same single
new pass the sys-jsc leg did. The vendored-WebKit backend cannot be built
outside CI, so this mirrors the sys-jsc baseline, which the two share
line-for-line.
@littledivy
littledivy force-pushed the bump-rusty-v8-158 branch 2 times, most recently from fbe0b02 to 1c81fdb Compare November 8, 2026 06:31
rusty_v8 158 adds 56 C-ABI symbols that neither backend defined, so no
test binary linked: isolate groups, DictionaryTemplate, resizable and
immutable ArrayBuffers, typed arrays over SharedArrayBuffer, Date parse
and string conversion, template native and lazy data properties, script
ids, inspector unwrapObject, and the ICU default time zone.

In this patch the vendor pin and gen/ bindings move to 158, lib.rs
re-exports the new isolate_group module, and both the QuickJS and JSC
backends implement every new symbol. Where the engine has no equivalent
(IsolateGroup, DetachGlobal global reuse, RegExp backtrack limit on JSC)
the shim picks the closest cheap behaviour instead of panicking. The
quickjs baseline gains 42 passes, and sys-jsc and jsc gain 10 each. The
escape-slot patch is regenerated so it applies strictly to 158 (Windows
has no fuzzy fallback).

deno_core at the pinned DENO_REF does not compile against the 152+ API
(Global::open is unsafe, interceptor setters return Boolean, build_fast
wants a 'static slice), so the integration patch now carries the deno_core
hunks of denoland/deno#36665, which is Deno's own migration. The test heap
limit change from that PR is left out.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants