Commit 19b35bc
committed
deps: V8: cherry-pick 25650aa994
Original commit message:
[microtask] Early-exit empty PerformCheckpointInternal and OnCompleted
Microtask checkpoints (MicrotaskQueue::PerformCheckpoint) are executed
frequently at the end of every DOM event listener, microtask scope exit,
timer callback, and mutation observer turn.
In typical DOM interactions and event dispatch cycles, the microtask
queue is frequently empty (size_ == 0), no microtask completion
callbacks are registered, and no weak references were kept during the
job (weak_refs_keep_during_job == undefined_value()).
Previously, even when the queue was empty, PerformCheckpointInternal
unconditionally allocated an artificial
MicrotasksScope(kDoNotRunMicrotasks), called RunMicrotasks (which set
running state flags, created suppress scopes, and rewound entered
contexts), invoked OnCompleted, and called isolate->ClearKeptObjects()
(performing an unconditional store to the weak_refs_keep_during_job root
table slot).
This CL fast-paths PerformCheckpointInternal when size() == 0,
microtasks_completed_callbacks_ is empty, and weak_refs_keep_during_job
is undefined. If WeakRef.prototype.deref() was invoked during the turn,
weak_refs_keep_during_job holds an OrderedHashSet, so the early-exit is
skipped and ClearKeptObjects() runs to clear kept objects as required by
ECMAScript §26.1.
Pinpoint Try Job on Apple Silicon M1 (150 iterations, Job
158c2910690000):
- Speedometer 3 Score: 31.42 -> 31.48 (+0.21%, p=0.0293, stat-sig win)
- TodoMVC-JavaScript-ES6-Webpack: -0.87% (p=0.0001)
- NewsSite-Nuxt: -0.40% (p=0.0001)
- TodoMVC-Angular: -0.45% (p=0.0681)
- TodoMVC-jQuery: -0.36% (p=0.6023)
- Charts-chartjs: -0.21% (p=0.0005)
- React-Stockcharts-SVG: -0.26% (p=0.0144)
Bug: 553846289
TAG=agy
CONV=a3721850-14cb-425b-8d34-169f9934ed78
Change-Id: Ic996d283b746a5684a55c9fbc56d8fcfb38ac299
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8312487
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109567}
Refs: v8/v8@25650aa
Signed-off-by: Nigro Simone <nigro.simone@gmail.com>1 parent ad55417 commit 19b35bc
2 files changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
| |||
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
178 | | - | |
179 | 191 | | |
180 | 192 | | |
181 | 193 | | |
| |||
347 | 359 | | |
348 | 360 | | |
349 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
350 | 368 | | |
351 | 369 | | |
352 | 370 | | |
353 | 371 | | |
354 | 372 | | |
355 | | - | |
| 373 | + | |
356 | 374 | | |
357 | 375 | | |
358 | 376 | | |
| |||
0 commit comments