mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 01:52:56 +00:00
Move create_channels into worker constructor (#3889)
This commit is contained in:
parent
7d115a2a65
commit
55ea854671
9 changed files with 79 additions and 79 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue