Index: runtime/vm/pages.cc |
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc |
index 895d2b2439878d29e023f9e705cc918890b98eed..4f62c59d6f0ea02bef7f2ec2e98a7d60f510489e 100644 |
--- a/runtime/vm/pages.cc |
+++ b/runtime/vm/pages.cc |
@@ -113,6 +113,7 @@ void HeapPage::Deallocate() { |
} |
void HeapPage::VisitObjects(ObjectVisitor* visitor) const { |
+ ASSERT(Thread::Current()->IsAtSafepoint()); |
NoSafepointScope no_safepoint; |
uword obj_addr = object_start(); |
uword end_addr = object_end(); |
@@ -125,6 +126,7 @@ void HeapPage::VisitObjects(ObjectVisitor* visitor) const { |
} |
void HeapPage::VisitObjectPointers(ObjectPointerVisitor* visitor) const { |
+ ASSERT(Thread::Current()->IsAtSafepoint()); |
NoSafepointScope no_safepoint; |
uword obj_addr = object_start(); |
uword end_addr = object_end(); |
@@ -752,9 +754,9 @@ void PageSpace::PrintHeapMapToJSONStream(Isolate* isolate, |
// "pages" is an array [page0, page1, ..., pageN], each page of the form |
// {"object_start": "0x...", "objects": [size, class id, size, ...]} |
// TODO(19445): Use ExclusivePageIterator once HeapMap supports large pages. |
+ HeapIterationScope iteration(Thread::Current()); |
MutexLocker ml(pages_lock_); |
MakeIterable(); |
- NoSafepointScope no_safepoint; |
JSONArray all_pages(&heap_map, "pages"); |
for (HeapPage* page = pages_; page != NULL; page = page->next()) { |
JSONObject page_container(&all_pages); |