From 7bf37bc6c66f4ee8f25d69a3fad5477034eab7ed Mon Sep 17 00:00:00 2001 From: "alexeif@chromium.org" Date: Thu, 10 May 2012 15:55:19 +0000 Subject: [PATCH] Set object tags directly to the entry name in heap profiler. Review URL: https://chromiumcodereview.appspot.com/10382106 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11538 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/profile-generator.cc | 8 +++++--- src/profile-generator.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/profile-generator.cc b/src/profile-generator.cc index 3f4e935..b31b77b 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -1710,8 +1710,7 @@ HeapEntry* V8HeapExplorer::AddEntry(HeapObject* object) { object->IsFixedDoubleArray() || object->IsByteArray() || object->IsExternalArray()) { - const char* tag = objects_tags_.GetTag(object); - return AddEntry(object, HeapEntry::kArray, tag != NULL ? tag : ""); + return AddEntry(object, HeapEntry::kArray, ""); } else if (object->IsHeapNumber()) { return AddEntry(object, HeapEntry::kHeapNumber, "number"); } @@ -2635,7 +2634,10 @@ const char* V8HeapExplorer::GetStrongGcSubrootName(Object* object) { void V8HeapExplorer::TagObject(Object* obj, const char* tag) { if (IsEssentialObject(obj)) { - objects_tags_.SetTag(obj, tag); + HeapEntry* entry = GetEntry(obj); + if (entry->name()[0] == '\0') { + entry->set_name(tag); + } } } diff --git a/src/profile-generator.h b/src/profile-generator.h index bc1fb42..92896c2 100644 --- a/src/profile-generator.h +++ b/src/profile-generator.h @@ -526,6 +526,7 @@ class HeapEntry BASE_EMBEDDED { HeapSnapshot* snapshot() { return snapshot_; } Type type() { return static_cast(type_); } const char* name() { return name_; } + void set_name(const char* name) { name_ = name; } inline SnapshotObjectId id() { return id_; } int self_size() { return self_size_; } int retained_size() { return retained_size_; } -- 2.7.4