Commit 244462b
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.1 parent 1a2cd91 commit 244462b
3 files changed
+4
-30
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 | 302 | | |
322 | | - | |
| 303 | + | |
323 | 304 | | |
324 | 305 | | |
325 | 306 | | |
| |||
415 | 396 | | |
416 | 397 | | |
417 | 398 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | 399 | | |
424 | 400 | | |
425 | 401 | | |
| |||
| 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