Index: runtime/vm/pages.cc |
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc |
index 177b09159a0bcbe8839fffa65ec068345d7a0fd9..d7d3a2c5f43a8589b9b7cf06aac9c890d4f744bc 100644 |
--- a/runtime/vm/pages.cc |
+++ b/runtime/vm/pages.cc |
@@ -611,6 +611,15 @@ void PageSpace::VisitObjects(ObjectVisitor* visitor) const { |
} |
+void PageSpace::VisitObjectsNoEmbedderPages(ObjectVisitor* visitor) const { |
+ for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
+ if (!it.page()->embedder_allocated()) { |
+ it.page()->VisitObjects(visitor); |
+ } |
+ } |
+} |
+ |
+ |
void PageSpace::VisitObjectPointers(ObjectPointerVisitor* visitor) const { |
for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
it.page()->VisitObjectPointers(visitor); |
@@ -652,15 +661,13 @@ RawObject* PageSpace::FindObject(FindObjectVisitor* visitor, |
} |
-void PageSpace::WriteProtect(bool read_only, bool include_code_pages) { |
+void PageSpace::WriteProtect(bool read_only) { |
if (read_only) { |
// Avoid MakeIterable trying to write to the heap. |
AbandonBumpAllocation(); |
} |
for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
- HeapPage::PageType page_type = it.page()->type(); |
- if ((page_type != HeapPage::kReadOnlyData) && |
- ((page_type != HeapPage::kExecutable) || include_code_pages)) { |
+ if (!it.page()->embedder_allocated()) { |
it.page()->WriteProtect(read_only); |
} |
} |