diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-18 18:30:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-18 18:30:04 -0400 |
commit | 3c9771deb2d615c47a2570023039c6a71f1c774b (patch) | |
tree | 759ce45a956798ddae58108286eafee29414d913 /runtime/ops | |
parent | a5ad3a44b5476909f12ae90501d8c7c451669be6 (diff) |
Reland "perf(core): preserve ops between snapshots (#18080)" (#18272)
Relanding 4b6305f4f25fc76f974bbdcc9cdb139d5ab8f5f4
Diffstat (limited to 'runtime/ops')
-rw-r--r-- | runtime/ops/fs_events.rs | 5 | ||||
-rw-r--r-- | runtime/ops/http.rs | 3 | ||||
-rw-r--r-- | runtime/ops/os/mod.rs | 14 | ||||
-rw-r--r-- | runtime/ops/permissions.rs | 5 | ||||
-rw-r--r-- | runtime/ops/process.rs | 5 | ||||
-rw-r--r-- | runtime/ops/runtime.rs | 5 | ||||
-rw-r--r-- | runtime/ops/signal.rs | 5 | ||||
-rw-r--r-- | runtime/ops/tty.rs | 5 | ||||
-rw-r--r-- | runtime/ops/web_worker.rs | 5 | ||||
-rw-r--r-- | runtime/ops/worker_host.rs | 5 |
10 files changed, 42 insertions, 15 deletions
diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs index 05cc22152..27e76b3d3 100644 --- a/runtime/ops/fs_events.rs +++ b/runtime/ops/fs_events.rs @@ -30,7 +30,10 @@ use tokio::sync::mpsc; deno_core::extension!( deno_fs_events, - ops = [op_fs_events_open, op_fs_events_poll] + ops = [op_fs_events_open, op_fs_events_poll], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); struct FsEventsResource { diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs index b9899b4e3..3a316d800 100644 --- a/runtime/ops/http.rs +++ b/runtime/ops/http.rs @@ -30,6 +30,9 @@ use tokio::net::UnixStream; deno_core::extension!( deno_http_runtime, ops = [op_http_start, op_http_upgrade, op_flash_upgrade_http], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); #[op] diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs index b34629395..70a126301 100644 --- a/runtime/ops/os/mod.rs +++ b/runtime/ops/os/mod.rs @@ -48,24 +48,24 @@ deno_core::extension!( state = |state, options| { state.put::<ExitCode>(options.exit_code); }, + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + } ); deno_core::extension!( deno_os_worker, ops_fn = deno_ops, middleware = |op| match op.name { - "op_exit" => noop_op::decl(), - "op_set_exit_code" => noop_op::decl(), + "op_exit" | "op_set_exit_code" => op.disable(), _ => op, }, + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + } ); #[op] -fn noop_op() -> Result<(), AnyError> { - Ok(()) -} - -#[op] fn op_exec_path(state: &mut OpState) -> Result<String, AnyError> { let current_exe = env::current_exe().unwrap(); state diff --git a/runtime/ops/permissions.rs b/runtime/ops/permissions.rs index c08d11e4a..6f7b98a30 100644 --- a/runtime/ops/permissions.rs +++ b/runtime/ops/permissions.rs @@ -17,7 +17,10 @@ deno_core::extension!( op_query_permission, op_revoke_permission, op_request_permission, - ] + ], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); #[derive(Deserialize)] diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index a15b63f80..cf8740255 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -107,7 +107,10 @@ deno_core::extension!( deprecated::op_run, deprecated::op_run_status, deprecated::op_kill, - ] + ], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); struct ChildResource(tokio::process::Child); diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs index a77e888c8..8802f9cd6 100644 --- a/runtime/ops/runtime.rs +++ b/runtime/ops/runtime.rs @@ -12,7 +12,10 @@ deno_core::extension!( options = { main_module: ModuleSpecifier }, state = |state, options| { state.put::<ModuleSpecifier>(options.main_module); - } + }, + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); #[op] diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs index 9cc261d85..93e1cfef2 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -31,7 +31,10 @@ use tokio::signal::windows::CtrlC; deno_core::extension!( deno_signal, - ops = [op_signal_bind, op_signal_unbind, op_signal_poll] + ops = [op_signal_bind, op_signal_unbind, op_signal_poll], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); #[cfg(unix)] diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index 60144e408..3146f22e2 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -34,7 +34,10 @@ fn get_windows_handle( deno_core::extension!( deno_tty, - ops = [op_stdin_set_raw, op_isatty, op_console_size] + ops = [op_stdin_set_raw, op_isatty, op_console_size], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); // ref: <https://learn.microsoft.com/en-us/windows/console/setconsolemode> diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs index 45137913e..7952a03f2 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -24,7 +24,10 @@ deno_core::extension!( op_worker_close, op_worker_get_type, op_worker_sync_fetch, - ] + ], + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); #[op] diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs index 26c99efab..d5285ec89 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -118,7 +118,10 @@ deno_core::extension!( let format_js_error_fn_holder = FormatJsErrorFnHolder(options.format_js_error_fn); state.put::<FormatJsErrorFnHolder>(format_js_error_fn_holder); - } + }, + customizer = |ext: &mut deno_core::ExtensionBuilder| { + ext.force_op_registration(); + }, ); #[derive(Deserialize)] |