Reviewers: Toon Verwaest,
Description:
Implement TracePathToObjectFrom helper for debugging.
[email protected]
Please review this at https://chromiumcodereview.appspot.com/10823054/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/heap.h
M src/heap.cc
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index
8e64f9e39cc5d02ee46e4b4ed77423c360594754..4d277db01dd1d032a34824f1f30a15306385e7b0
100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -6770,6 +6770,15 @@ void PathTracer::ProcessResults() {
#ifdef DEBUG
+// Triggers a depth-first traversal of reachable objects from one
+// given root object and finds a path to a specific heap object and
+// prints it.
+void Heap::TracePathToObjectFrom(Object* target, Object* root) {
+ PathTracer tracer(target, PathTracer::FIND_ALL, VISIT_ALL);
+ tracer.VisitPointer(&root);
+}
+
+
// Triggers a depth-first traversal of reachable objects from roots
// and finds a path to a specific heap object and prints it.
void Heap::TracePathToObject(Object* target) {
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index
99b97f303130a4037a7e4d3079953dabdbfc5efc..af6207dc9a6e5f7e6d8b406cd539db430dcd8087
100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1285,6 +1285,7 @@ class Heap {
return disallow_allocation_failure_;
}
+ void TracePathToObjectFrom(Object* target, Object* root);
void TracePathToObject(Object* target);
void TracePathToGlobal();
#endif
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev