[vm] Take only a read lock during Field::SetStaticValue. It is safe for multiple isolates to set their values concurrently. Only growth of the field tables needs to be excluded by the write lock. A storm of such setters are invoked as part of core library initialization during isolate spawning. TEST=ci, tsan Change-Id: I4677e33ee80bb06d261ada2ae9d6b71c94fde611 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405400 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index b909685..a02f753 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc
@@ -13330,7 +13330,7 @@ const intptr_t id = field_id(); ASSERT(id >= 0); - SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock()); + SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock()); thread->isolate()->field_table()->SetAt(id, value.ptr()); }