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

Unified Diff: vm/pages.cc

Issue 8761006: - Implement a simple old-generation marker. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month 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 | « vm/pages.h ('k') | vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/pages.cc
===================================================================
--- vm/pages.cc (revision 1929)
+++ vm/pages.cc (working copy)
@@ -5,6 +5,7 @@
#include "vm/pages.h"
#include "vm/assert.h"
+#include "vm/gc_marker.h"
#include "vm/object.h"
#include "vm/virtual_memory.h"
@@ -55,7 +56,9 @@
max_capacity_(max_capacity),
capacity_(0),
in_use_(0),
- is_executable_(is_executable) { }
+ count_(0),
+ is_executable_(is_executable),
+ sweeping_(false) { }
PageSpace::~PageSpace() {
@@ -174,4 +177,31 @@
}
}
+
+void PageSpace::MarkSweep() {
+ // MarkSweep is not reentrant. Make sure that is the case.
+ ASSERT(!sweeping_);
+ sweeping_ = true;
+ Isolate* isolate = Isolate::Current();
+ NoHandleScope no_handles(isolate);
+
+ Timer timer(FLAG_verbose_gc, "MarkSweep");
+ timer.Start();
+
+ // Mark all reachable old-gen objects.
+ GCMarker marker(heap_);
+ marker.MarkObjects(isolate, this);
+
+ UNIMPLEMENTED();
+ timer.Stop();
+ if (FLAG_verbose_gc) {
+ OS::PrintErr("Mark-Sweep[%d]: %dus\n", count_, timer.TotalElapsedTime());
+ }
+
+ count_++;
+ // Done, reset the marker.
+ ASSERT(sweeping_);
+ sweeping_ = false;
+}
+
} // namespace dart
« no previous file with comments | « vm/pages.h ('k') | vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698