Skip to content

Commit 3e9290d

Browse files
alexmarkovCommit Bot
authored and
Commit Bot
committed
[vm] Skip caching of function entry points in Thread in JIT mode
Cached entry points of core library functions are only used in AOT mode (JIT mode uses Function/Code objects instead of entry points in order to call those functions). This change removes storing entry points into the Thread. It fixes TSAN error which reports a data race between JIT compilation which installs Code and caching of entry points when scheduling a thread. TEST=ci Fixes #49194 Issue: #48378 Change-Id: Ib109118df414cd722001dad363e9e05a94ab0556 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247501 Commit-Queue: Alexander Markov <[email protected]> Reviewed-by: Slava Egorov <[email protected]> Reviewed-by: Daco Harkes <[email protected]>
1 parent 8d9009d commit 3e9290d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

runtime/vm/isolate.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,14 @@ Thread* IsolateGroup::ScheduleThreadLocked(MonitorLocker* ml,
614614
thread->isolate_ = nullptr;
615615
thread->isolate_group_ = this;
616616
thread->field_table_values_ = nullptr;
617+
#if defined(DART_PRECOMPILED_RUNTIME)
617618
if (object_store() != nullptr) {
618619
#define INIT_ENTRY_POINT(name) \
619620
thread->name##_entry_point_ = Function::EntryPointOf(object_store()->name());
620621
CACHED_FUNCTION_ENTRY_POINTS_LIST(INIT_ENTRY_POINT)
621622
#undef INIT_ENTRY_POINT
622623
}
624+
#endif // defined(DART_PRECOMPILED_RUNTIME)
623625
ASSERT(heap() != nullptr);
624626
thread->heap_ = heap();
625627
thread->set_os_thread(os_thread);

0 commit comments

Comments
 (0)