Repository navigation
chore: update V8 to 15.8 - #37269
Open
bartlomieju wants to merge 12 commits into
Open
chore: update V8 to 15.8#37269bartlomieju wants to merge 12 commits into
bartlomieju wants to merge 12 commits into
Conversation
- `Global::open` is now `unsafe`; migrate call sites to the safe `v8::Local::new(scope, handle)`. - Interceptor setter/definer callbacks now take `ReturnValue<Boolean>`. - V8 removed asm.js validation, so `--no-validate-asm` is gone. Leaving it in made V8 reject the flag string and silently drop every flag after it. - Bootstrap no longer fits in a 5MB heap; raise the heap-limit test caps.
`MicrotaskQueue::new` now returns an owning `MicrotaskQueueHandle` instead of a `UniqueRef`, so the leak that hands the queue to the context is now explicit. Indexed/named setter and definer interceptors take `ReturnValue<Boolean>`.
The setter/definer `ReturnValue` payload changed to `Boolean` in v8 152, but the QuickJS backend vendors an older rusty_v8 that still expects `()`. Add a `PropertyInterceptorReturnValue` alias to the deno_v8 facade, which is where backend differences belong, and name it from the interceptors.
v8 152 replaced the `UniqueRef<MicrotaskQueue>` from `MicrotaskQueue::new`
with an owning `MicrotaskQueueHandle`. Two things followed from that which the
first pass got wrong.
`MicrotaskQueue` no longer implements `Drop` — only the handle does — so the
`drop_in_place` in `ContextifyContext::drop` silently became a no-op, and
forgetting the handle to recover a raw pointer leaked it outright. Under the
default `v8_cppgc_microtask_queue` setting the handle is a root into the
isolate's heap that contexts outlive on their own, so it wants to be held and
dropped, not leaked.
`ContextifyContext` now stores an `Option<OwnedMicrotaskQueue>` and lets
ordinary ownership release it, which drops the hand-written `Drop` impl, the
`mem::forget`, and the `unsafe { drop_in_place }` along with it.
`ContextifyModule` keeps borrowing the queue as a raw alias, which is now
sounder: a context keeps its queue alive independently of the handle, so the
alias survives even if the owning `ContextifyContext` is collected first.
`OwnedMicrotaskQueue` is aliased in the deno_v8 facade because the QuickJS
backend still returns `UniqueRef<MicrotaskQueue>`; both are RAII wrappers that
deref to `MicrotaskQueue`, so callers just name the alias.
The ModuleMap split moved these call sites after the v8 152 changes were written; use v8::Local::new like the rest.
Float16Array and explicit resource management ship by default, so their flags are gone. V8 stops parsing at the first unknown flag, which silently dropped the flags after them, including --enable-queue-microtask. V8 also removed live edit, along with --inspector-live-edit.
Brings V8 15.8.62.23.
V8 15.8 removed live edit, so Debugger.setScriptSource now always fails with a protocol error. Previously that aborted --watch-hmr; now it prints a one-time notice and restarts the program like --watch, and desktop HMR asks the host to reload the page instead of dropping the change.
V8 15.8 aborts when reading an embedder data slot past the end of a context's embedder data. node:vm's wasm code generation callback runs for every context and reads slots 3 and 4, which deno_core's own contexts didn't have, so compiling wasm after creating a vm context crashed. deno_core now initializes the slots up to MAX_EMBEDDER_DATA_SLOT_INDEX to null in every context it creates.
code-cache-base-url.html now passes. The two tentative import defer tests with a cyclic top-level await dependency no longer reject: V8 15.8's reworked ReadyForSyncExecution leaves the import.defer() promise pending.
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.
Updates the
v8crate from 150.4.0 to 158.0.0, which brings V8 15.8.62.23.This supersedes #36665 (152.2.0) and includes its changes:
Global::openis now
unsafe, so call sites go throughv8::Local::new, and the node:vmmicrotask queue is owned explicitly instead of leaked.
V8 15.8 removed three flags we passed.
--js-float16arrayand--js-explicit-resource-managementare gone because those features now shipby default; since V8 stops parsing at the first unknown flag, they were also
silently dropping
--js-source-phase-imports,--js-defer-import-evaland--enable-queue-microtask.--inspector-live-editis gone because V8removed live edit entirely, so
Debugger.setScriptSourcealways fails.--watch-hmrnow notices that, prints a one-time message and falls back torestarting like
--watch, and desktop HMR reloads the page instead ofdropping the change. The HMR integration tests are updated accordingly.
V8 15.8 also turns reading an embedder data slot past the end of a context's
embedder data into a fatal error. node:vm's wasm code generation callback
runs for every context and reads slots 3 and 4, which deno_core's contexts
didn't have, so compiling wasm after
vm.createContext()crashed (thevm_wasm_streamingspec and two WASI node compat tests). deno_core nowinitializes those slots to null in every context it creates.
Closes #36665