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

Unified Diff: src/profiler/heap-snapshot-generator.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/profiler/heap-snapshot-generator.h ('k') | src/runtime/runtime.h » ('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 b360fccdfe3e6a5f588fc8af6c4ac21d7e56ae2f..9adfba050b04b5ed418757e6231966fef33d915c 100644
--- a/src/profiler/heap-snapshot-generator.cc
+++ b/src/profiler/heap-snapshot-generator.cc
@@ -1014,6 +1014,8 @@ bool V8HeapExplorer::ExtractReferencesPass1(int entry, HeapObject* obj) {
ExtractJSWeakCollectionReferences(entry, JSWeakSet::cast(obj));
} else if (obj->IsJSWeakMap()) {
ExtractJSWeakCollectionReferences(entry, JSWeakMap::cast(obj));
+ } else if (obj->IsJSWeakRef()) {
+ ExtractJSWeakRefReferences(entry, JSWeakRef::cast(obj));
} else if (obj->IsJSSet()) {
ExtractJSCollectionReferences(entry, JSSet::cast(obj));
} else if (obj->IsJSMap()) {
@@ -1199,6 +1201,15 @@ void V8HeapExplorer::ExtractJSWeakCollectionReferences(int entry,
SetInternalReference(obj, entry, "table", obj->table(),
JSWeakCollection::kTableOffset);
}
+void V8HeapExplorer::ExtractJSWeakRefReferences(int entry,
+ JSWeakRef* ref) {
+ SetInternalReference(ref, entry, "executor", ref->executor(),
+ JSWeakRef::kExecutorOffset);
+ SetInternalReference(ref, entry, "target", ref->target(),
+ JSWeakRef::kTargetOffset);
+ SetInternalReference(ref, entry, "holdings", ref->holdings(),
+ JSWeakRef::kHoldingsOffset);
+}
void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) {
if (context == context->declaration_context()) {
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698