e1f76cb03e
Serializing the object stored in a handle may require allocation, so serialization of the current (weak) persistent handles should not be done under a no safepoint scope. Instead, retrieve the stored objects and any needed metadata for the current (weak) persistent handles under a no safepoint scope, and then separately serialize the retrieved information outside of that scope. Fixes https://github.com/dart-lang/sdk/issues/62978. TEST=vm/cc/Service_PersistentHandles on vm-dyn-*, which revealed this issue. Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try Change-Id: Ie9e32c758140aaebc7bd87a704119a8b82d0f8a9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491300 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>