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

Unified Diff: vm/gc_sweeper.cc

Issue 11186013: - Do not bump allocate in old-space pages. Always use (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 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 | vm/pages.h » ('j') | vm/pages.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/gc_sweeper.cc
===================================================================
--- vm/gc_sweeper.cc (revision 13711)
+++ vm/gc_sweeper.cc (working copy)
@@ -17,17 +17,23 @@
intptr_t in_use = page->used();
page->set_used(0);
+ // Whole page is empty. Do not enter anything into the freelist.
+ if (in_use == 0) {
+ return 0;
+ }
+
uword current = page->first_object_start();
- uword top = page->top();
+ uword end = page->end();
- while (current < top) {
+ while (current < end) {
+ intptr_t obj_size;
if (in_use_swept == in_use) {
// No more marked objects will be found on this page.
- page->set_top(current);
+ obj_size = end - current;
+ freelist->Free(current, obj_size);
break;
}
RawObject* raw_obj = RawObject::FromAddr(current);
- intptr_t obj_size;
if (raw_obj->IsMarked()) {
// Found marked object. Clear the mark bit and update swept bytes.
raw_obj->ClearMarkBit();
@@ -35,7 +41,7 @@
in_use_swept += obj_size;
} else {
uword free_end = current + raw_obj->Size();
- while (free_end < top) {
+ while (free_end < end) {
RawObject* next_obj = RawObject::FromAddr(free_end);
if (next_obj->IsMarked()) {
// Reached the end of the free block.
@@ -45,12 +51,7 @@
free_end += next_obj->Size();
}
obj_size = free_end - current;
- if ((current + obj_size) == top) {
- page->set_top(current);
- break;
- } else {
- freelist->Free(current, obj_size);
- }
+ freelist->Free(current, obj_size);
}
current += obj_size;
}
« no previous file with comments | « no previous file | vm/pages.h » ('j') | vm/pages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698