mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +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> |
||
---|---|---|
.. | ||
bin | ||
docs | ||
include | ||
lib | ||
observatory | ||
observatory_2 | ||
platform | ||
tests | ||
third_party | ||
tools | ||
vm | ||
.clang-tidy | ||
.gitignore | ||
BUILD.gn | ||
codereview.settings | ||
configs.gni | ||
CPPLINT.cfg | ||
OWNERS | ||
PRESUBMIT.py | ||
runtime_args.gni |