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

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: 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..4c0247634063c4f7dcd77399a6617f1b6d2c15b5 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,21 @@ 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) {
+ SetWeakReference(weak_cell, entry, "value", weak_cell->value(),
+ WeakCell::kValueOffset);
+ TagObject(weak_cell->next(), "(weak cell)");
+ SetWeakReference(weak_cell, entry, "next", weak_cell->next(),
ulan 2016/08/02 12:32:17 This is a non-essential reference. Might make sens
alph 2016/08/02 13:00:11 Done.
+ WeakCell::kNextOffset);
+}
void V8HeapExplorer::ExtractPropertyCellReferences(int entry,
PropertyCell* cell) {
« 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