Commit 4a8ea63
async_wrap,src: wrap promises directly
Promises do not have any internal fields by default. V8 recently added
the capability of configuring the number of internal fields on promises.
This change adds an internal field to promises allowing promises to be
wrapped directly by the PromiseWrap object. In addition to cleaner code
this avoids an extra object allocation per promise and speeds up promise
creation with async_hooks enabled by ~2x.
PR-URL: #13242
Ref: #13224
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent 0be029e commit 4a8ea63
3 files changed
+4
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| 957 | + | |
957 | 958 | | |
958 | 959 | | |
959 | 960 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 297 | + | |
| 298 | + | |
316 | 299 | | |
317 | 300 | | |
318 | 301 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 302 | + | |
323 | 303 | | |
324 | 304 | | |
325 | 305 | | |
| |||
415 | 395 | | |
416 | 396 | | |
417 | 397 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | 398 | | |
424 | 399 | | |
425 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | 259 | | |
263 | 260 | | |
264 | 261 | | |
| |||
0 commit comments