Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: runtime/vm/pages.cc

Issue 10696029: Implement a 2-pass heap verification algorithm. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index fee63db7b147ee389a983fee52a2aa18ed5845ac..6515f983a1f9024287376bceb0b15a1770b46c4b 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -266,6 +266,23 @@ bool PageSpace::Contains(uword addr) const {
}
+void PageSpace::StartEndAddress(uword* start, uword* end) const {
+ ASSERT(pages_ != NULL || large_pages_ != NULL);
+ *start = static_cast<uword>(~0);
+ *end = 0;
+ for (HeapPage* page = pages_; page != NULL; page = page->next()) {
+ *start = Utils::Minimum(*start, page->start());
+ *end = Utils::Maximum(*end, page->end());
+ }
+ for (HeapPage* page = large_pages_; page != NULL; page = page->next()) {
+ *start = Utils::Minimum(*start, page->start());
+ *end = Utils::Maximum(*end, page->end());
+ }
+ ASSERT(*start != static_cast<uword>(~0));
+ ASSERT(*end != 0);
+}
+
+
void PageSpace::VisitObjects(ObjectVisitor* visitor) const {
HeapPage* page = pages_;
while (page != NULL) {
@@ -327,7 +344,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
NoHandleScope no_handles(isolate);
if (FLAG_verify_before_gc) {
- OS::PrintErr("Verifying before MarkSweep... ");
+ OS::PrintErr("Verifying before MarkSweep...");
heap_->Verify();
OS::PrintErr(" done.\n");
}
@@ -399,7 +416,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
}
if (FLAG_verify_after_gc) {
- OS::PrintErr("Verifying after MarkSweep... ");
+ OS::PrintErr("Verifying after MarkSweep...");
heap_->Verify();
OS::PrintErr(" done.\n");
}
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698