Repository navigation
Conversation
With context isolation the preload realm's global is private to preloads, so Buffer is defined there as a property that loads the polyfill on first use instead of evaluating it for every frame before any preload runs. Without context isolation it stays a preload-scoped parameter as before. The persisted preload code cache is now also keyed on that wrapper shape, because V8's cached-data check does not notice a changed parameter list. Also drops the `Buffer` hidden value set on the sandboxed global; its native consumer was removed in #34794. With the wrapper shape now depending on where the bundle runs, the renderer decides it from the actual script context (main world vs isolated world) rather than the contextIsolation preference, and names the parameter list in the compiled source so a persisted code cache produced for one shape is rejected rather than run against the other. Co-authored-by: Sam Attard <[email protected]>
6 tasks done
trop
Bot
deleted the
trop/45-x-y-bp-perf-make-the-sandboxed-preload-buffer-global-lazy-1789682868793
branch
September 17, 2026 22:10
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.
Backport of #53855
See that PR for details.
Notes: Reduced sandboxed renderer startup work for preload scripts that do not use
Buffer.