Skip to content

Cleanup after from the startup-snapshot and WrapGlobal changes - #7674

Merged
dcarney-cf merged 3 commits into
mainfrom
dcarney/snapshot-review-followups
Oct 10, 2026
Merged

dcarney-cf merged 3 commits into
mainfrom
dcarney/snapshot-review-followups

Conversation

@dcarney-cf

Copy link
Copy Markdown
Contributor

No description provided.

dcarney-cf and others added 3 commits October 9, 2026 12:58
…ate group

50c66ec switched makeWorkerIsolate() to jsg::newIsolateGroup(), but
the startup-snapshot pipeline (0f395f8) reintroduced
v8::IsolateGroup::GetDefault() while restructuring that function. On
builds with multiple pointer-compression cages this put every Worker in
the default group, sharing one cage and its heap limit.

Restoring newIsolateGroup() alone would leave the zygote inconsistent:
the SnapshotCreator(CreateParams) constructor always allocates its
isolate in the default group, while the ArrayBuffer allocator is created
for the requested group. Allocate the isolate in the requested group and
pass it to the non-owning SnapshotCreator constructor instead. That
creator only exits the isolate on destruction, so ~IsolateBase() now
always disposes the isolate itself after releasing the creator.

workerd's own build does not enable multiple cages, so newIsolateGroup()
returns the default group here and behavior is unchanged locally.

Addresses review comments on #6908.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
realm_take_resource_templates() returned each persistent handle as a
bare usize, which worker.c++ reconstituted into a v8::Global with
memcpy. src/rust/AGENTS.md requires V8 handles to cross the bridge as
the shared jsg::v8::ffi types so both sides agree on one cxx-verified
definition.

Return Vec<Global> using the shared struct from v8.rs, and recover each
handle on the C++ side with global_from_ffi(). The lib.rs bridge now
includes v8.rs.h, so its generated code depends on v8.rs@cxx.

Addresses a review comment on #7668.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Slot 4 is ContextPointerSlot::BOOTSTRAP_STATE. The Rust realm lives in
the isolate's SET_DATA_RUST_REALM slot, not in a context slot.

Addresses a review comment on #7671.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dcarney-cf
dcarney-cf requested review from a team as code owners October 9, 2026 13:07
@ask-bonk

ask-bonk Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review: 2 findings (1 blocking, 1 warning).

Updates snapshot isolate ownership and Rust V8-handle transfer plumbing.


Reviewed commit: d3f73e85 · github run

Comment thread src/workerd/io/worker.c++
Comment thread src/workerd/jsg/setup.c++

@csjh csjh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dcarney-cf
dcarney-cf merged commit 976f16e into main Oct 10, 2026
34 of 36 checks passed
@dcarney-cf
dcarney-cf deleted the dcarney/snapshot-review-followups branch October 10, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants