Commit 6199541
src: fix timing of snapshot serialize callback
Previously the addAfterUserSerailizeCallback() wasn't
ready to be used for building the built-in snapshot.
This patch initializes the callbacks at the time
lib/internal/v8/start_snapshot.js is loaded, so that
these callbacks get run correctly when building the
built-in snapshot.
Currently when building the built-in snapshot,
addAfterUserSerializeCallback() is only used by createUnsafeBuffer(),
other usages can only come from user-land snapshots,
which is covered by tests, but what gets run by the
built-in snapshot building process is less visible, and the
path used by createUnsafeBuffer() isn't reliably visible in user
land either. This adds an internal usage counter in debug builds
to verify this path when building the built-in snapshot.
PR-URL: #60434
Fixes: #60423
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>1 parent 13b6879 commit 6199541Copy full SHA for 6199541
File tree
Expand file treeCollapse file tree
4 files changed
+45
-3
lines changedOpen diff view settings
Filter options
- lib/internal
- main
- v8
- test/parallel
Expand file treeCollapse file tree
4 files changed
+45
-3
lines changedOpen diff view settings
Collapse file
lib/internal/main/mksnapshot.js
Copy file name to clipboardExpand all lines: lib/internal/main/mksnapshot.js-2Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | | - |
25 | 24 | |
26 | 25 | |
27 | 26 | |
| ||
139 | 138 | |
140 | 139 | |
141 | 140 | |
142 | | - |
143 | 141 | |
144 | 142 | |
145 | 143 | |
|
Collapse file
lib/internal/v8/startup_snapshot.js
Copy file name to clipboardExpand all lines: lib/internal/v8/startup_snapshot.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
115 | 115 | |
116 | 116 | |
117 | 117 | |
| 118 | + |
118 | 119 | |
119 | | - |
120 | 120 | |
121 | 121 | |
122 | 122 | |
|
Collapse file
test/parallel/test-buffer-alloc-unsafe-is-initialized-with-zero-fill-flag.js
Copy file name to clipboard+21Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
Collapse file
test/parallel/test-buffer-alloc-unsafe-is-uninitialized.js
Copy file name to clipboard+23Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
0 commit comments