Commit f56c785
committed
deps: V8: cherry-pick c0fceaa0669b
Original commit message:
Reland "[api] JSFunction PromiseHook for v8::Context"
This is a reland of d5457f5fb7ea05ca05a697599ffa50d35c1ae3c7
after a speculative revert.
Additionally it fixes an issue with throwing promise hooks.
Original change's description:
> [api] JSFunction PromiseHook for v8::Context
>
> This will enable Node.js to get much better performance from async_hooks
> as currently PromiseHook delegates to C++ for the hook function and then
> Node.js delegates it right back to JavaScript, introducing several
> unnecessary barrier hops in code that gets called very, very frequently
> in modern, promise-heavy applications.
>
> This API mirrors the form of the original C++ function based PromiseHook
> API, however it is intentionally separate to allow it to use JSFunctions
> triggered within generated code to, as much as possible, avoid entering
> runtime functions entirely.
>
> Because PromiseHook has internal use also, beyond just the Node.js use,
> I have opted to leave the existing API intact and keep this separate to
> avoid conflicting with any possible behaviour expectations of other API
> users.
>
> The design ideas for this new API stemmed from discussion with some V8
> team members at a previous Node.js Diagnostics Summit hosted by Google
> in Munich, and the relevant documentation of the discussion can be found
> here: https://docs.google.com/document/d/1g8OrG5lMIUhRn1zbkutgY83MiTSMx-0NHDs8Bf-nXxM/edit#heading=h.w1bavzz80l1e
>
> A summary of the reasons for why this new design is important can be
> found here: https://docs.google.com/document/d/1vtgoT4_kjgOr-Bl605HR2T6_SC-C8uWzYaOPDK5pmRo/edit?usp=sharing
>
> Bug: v8:11025
> Change-Id: I0b403b00c37d3020b5af07b654b860659d3a7697
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2759188
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73858}
Bug: v8:11025
Bug: chromium:1197475
Change-Id: I73a71e97d9c3dff89a2b092c3fe4adff81ede8ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2823917
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74071}
Refs: v8/v8@c0fceaa
PR-URL: #38273
Backport-PR-URL: #38991
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>1 parent 7197fce commit f56c785Copy full SHA for f56c785
File tree
Expand file treeCollapse file tree
32 files changed
+782
-131
lines changedOpen diff view settings
Filter options
- deps/v8
- include
- src
- api
- builtins
- codegen
- d8
- execution
- heap
- objects
- runtime
- test
- cctest
- mjsunit
Expand file treeCollapse file tree
32 files changed
+782
-131
lines changedOpen diff view settings
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
| 39 | + |
40 | 40 | |
41 | 41 | |
42 | 42 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
211 | 211 | |
212 | 212 | |
213 | 213 | |
| 214 | + |
214 | 215 | |
215 | 216 | |
216 | 217 | |
|
Collapse file
+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10585 | 10585 | |
10586 | 10586 | |
10587 | 10587 | |
| 10588 | + |
| 10589 | + |
| 10590 | + |
| 10591 | + |
| 10592 | + |
| 10593 | + |
| 10594 | + |
| 10595 | + |
| 10596 | + |
| 10597 | + |
| 10598 | + |
| 10599 | + |
10588 | 10600 | |
10589 | 10601 | |
10590 | 10602 | |
|
Collapse file
+39Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6220 | 6220 | |
6221 | 6221 | |
6222 | 6222 | |
| 6223 | + |
| 6224 | + |
| 6225 | + |
| 6226 | + |
| 6227 | + |
| 6228 | + |
| 6229 | + |
| 6230 | + |
| 6231 | + |
| 6232 | + |
| 6233 | + |
| 6234 | + |
| 6235 | + |
| 6236 | + |
| 6237 | + |
| 6238 | + |
| 6239 | + |
| 6240 | + |
| 6241 | + |
| 6242 | + |
| 6243 | + |
| 6244 | + |
| 6245 | + |
| 6246 | + |
| 6247 | + |
| 6248 | + |
| 6249 | + |
| 6250 | + |
| 6251 | + |
| 6252 | + |
| 6253 | + |
| 6254 | + |
| 6255 | + |
| 6256 | + |
| 6257 | + |
| 6258 | + |
| 6259 | + |
| 6260 | + |
| 6261 | + |
6223 | 6262 | |
6224 | 6263 | |
6225 | 6264 | |
|
Collapse file
deps/v8/src/builtins/builtins-async-function-gen.cc
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-async-function-gen.cc+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
157 | 157 | |
158 | 158 | |
159 | 159 | |
| 160 | + |
| 161 | + |
160 | 162 | |
161 | 163 | |
162 | 164 | |
163 | 165 | |
164 | 166 | |
165 | | - |
| 167 | + |
166 | 168 | |
167 | 169 | |
168 | 170 | |
|
Collapse file
deps/v8/src/builtins/builtins-async-gen.cc
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-async-gen.cc+40-22Lines changed: 40 additions & 22 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
97 | 97 | |
98 | 98 | |
99 | 99 | |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | - |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
112 | 105 | |
113 | 106 | |
114 | 107 | |
| ||
168 | 161 | |
169 | 162 | |
170 | 163 | |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
171 | 177 | |
172 | 178 | |
173 | 179 | |
174 | | - |
175 | | - |
176 | | - |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
177 | 187 | |
178 | | - |
179 | | - |
| 188 | + |
| 189 | + |
180 | 190 | |
181 | | - |
182 | | - |
183 | | - |
184 | | - |
185 | | - |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
186 | 204 | |
187 | 205 | |
188 | 206 | |
|
Collapse file
deps/v8/src/builtins/builtins-async-gen.h
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-async-gen.h+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
62 | 62 | |
63 | 63 | |
64 | 64 | |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
65 | 71 | |
66 | 72 | |
67 | 73 | |
|
Collapse file
deps/v8/src/builtins/builtins-async-generator-gen.cc
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-async-generator-gen.cc+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
518 | 518 | |
519 | 519 | |
520 | 520 | |
521 | | - |
| 521 | + |
522 | 522 | |
523 | 523 | |
524 | 524 | |
|
Collapse file
deps/v8/src/builtins/builtins-microtask-queue-gen.cc
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-microtask-queue-gen.cc+48-14Lines changed: 48 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
46 | 46 | |
47 | 47 | |
48 | 48 | |
| 49 | + |
| 50 | + |
49 | 51 | |
50 | | - |
| 52 | + |
| 53 | + |
51 | 54 | |
52 | 55 | |
53 | 56 | |
| ||
199 | 202 | |
200 | 203 | |
201 | 204 | |
202 | | - |
| 205 | + |
203 | 206 | |
204 | 207 | |
205 | 208 | |
| ||
208 | 211 | |
209 | 212 | |
210 | 213 | |
211 | | - |
| 214 | + |
212 | 215 | |
213 | 216 | |
214 | 217 | |
| ||
243 | 246 | |
244 | 247 | |
245 | 248 | |
246 | | - |
247 | | - |
| 249 | + |
| 250 | + |
248 | 251 | |
249 | 252 | |
250 | 253 | |
| ||
253 | 256 | |
254 | 257 | |
255 | 258 | |
256 | | - |
257 | | - |
| 259 | + |
| 260 | + |
258 | 261 | |
259 | 262 | |
260 | 263 | |
| ||
296 | 299 | |
297 | 300 | |
298 | 301 | |
299 | | - |
300 | | - |
| 302 | + |
| 303 | + |
301 | 304 | |
302 | 305 | |
303 | 306 | |
| ||
306 | 309 | |
307 | 310 | |
308 | 311 | |
309 | | - |
310 | | - |
| 312 | + |
| 313 | + |
311 | 314 | |
312 | 315 | |
313 | 316 | |
| ||
465 | 468 | |
466 | 469 | |
467 | 470 | |
| 471 | + |
| 472 | + |
| 473 | + |
| 474 | + |
| 475 | + |
| 476 | + |
| 477 | + |
| 478 | + |
| 479 | + |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
| 484 | + |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
| 489 | + |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
468 | 501 | |
469 | 502 | |
470 | | - |
| 503 | + |
| 504 | + |
471 | 505 | |
472 | | - |
473 | | - |
| 506 | + |
| 507 | + |
474 | 508 | |
475 | 509 | |
476 | 510 | |
|
Collapse file
deps/v8/src/builtins/cast.tq
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/cast.tq+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
386 | 386 | |
387 | 387 | |
388 | 388 | |
| 389 | + |
| 390 | + |
| 391 | + |
| 392 | + |
| 393 | + |
| 394 | + |
389 | 395 | |
390 | 396 | |
391 | 397 | |
|
0 commit comments