Commit 1a82b90e authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

[heap] Fix stack scan to include client Isolates

Stack scan during marking for shared heap broke in
  https://crrev.com/c/3703837

This CL re-adds the client Isolate handling which is necessary as
those client Isolates may refer to the shared Isolate from stack.

Bug: v8:13019
Change-Id: I1ee27fb8bab173087a98a0b79f4126612427b016
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3736444Reviewed-by: 's avatarNikolaos Papaspyrou <nikolaos@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81460}
parent 6e429dcc
......@@ -5082,9 +5082,12 @@ void Heap::IterateRootsIncludingClients(RootVisitor* v,
}
}
void Heap::IterateRootsFromStack(RootVisitor* v) {
void Heap::IterateRootsFromStackIncludingClient(RootVisitor* v) {
IterateStackRoots(v);
v->Synchronize(VisitorSynchronization::kStackRoots);
if (isolate()->is_shared()) {
isolate()->global_safepoint()->IterateClientIsolates(
[v](Isolate* client) { client->heap()->IterateStackRoots(v); });
}
}
void Heap::IterateWeakGlobalHandles(RootVisitor* v) {
......
......@@ -1057,7 +1057,7 @@ class Heap {
void IterateRoots(RootVisitor* v, base::EnumSet<SkipRoot> options);
void IterateRootsIncludingClients(RootVisitor* v,
base::EnumSet<SkipRoot> options);
void IterateRootsFromStack(RootVisitor* v);
void IterateRootsFromStackIncludingClient(RootVisitor* v);
// Iterates over entries in the smi roots list. Only interesting to the
// serializer/deserializer, since GC does not care about smis.
......
......@@ -2145,7 +2145,7 @@ Address MarkCompactCollector::FindBasePtrForMarking(Address maybe_inner_ptr) {
#endif // V8_ENABLE_INNER_POINTER_RESOLUTION_MB
void MarkCompactCollector::MarkRootsFromStack(RootVisitor* root_visitor) {
heap()->IterateRootsFromStack(root_visitor);
heap()->IterateRootsFromStackIncludingClient(root_visitor);
}
void MarkCompactCollector::MarkObjectsFromClientHeaps() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment