Move create_channels into worker constructor (#3889)

This commit is contained in:
Ryan Dahl 2020-02-05 02:40:38 -05:00 committed by GitHub
parent 7d115a2a65
commit 55ea854671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 79 additions and 79 deletions

View file

@ -45,12 +45,11 @@ pub struct WasmCompiler {
impl WasmCompiler {
/// Create a new V8 worker with snapshot of WASM compiler and setup compiler's runtime.
fn setup_worker(global_state: ThreadSafeGlobalState) -> CompilerWorker {
let (int, ext) = ThreadSafeState::create_channels();
let entry_point =
ModuleSpecifier::resolve_url_or_path("./__$deno$wasm_compiler.ts")
.unwrap();
let worker_state =
ThreadSafeState::new(global_state.clone(), None, entry_point, int)
ThreadSafeState::new(global_state.clone(), None, entry_point)
.expect("Unable to create worker state");
// Count how many times we start the compiler worker.
@ -63,7 +62,6 @@ impl WasmCompiler {
"WASM".to_string(),
startup_data::compiler_isolate_init(),
worker_state,
ext,
);
worker.execute("bootstrapWasmCompilerRuntime()").unwrap();
worker