dart-sdk/sdk
Liam Appelbe edeac698c2 [vm/ffi] Closure callbacks for async callbacks
This change is almost trivial. The closure is stored on the callback's
RawReceivePort, not in the VM. So we can basically just remove the CFE
check and it pretty much works. The only problem is that we can't set
function.FfiCallbackTarget anymore, so most of the CL is dealing with
that.

A few places were deciding whether an FFI trampoline was a call or a
callback based on whether function.FfiCallbackTarget() was null. But
now the target will be null for async callbacks. So instead I've added
a new value to the FfiCallbackKind enum (and renamed it), and changed
those checks.

Sync callback closures will be a separate CL, because they're more
complicated.

Bug: https://github.com/dart-lang/sdk/issues/52689
Change-Id: I8e5dfb557362e679f66195b735c3c382e6792840
TEST=async_void_function_callbacks_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316160
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-07-26 23:23:26 +00:00
..
bin [dart2wasm] Add JS compatibility mode. 2023-07-18 19:34:38 +00:00
lib [vm/ffi] Closure callbacks for async callbacks 2023-07-26 23:23:26 +00:00
.gitignore [sdk] Generate a version file for the unpatched SDK 2022-05-05 10:36:05 +00:00
api_readme.md [docs] fix a grammar issue in the sdk readme 2023-04-26 18:25:55 +00:00
BUILD.gn [dart2wasm] Add JS compatibility mode. 2023-07-18 19:34:38 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00