Implement runJobs() for the SpiderMonkey Debugger API #597
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
in the SpiderMonkey Debugger API, hooks like onNewGlobalObject() use an AutoDebuggerJobQueueInterruption to switch to a new microtask queue and avoid clobbering the debuggee’s microtask queue. this in turn relies on JobQueue::runJobs(), which is not yet implemented in RustJobQueue.
this patch implements runJobs() for RustJobQueue by calling into Servo’s MicrotaskQueue::checkpoint() via a new function in JobQueueTraps.
SpiderMonkey does not own any job queues, 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.
Servo patch: servo/servo#38265