Skip to content

Commit 08164f8

Browse files
rmacnak-googleCommit Bot
authored and
Commit Bot
committed
[vm] Add missing safepoint transition when updating or deleting API handles.
TEST=tsan, iso-stress Change-Id: I82f8fb8ef3bbedf510e34488fdaa7d8af5902830 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231332 Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 3d977bc commit 08164f8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

runtime/vm/dart_api_impl.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,9 +1114,10 @@ Dart_NewFinalizableHandle(Dart_Handle object,
11141114

11151115
DART_EXPORT void Dart_UpdateExternalSize(Dart_WeakPersistentHandle object,
11161116
intptr_t external_size) {
1117-
IsolateGroup* isolate_group = IsolateGroup::Current();
1117+
Thread* T = Thread::Current();
1118+
IsolateGroup* isolate_group = T->isolate_group();
11181119
CHECK_ISOLATE_GROUP(isolate_group);
1119-
NoSafepointScope no_safepoint_scope;
1120+
TransitionToVM transition(T);
11201121
ApiState* state = isolate_group->api_state();
11211122
ASSERT(state != NULL);
11221123
ASSERT(state->IsActiveWeakPersistentHandle(object));
@@ -1140,9 +1141,10 @@ DART_EXPORT void Dart_UpdateFinalizableExternalSize(
11401141
}
11411142

11421143
DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object) {
1143-
IsolateGroup* isolate_group = IsolateGroup::Current();
1144+
Thread* T = Thread::Current();
1145+
IsolateGroup* isolate_group = T->isolate_group();
11441146
CHECK_ISOLATE_GROUP(isolate_group);
1145-
NoSafepointScope no_safepoint_scope;
1147+
TransitionToVM transition(T);
11461148
ApiState* state = isolate_group->api_state();
11471149
ASSERT(state != NULL);
11481150
ASSERT(state->IsActivePersistentHandle(object));
@@ -1155,9 +1157,10 @@ DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object) {
11551157

11561158
DART_EXPORT void Dart_DeleteWeakPersistentHandle(
11571159
Dart_WeakPersistentHandle object) {
1158-
IsolateGroup* isolate_group = IsolateGroup::Current();
1160+
Thread* T = Thread::Current();
1161+
IsolateGroup* isolate_group = T->isolate_group();
11591162
CHECK_ISOLATE_GROUP(isolate_group);
1160-
NoSafepointScope no_safepoint_scope;
1163+
TransitionToVM transition(T);
11611164
ApiState* state = isolate_group->api_state();
11621165
ASSERT(state != NULL);
11631166
ASSERT(state->IsActiveWeakPersistentHandle(object));

0 commit comments

Comments
 (0)