From 03dc3b8972f460e40d0b75fc3207cae9fe4f60da Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 22 Jul 2022 17:54:22 +0530 Subject: feat(ops): V8 Fast Calls (#15122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- ext/net/lib.rs | 4 +++- ext/web/02_timers.js | 4 +++- ext/web/timers.rs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/net/lib.rs b/ext/net/lib.rs index c95348020..249170060 100644 --- a/ext/net/lib.rs +++ b/ext/net/lib.rs @@ -81,6 +81,8 @@ pub fn init( unstable: bool, unsafely_ignore_certificate_errors: Option>, ) -> Extension { + let mut ops = ops::init::

(); + ops.extend(ops_tls::init::

()); Extension::builder() .js(include_js_files!( prefix "deno:ext/net", @@ -88,7 +90,7 @@ pub fn init( "02_tls.js", "04_net_unstable.js", )) - .ops([&ops::init::

()[..], &ops_tls::init::

()[..]].concat()) + .ops(ops) .state(move |state| { state.put(DefaultTlsOptions { root_cert_store: root_cert_store.clone(), diff --git a/ext/web/02_timers.js b/ext/web/02_timers.js index a4ce33a18..1a456f9bb 100644 --- a/ext/web/02_timers.js +++ b/ext/web/02_timers.js @@ -23,9 +23,11 @@ const { webidl } = window.__bootstrap; const { reportException } = window.__bootstrap.event; const { assert } = window.__bootstrap.infra; + // deno-lint-ignore camelcase + const { op_now } = Deno.core.ops; function opNow() { - return core.opSync("op_now"); + return op_now.call(); } // --------------------------------------------------------------------------- diff --git a/ext/web/timers.rs b/ext/web/timers.rs index f57baa559..ebef717ba 100644 --- a/ext/web/timers.rs +++ b/ext/web/timers.rs @@ -28,7 +28,7 @@ pub type StartTime = Instant; // If the High precision flag is not set, the // nanoseconds are rounded on 2ms. #[op] -pub fn op_now(state: &mut OpState, _argument: ()) -> f64 +pub fn op_now(state: &mut OpState) -> f64 where TP: TimersPermission + 'static, { -- cgit v1.2.3