Commit ffcee2d6 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap-profiler] Make WeakMap => key value weak in heap snapshot.

Bug: chromium:875041
Change-Id: I4008fa2f7d92a0f2005c7566eb2945a800a9d284
Reviewed-on: https://chromium-review.googlesource.com/1190862
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55474}
parent 02173853
...@@ -1077,8 +1077,8 @@ void V8HeapExplorer::ExtractEphemeronHashTableReferences( ...@@ -1077,8 +1077,8 @@ void V8HeapExplorer::ExtractEphemeronHashTableReferences(
Object* value = table->get(value_index); Object* value = table->get(value_index);
SetWeakReference(table, entry, key_index, key, SetWeakReference(table, entry, key_index, key,
table->OffsetOfElementAt(key_index)); table->OffsetOfElementAt(key_index));
SetInternalReference(table, entry, value_index, value, SetWeakReference(table, entry, value_index, value,
table->OffsetOfElementAt(value_index)); table->OffsetOfElementAt(value_index));
HeapEntry* key_entry = GetEntry(key); HeapEntry* key_entry = GetEntry(key);
int key_entry_index = key_entry->index(); int key_entry_index = key_entry->index();
HeapEntry* value_entry = GetEntry(value); HeapEntry* value_entry = GetEntry(value);
......
...@@ -686,7 +686,7 @@ TEST(HeapSnapshotWeakCollection) { ...@@ -686,7 +686,7 @@ TEST(HeapSnapshotWeakCollection) {
++weak_entries; ++weak_entries;
} }
} }
CHECK_EQ(1, weak_entries); // Key is the only weak. CHECK_EQ(2, weak_entries); // Key and value are weak.
const v8::HeapGraphNode* wm_s = const v8::HeapGraphNode* wm_s =
GetProperty(env->GetIsolate(), wm, v8::HeapGraphEdge::kProperty, "str"); GetProperty(env->GetIsolate(), wm, v8::HeapGraphEdge::kProperty, "str");
CHECK(wm_s); CHECK(wm_s);
......
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