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

Unified Diff: runtime/vm/object_graph.cc

Issue 1212943010: Safer interface for heap iteration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix release mode. Created 5 years, 5 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 | « runtime/vm/object.cc ('k') | 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/object_graph.cc
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index b07fe0a90637f15965a6e46660fa3154451c1a8e..2e30f252907796eef24733c6c5ff08ea0e9432a5 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -148,7 +148,7 @@ class Unmarker : public ObjectVisitor {
static void UnmarkAll(Isolate* isolate) {
Unmarker unmarker(isolate);
- isolate->heap()->VisitObjects(&unmarker);
+ isolate->heap()->IterateObjects(&unmarker);
}
private:
@@ -172,13 +172,8 @@ ObjectGraph::~ObjectGraph() {
void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) {
NoSafepointScope no_safepoint_scope_;
- PageSpace* old_space = isolate()->heap()->old_space();
- MonitorLocker ml(old_space->tasks_lock());
- while (old_space->tasks() > 0) {
- ml.Wait();
- }
Stack stack(isolate());
- isolate()->VisitObjectPointers(&stack, false, false);
+ isolate()->IterateObjectPointers(&stack, false, false);
stack.TraverseGraph(visitor);
Unmarker::UnmarkAll(isolate());
}
@@ -187,11 +182,6 @@ void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) {
void ObjectGraph::IterateObjectsFrom(const Object& root,
ObjectGraph::Visitor* visitor) {
NoSafepointScope no_safepoint_scope_;
- PageSpace* old_space = isolate()->heap()->old_space();
- MonitorLocker ml(old_space->tasks_lock());
- while (old_space->tasks() > 0) {
- ml.Wait();
- }
Stack stack(isolate());
RawObject* root_raw = root.raw();
stack.VisitPointer(&root_raw);
@@ -377,7 +367,7 @@ intptr_t ObjectGraph::InboundReferences(Object* obj, const Array& references) {
Object& scratch = Object::Handle();
NoSafepointScope no_safepoint_scope_;
InboundReferencesVisitor visitor(isolate(), obj->raw(), references, &scratch);
- isolate()->heap()->VisitObjects(&visitor);
+ isolate()->heap()->IterateObjects(&visitor);
return visitor.length();
}
@@ -466,7 +456,7 @@ intptr_t ObjectGraph::Serialize(WriteStream* stream) {
stream->WriteUnsigned(0);
{
WritePointerVisitor ptr_writer(isolate(), stream);
- isolate()->VisitObjectPointers(&ptr_writer, false, false);
+ isolate()->IterateObjectPointers(&ptr_writer, false, false);
}
stream->WriteUnsigned(0);
IterateObjects(&visitor);
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698