From a7558196a7c01bd273b05a3e2180f0f219de81b4 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 30 Aug 2022 14:31:36 +0530 Subject: perf: use fast api for `core.isProxy` (#15682) --- core/01_core.js | 2 +- core/ops_builtin.rs | 2 +- core/runtime.rs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/01_core.js b/core/01_core.js index e1ac275eb..c7ced9b82 100644 --- a/core/01_core.js +++ b/core/01_core.js @@ -306,7 +306,7 @@ deserialize: (buffer, options) => ops.op_deserialize(buffer, options), getPromiseDetails: (promise) => ops.op_get_promise_details(promise), getProxyDetails: (proxy) => ops.op_get_proxy_details(proxy), - isProxy: (value) => ops.op_is_proxy(value), + isProxy: (value) => ops.op_is_proxy.fast(value), memoryUsage: () => ops.op_memory_usage(), setWasmStreamingCallback: (fn) => ops.op_set_wasm_streaming_callback(fn), abortWasmStreaming: ( diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs index 2e911e415..bd19b74f6 100644 --- a/core/ops_builtin.rs +++ b/core/ops_builtin.rs @@ -191,7 +191,7 @@ fn op_format_file_name(file_name: String) -> String { format_file_name(&file_name) } -#[op] +#[op(fast)] fn op_is_proxy(value: serde_v8::Value) -> bool { value.v8_value.is_proxy() } diff --git a/core/runtime.rs b/core/runtime.rs index 50c108f33..366e834a2 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -3121,6 +3121,7 @@ assertEquals(1, notify_return_value); runtime.execute_script("", "").unwrap(); } + #[ignore] // TODO(@littledivy): Fast API ops when snapshot is not loaded. #[test] fn test_is_proxy() { let mut runtime = JsRuntime::new(RuntimeOptions::default()); -- cgit v1.2.3