1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00
denoland-deno/ops/optimizer_tests
Andreu Botella 68782346d0
feat(core): Reland support for async ops in realms (#17204)
Currently realms are supported on `deno_core`, but there was no support
for async ops anywhere other than the main realm. The main issue is 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 takes the `ContextState` struct added in #17050, and adds to
it a `js_recv_cb` callback for each realm. Combined with the fact that
that same PR also added a list of known realms to `JsRuntimeState`, and
that #17174 made `OpCtx` instances realm-specific and had them include
an index into that list of known realms, this makes it possible to know
the current realm in the `queue_async_op` and `queue_fast_async_op`
methods, and therefore to send the results of promises for each realm to
that 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.

This PR is a reland of #14734 after it was reverted in #16366, except
that `ContextState` and `JsRuntimeState::known_realms` were previously
relanded in #17050. Another significant difference with the original PR
is passing around an index into `JsRuntimeState::known_realms` instead
of a `v8::Global<v8::Context>` to identify the realm, because async op
queuing in fast calls cannot call into V8, and therefore cannot have
access to V8 globals. This also simplified the implementation of
`resolve_async_ops`.

Co-authored-by: Luis Malheiro <luismalheiro@gmail.com>
2023-01-14 14:40:16 +01:00
..
async_nop.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
async_nop.out feat(core): Reland support for async ops in realms (#17204) 2023-01-14 14:40:16 +01:00
async_nop.rs feat(ops): implement fast lazy async ops (#16579) 2022-11-11 19:14:53 +05:30
async_result.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
async_result.out feat(core): Reland support for async ops in realms (#17204) 2023-01-14 14:40:16 +01:00
async_result.rs feat(ops): implement fast lazy async ops (#16579) 2022-11-11 19:14:53 +05:30
callback_options.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
callback_options.out perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
callback_options.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
incompatible_1.expected refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
incompatible_1.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
incompatible_1.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
issue16934.expected fix(ops): disallow auto-borrowing OpState across potential await point (#16952) 2022-12-05 21:40:22 +05:30
issue16934.out feat(core): Reland support for async ops in realms (#17204) 2023-01-14 14:40:16 +01:00
issue16934.rs fix(ops): disallow auto-borrowing OpState across potential await point (#16952) 2022-12-05 21:40:22 +05:30
issue16934_fast.expected fix(ops): disallow auto-borrowing OpState across potential await point (#16952) 2022-12-05 21:40:22 +05:30
issue16934_fast.out feat(core): Reland support for async ops in realms (#17204) 2023-01-14 14:40:16 +01:00
issue16934_fast.rs fix(ops): disallow auto-borrowing OpState across potential await point (#16952) 2022-12-05 21:40:22 +05:30
op_blob_revoke_object_url.expected Revert "feat(ops): Fast zero copy string arguments (#16777)" (#17063) 2022-12-15 15:26:10 +00:00
op_blob_revoke_object_url.out Revert "feat(ops): Fast zero copy string arguments (#16777)" (#17063) 2022-12-15 15:26:10 +00:00
op_blob_revoke_object_url.rs Revert "feat(ops): Fast zero copy string arguments (#16777)" (#17063) 2022-12-15 15:26:10 +00:00
op_state.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
op_state.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
op_state.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
op_state_basic1.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
op_state_basic1.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
op_state_basic1.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
op_state_generics.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
op_state_generics.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
op_state_generics.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
op_state_result.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
op_state_result.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
op_state_result.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
op_state_warning.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
op_state_warning.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
op_state_warning.rs feat(ops): implement fast lazy async ops (#16579) 2022-11-11 19:14:53 +05:30
op_state_with_transforms.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
op_state_with_transforms.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
op_state_with_transforms.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
opstate_with_arity.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
opstate_with_arity.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
opstate_with_arity.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
option_arg.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
option_arg.out perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
option_arg.rs perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
param_mut_binding_warning.expected refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
param_mut_binding_warning.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
param_mut_binding_warning.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
raw_ptr.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
raw_ptr.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
raw_ptr.rs feat(ops): support raw pointer arguments (#16826) 2022-11-26 20:07:43 +05:30
serde_v8_value.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
serde_v8_value.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
serde_v8_value.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
u64_result.expected refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
u64_result.out chore(ops): increase codegen tests coverage (#16834) 2022-11-27 09:10:31 +05:30
u64_result.rs refactor(ops): Rewrite fast call optimizer and codegen (#16514) 2022-11-10 17:23:31 +05:30
uint8array.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
uint8array.out perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
uint8array.rs perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_result.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_result.out perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_result.rs perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_result2.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_result2.out feat: Stabilize Deno.TcpConn.setNoDelay() and Deno.TcpConn.setKeepAlive() (#17003) 2022-12-14 00:54:11 +01:00
unit_result2.rs feat: Stabilize Deno.TcpConn.setNoDelay() and Deno.TcpConn.setKeepAlive() (#17003) 2022-12-14 00:54:11 +01:00
unit_ret.expected perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_ret.out perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
unit_ret.rs perf(ops): Reenable fast unit result optimization (#16827) 2022-11-27 04:48:17 +00:00
wasm_op.expected feat(ops): fast calls for Wasm (#16776) 2022-11-27 19:24:28 +05:30
wasm_op.out feat(ops): fast calls for Wasm (#16776) 2022-11-27 19:24:28 +05:30
wasm_op.rs feat(ops): fast calls for Wasm (#16776) 2022-11-27 19:24:28 +05:30