Clement Skau
4258a59789
[vm][ffi] Passes FFI handles on stack.
...
Passing handles in FFI calls has significant overhead due to
how each handle requires a runtime entry to allocate in the
handle scope.
This change removes that runtime entry by relying on the
register allocator to allocate all handle arguments on the stack,
so that we don't need to allocate them separately.
To pass the stack handles to the native call we then pass a pointer
to the stack slot as the native argument.
Testing:
- We already have comprehensive tests for correctness in the form
of the FFI tests. These make calls with various combinations of
Handle and non-handle arguments.
- Correct GC behaviour is likewise covered in
`vmspecific_handle_test.dart` which makes calls with handles
arguments and triggers GC in-flight.
In case we do not correctly pass the handles on the stack, the
GC will trash them during the call.
TEST=Existing.
Bug: https://github.com/dart-lang/sdk/issues/47624
Change-Id: Ic837bad5484daaa5534b7c2e8707ac2c5dfa480f
Cq-Include-Trybots: luci.dart.try:vm-kernel-gcc-linux-try,vm-kernel-linux-debug-simriscv64-try,vm-kernel-nnbd-mac-release-arm64-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-simriscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243320
Reviewed-by: Slava Egorov <vegorov@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2022-05-11 06:43:14 +00:00
..
2022-05-11 06:43:14 +00:00
2022-05-04 20:53:15 +00:00
2022-05-10 18:08:43 +00:00
2021-07-29 16:55:55 +00:00
2021-08-10 21:10:01 +00:00
2022-03-09 14:17:44 +00:00
2022-05-05 22:36:56 +00:00
2022-04-28 22:21:40 +00:00
2020-11-13 22:10:54 +00:00
2022-03-03 00:58:49 +00:00
2021-10-14 00:10:12 +00:00
2021-03-19 15:29:57 +00:00
2021-07-13 01:55:45 +00:00
2021-12-16 10:39:49 +00:00
2021-07-05 10:45:47 +00:00
2021-07-13 01:55:45 +00:00
2022-03-26 09:41:21 +00:00
2022-03-26 09:41:21 +00:00
2021-09-08 16:29:19 +00:00
2020-10-06 17:10:05 +00:00
2020-05-26 08:47:30 +00:00
2021-12-14 22:20:05 +00:00
2022-05-05 19:29:35 +00:00
2022-05-05 19:29:35 +00:00
2021-03-02 16:28:12 +00:00
2022-03-26 09:41:21 +00:00
2021-05-05 23:43:14 +00:00
2022-04-29 01:03:50 +00:00
2021-12-20 21:40:33 +00:00
2021-12-20 21:40:33 +00:00
2021-11-17 11:02:01 +00:00
2021-11-17 11:02:01 +00:00
2021-02-02 11:35:00 +00:00
2021-02-02 11:35:00 +00:00
2021-09-08 13:39:34 +00:00
2022-04-29 01:03:50 +00:00
2022-05-02 20:53:01 +00:00
2020-11-13 22:10:54 +00:00
2021-02-02 11:35:00 +00:00
2021-09-10 22:21:36 +00:00
2021-11-24 13:03:52 +00:00
2021-09-10 22:21:36 +00:00
2021-11-24 13:03:52 +00:00
2021-09-10 22:21:36 +00:00
2021-02-04 17:36:47 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2021-09-10 22:21:36 +00:00
2021-11-24 13:03:52 +00:00
2021-02-04 17:36:47 +00:00
2022-01-28 07:49:21 +00:00
2022-02-22 21:48:14 +00:00
2022-05-04 22:59:24 +00:00
2022-02-22 21:48:14 +00:00
2022-05-04 22:59:24 +00:00
2022-02-22 21:48:14 +00:00
2022-05-04 22:59:24 +00:00
2022-02-22 21:48:14 +00:00
2022-05-04 22:59:24 +00:00
2022-02-22 21:48:14 +00:00
2022-05-04 22:59:24 +00:00
2020-06-11 12:29:19 +00:00
2022-04-27 10:26:25 +00:00
2022-04-07 23:15:48 +00:00
2021-12-16 21:33:49 +00:00
2022-04-13 07:54:02 +00:00
2021-12-16 21:33:49 +00:00
2021-09-27 23:45:45 +00:00
2021-12-16 21:33:49 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2021-09-27 23:45:45 +00:00
2021-12-16 21:33:49 +00:00
2022-01-20 00:57:57 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2022-01-20 00:57:57 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2022-01-20 00:57:57 +00:00
2022-01-21 21:24:20 +00:00
2022-03-04 03:28:51 +00:00
2022-05-05 22:15:45 +00:00
2022-03-22 22:41:50 +00:00
2021-07-29 16:55:55 +00:00
2021-10-14 00:10:12 +00:00
2022-01-06 18:38:28 +00:00
2022-04-20 21:10:08 +00:00
2022-03-25 10:29:30 +00:00
2022-05-10 16:11:53 +00:00
2022-04-18 20:34:57 +00:00
2021-04-26 07:52:47 +00:00
2021-07-08 14:22:54 +00:00
2022-04-28 22:21:40 +00:00
2022-01-28 07:49:21 +00:00
2021-03-19 20:24:48 +00:00
2021-03-19 20:24:48 +00:00
2021-03-19 20:24:48 +00:00
2022-01-20 00:57:57 +00:00
2021-03-19 20:24:48 +00:00
2022-02-18 12:09:42 +00:00
2022-01-28 07:49:21 +00:00
2021-09-15 22:32:04 +00:00
2020-10-16 20:05:02 +00:00
2022-04-29 01:03:50 +00:00
2021-01-15 23:32:02 +00:00
2022-01-20 00:57:57 +00:00
2021-09-01 16:57:59 +00:00
2021-09-01 16:57:59 +00:00
2022-04-27 13:07:21 +00:00
2021-07-09 13:48:25 +00:00
2022-04-19 18:51:47 +00:00
2021-11-16 16:23:36 +00:00
2020-06-02 21:29:03 +00:00
2022-04-29 01:03:50 +00:00
2021-11-08 15:51:32 +00:00
2022-04-08 08:25:33 +00:00
2022-04-08 08:25:33 +00:00
2021-09-08 01:16:57 +00:00
2022-02-17 18:10:31 +00:00
2022-02-17 18:10:31 +00:00
2020-11-03 10:27:44 +00:00
2022-04-18 22:30:36 +00:00
2021-11-01 17:41:41 +00:00
2022-04-27 17:11:35 +00:00
2021-02-16 18:27:39 +00:00
2022-05-10 16:11:53 +00:00
2021-01-15 23:32:02 +00:00
2021-01-15 23:32:02 +00:00
2021-01-15 23:32:02 +00:00
2021-10-14 00:10:12 +00:00
2020-11-03 10:27:44 +00:00
2022-01-21 21:24:20 +00:00
2022-01-21 21:24:20 +00:00
2021-10-07 06:43:53 +00:00
2022-01-21 02:02:00 +00:00
2021-09-27 22:01:43 +00:00
2021-04-20 11:17:36 +00:00
2022-04-21 11:06:39 +00:00
2021-12-16 10:39:49 +00:00
2021-01-15 23:32:02 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2021-01-15 23:32:02 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2022-01-20 00:57:57 +00:00
2022-04-07 19:44:48 +00:00
2022-01-20 00:57:57 +00:00
2021-02-25 21:09:57 +00:00
2021-04-19 14:11:38 +00:00
2022-01-20 00:57:57 +00:00
2020-05-02 17:22:05 +00:00
2020-05-02 17:22:05 +00:00
2021-09-22 14:20:16 +00:00
2022-04-11 15:42:01 +00:00
2021-09-28 18:30:52 +00:00
2022-02-28 15:05:59 +00:00
2022-04-29 01:03:50 +00:00
2022-04-28 23:27:20 +00:00
2022-01-12 02:09:24 +00:00
2022-04-19 00:56:46 +00:00
2022-01-12 02:09:24 +00:00
2020-08-07 18:09:35 +00:00
2020-08-07 18:09:35 +00:00
2021-05-04 11:08:31 +00:00
2022-05-02 20:53:01 +00:00
2022-01-28 07:49:21 +00:00
2022-01-28 07:49:21 +00:00
2022-05-02 23:44:46 +00:00
2022-02-18 10:21:02 +00:00
2021-05-18 06:12:03 +00:00
2022-05-02 20:53:01 +00:00
2021-05-10 09:13:09 +00:00
2021-03-02 13:11:42 +00:00
2022-04-25 23:12:53 +00:00
2021-09-30 13:19:42 +00:00
2021-09-30 13:19:42 +00:00
2021-09-16 19:40:05 +00:00
2021-09-16 17:18:37 +00:00
2020-11-13 22:10:54 +00:00
2020-11-13 22:10:54 +00:00
2020-11-13 22:10:54 +00:00
2021-12-08 00:25:10 +00:00
2021-07-16 20:50:58 +00:00
2022-01-20 00:57:57 +00:00
2020-11-13 22:10:54 +00:00
2021-04-14 21:50:31 +00:00
2021-01-15 23:32:02 +00:00
2020-05-15 20:28:21 +00:00
2020-05-07 19:40:18 +00:00
2020-05-28 17:25:58 +00:00
2021-08-18 18:22:53 +00:00
2022-03-25 10:29:30 +00:00
2022-04-29 01:03:50 +00:00
2021-09-03 19:08:37 +00:00
2020-06-25 03:36:41 +00:00
2022-03-25 10:29:30 +00:00
2022-03-25 10:29:30 +00:00
2022-04-18 23:14:37 +00:00
2020-11-10 18:41:24 +00:00
2020-05-09 08:27:48 +00:00
2022-03-08 22:42:46 +00:00
2021-07-02 19:06:45 +00:00
2021-01-15 23:32:02 +00:00
2021-01-15 23:32:02 +00:00
2022-03-26 09:41:21 +00:00
2021-09-02 14:14:35 +00:00
2021-07-29 16:55:55 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2020-05-26 08:47:30 +00:00
2021-01-15 23:32:02 +00:00
2022-04-29 01:03:50 +00:00
2021-09-03 19:08:37 +00:00
2021-07-07 23:12:53 +00:00
2021-09-30 16:50:58 +00:00
2021-07-07 23:12:53 +00:00
2021-01-15 23:32:02 +00:00
2020-05-06 19:19:52 +00:00
2020-05-06 19:19:52 +00:00
2022-04-26 11:45:48 +00:00
2022-01-20 00:57:57 +00:00
2022-04-29 01:03:50 +00:00
2021-01-15 23:32:02 +00:00
2022-05-02 20:53:01 +00:00
2022-05-02 20:53:01 +00:00
2022-05-04 20:53:15 +00:00
2021-01-15 23:32:02 +00:00
2022-05-10 21:31:40 +00:00
2022-05-06 12:57:44 +00:00
2022-04-28 21:16:01 +00:00
2022-04-28 21:16:01 +00:00
2022-04-28 21:16:01 +00:00
2022-04-28 21:16:01 +00:00
2020-05-04 21:15:27 +00:00
2022-03-22 22:41:50 +00:00
2022-03-10 23:48:05 +00:00
2022-03-22 22:41:50 +00:00
2022-03-22 22:41:50 +00:00
2021-03-31 20:51:32 +00:00
2022-03-22 22:41:50 +00:00
2022-03-22 22:41:50 +00:00
2022-03-30 19:01:33 +00:00
2021-09-13 19:30:30 +00:00
2022-03-22 22:41:50 +00:00
2022-04-28 21:16:01 +00:00
2022-04-28 21:16:01 +00:00
2022-04-29 01:03:50 +00:00
2022-04-29 01:03:50 +00:00
2021-03-03 09:31:53 +00:00
2021-03-03 09:31:53 +00:00
2021-03-09 20:27:00 +00:00
2020-11-13 19:07:20 +00:00
2020-11-11 23:42:12 +00:00
2021-08-05 20:46:12 +00:00
2021-07-13 19:04:20 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2021-12-17 00:15:09 +00:00
2021-11-18 19:45:26 +00:00
2021-10-14 00:10:12 +00:00
2022-04-07 23:15:48 +00:00
2022-03-23 18:30:21 +00:00
2022-04-28 20:45:40 +00:00
2021-08-24 16:49:23 +00:00
2021-02-04 11:12:47 +00:00
2021-02-04 11:12:47 +00:00
2022-05-02 20:53:01 +00:00
2022-02-02 00:32:25 +00:00
2022-04-29 01:03:50 +00:00
2022-05-05 22:36:56 +00:00
2021-09-02 19:22:16 +00:00
2021-08-20 16:19:16 +00:00
2022-02-17 21:29:11 +00:00
2021-01-15 23:32:02 +00:00
2021-09-08 01:16:57 +00:00
2021-09-02 19:22:16 +00:00
2021-01-15 23:32:02 +00:00
2020-11-03 10:27:44 +00:00
2022-01-20 00:57:57 +00:00
2021-06-09 02:50:50 +00:00
2021-01-15 23:32:02 +00:00
2021-07-02 14:26:04 +00:00
2020-10-16 19:22:52 +00:00
2021-09-16 19:40:05 +00:00
2021-12-16 10:39:49 +00:00
2021-12-16 10:39:49 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-04-29 01:03:50 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-05-02 20:53:01 +00:00
2022-03-22 19:45:03 +00:00
2021-05-11 11:15:53 +00:00
2022-03-08 18:06:14 +00:00
2022-04-29 01:03:50 +00:00
2022-03-08 18:06:14 +00:00
2021-12-08 22:09:08 +00:00
2021-07-16 20:50:58 +00:00
2022-03-02 18:57:29 +00:00
2022-03-02 18:57:29 +00:00
2021-12-15 22:22:36 +00:00
2022-05-10 18:08:43 +00:00
2022-05-10 18:08:43 +00:00
2021-08-16 11:11:04 +00:00
2021-08-16 11:11:04 +00:00
2022-01-20 00:57:57 +00:00
2021-10-20 16:54:32 +00:00
2021-08-16 11:11:04 +00:00
2021-08-16 11:11:04 +00:00
2022-03-24 17:12:29 +00:00
2022-03-07 22:49:23 +00:00
2021-12-14 20:05:55 +00:00
2022-03-07 22:49:23 +00:00
2022-01-20 00:57:57 +00:00
2022-03-07 22:49:23 +00:00
2022-01-20 00:57:57 +00:00
2021-09-16 00:13:34 +00:00
2021-09-15 22:32:04 +00:00
2021-07-29 16:55:55 +00:00
2022-01-12 19:12:04 +00:00
2022-05-10 18:08:43 +00:00
2022-05-10 18:08:43 +00:00
2021-07-02 19:06:45 +00:00
2021-07-02 19:06:45 +00:00
2020-12-14 16:22:48 +00:00
2022-03-10 22:38:26 +00:00
2021-09-08 13:39:34 +00:00
2021-07-02 19:06:45 +00:00
2022-04-29 01:03:50 +00:00
2022-04-29 01:03:50 +00:00
2022-05-02 20:53:01 +00:00
2022-05-02 20:53:01 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-03-22 19:45:03 +00:00
2022-05-06 12:57:44 +00:00
2022-03-22 19:45:03 +00:00
2021-01-15 23:32:02 +00:00
2022-03-22 19:45:03 +00:00
2022-02-18 16:06:12 +00:00
2021-08-16 13:02:34 +00:00
2021-11-10 15:29:13 +00:00
2022-05-02 20:53:01 +00:00
2022-05-02 19:25:12 +00:00
2022-04-25 23:12:53 +00:00
2021-12-17 00:15:09 +00:00
2021-11-02 17:42:52 +00:00
2021-11-02 17:42:52 +00:00
2021-08-16 11:11:04 +00:00
2021-10-20 16:54:32 +00:00
2021-10-20 16:54:32 +00:00
2021-10-20 16:54:32 +00:00
2021-10-20 16:54:32 +00:00
2022-04-07 23:15:48 +00:00
2021-10-20 16:54:32 +00:00
2021-10-20 16:54:32 +00:00
2020-06-02 13:25:01 +00:00
2022-04-18 20:34:57 +00:00
2020-05-15 10:57:09 +00:00
2020-12-08 00:36:38 +00:00
2021-02-04 11:45:22 +00:00
2021-10-14 00:10:12 +00:00
2021-10-14 00:10:12 +00:00
2021-10-14 00:10:12 +00:00
2022-05-04 20:53:15 +00:00
2022-05-02 20:53:01 +00:00
2022-04-28 21:16:01 +00:00
2021-07-02 19:06:45 +00:00
2022-04-28 21:16:01 +00:00
2022-04-28 21:16:01 +00:00
2021-07-02 19:06:45 +00:00
2022-05-03 15:38:34 +00:00
2022-05-03 15:38:34 +00:00
2021-10-05 16:32:40 +00:00
2021-10-05 16:32:40 +00:00
2021-12-15 23:12:19 +00:00
2021-12-15 23:12:19 +00:00
2021-06-14 20:45:18 +00:00
2021-06-14 20:45:18 +00:00
2022-03-28 11:20:52 +00:00
2022-03-29 08:03:35 +00:00
2022-03-29 08:03:35 +00:00
2020-06-29 16:10:13 +00:00
2022-01-28 07:49:21 +00:00
2022-01-20 00:57:57 +00:00
2020-05-04 21:15:27 +00:00
2021-07-08 14:22:54 +00:00
2021-12-15 22:22:36 +00:00
2021-09-02 21:46:35 +00:00
2022-01-20 00:57:57 +00:00
2020-08-06 19:55:12 +00:00
2021-10-07 17:13:12 +00:00
2021-08-31 00:10:08 +00:00
2021-10-25 17:30:50 +00:00
2021-12-08 01:22:49 +00:00
2021-09-08 01:16:57 +00:00
2021-10-25 17:30:50 +00:00
2021-02-22 19:58:49 +00:00
2021-10-25 17:30:50 +00:00
2022-04-29 01:03:50 +00:00
2022-03-10 23:48:05 +00:00
2021-10-14 00:10:12 +00:00
2020-08-07 21:40:45 +00:00
2020-08-07 21:40:45 +00:00
2022-05-05 23:20:25 +00:00
2022-05-05 23:20:25 +00:00