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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/gc_sweeper.h" 5 #include "vm/gc_sweeper.h"
6 6
7 #include "vm/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/pages.h" 10 #include "vm/pages.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 current += obj_size; 51 current += obj_size;
52 } 52 }
53 ASSERT(current == end); 53 ASSERT(current == end);
54 54
55 return in_use; 55 return in_use;
56 } 56 }
57 57
58 58
59 bool GCSweeper::SweepLargePage(HeapPage* page) { 59 bool GCSweeper::SweepLargePage(HeapPage* page) {
60 bool in_use = false;
60 RawObject* raw_obj = RawObject::FromAddr(page->object_start()); 61 RawObject* raw_obj = RawObject::FromAddr(page->object_start());
61 if (!raw_obj->IsMarked()) { 62 if (raw_obj->IsMarked()) {
62 // The large object was not marked. Used size is zero, which also tells the 63 raw_obj->ClearMarkBit();
63 // calling code that the large object page can be recycled. 64 in_use = true;
64 return false;
65 } 65 }
66 raw_obj->ClearMarkBit(); 66 #ifdef DEBUG
67 return true; 67 // String::MakeExternal and Array::MakeArray create trailing filler objects,
68 // but they are always unreachable. Verify that they are not marked.
69 uword current = RawObject::ToAddr(raw_obj) + raw_obj->Size();
70 uword end = page->object_end();
71 while (current < end) {
72 RawObject* cur_obj = RawObject::FromAddr(current);
73 ASSERT(!cur_obj->IsMarked());
74 current += cur_obj->Size();
75 }
76 #endif // DEBUG
77 return in_use;
68 } 78 }
69 79
70 } // namespace dart 80 } // namespace dart
OLDNEW
« 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