summaryrefslogtreecommitdiff
path: root/ops/lib.rs
AgeCommit message (Collapse)Author
2022-10-28Reland "perf(core): generate inlined wrappers for async ops" (#16455)Divy Srivastava
Reland https://github.com/denoland/deno/pull/16428
2022-10-27Revert "perf(core): generate inlined wrappers for async ops (#16428)" (#16443)Divy Srivastava
2022-10-27perf(core): generate inlined wrappers for async ops (#16428)Divy Srivastava
V8's JIT can do a better job knowing the argument count and also enable fast call path (in future). This also lets us call async ops without `opAsync`: ```js const { ops } = Deno.core; await ops.op_void_async(); ``` this patch: 4405286 ops/sec main: 3508771 ops/sec
2022-10-21perf(core): don't access isolate slots for JsRuntimeState (#16376)Divy Srivastava
example writeFile benchmark: ``` # before time 188 ms rate 53191 time 168 ms rate 59523 time 167 ms rate 59880 time 166 ms rate 60240 time 168 ms rate 59523 time 173 ms rate 57803 time 183 ms rate 54644 # after time 157 ms rate 63694 time 152 ms rate 65789 time 151 ms rate 66225 time 151 ms rate 66225 time 152 ms rate 65789 ```
2022-10-21Revert realms from deno_core (#16366)Divy Srivastava
This revert has been discussed at length out-of-band (including with @andreubotella). The realms work in impeding ongoing event loop and performance work. We very much want to land realms but it needs to wait until these lower-level refactors are complete. We hope to bring realms back in a couple weeks.
2022-10-20chore: upgrade rusty_v8 to 0.54.0 (#16368)Bartek Iwańczuk
<!-- Before submitting a PR, please read http://deno.land/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. -->
2022-10-20perf(ext/ffi): Fast UnsafePointerView read functions (#16351)Aapo Alasuutari
This PR makes pointer read methods of `Deno.UnsafePointerView` Fast API compliant, with the exception of `getCString` which cannot be made fast with current V8 Fast API.
2022-10-16refactor(core): make `borrow_mut` more explicit in the ops macro (#16025)ad hoc
2022-09-23perf: use fast ops for tty (#15976)Divy Srivastava
2022-09-23feat(ops): Fallible fast ops (#15989)Aapo Alasuutari
2022-09-22feat(ops): Automatic fast ops creation (#15527)Aapo Alasuutari
2022-09-17perf(web): optimize encodeInto() (#15922)Divy Srivastava
2022-09-07perf(ops): inline &[u8] arguments and enable fast API (#15731)Divy Srivastava
2022-09-06perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)Divy Srivastava
2022-09-05fix(ops): use qualified borrow in op macro (#15769)sigmaSd
Fix https://github.com/denoland/deno/issues/15764 Use RefCell::borrow instead of state.borrow to avoid clash with std::borrow::Borrow
2022-09-01feat(ops): support `v8::FastApiCallbackOptions` (#15721)Divy Srivastava
2022-08-30perf: use fast api for `core.isProxy` (#15682)Divy Srivastava
2022-08-30perf(ops): inline String args (#15681)Divy Srivastava
2022-08-28perf: use fast api for op_now (#15643)Divy Srivastava
2022-08-21feat(ops): V8 Fast Calls (#15291)Divy Srivastava
2022-08-11refactor(core): unwrap sync ops in rust (#15449)Nayeem Rahman
2022-08-10feat(core): Add support for async ops in realms (#14734)Andreu Botella
Pull request #14019 enabled initial support for realms, but it did not include support for async ops anywhere other than the main realm. The main issue was that the `js_recv_cb` callback, which resolves promises corresponding to async ops, was only set for the main realm, so async ops in other realms would never resolve. Furthermore, promise ID's are specific to each realm, which meant that async ops from other realms would result in a wrong promise from the main realm being resolved. This change creates a `ContextState` struct, similar to `JsRuntimeState` but stored in a slot of each `v8::Context`, which contains a `js_recv_cb` callback for each realm. Combined with a new list of known realms, which stores them as `v8::Weak<v8::Context>`, and a change in the `#[op]` macro to pass the current context to `queue_async_op`, this makes it possible to send the results of promises for different realms to their realm, and prevent the ID's from getting mixed up. Additionally, since promise ID's are no longer unique to the isolate, having a single set of unrefed ops doesn't work. This change therefore also moves `unrefed_ops` from `JsRuntimeState` to `ContextState`, and adds the lengths of the unrefed op sets for all known realms to get the total number of unrefed ops to compare in the event loop. Co-authored-by: Luis Malheiro <luismalheiro@gmail.com>
2022-07-22Revert "feat(ops): V8 Fast Calls (#15122)" (#15276)Divy Srivastava
This reverts commit 03dc3b8972f460e40d0b75fc3207cae9fe4f60da.
2022-07-22feat(ops): V8 Fast Calls (#15122)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-07-01perf(ops): fast path for SMI return values (#15033)Divy Srivastava
2022-07-01fix(core): remove unsafe in OpsTracker (#15025)Nugine
2022-06-16cleanup(ops): match variations with regexes (#14888)Aaron O'Mullan
2022-06-16feat(ops): support `Result<impl Future<Output = Result<T, AnyError>> + ↵Divy Srivastava
'static, AnyError>` (#14869) feat(ops): support a result returning a future returning a result
2022-06-08feat(ops): 'hybrid' ops - sync returning future (#14640)Divy Srivastava
2022-06-07refactor(core): Move Deno.core bindings to ops (#14793)Nayeem Rahman
2022-06-02chore(ops): fix typo in lib.rs (#14777)Ikko Ashimine
2022-05-12cleanup(ops): shorter codegen'd infallible sync ops return (#14587)Aapo Alasuutari
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-05-12cleanup(ops): simpler is_unit_result() (#14586)Aaron O'Mullan
Rough token-string matching is robust enough and much easier to grok
2022-05-12feat(ops): infallible / result-free ops (#14585)Aaron O'Mullan
2022-05-12feat(ops): #[op(v8)] (#14582)Aaron O'Mullan
2022-05-12feat(ops): allow passing scope handle to ops (#14574)Divy Srivastava
2022-05-05feat(ops): sync Rc<RefCell<OpState>> (#14438)Aaron O'Mullan
2022-04-23chore(ext/fetch): custom arity (#14198)Divy Srivastava
2022-04-08refactor(core): OpCtx (#14228)Aaron O'Mullan
2022-04-02feat(ops): #[op(unstable)] (#14124)Aaron O'Mullan
2022-03-22feat(core): disableable extensions & ops (#14063)Aaron O'Mullan
Streamlines a common middleware pattern and provides foundations for avoiding variably sized v8::ExternalReferences & enabling fully monomorphic op callpaths
2022-03-19chore(ops): hide implementation details from rustdoc (#14038)Divy Srivastava
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-03-19fix(ops): throw TypeError on op return failure (#14033)Aaron O'Mullan
Fixes #14028
2022-03-18chore(ops): include argument position in serde_v8 errors (#14027)Divy Srivastava
2022-03-16feat(ops): optional OpState (#13954)Aaron O'Mullan
2022-03-15cleanup(core): OpPair => OpDecl (#13952)Aaron O'Mullan
2022-03-14feat(ops): custom arity (#13949)Aaron O'Mullan
Also cleanup & drop ignored wildcard op-args
2022-03-14feat(core): codegen ops (#13861)Divy Srivastava
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>