Add jsg support for shared-ownership module sources - #7523
Merged
Merged
Conversation
Contributor
|
LGTM |
Builtin modules that aren't compiled into the binary need to reach V8 as external strings that keep their own storage alive, not as borrowed buffers that V8 can outlive. - Add jsg::copyToArc() to copy a buffer into a kj::Arc. - Pick the ModuleInfo ESM constructor by source type: ArrayPtr is copied, StaticExternalStringSource is borrowed, Arc<OwnedAscii> is shared. This replaces ModuleInfoCompileOption. - Add addBuiltinModule(Arc<OwnedAscii>) to the legacy registry and BuiltinBuilder::addEsm(Arc<OwnedAscii>) to the new one. - gen-compile-cache: copy the Rust-owned path and source before making external strings from them.
mikea
force-pushed
the
maizatskyi/2026-09-25-module-source-ownership-base
branch
from
September 25, 2026 18:15
bfc98fb to
a745140
Compare
mikea
marked this pull request as ready for review
September 25, 2026 19:00
jasnell
reviewed
Sep 25, 2026
jasnell
approved these changes
Sep 25, 2026
mikea
enabled auto-merge
September 25, 2026 19:48
mikea
disabled auto-merge
September 25, 2026 19:51
mikea
deleted the
maizatskyi/2026-09-25-module-source-ownership-base
branch
September 25, 2026 19:52
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.
Builtin modules that aren't compiled into the binary need to reach V8 as external strings that keep their own storage alive, not as borrowed buffers that V8 can outlive.