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

Unified Diff: src/heap-profiler.cc

Issue 9139018: Provide a way for iterating through all external strings referenced from the JS heap (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 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
Index: src/heap-profiler.cc
===================================================================
--- src/heap-profiler.cc (revision 10391)
+++ src/heap-profiler.cc (working copy)
@@ -104,6 +104,18 @@
class_id, Utils::ToLocal(Handle<Object>(wrapper)));
}
+void HeapProfiler::VisitExternalResources(ExternalResourceVisitor* visitor) {
+ HEAP->CollectAllGarbage(Heap::kMakeHeapIterableMask);
+ AssertNoAllocation no_allocation;
+ HeapIterator iterator;
+ for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
+ if (!obj->IsString())
mnaganov (inactive) 2012/01/11 18:50:23 Why not obj->IsExternalString()?
yurys 2012/01/11 19:50:13 Done.
+ continue;
+ String* string= String::cast(obj);
+ if (StringShape(string).IsExternal())
+ visitor->VisitExternalString(string);
+ }
+}
HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name,
int type,

Powered by Google App Engine
This is Rietveld 408576698