src: use v8::(Des|S)erializeInternalFieldsCallback#53217
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Jun 7, 2024
Merged
src: use v8::(Des|S)erializeInternalFieldsCallback#53217nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
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.
Collaborator
|
Review requested:
|
Collaborator
legendecas
approved these changes
May 31, 2024
Collaborator
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 |
Collaborator
|
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 <legendecas@gmail.com>
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 <legendecas@gmail.com>
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 <legendecas@gmail.com>
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.
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