Skip to content

Commit 80ed949

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
[vm, reload] Don't drop unwind errors for isolates other than the first isolate in a group during a reload.
Bug: dart-lang/sdk#40894 Change-Id: Id63a8c8d214c3233ef85fdf96982eda0d5471cb9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138572 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 81c3208 commit 80ed949

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

runtime/vm/isolate_reload.cc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -944,23 +944,18 @@ bool IsolateGroupReloadContext::Reload(bool force_reload,
944944
success = false;
945945
}
946946

947-
// Once we --enable-isolate-groups in JIT again, we have to ensure unwind
948-
// errors will be propagated to all isolates.
949-
if (result.IsUnwindError()) {
950-
const auto& error = Error::Cast(result);
951-
if (thread->top_exit_frame_info() == 0) {
952-
// We can only propagate errors when there are Dart frames on the stack.
953-
// In this case there are no Dart frames on the stack and we set the
954-
// thread's sticky error. This error will be returned to the message
955-
// handler.
956-
thread->set_sticky_error(error);
957-
} else {
958-
// If the tag handler returns with an UnwindError error, propagate it and
959-
// give up.
960-
Exceptions::PropagateError(error);
961-
UNREACHABLE();
947+
// Re-queue any shutdown requests so they can inform each isolate's own thread
948+
// to shut down.
949+
isolateIndex = 0;
950+
ForEachIsolate([&](Isolate* isolate) {
951+
tmp = results.At(isolateIndex);
952+
if (tmp.IsUnwindError()) {
953+
Isolate::KillIfExists(isolate, UnwindError::Cast(tmp).is_user_initiated()
954+
? Isolate::kKillMsg
955+
: Isolate::kInternalKillMsg);
962956
}
963-
}
957+
isolateIndex++;
958+
});
964959

965960
return success;
966961
}

0 commit comments

Comments
 (0)