Skip to content

Live snapshots part 3: reset isolate level c++ handles - #7138

Open
dbezhetskov wants to merge 2 commits into
cloudflare:mainfrom
dbezhetskov:live-snapshots-3
Open

Live snapshots part 3: reset isolate level c++ handles #7138
dbezhetskov wants to merge 2 commits into
cloudflare:mainfrom
dbezhetskov:live-snapshots-3

Conversation

@dbezhetskov

Copy link
Copy Markdown

To produce the V8 snapshot blob we need to reset all live handles before serialization.
Here we reset isolate level handles.

depends on: #6908

Build a throwaway “zygote” Worker from the same source and bindings,
solely to evaluate top-level code and produce a snapshot artifact.
The SnapshotArtifact encapsulates all the data required to construct
a new isolate from a V8 startup snapshot.

Add a SnapshotConfig parameter to WorkerdApi controlling how the
isolate is created:
  - kj::none: a regular isolate, no snapshots involved
  - MutableSnapshot: the isolate is created via v8::SnapshotCreator
    and fills the snapshot artifact
  - ReadonlySharedSnapshot: the isolate boots from a previously
    produced snapshot blob
To create snapshot we need to reset all C++ handles first.
Here we reset IsolateBase level handles.
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.

1 participant