Repository navigation
Conversation
Import attributes were created in C++ with v8::Object::New() and a
null prototype, once per module request and once per import() call.
Every import() call also created a `{ __proto__: null }`
diagnostics_channel context, which was discarded when module.import
had no subscribers. V8 creates all of these in dictionary mode.
Build the attributes from an ordinary object with its prototype set to
null, and only create the trace context when there are subscribers.
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Collaborator
|
Review requested:
|
jsumners-nr
approved these changes
Nov 17, 2026
aduh95
approved these changes
Nov 17, 2026
Collaborator
Member
|
V8 has optimized this kind of objects in https://chromium-review.googlesource.com/c/v8/v8/+/8476491 with flag |
legendecas
approved these changes
Nov 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67554 +/- ##
==========================================
- Coverage 90.68% 90.67% -0.01%
==========================================
Files 800 800
Lines 280556 281000 +444
Branches 54179 54293 +114
==========================================
+ Hits 254412 254795 +383
- Misses 16262 16299 +37
- Partials 9882 9906 +24
🚀 New features to boost your workflow:
|
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.
Import attributes were created in C++ with
v8::Object::New()and a nullprototype, once per module request and once per
import()call. Everyimport()call also created a{ __proto__: null }diagnostics_channelcontext, which was discarded when
module.importhad no subscribers. V8creates all of these in dictionary mode.
Build the attributes from an ordinary object with its prototype set to null,
and only create the trace context when there are subscribers. The attributes
are still frozen with a null prototype.
This is independent of #67552, and the two
merge cleanly.
Refs: #67552
AI Generated.