Reviewers: Toon Verwaest, Yury Semikhatsky, Yang,
Message:
On 2012/10/30 14:03:33, Toon Verwaest wrote:
This seems to be unnecessary given that the same function is called in
if(extract_indexed_refs) below.
Indeed, fixed. Fixed the 80-char limit as well.
Description:
Heap explorer: Show representation of strings.
* src/profile-generator.cc (V8HeapExplorer::GetSystemEntryName): For
maps of strings, return a name that encodes the representation
strategy used for the strings.
(V8HeapExplorer::ExtractReferences): For strings, visit the maps as
well, so that the user can see what representation is used for their
strings.
See http://wingolog.org/pub/string-representations.png for an example of
what it
looks like.
BUG=
Please review this at https://codereview.chromium.org/11344021/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/profile-generator.cc
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index
b853f33cb19aa2a15405cbdca4f76fdf3d25382b..c57ec3506665c6d8d0766379309c659f133f5dab
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,6 @@ void V8HeapExplorer::ExtractReferences(HeapObject*
obj) {
ExtractJSObjectReferences(entry, JSObject::cast(obj));
} else if (obj->IsString()) {
ExtractStringReferences(entry, String::cast(obj));
- extract_indexed_refs = false;
} else if (obj->IsContext()) {
ExtractContextReferences(entry, Context::cast(obj));
} else if (obj->IsMap()) {
@@ -1966,11 +1972,14 @@ 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);
}
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev