Permalink
Browse files

Set object tags directly to the entry name in heap profiler.

  • Loading branch information...
1 parent fa0ae2d commit 2fe76008e946861d02bddb1ef7978b9ab525e054 alexeif@chromium.org committed May 10, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −3 src/profile-generator.cc
  2. +1 −0 src/profile-generator.h
View
@@ -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);
+ }
}
}
View
@@ -526,6 +526,7 @@ class HeapEntry BASE_EMBEDDED {
HeapSnapshot* snapshot() { return snapshot_; }
Type type() { return static_cast<Type>(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_; }

0 comments on commit 2fe7600

Please sign in to comment.