Auto merge of #24757 - Akash-Pateria:async-wasm-compilation-subsequent, r=jdm

Async wasm compilation event loop integration

The PR contains changes related to binding the runnable dispatching in script_runtime and is part of the Asynchronous WebAssembly Compilation fix. This is the first step in the subsequent steps mentioned in the [wiki](https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes are part of #21476 fix
This commit is contained in:
bors-servo 2019-11-20 16:16:13 -05:00 committed by GitHub
commit dc22a78cc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 162 additions and 427 deletions

View file

@ -32,6 +32,7 @@ use crate::script_runtime::{
new_child_runtime, CommonScriptMsg, JSContext as SafeJSContext, Runtime, ScriptChan, ScriptPort,
};
use crate::task_queue::{QueuedTask, QueuedTaskConversion, TaskQueue};
use crate::task_source::networking::NetworkingTaskSource;
use crate::task_source::TaskSourceName;
use crossbeam_channel::{unbounded, Receiver, Sender};
use devtools_traits::DevtoolScriptControlMsg;
@ -344,7 +345,16 @@ impl DedicatedWorkerGlobalScope {
.referrer_policy(referrer_policy)
.origin(origin);
let runtime = unsafe { new_child_runtime(parent) };
let runtime = unsafe {
if let Some(pipeline_id) = pipeline_id {
new_child_runtime(
parent,
Some(NetworkingTaskSource(parent_sender.clone(), pipeline_id)),
)
} else {
new_child_runtime(parent, None)
}
};
let (devtools_mpsc_chan, devtools_mpsc_port) = unbounded();
ROUTER.route_ipc_receiver_to_crossbeam_sender(

View file

@ -315,7 +315,7 @@ impl ServiceWorkerGlobalScope {
},
};
let runtime = new_rt_and_cx();
let runtime = new_rt_and_cx(None);
let (devtools_mpsc_chan, devtools_mpsc_port) = unbounded();
ROUTER

View file

@ -477,7 +477,7 @@ impl WorkletThread {
global_init: init.global_init,
global_scopes: HashMap::new(),
control_buffer: None,
runtime: new_rt_and_cx(),
runtime: new_rt_and_cx(None),
should_gc: false,
gc_threshold: MIN_GC_THRESHOLD,
});