mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
script: Implement jsglue trap for runJobs() (#38265)
in the [SpiderMonkey Debugger API](https://firefox-source-docs.mozilla.org/js/Debugger/), hooks like [onNewGlobalObject()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewglobalobject-global) use an AutoDebuggerJobQueueInterruption to [switch to a new microtask queue](b14aebff23/mozjs-sys/mozjs/js/src/debugger/Debugger.cpp (L2834-L2841)
) and avoid clobbering the debuggee’s microtask queue. this in turn relies on JobQueue::runJobs(), which is [not yet implemented in RustJobQueue](b14aebff23/mozjs-sys/src/jsglue.cpp (L76-L78)
). this patch bumps mozjs to servo/mozjs#597, which implements [runJobs()](b14aebff23/mozjs-sys/mozjs/js/public/Promise.h (L61-L76)
) for RustJobQueue by calling into Servo’s MicrotaskQueue::checkpoint() via a new function in JobQueueTraps. SpiderMonkey [does not own external job queues](b14aebff23/mozjs-sys/mozjs/js/public/Promise.h (L117-L123)
), so the lifetime of these queues is managed in Servo, where they are stored in a Vec-based stack. stack-like behaviour is adequate for SpiderMonkey’s save and restore patterns, as far as we can tell, but we’ve added an assertion just in case. Testing: manually tested working in devtools debugger patch (#37667), where it will undergo automated tests Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
b40d73de38
commit
8194aa7c1e
2 changed files with 15 additions and 3 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -5240,7 +5240,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "mozjs"
|
||||
version = "0.14.1"
|
||||
source = "git+https://github.com/servo/mozjs#b23161580b082e1ccfa3273d94f43f6168aedc3d"
|
||||
source = "git+https://github.com/servo/mozjs#4035b0c4e9e2df5cacc68c4b71e7375a48605902"
|
||||
dependencies = [
|
||||
"bindgen 0.71.1",
|
||||
"cc",
|
||||
|
@ -5251,8 +5251,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "mozjs_sys"
|
||||
version = "0.128.13-2"
|
||||
source = "git+https://github.com/servo/mozjs#b23161580b082e1ccfa3273d94f43f6168aedc3d"
|
||||
version = "0.128.13-3"
|
||||
source = "git+https://github.com/servo/mozjs#4035b0c4e9e2df5cacc68c4b71e7375a48605902"
|
||||
dependencies = [
|
||||
"bindgen 0.71.1",
|
||||
"cc",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue