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

Unified Diff: src/profile-generator.cc

Issue 11344021: Heap explorer: Show representation of strings. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index b853f33cb19aa2a15405cbdca4f76fdf3d25382b..78cd32ddc33c893c580ac472928fe832d2fdb95a 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -1774,7 +1774,14 @@ void V8HeapExplorer::AddRootEntries(SnapshotFillerInterface* filler) {
const char* V8HeapExplorer::GetSystemEntryName(HeapObject* object) {
switch (object->map()->instance_type()) {
- case MAP_TYPE: return "system / Map";
+ case MAP_TYPE:
+ switch (Map::cast(object)->instance_type()) {
+#define MAKE_STRING_MAP_CASE(instance_type, size, name, Name) \
+ case instance_type: return "system / Map (" #Name ")";
+ STRING_TYPE_LIST(MAKE_STRING_MAP_CASE)
+#undef MAKE_STRING_MAP_CASE
+ default: return "system / Map";
+ }
case JS_GLOBAL_PROPERTY_CELL_TYPE: return "system / JSGlobalPropertyCell";
case FOREIGN_TYPE: return "system / Foreign";
case ODDBALL_TYPE: return "system / Oddball";
@@ -1851,7 +1858,7 @@ void V8HeapExplorer::ExtractReferences(HeapObject* obj) {
ExtractJSObjectReferences(entry, JSObject::cast(obj));
} else if (obj->IsString()) {
ExtractStringReferences(entry, String::cast(obj));
- extract_indexed_refs = false;
+ SetInternalReference(obj, entry, "map", obj->map(), HeapObject::kMapOffset);
Toon Verwaest 2012/10/30 14:03:34 This seems to be unnecessary given that the same f
} else if (obj->IsContext()) {
ExtractContextReferences(entry, Context::cast(obj));
} else if (obj->IsMap()) {
@@ -1966,11 +1973,11 @@ void V8HeapExplorer::ExtractJSObjectReferences(
void V8HeapExplorer::ExtractStringReferences(int entry, String* string) {
if (string->IsConsString()) {
ConsString* cs = ConsString::cast(string);
- SetInternalReference(cs, entry, "first", cs->first());
- SetInternalReference(cs, entry, "second", cs->second());
+ SetInternalReference(cs, entry, "first", cs->first(), ConsString::kFirstOffset);
+ SetInternalReference(cs, entry, "second", cs->second(), ConsString::kSecondOffset);
} else if (string->IsSlicedString()) {
SlicedString* ss = SlicedString::cast(string);
- SetInternalReference(ss, entry, "parent", ss->parent());
+ SetInternalReference(ss, entry, "parent", ss->parent(), SlicedString::kParentOffset);
Yang 2012/10/30 14:39:40 Please keep the 80-char limit.
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698