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

Unified Diff: src/heap-profiler.cc

Issue 6626043: Add an interface for an embedder to provide information about native (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix GetCopy Created 9 years, 9 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 | « src/heap-profiler.h ('k') | src/objects.h » ('j') | src/profile-generator.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-profiler.cc
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
index 07b631fa7332d8de6bc1b50f6987aae4d74e58cd..f983913082d5bd36f28e41fa622fc2bcdcbb3791 100644
--- a/src/heap-profiler.cc
+++ b/src/heap-profiler.cc
@@ -364,6 +364,26 @@ HeapSnapshot* HeapProfiler::TakeSnapshot(String* name,
}
+void HeapProfiler::DefineWrapperClass(
+ uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback) {
Vitaly Repeshko 2011/03/09 19:10:08 Assert class_id is not kNoClassId.
mnaganov (inactive) 2011/03/10 12:23:35 Done.
+ ASSERT(singleton_ != NULL);
+ if (singleton_->wrapper_callbacks_.length() <= class_id) {
+ singleton_->wrapper_callbacks_.AddBlock(
+ NULL, class_id - singleton_->wrapper_callbacks_.length() + 1);
+ }
+ singleton_->wrapper_callbacks_[class_id] = callback;
+}
+
+
+v8::RetainedObjectInfo* HeapProfiler::ExecuteWrapperClassCallback(
+ uint16_t class_id, Object** wrapper) {
+ ASSERT(singleton_ != NULL);
+ if (singleton_->wrapper_callbacks_.length() <= class_id) return NULL;
+ return singleton_->wrapper_callbacks_[class_id](
+ class_id, Utils::ToLocal(Handle<Object>(wrapper)));
+}
+
+
HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name,
int type,
v8::ActivityControl* control) {
@@ -401,7 +421,7 @@ HeapSnapshot* HeapProfiler::TakeSnapshotImpl(const char* name,
HeapSnapshot* HeapProfiler::TakeSnapshotImpl(String* name,
int type,
v8::ActivityControl* control) {
- return TakeSnapshotImpl(snapshots_->GetName(name), type, control);
+ return TakeSnapshotImpl(snapshots_->names()->GetName(name), type, control);
}
@@ -872,7 +892,8 @@ class AllocatingConstructorHeapProfileIterator {
const NumberAndSizeInfo& number_and_size) {
const char* name = cluster.GetSpecialCaseName();
if (name == NULL) {
- name = snapshot_->collection()->GetFunctionName(cluster.constructor());
+ name = snapshot_->collection()->names()->GetFunctionName(
+ cluster.constructor());
}
AddEntryFromAggregatedSnapshot(snapshot_,
root_child_index_,
@@ -1013,7 +1034,8 @@ class AggregatedRetainerTreeAllocator : public HeapEntriesAllocator {
JSObjectsCluster cluster = HeapObjectAsCluster(obj);
const char* name = cluster.GetSpecialCaseName();
if (name == NULL) {
- name = snapshot_->collection()->GetFunctionName(cluster.constructor());
+ name = snapshot_->collection()->names()->GetFunctionName(
+ cluster.constructor());
}
return AddEntryFromAggregatedSnapshot(
snapshot_, root_child_index_, HeapEntry::kObject, name,
« no previous file with comments | « src/heap-profiler.h ('k') | src/objects.h » ('j') | src/profile-generator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698