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

Unified Diff: src/heap-snapshot-generator.h

Issue 213673006: Show references from weak containers as weak in heap snapshots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added a test. Created 6 years, 9 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 | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-snapshot-generator.h
diff --git a/src/heap-snapshot-generator.h b/src/heap-snapshot-generator.h
index 634ede19ab49c8b9d02ac9c7841a2b965f25da22..1582b2e1e85a94e9a518c2392a51370a59b41d37 100644
--- a/src/heap-snapshot-generator.h
+++ b/src/heap-snapshot-generator.h
@@ -376,6 +376,9 @@ class V8HeapExplorer : public HeapEntriesAllocator {
static HeapObject* const kInternalRootObject;
private:
+ typedef bool (V8HeapExplorer::*ExtractReferencesMethod)(int entry,
+ HeapObject* object);
+
HeapEntry* AddEntry(HeapObject* object);
HeapEntry* AddEntry(HeapObject* object,
HeapEntry::Type type,
@@ -383,7 +386,11 @@ class V8HeapExplorer : public HeapEntriesAllocator {
const char* GetSystemEntryName(HeapObject* object);
- void ExtractReferences(HeapObject* obj);
+ template<V8HeapExplorer::ExtractReferencesMethod extractor>
+ bool IterateAndExtractSinglePass();
+
+ bool ExtractReferencesPass1(int entry, HeapObject* obj);
+ bool ExtractReferencesPass2(int entry, HeapObject* obj);
void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy);
void ExtractJSObjectReferences(int entry, JSObject* js_obj);
void ExtractStringReferences(int entry, String* obj);
@@ -400,12 +407,14 @@ class V8HeapExplorer : public HeapEntriesAllocator {
void ExtractPropertyCellReferences(int entry, PropertyCell* cell);
void ExtractAllocationSiteReferences(int entry, AllocationSite* site);
void ExtractJSArrayBufferReferences(int entry, JSArrayBuffer* buffer);
+ void ExtractFixedArrayReferences(int entry, FixedArray* array);
void ExtractClosureReferences(JSObject* js_obj, int entry);
void ExtractPropertyReferences(JSObject* js_obj, int entry);
bool ExtractAccessorPairProperty(JSObject* js_obj, int entry,
Object* key, Object* callback_obj);
void ExtractElementReferences(JSObject* js_obj, int entry);
void ExtractInternalReferences(JSObject* js_obj, int entry);
+
bool IsEssentialObject(Object* object);
void SetContextReference(HeapObject* parent_obj,
int parent,
@@ -439,6 +448,11 @@ class V8HeapExplorer : public HeapEntriesAllocator {
const char* reference_name,
Object* child_obj,
int field_offset);
+ void SetWeakReference(HeapObject* parent_obj,
+ int parent,
+ int index,
+ Object* child_obj,
+ int field_offset);
void SetPropertyReference(HeapObject* parent_obj,
int parent,
Name* reference_name,
@@ -452,6 +466,7 @@ class V8HeapExplorer : public HeapEntriesAllocator {
VisitorSynchronization::SyncTag tag, bool is_weak, Object* child);
const char* GetStrongGcSubrootName(Object* object);
void TagObject(Object* obj, const char* tag);
+ void MarkAsWeakContainer(Object* object);
HeapEntry* GetEntry(Object* obj);
@@ -467,6 +482,7 @@ class V8HeapExplorer : public HeapEntriesAllocator {
HeapObjectsSet objects_tags_;
HeapObjectsSet strong_gc_subroot_names_;
HeapObjectsSet user_roots_;
+ HeapObjectsSet weak_containers_;
v8::HeapProfiler::ObjectNameResolver* global_object_name_resolver_;
static HeapObject* const kGcRootsObject;
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698