Index: runtime/vm/scavenger.cc |
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc |
index 32d62e000906025ed067aaa6032adfd2f326b1a0..6e34bd0fa65fabbc9fa9afaffb19fbf255f12812 100644 |
--- a/runtime/vm/scavenger.cc |
+++ b/runtime/vm/scavenger.cc |
@@ -731,6 +731,8 @@ void Scavenger::FlushTLS() const { |
} |
void Scavenger::VisitObjectPointers(ObjectPointerVisitor* visitor) const { |
+ ASSERT(Thread::Current()->IsAtSafepoint() || |
+ (Thread::Current()->task_kind() == Thread::kMarkerTask)); |
FlushTLS(); |
uword cur = FirstObjectStart(); |
while (cur < top_) { |
@@ -740,6 +742,8 @@ void Scavenger::VisitObjectPointers(ObjectPointerVisitor* visitor) const { |
} |
void Scavenger::VisitObjects(ObjectVisitor* visitor) const { |
+ ASSERT(Thread::Current()->IsAtSafepoint() || |
+ (Thread::Current()->task_kind() == Thread::kMarkerTask)); |
FlushTLS(); |
uword cur = FirstObjectStart(); |
while (cur < top_) { |