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

Unified Diff: runtime/vm/gc_sweeper.cc

Issue 344913003: Verify that GC can handle trailing fillers in large pages. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_sweeper.cc
===================================================================
--- runtime/vm/gc_sweeper.cc (revision 37564)
+++ runtime/vm/gc_sweeper.cc (working copy)
@@ -57,14 +57,24 @@
bool GCSweeper::SweepLargePage(HeapPage* page) {
+ bool in_use = false;
RawObject* raw_obj = RawObject::FromAddr(page->object_start());
- if (!raw_obj->IsMarked()) {
- // The large object was not marked. Used size is zero, which also tells the
- // calling code that the large object page can be recycled.
- return false;
+ if (raw_obj->IsMarked()) {
+ raw_obj->ClearMarkBit();
+ in_use = true;
}
- raw_obj->ClearMarkBit();
- return true;
+#ifdef DEBUG
+ // String::MakeExternal and Array::MakeArray create trailing filler objects,
+ // but they are always unreachable. Verify that they are not marked.
+ uword current = RawObject::ToAddr(raw_obj) + raw_obj->Size();
+ uword end = page->object_end();
+ while (current < end) {
+ RawObject* cur_obj = RawObject::FromAddr(current);
+ ASSERT(!cur_obj->IsMarked());
+ current += cur_obj->Size();
+ }
+#endif // DEBUG
+ return in_use;
}
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698