inspector: defer JS execution from V8 interrupts - #65397
Conversation
|
Review requested:
|
Inspector messages for a main thread connection are dispatched from a V8 interrupt handler. Defer frontend messages in this case using a microtask. This preserves the existing timing contract for main thread inspector connections, where notifications are observable after a microtask checkpoint. Starting the inspector I/O thread and toggling network tracking can also call into JS from an interrupt. Signed-off-by: deepak1556 <[email protected]>
Signed-off-by: deepak1556 <[email protected]>
Original commit message:
[api] Prepare DisallowJavascriptExecution scope around api callbacks
In `v8::Isolate::RequestInterrupt` the API contract says:
API interrupt callbacks are forbidden from executing JavaScript
on the interrupted Isolate.
This CL prepares the infrastructure to enforce this contract.
Bug: 540137721, 40067940
TAG=agy
CONV=78573798-a951-4bd3-9c6f-3e3b6775da4b
Change-Id: I43cc83c3cc3ebd34052a927dde55bbf4d49d2d29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8173727
Auto-Submit: Olivier Flückiger <[email protected]>
Reviewed-by: Simon Zünd <[email protected]>
Commit-Queue: Olivier Flückiger <[email protected]>
Cr-Commit-Position: refs/heads/main@{#109086}
Refs: v8/v8@b36cf9f
Signed-off-by: deepak1556 <[email protected]>
e9d757c to
788c38a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65397 +/- ##
==========================================
- Coverage 90.14% 90.12% -0.02%
==========================================
Files 752 752
Lines 251870 251889 +19
Branches 47365 47353 -12
==========================================
- Hits 227037 227021 -16
- Misses 16177 16205 +28
- Partials 8656 8663 +7
🚀 New features to boost your workflow:
|
Commit Queue failedThis pull request has multiple commits, but no landing policy was selected. Add
commit-queue-squash
The pull request was removed from the Commit Queue and labeled
commit-queue-failed
Full Commit Queue output |
|
Landed in 03e2b9b...ccd648e |
Inspector messages for a main thread connection are dispatched from a V8 interrupt handler. Defer frontend messages in this case using a microtask. This preserves the existing timing contract for main thread inspector connections, where notifications are observable after a microtask checkpoint. Starting the inspector I/O thread and toggling network tracking can also call into JS from an interrupt. Signed-off-by: deepak1556 <[email protected]> PR-URL: #65397 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
Signed-off-by: deepak1556 <[email protected]> PR-URL: #65397 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
Original commit message:
[api] Prepare DisallowJavascriptExecution scope around api callbacks
In `v8::Isolate::RequestInterrupt` the API contract says:
API interrupt callbacks are forbidden from executing JavaScript
on the interrupted Isolate.
This CL prepares the infrastructure to enforce this contract.
Bug: 540137721, 40067940
TAG=agy
CONV=78573798-a951-4bd3-9c6f-3e3b6775da4b
Change-Id: I43cc83c3cc3ebd34052a927dde55bbf4d49d2d29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8173727
Auto-Submit: Olivier Flückiger <[email protected]>
Reviewed-by: Simon Zünd <[email protected]>
Commit-Queue: Olivier Flückiger <[email protected]>
Cr-Commit-Position: refs/heads/main@{#109086}
Refs: v8/v8@b36cf9f
Signed-off-by: deepak1556 <[email protected]>
PR-URL: #65397
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Followup to #65028 covering additional callsites, upstreaming from electron/electron#52960.
Backported the V8 feature to enable the scope check moving forward,
node::RequestInterruptalready subjected this restriction with its scope check. The change should only affect addons that were to usev8::Isolate::RequestInterrupt, but its already a documented caution in the public header. Any reason the feature shouldn't be enabled ?cc @joyeecheung