Commit 12708c93 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap-profiler] Make WeakMap key edge name more descriptive.

Currently a WeakMap key edge shows up as '<id> / WeakMap'. This patch
changes it to '<id> / key <KeyName> in WeakMap'.

Bug: chromium:827713
Change-Id: I0306bacdc331ab69739be88cf29d16a21187625f
Reviewed-on: https://chromium-review.googlesource.com/992035Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52465}
parent 59a56825
......@@ -1364,8 +1364,10 @@ void V8HeapExplorer::ExtractFixedArrayReferences(int entry, FixedArray* array) {
int key_entry_index = key_entry->index();
HeapEntry* value_entry = GetEntry(value);
if (key_entry && value_entry) {
const char* edge_name =
names_->GetFormatted("key %s in WeakMap", key_entry->name());
filler_->SetNamedAutoIndexReference(HeapGraphEdge::kInternal,
key_entry_index, "WeakMap",
key_entry_index, edge_name,
value_entry);
}
}
......
......@@ -768,7 +768,7 @@ TEST(HeapSnapshotEphemeron) {
const v8::HeapGraphNode* child = edge->GetToNode();
if (!strcmp("ValueClass", GetName(child))) {
v8::String::Utf8Value edge_name(CcTest::isolate(), edge->GetName());
CHECK(EndsWith(*edge_name, " / WeakMap"));
CHECK(EndsWith(*edge_name, " / key KeyClass in WeakMap"));
success = true;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment