[vm] Don't read function entry points when initializing Threads that don't execute Dart code.

Such helper threads may start concurrently with PostLoad phase of deserialization, during which the function entry points are being initialized.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/49394
Change-Id: I4cad3ebc0d54364d508ba8af8091efebbb6ece3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250761
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2022-07-06 21:49:10 +00:00 committed by Commit Bot
parent c677a0c36f
commit 1044c64347

View file

@ -615,7 +615,7 @@ Thread* IsolateGroup::ScheduleThreadLocked(MonitorLocker* ml,
thread->isolate_group_ = this;
thread->field_table_values_ = nullptr;
#if defined(DART_PRECOMPILED_RUNTIME)
if (object_store() != nullptr) {
if (object_store() != nullptr && is_mutator) {
#define INIT_ENTRY_POINT(name) \
thread->name##_entry_point_ = Function::EntryPointOf(object_store()->name());
CACHED_FUNCTION_ENTRY_POINTS_LIST(INIT_ENTRY_POINT)