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

Unified Diff: src/profiler/heap-snapshot-generator.cc

Issue 2204873003: Add WeakCell support to heap profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressing comment Created 4 years, 4 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 | « src/profiler/heap-snapshot-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/heap-snapshot-generator.cc
diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc
index 3fb387c59d4d627ce08ccc35ee21660249d7a556..dd49a191a90660afec2b6071f9035a735fb3fca6 100644
--- a/src/profiler/heap-snapshot-generator.cc
+++ b/src/profiler/heap-snapshot-generator.cc
@@ -1047,6 +1047,8 @@ bool V8HeapExplorer::ExtractReferencesPass1(int entry, HeapObject* obj) {
ExtractBoxReferences(entry, Box::cast(obj));
} else if (obj->IsCell()) {
ExtractCellReferences(entry, Cell::cast(obj));
+ } else if (obj->IsWeakCell()) {
+ ExtractWeakCellReferences(entry, WeakCell::cast(obj));
} else if (obj->IsPropertyCell()) {
ExtractPropertyCellReferences(entry, PropertyCell::cast(obj));
} else if (obj->IsAllocationSite()) {
@@ -1475,16 +1477,19 @@ void V8HeapExplorer::ExtractCodeReferences(int entry, Code* code) {
}
}
-
void V8HeapExplorer::ExtractBoxReferences(int entry, Box* box) {
SetInternalReference(box, entry, "value", box->value(), Box::kValueOffset);
}
-
void V8HeapExplorer::ExtractCellReferences(int entry, Cell* cell) {
SetInternalReference(cell, entry, "value", cell->value(), Cell::kValueOffset);
}
+void V8HeapExplorer::ExtractWeakCellReferences(int entry, WeakCell* weak_cell) {
+ TagObject(weak_cell, "(weak cell)");
+ SetWeakReference(weak_cell, entry, "value", weak_cell->value(),
+ WeakCell::kValueOffset);
+}
void V8HeapExplorer::ExtractPropertyCellReferences(int entry,
PropertyCell* cell) {
@@ -1844,6 +1849,8 @@ bool V8HeapExplorer::IsEssentialHiddenReference(Object* parent,
if (parent->IsAllocationSite() &&
field_offset == AllocationSite::kWeakNextOffset)
return false;
+ if (parent->IsWeakCell() && field_offset == WeakCell::kNextOffset)
+ return false;
// TODO(ulan): JSFunction, Code, and Context also have next weak link, which
// is non-essential. Currently they are handled as normal weak links.
// Move them here.
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698