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

Unified Diff: src/profile-generator.cc

Issue 5256004: Expose an API method for getting JSObject constructor name (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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/profile-generator.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
===================================================================
--- src/profile-generator.cc (revision 5888)
+++ src/profile-generator.cc (working copy)
@@ -1295,8 +1295,8 @@
} else if (object->IsJSObject()) {
return AddEntry(object,
HeapEntry::kObject,
- collection_->GetName(
- JSObject::cast(object)->constructor_name()),
+ collection_->GetName(GetConstructorNameForHeapProfile(
+ JSObject::cast(object))),
children_count,
retainers_count);
} else if (object->IsString()) {
@@ -2769,6 +2769,12 @@
sorted_entries->Sort(SortUsingEntryValue);
}
+
+String* GetConstructorNameForHeapProfile(JSObject* object) {
+ if (object->IsJSFunction()) return Heap::closure_symbol();
+ return object->constructor_name();
+}
+
} } // namespace v8::internal
#endif // ENABLE_LOGGING_AND_PROFILING
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698