mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:40:07 +00:00
2d230aa0b5
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> |
||
---|---|---|
.. | ||
address_sanitizer.h | ||
allocation.cc | ||
allocation.h | ||
assert.cc | ||
assert.h | ||
atomic.h | ||
BUILD.gn | ||
elf.h | ||
floating_point.h | ||
floating_point_win.cc | ||
floating_point_win.h | ||
globals.h | ||
growable_array.h | ||
hashmap.cc | ||
hashmap.h | ||
leak_sanitizer.h | ||
mach_o.h | ||
memory_sanitizer.h | ||
pe.h | ||
platform_sources.gni | ||
priority_queue.h | ||
safe_stack.h | ||
signal_blocker.h | ||
splay-tree-inl.h | ||
splay-tree.h | ||
syslog.h | ||
syslog_android.cc | ||
syslog_fuchsia.cc | ||
syslog_linux.cc | ||
syslog_macos.cc | ||
syslog_win.cc | ||
text_buffer.cc | ||
text_buffer.h | ||
thread_sanitizer.h | ||
unaligned.h | ||
undefined_behavior_sanitizer.h | ||
unicode.cc | ||
unicode.h | ||
unwinding_records.cc | ||
unwinding_records.h | ||
unwinding_records_win.cc | ||
utils.cc | ||
utils.h | ||
utils_android.cc | ||
utils_android.h | ||
utils_fuchsia.cc | ||
utils_fuchsia.h | ||
utils_linux.cc | ||
utils_linux.h | ||
utils_macos.cc | ||
utils_macos.h | ||
utils_win.cc | ||
utils_win.h |