Skip to content

feat: upgrade V8 to 150.2.0 - #36098

Merged
bartlomieju merged 4 commits into
mainfrom
update-v8-150.2.0
Jul 17, 2026
Merged

bartlomieju merged 4 commits into
mainfrom
update-v8-150.2.0

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Bumps the v8 crate from 149.4.0 to 150.2.0.

This version changes how the fast-call API stores type information. V8
now keeps the raw CFunction and CFunctionInfo pointers directly
inside FunctionTemplateInfo rather than copying them into a managed
heap object, so build_fast, CFunction::new, and CFunctionInfo::new
now require 'static borrows. The backing storage for every fast-call
overload must therefore outlive the FunctionTemplate built from it.

Two call sites needed adapting. In deno_core, the fast-call overload
array is now stored in OpCtx, which lives until isolate disposal, and
a lifetime-extended slice into that stable storage is handed to
build_fast. In ext/ffi, the trampoline's CFunction overload is
built inside Turbocall so its boxed backing storage, owned by the
cppgc-managed FunctionData set as the function's data, outlives the
function; build_fast receives a static-extended slice into that box.

Verification of the FFI fast-call path is left to CI for now.

Adapts to the fast-call API change in v8 150.x, where V8 stores the raw
CFunction / CFunctionInfo pointers directly inside FunctionTemplateInfo
instead of copying them. build_fast, CFunction::new, and
CFunctionInfo::new now require 'static borrows, so the overload storage
must outlive every FunctionTemplate built from it.

- deno_core: store the fast-call overload array in OpCtx (which lives
  until isolate disposal) and pass a lifetime-extended slice to
  build_fast.
- ext/ffi: build the CFunction overload inside Turbocall so its boxed
  backing storage, owned by the cppgc FunctionData, outlives the
  function; hand build_fast a static-extended slice.
Three test failures surfaced by the V8 150.2.0 upgrade:

- op_serialize detached transferred ArrayBuffers before registering them
  with the ValueSerializer and writing the value. V8 150.x checks
  was_detached() before consulting the transfer map when serializing a
  typed-array view, so a pre-detached transferred buffer now throws
  "An ArrayBuffer is detached and could not be cloned" (broke
  test-worker-workerdata-messageport.js). Register the transfer and write
  the value first, then detach the buffers.

- Regenerate the seeded Math.random() expectations in run/seed_random and
  the compile standalone_runtime_flags test; V8's seeded PRNG output
  changed. The crypto.getRandomValues bytes are unchanged.
@bartlomieju bartlomieju changed the title chore: update v8 to 150.2.0 feat: upgrade V8 to 150.2.0 Jul 16, 2026
@bartlomieju
bartlomieju merged commit 7e036ea into main Jul 17, 2026
135 checks passed
@bartlomieju
bartlomieju deleted the update-v8-150.2.0 branch July 17, 2026 14:31
bartlomieju added a commit that referenced this pull request Jul 23, 2026
Bumps the `v8` crate from 149.4.0 to 150.2.0.

This version changes how the fast-call API stores type information. V8
now keeps the raw `CFunction` and `CFunctionInfo` pointers directly
inside `FunctionTemplateInfo` rather than copying them into a managed
heap object, so `build_fast`, `CFunction::new`, and `CFunctionInfo::new`
now require `'static` borrows. The backing storage for every fast-call
overload must therefore outlive the `FunctionTemplate` built from it.

Two call sites needed adapting. In `deno_core`, the fast-call overload
array is now stored in `OpCtx`, which lives until isolate disposal, and
a lifetime-extended slice into that stable storage is handed to
`build_fast`. In `ext/ffi`, the trampoline's `CFunction` overload is
built inside `Turbocall` so its boxed backing storage, owned by the
cppgc-managed `FunctionData` set as the function's data, outlives the
function; `build_fast` receives a static-extended slice into that box.

Verification of the FFI fast-call path is left to CI for now.
@littledivy littledivy mentioned this pull request Jul 27, 2026
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.

1 participant