-
Notifications
You must be signed in to change notification settings - Fork 5.1k
compile: load an executable's embedded ES module graph without per-import round trips #40643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f2fe7fa
compile: load an executable's embedded ES module graph without per-im…
Jarred-Sumner e27981e
[autofix.ci] apply automated fixes
autofix-ci[bot] 19c3dc8
compile: keep a shared provider's module_info when pre-registering em…
Jarred-Sumner 2f4e9ff
Address review: declare new codegen outputs to ninja, platform-neutra…
Jarred-Sumner 5591c75
compile: keep the referrer string alive across fetchESMSourceCodeSync…
Jarred-Sumner 77c4999
Bump WebKit to d9feedfcb16d (568ccc283a73 + Windows arm64 CI fix)
Jarred-Sumner a45dfcf
ci: retrigger now that the WebKit prebuilt is published
Jarred-Sumner c28a5d1
test: update the bytecode portability snapshot for the shared-string-…
Jarred-Sumner 138289a
compile: register an embedded entry's complete static-import closure …
Jarred-Sumner 8498eb0
[autofix.ci] apply automated fixes
autofix-ci[bot] 19aa37f
compile: register pre-built module records with ModuleRegistryEntry::…
Jarred-Sumner fd1487b
compile: bail out of closure pre-registration if the MarkedArgumentBu…
Jarred-Sumner 79596c4
compile: check MarkedArgumentBuffer overflow after appending each clo…
Jarred-Sumner e318b1f
compile: resolve an embedded specifier to the graph's own spelling of…
Jarred-Sumner 22d36ad
[autofix.ci] apply automated fixes
autofix-ci[bot] 802afb2
test: pin the number of host loader calls a compiled --splitting --by…
Jarred-Sumner c3d179e
jsc: add the SAFETY comment clippy wants on Bun__standaloneModuleKey'…
Jarred-Sumner 0a49fb7
compile: keep the exception check after provideModule when pre-regist…
Jarred-Sumner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Make the static-storage requirement explicit.
This safe function passes
bytesto C++ without copying. A caller can pass a temporary or heap-backed slice, drop its owner, and leave the returnedBunStringwith a dangling pointer. Make the constructorunsafeand document the lifetime invariant, or otherwise require static storage in the API.Based on learnings: mark an API
unsafewhen callers must uphold a memory-safety invariant.🤖 Prompt for AI Agents
Source: Learnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept as a safe fn to match
create_static_external/create_static_external_utf16right above it, which have the identical retained-slice contract; the doc comment states the lifetime requirement.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jarred-Sumner, the existing constructors have the same issue. Consistency does not make the retained-storage invariant safe.create_static_external_latin1_with_hashreturns aStringthat can outlivebytes. A caller can pass non-static storage through this safe API. The returned value then contains a dangling pointer after that storage is released.The documentation helps callers, but it does not enforce the memory-safety invariant. The constructor should be
unsafe, or its input type should require static storage.✏️ Learnings added
🧠 Learnings used
You are interacting with an AI system.