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

Unified Diff: runtime/vm/dart.cc

Issue 10675010: - Premark vm_isolate objects to avoid having to test for them (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/gc_marker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
===================================================================
--- runtime/vm/dart.cc (revision 9135)
+++ runtime/vm/dart.cc (working copy)
@@ -29,6 +29,19 @@
DebugInfo* Dart::pprof_symbol_generator_ = NULL;
FileWriterFunction Dart::flow_graph_writer_ = NULL;
+// An object visitor which will mark all visited objects. This is used to
+// premark all objects in the vm_isolate_ heap.
+class PremarkingVisitor : public ObjectVisitor {
+ public:
+ void VisitObject(RawObject* obj) {
+ // RawInstruction objects are premarked on allocation.
+ if (!obj->IsMarked()) {
+ obj->SetMarkBit();
+ }
+ }
+};
+
+
// TODO(turnidge): We should add a corresponding Dart::Cleanup.
bool Dart::InitOnce(Dart_IsolateCreateCallback create,
Dart_IsolateInterruptCallback interrupt) {
@@ -56,6 +69,8 @@
Object::InitOnce();
StubCode::InitOnce();
Scanner::InitOnce();
+ PremarkingVisitor premarker;
+ vm_isolate_->heap()->IterateOldObjects(&premarker);
}
Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread.
Isolate::SetCreateCallback(create);
« no previous file with comments | « no previous file | runtime/vm/gc_marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698