dart-sdk/runtime/platform
Martin Kustermann 2d230aa0b5 [vm/ffi] Move ffi-callback related state from Thread to ObjectStore, move jit trampolines from Isolate to IsolateGroup
The ffi-callback related information on the [Thread] object is metadata
corresponding to ffi-callback-trampoline [Function] objects. There is
nothing thread or isolate specific about it.

Moving it away from [Thread] is needed because an [Isolate] can
have different [Thread] objects across its lifetime (see [0]): When
the stack of an isolate is empty, we reserve now the right to
re-cycle the [Thread]. If the isolate later runs again, it may
get a new [Thread] object.

This CL moves this information from [Thread] to the [ObjectStore]. In
addition we make the compiler be responsible for populating this
metadata - instead of doing this per-call site of
`Pointer.fromFunction()`. It will be preserved across snapshot writing
& snapshot reading (for AppJIT as well as AppAOT).

Similarly the JIT trampolines that are on Isolate aren't isolate
specific and can go to [IsolateGroup]. This simplifies doing the above
as the compiler can allocate those as well.

The effect is that [Thread] object gets smaller, GC doesn't have to
visit the 2 slots per-thread. It comes at expense of 2 more loads
when invoking the callback.

[0] https://dart-review.googlesource.com/c/sdk/+/297920

TEST=Regression test is vm/ffi{,_2}/invoke_callback_after_suspension_test

Change-Id: Ifde46a9f6e79819b5c0e359c3d3998d1d93b9b1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303700
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-05-17 11:23:28 +00:00
..
address_sanitizer.h Reland "Reland "[VM] Begin supporting Perfetto file recorder"" 2023-04-18 19:39:05 +00:00
allocation.cc [vm] Clean up ClassTable 2022-09-10 15:12:35 +00:00
allocation.h [vm] Clean up ClassTable 2022-09-10 15:12:35 +00:00
assert.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
assert.h [VM/GC] Ensure that all the GC verification flags do not produce trace 2023-04-28 23:25:43 +00:00
atomic.h [ VM / Service ] Allow for CpuSamples to be streamed when samples are about to be overwritten. 2021-07-16 20:50:58 +00:00
BUILD.gn [fuchsia] allow injecting the inspect node 2021-03-22 17:38:24 +00:00
elf.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
floating_point.h [gardening] Fix import to fix Flutter build 2019-09-06 09:08:49 +00:00
floating_point_win.cc Spelling 2023-01-24 18:00:25 +00:00
floating_point_win.h Make header include guards great again 2016-10-26 00:26:03 -07:00
globals.h Spelling 2023-01-24 18:00:25 +00:00
growable_array.h [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
hashmap.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
hashmap.h [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
leak_sanitizer.h [vm] Fix zero-as-null-pointer-constant warnings in the VM. 2023-04-10 21:38:57 +00:00
mach_o.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
memory_sanitizer.h [vm] Fix zero-as-null-pointer-constant warnings in the VM. 2023-04-10 21:38:57 +00:00
pe.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
platform_sources.gni [vm/win/aot] Provide unwinding information for Windows AOT snapshots. 2023-05-11 03:14:27 +00:00
priority_queue.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
safe_stack.h [vm] Fix various UBSan failures. 2020-05-07 19:40:18 +00:00
signal_blocker.h [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
splay-tree-inl.h [ VM ] Updated splay-tree licenses, added V8 project authors to AUTHORS 2019-04-30 19:50:46 +00:00
splay-tree.h [ VM ] Updated splay-tree licenses, added V8 project authors to AUTHORS 2019-04-30 19:50:46 +00:00
syslog.h [build] Remove last platform -> vm and bin -> vm dependencies. Fix some ODR violations. 2019-04-22 20:15:43 +00:00
syslog_android.cc [standalone] Fix reuse of va_list in syslog_android.cc. 2021-12-15 22:22:36 +00:00
syslog_fuchsia.cc [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_ 2021-07-02 19:06:45 +00:00
syslog_linux.cc [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_ 2021-07-02 19:06:45 +00:00
syslog_macos.cc [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_ 2021-07-02 19:06:45 +00:00
syslog_win.cc [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_ 2021-07-02 19:06:45 +00:00
text_buffer.cc [VM/Service] Rename JSONStream::AppendSerializedObject to JSONStream::AppendBytes 2023-04-17 15:58:28 +00:00
text_buffer.h [vm] Speed up JSON encoding. 2023-02-21 18:58:42 +00:00
thread_sanitizer.h [vm, compiler] Don't do safepoint transitions in generated code under TSAN. 2023-04-17 22:37:57 +00:00
unaligned.h [vm] Fix various UBSan failures. 2020-05-07 19:40:18 +00:00
undefined_behavior_sanitizer.h [vm] Fix various UBSan failures. 2020-05-07 19:40:18 +00:00
unicode.cc [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
unicode.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
unwinding_records.cc [platform] Fix include of vm/globals.h instead of platform/globals.h. 2023-05-11 11:53:56 +00:00
unwinding_records.h [vm/win/aot] Provide unwinding information for Windows AOT snapshots. 2023-05-11 03:14:27 +00:00
unwinding_records_win.cc [vm/ffi] Move ffi-callback related state from Thread to ObjectStore, move jit trampolines from Isolate to IsolateGroup 2023-05-17 11:23:28 +00:00
utils.cc [vm] Make clz/ctz inlinable. 2023-05-15 17:52:49 +00:00
utils.h [vm] Make clz/ctz inlinable. 2023-05-15 17:52:49 +00:00
utils_android.cc [vm] Update to variadic FATAL. 2023-03-06 22:06:59 +00:00
utils_android.h [vm/compiler] bit utilities 2019-10-07 18:13:06 +00:00
utils_fuchsia.cc [vm] Update to variadic FATAL. 2023-03-06 22:06:59 +00:00
utils_fuchsia.h [fuchsia] allow injecting the inspect node 2021-03-22 17:38:24 +00:00
utils_linux.cc [vm] Update to variadic FATAL. 2023-03-06 22:06:59 +00:00
utils_linux.h [vm/compiler] bit utilities 2019-10-07 18:13:06 +00:00
utils_macos.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
utils_macos.h [vm] Make VM strict about min required Mac OS X version. 2023-03-08 09:08:39 +00:00
utils_win.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
utils_win.h [vm/compiler] bit utilities 2019-10-07 18:13:06 +00:00