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

Unified Diff: src/heap/object-stats.cc

Issue 2915793002: [api] Prototype WeakRef implementation
Patch Set: Created 3 years, 7 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/heap/object-stats.h ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/object-stats.cc
diff --git a/src/heap/object-stats.cc b/src/heap/object-stats.cc
index e9067937aaffb541a01c302e8ed4c3404b2aa6ba..aabcd420d774b24dd4019d6a22f54c1dfcc6e40c 100644
--- a/src/heap/object-stats.cc
+++ b/src/heap/object-stats.cc
@@ -429,6 +429,20 @@ void ObjectStatsCollector::RecordJSWeakCollectionDetails(
}
}
+void ObjectStatsCollector::RecordJSWeakRefDetails(
+ JSWeakRef* obj) {
+ if (obj->executor() != nullptr) {
+ RecordJSFunctionDetails(obj->executor());
+ }
+ if (obj->holdings() != nullptr && obj->holdings()->IsObject()) {
+ // RecordObjectStats(obj->holdings());
+ }
+ WeakCell* cell = obj->target();
+ if (cell->cleared() != true && cell->value()->IsObject()) {
+ RecordJSObjectDetails(static_cast<JSObject*>(cell->value()));
+ }
+}
+
void ObjectStatsCollector::RecordJSCollectionDetails(JSObject* obj) {
// The JS versions use a different HashTable implementation that cannot use
// the regular helper. Since overall impact is usually small just record
« no previous file with comments | « src/heap/object-stats.h ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698