-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
src: use v8::(Des|S)erializeInternalFieldsCallback #53217
Merged
Merged
Conversation
This file contains 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
Previously V8 would just try to serialize the context data fields "verbatim" by copying the pointer values. This patch makes use of the new callbacks so that at serialization, the embedder data for the context can at least be serialized in a meaningful way (which are all reset to empty for now). Otherwise the upstream may have difficulties serializing these pointer values "verbatim" especially with the introduction of external pointer tables, even though the verbatim pointer values from a previous process is meaningless to Node.js. For Node.js the callback currently just checks that the slots are know. We will reassign the pointers with newly created native structures during deserialization and there isn't much we can reuse for now.
Review requested:
|
nodejs-github-bot
added
c++
Issues and PRs that require attention from people who are familiar with C++.
needs-ci
PRs that need a full CI run.
labels
May 30, 2024
legendecas
approved these changes
May 31, 2024
legendecas
added
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
snapshot
Issues and PRs related to the startup snapshot
labels
May 31, 2024
joyeecheung
added
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Jun 6, 2024
nodejs-github-bot
added
commit-queue-failed
An error occurred while landing this pull request using GitHub Actions.
and removed
commit-queue
Add this label to land a pull request using GitHub Actions.
labels
Jun 6, 2024
Commit Queue failed- Loading data for nodejs/node/pull/53217 ✔ Done loading data for nodejs/node/pull/53217 ----------------------------------- PR info ------------------------------------ Title src: use v8::(Des|S)erializeInternalFieldsCallback (#53217) Author Joyee Cheung (@joyeecheung) Branch joyeecheung:context-data -> nodejs:main Labels c++, author ready, needs-ci, snapshot Commits 1 - src: use v8::(Des|S)erializeInternalFieldsCallback Committers 1 - Joyee Cheung PR-URL: https://github.com/nodejs/node/pull/53217 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5512712/comments/cfc2b28d_c921ac80?tab=comments Reviewed-By: Chengzhong Wu ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/53217 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5512712/comments/cfc2b28d_c921ac80?tab=comments Reviewed-By: Chengzhong Wu -------------------------------------------------------------------------------- ℹ This PR was created on Thu, 30 May 2024 13:11:13 GMT ✔ Approvals: 1 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/53217#pullrequestreview-2090507412 ✘ This PR needs to wait 2 more hours to land (or 0 hours if there is one more approval) ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-05-30T16:38:45Z: https://ci.nodejs.org/job/node-test-pull-request/59545/ - Querying data for job/node-test-pull-request/59545/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/9399477851 |
joyeecheung
added
commit-queue
Add this label to land a pull request using GitHub Actions.
and removed
commit-queue-failed
An error occurred while landing this pull request using GitHub Actions.
labels
Jun 7, 2024
nodejs-github-bot
removed
the
commit-queue
Add this label to land a pull request using GitHub Actions.
label
Jun 7, 2024
Landed in a2233c3 |
RafaelGSS
pushed a commit
that referenced
this pull request
Jun 7, 2024
Previously V8 would just try to serialize the context data fields "verbatim" by copying the pointer values. This patch makes use of the new callbacks so that at serialization, the embedder data for the context can at least be serialized in a meaningful way (which are all reset to empty for now). Otherwise the upstream may have difficulties serializing these pointer values "verbatim" especially with the introduction of external pointer tables, even though the verbatim pointer values from a previous process is meaningless to Node.js. For Node.js the callback currently just checks that the slots are know. We will reassign the pointers with newly created native structures during deserialization and there isn't much we can reuse for now. PR-URL: #53217 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5512712/comments/cfc2b28d_c921ac80?tab=comments Reviewed-By: Chengzhong Wu <[email protected]>
Merged
EliphazBouye
pushed a commit
to EliphazBouye/node
that referenced
this pull request
Jun 20, 2024
Previously V8 would just try to serialize the context data fields "verbatim" by copying the pointer values. This patch makes use of the new callbacks so that at serialization, the embedder data for the context can at least be serialized in a meaningful way (which are all reset to empty for now). Otherwise the upstream may have difficulties serializing these pointer values "verbatim" especially with the introduction of external pointer tables, even though the verbatim pointer values from a previous process is meaningless to Node.js. For Node.js the callback currently just checks that the slots are know. We will reassign the pointers with newly created native structures during deserialization and there isn't much we can reuse for now. PR-URL: nodejs#53217 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5512712/comments/cfc2b28d_c921ac80?tab=comments Reviewed-By: Chengzhong Wu <[email protected]>
bmeck
pushed a commit
to bmeck/node
that referenced
this pull request
Jun 22, 2024
Previously V8 would just try to serialize the context data fields "verbatim" by copying the pointer values. This patch makes use of the new callbacks so that at serialization, the embedder data for the context can at least be serialized in a meaningful way (which are all reset to empty for now). Otherwise the upstream may have difficulties serializing these pointer values "verbatim" especially with the introduction of external pointer tables, even though the verbatim pointer values from a previous process is meaningless to Node.js. For Node.js the callback currently just checks that the slots are know. We will reassign the pointers with newly created native structures during deserialization and there isn't much we can reuse for now. PR-URL: nodejs#53217 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5512712/comments/cfc2b28d_c921ac80?tab=comments Reviewed-By: Chengzhong Wu <[email protected]>
marco-ippolito
added
the
dont-land-on-v20.x
PRs that should not land on the v20.x-staging branch and should not be released in v20.x.
label
Jul 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
c++
Issues and PRs that require attention from people who are familiar with C++.
dont-land-on-v20.x
PRs that should not land on the v20.x-staging branch and should not be released in v20.x.
needs-ci
PRs that need a full CI run.
snapshot
Issues and PRs related to the startup snapshot
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.
Split from #50983, that one needs more work to make the entire snapshot reproducible. This at least makes the context data slots serialized as some non-gibberish (empty) values, otherwise V8 might run into issues serializing the gibberish pointer values.
Previously V8 would just try to serialize the context data fields "verbatim" by copying the pointer values. This patch makes use of the new callbacks so that at serialization, the embedder data for the context can at least be serialized in a meaningful way (which are all reset to empty for now). Otherwise the upstream may have difficulties serializing these pointer values "verbatim" especially with the introduction of external pointer tables, even though the verbatim pointer values from a previous process is meaningless to Node.js.
For Node.js the callback currently just checks that the slots are known. We will reassign the pointers with newly created native structures during deserialization and there isn't much we can reuse for now.
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5512712/comments/cfc2b28d_c921ac80?tab=comments