Index: runtime/vm/object_graph.cc |
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc |
index ae3678abf7b67dd4e21f3eb0af31c10f051fdb37..1c3373f4200ed3876fd1286003438cfd02c58e1e 100644 |
--- a/runtime/vm/object_graph.cc |
+++ b/runtime/vm/object_graph.cc |
@@ -94,15 +94,12 @@ class ObjectGraph::Stack : public ObjectPointerVisitor { |
DISALLOW_COPY_AND_ASSIGN(Stack); |
}; |
- |
RawObject** const ObjectGraph::Stack::kSentinel = NULL; |
- |
RawObject* ObjectGraph::StackIterator::Get() const { |
return stack_->data_[index_].obj; |
} |
- |
bool ObjectGraph::StackIterator::MoveToParent() { |
intptr_t parent = stack_->Parent(index_); |
if (parent == Stack::kNoParent) { |
@@ -113,7 +110,6 @@ bool ObjectGraph::StackIterator::MoveToParent() { |
} |
} |
- |
intptr_t ObjectGraph::StackIterator::OffsetFromParentInWords() const { |
intptr_t parent_index = stack_->Parent(index_); |
if (parent_index == Stack::kNoParent) { |
@@ -136,7 +132,6 @@ intptr_t ObjectGraph::StackIterator::OffsetFromParentInWords() const { |
} |
} |
- |
class Unmarker : public ObjectVisitor { |
public: |
Unmarker() {} |
@@ -156,17 +151,14 @@ class Unmarker : public ObjectVisitor { |
DISALLOW_COPY_AND_ASSIGN(Unmarker); |
}; |
- |
ObjectGraph::ObjectGraph(Thread* thread) : StackResource(thread) { |
// The VM isolate has all its objects pre-marked, so iterating over it |
// would be a no-op. |
ASSERT(thread->isolate() != Dart::vm_isolate()); |
} |
- |
ObjectGraph::~ObjectGraph() {} |
- |
void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) { |
NoSafepointScope no_safepoint_scope_; |
Stack stack(isolate()); |
@@ -175,7 +167,6 @@ void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) { |
Unmarker::UnmarkAll(isolate()); |
} |
- |
void ObjectGraph::IterateObjectsFrom(const Object& root, |
ObjectGraph::Visitor* visitor) { |
NoSafepointScope no_safepoint_scope_; |
@@ -186,7 +177,6 @@ void ObjectGraph::IterateObjectsFrom(const Object& root, |
Unmarker::UnmarkAll(isolate()); |
} |
- |
class InstanceAccumulator : public ObjectVisitor { |
public: |
InstanceAccumulator(ObjectGraph::Stack* stack, intptr_t class_id) |
@@ -206,7 +196,6 @@ class InstanceAccumulator : public ObjectVisitor { |
DISALLOW_COPY_AND_ASSIGN(InstanceAccumulator); |
}; |
- |
void ObjectGraph::IterateObjectsFrom(intptr_t class_id, |
ObjectGraph::Visitor* visitor) { |
NoSafepointScope no_safepoint_scope_; |
@@ -219,7 +208,6 @@ void ObjectGraph::IterateObjectsFrom(intptr_t class_id, |
Unmarker::UnmarkAll(isolate()); |
} |
- |
class SizeVisitor : public ObjectGraph::Visitor { |
public: |
SizeVisitor() : size_(0) {} |
@@ -238,7 +226,6 @@ class SizeVisitor : public ObjectGraph::Visitor { |
intptr_t size_; |
}; |
- |
class SizeExcludingObjectVisitor : public SizeVisitor { |
public: |
explicit SizeExcludingObjectVisitor(const Object& skip) : skip_(skip) {} |
@@ -248,7 +235,6 @@ class SizeExcludingObjectVisitor : public SizeVisitor { |
const Object& skip_; |
}; |
- |
class SizeExcludingClassVisitor : public SizeVisitor { |
public: |
explicit SizeExcludingClassVisitor(intptr_t skip) : skip_(skip) {} |
@@ -260,7 +246,6 @@ class SizeExcludingClassVisitor : public SizeVisitor { |
const intptr_t skip_; |
}; |
- |
intptr_t ObjectGraph::SizeRetainedByInstance(const Object& obj) { |
HeapIterationScope iteration_scope(true); |
SizeVisitor total; |
@@ -272,7 +257,6 @@ intptr_t ObjectGraph::SizeRetainedByInstance(const Object& obj) { |
return size_total - size_excluding_obj; |
} |
- |
intptr_t ObjectGraph::SizeReachableByInstance(const Object& obj) { |
HeapIterationScope iteration_scope(true); |
SizeVisitor total; |
@@ -280,7 +264,6 @@ intptr_t ObjectGraph::SizeReachableByInstance(const Object& obj) { |
return total.size(); |
} |
- |
intptr_t ObjectGraph::SizeRetainedByClass(intptr_t class_id) { |
HeapIterationScope iteration_scope(true); |
SizeVisitor total; |
@@ -292,7 +275,6 @@ intptr_t ObjectGraph::SizeRetainedByClass(intptr_t class_id) { |
return size_total - size_excluding_class; |
} |
- |
intptr_t ObjectGraph::SizeReachableByClass(intptr_t class_id) { |
HeapIterationScope iteration_scope(true); |
SizeVisitor total; |
@@ -300,7 +282,6 @@ intptr_t ObjectGraph::SizeReachableByClass(intptr_t class_id) { |
return total.size(); |
} |
- |
class RetainingPathVisitor : public ObjectGraph::Visitor { |
public: |
// We cannot use a GrowableObjectArray, since we must not trigger GC. |
@@ -388,7 +369,6 @@ class RetainingPathVisitor : public ObjectGraph::Visitor { |
bool was_last_array_; |
}; |
- |
intptr_t ObjectGraph::RetainingPath(Object* obj, const Array& path) { |
NoSafepointScope no_safepoint_scope_; |
HeapIterationScope iteration_scope(true); |
@@ -402,7 +382,6 @@ intptr_t ObjectGraph::RetainingPath(Object* obj, const Array& path) { |
return visitor.length(); |
} |
- |
class InboundReferencesVisitor : public ObjectVisitor, |
public ObjectPointerVisitor { |
public: |
@@ -466,7 +445,6 @@ class InboundReferencesVisitor : public ObjectVisitor, |
intptr_t length_; |
}; |
- |
intptr_t ObjectGraph::InboundReferences(Object* obj, const Array& references) { |
Object& scratch = Object::Handle(); |
NoSafepointScope no_safepoint_scope; |
@@ -475,7 +453,6 @@ intptr_t ObjectGraph::InboundReferences(Object* obj, const Array& references) { |
return visitor.length(); |
} |
- |
static void WritePtr(RawObject* raw, WriteStream* stream) { |
ASSERT(raw->IsHeapObject()); |
ASSERT(raw->IsOldObject()); |
@@ -487,7 +464,6 @@ static void WritePtr(RawObject* raw, WriteStream* stream) { |
stream->WriteUnsigned(addr / kObjectAlignment); |
} |
- |
class WritePointerVisitor : public ObjectPointerVisitor { |
public: |
WritePointerVisitor(Isolate* isolate, |
@@ -522,7 +498,6 @@ class WritePointerVisitor : public ObjectPointerVisitor { |
intptr_t count_; |
}; |
- |
static void WriteHeader(RawObject* raw, |
intptr_t size, |
intptr_t cid, |
@@ -533,7 +508,6 @@ static void WriteHeader(RawObject* raw, |
stream->WriteUnsigned(cid); |
} |
- |
class WriteGraphVisitor : public ObjectGraph::Visitor { |
public: |
WriteGraphVisitor(Isolate* isolate, |
@@ -570,7 +544,6 @@ class WriteGraphVisitor : public ObjectGraph::Visitor { |
intptr_t count_; |
}; |
- |
static void IterateUserFields(ObjectPointerVisitor* visitor) { |
Thread* thread = Thread::Current(); |
// Scope to prevent handles create here from appearing as stack references. |
@@ -605,7 +578,6 @@ static void IterateUserFields(ObjectPointerVisitor* visitor) { |
} |
} |
- |
intptr_t ObjectGraph::Serialize(WriteStream* stream, |
SnapshotRoots roots, |
bool collect_garbage) { |