Index: src/heap-snapshot-generator.cc |
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc |
index cafee77b4ce10d20be74ee3df7fe290349cff63f..d872e78a4fa2893c1b65d319abf6314e621d9283 100644 |
--- a/src/heap-snapshot-generator.cc |
+++ b/src/heap-snapshot-generator.cc |
@@ -155,6 +155,7 @@ const char* HeapEntry::TypeAsString() { |
case kSynthetic: return "/synthetic/"; |
case kConsString: return "/concatenated string/"; |
case kSlicedString: return "/sliced string/"; |
+ case kSymbol: return "/symbol/"; |
default: return "???"; |
} |
} |
@@ -851,6 +852,8 @@ HeapEntry* V8HeapExplorer::AddEntry(HeapObject* object) { |
return AddEntry(object, |
HeapEntry::kString, |
names_->GetName(String::cast(object))); |
+ } else if (object->IsSymbol()) { |
+ return AddEntry(object, HeapEntry::kSymbol, "symbol"); |
} else if (object->IsCode()) { |
return AddEntry(object, HeapEntry::kCode, ""); |
} else if (object->IsSharedFunctionInfo()) { |
@@ -1098,6 +1101,8 @@ bool V8HeapExplorer::ExtractReferencesPass1(int entry, HeapObject* obj) { |
ExtractJSObjectReferences(entry, JSObject::cast(obj)); |
} else if (obj->IsString()) { |
ExtractStringReferences(entry, String::cast(obj)); |
+ } else if (obj->IsSymbol()) { |
+ ExtractSymbolReferences(entry, Symbol::cast(obj)); |
} else if (obj->IsMap()) { |
ExtractMapReferences(entry, Map::cast(obj)); |
} else if (obj->IsSharedFunctionInfo()) { |
@@ -1244,6 +1249,13 @@ void V8HeapExplorer::ExtractStringReferences(int entry, String* string) { |
} |
+void V8HeapExplorer::ExtractSymbolReferences(int entry, Symbol* symbol) { |
+ SetInternalReference(symbol, entry, |
+ "name", symbol->name(), |
+ Symbol::kNameOffset); |
+} |
+ |
+ |
void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) { |
if (context == context->declaration_context()) { |
ScopeInfo* scope_info = context->closure()->shared()->scope_info(); |