[vm, gc] Don't cache a thread in marking visitors.
Marking visitors can run on multiple threads during their lifecycle, so this only creates confusion.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/48957
Change-Id: Ia2ac68f0e17c985b18a1faf51be7004c972cf27b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247520
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/heap/marker.cc b/runtime/vm/heap/marker.cc
index 452e0d4..40fcf17 100644
--- a/runtime/vm/heap/marker.cc
+++ b/runtime/vm/heap/marker.cc
@@ -33,14 +33,11 @@
MarkingStack* marking_stack,
MarkingStack* deferred_marking_stack)
: ObjectPointerVisitor(isolate_group),
- thread_(Thread::Current()),
page_space_(page_space),
work_list_(marking_stack),
deferred_work_list_(deferred_marking_stack),
marked_bytes_(0),
- marked_micros_(0) {
- ASSERT(thread_->isolate_group() == isolate_group);
- }
+ marked_micros_(0) {}
~MarkingVisitorBase() { ASSERT(delayed_.IsEmpty()); }
uintptr_t marked_bytes() const { return marked_bytes_; }
@@ -279,8 +276,6 @@
// buffer. Release the store buffer to satisfy the invariant that
// thread local store buffer is empty after marking and all references
// are processed.
- // TODO(http://dartbug.com/48957): `thread_` can differ from
- // `Thread::Current()`.
Thread::Current()->ReleaseStoreBuffer();
}