Upgrade to Spidermonkey 67.

This commit is contained in:
Josh Matthews 2019-06-02 23:38:12 -04:00
parent ce9f35e0e3
commit 63714c90fb
19 changed files with 260 additions and 139 deletions

View file

@ -845,11 +845,16 @@ impl ScriptThread {
}
// https://html.spec.whatwg.org/multipage/#await-a-stable-state
#[allow(unsafe_code)]
pub fn await_stable_state(task: Microtask) {
SCRIPT_THREAD_ROOT.with(|root| {
if let Some(script_thread) = root.get() {
let script_thread = unsafe { &*script_thread };
script_thread.microtask_queue.enqueue(task);
unsafe {
let script_thread = &*script_thread;
script_thread
.microtask_queue
.enqueue(task, script_thread.get_cx());
}
}
});
}
@ -1123,6 +1128,8 @@ impl ScriptThread {
devtools_port: devtools_port,
devtools_sender: ipc_devtools_sender,
microtask_queue: runtime.microtask_queue.clone(),
js_runtime: Rc::new(runtime),
topmost_mouse_over_target: MutNullableDom::new(Default::default()),
closed_pipelines: DomRefCell::new(HashSet::new()),
@ -1133,8 +1140,6 @@ impl ScriptThread {
content_process_shutdown_chan: state.content_process_shutdown_chan,
microtask_queue: Default::default(),
mutation_observer_microtask_queued: Default::default(),
mutation_observers: Default::default(),
@ -3541,13 +3546,17 @@ impl ScriptThread {
}
}
#[allow(unsafe_code)]
pub fn enqueue_microtask(job: Microtask) {
SCRIPT_THREAD_ROOT.with(|root| {
let script_thread = unsafe { &*root.get().unwrap() };
script_thread.microtask_queue.enqueue(job);
SCRIPT_THREAD_ROOT.with(|root| unsafe {
let script_thread = &*root.get().unwrap();
script_thread
.microtask_queue
.enqueue(job, script_thread.get_cx());
});
}
#[allow(unsafe_code)]
fn perform_a_microtask_checkpoint(&self) {
let globals = self
.documents
@ -3556,8 +3565,13 @@ impl ScriptThread {
.map(|(_id, document)| document.global())
.collect();
self.microtask_queue
.checkpoint(|id| self.documents.borrow().find_global(id), globals)
unsafe {
self.microtask_queue.checkpoint(
self.get_cx(),
|id| self.documents.borrow().find_global(id),
globals,
)
}
}
}