Bug 105725 - Web Inspector: Native Memory Instrumentation: propagate ownership type to the serialized heap graph
Summary: Web Inspector: Native Memory Instrumentation: propagate ownership type to the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-24 09:29 PST by Ilya Tikhonovsky
Modified: 2012-12-24 23:03 PST (History)
11 users (show)

See Also:


Attachments
Patch (22.94 KB, patch)
2012-12-24 09:39 PST, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (25.09 KB, patch)
2012-12-24 22:00 PST, Ilya Tikhonovsky
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2012-12-24 09:29:44 PST
We are collecting information about edges but do not report the edge type.
But we could calculate edge types almost automatically.

Actually WebCore uses three edge types. 
ByPointer usually means a weak reference.
ByOwnPtr means a single strong reference.
ByRefPtr means one or more strong references.

In some cases a pointer to an object could be a strong reference. I hope it is relatively rare case in WebCore.
If it is possible I'll replace such pointer with OwnPtr. If it is not possible, I'll introduce addStrongPointerMember method.
Comment 1 Ilya Tikhonovsky 2012-12-24 09:39:37 PST
Created attachment 180675 [details]
Patch
Comment 2 Build Bot 2012-12-24 10:15:31 PST
Comment on attachment 180675 [details]
Patch

Attachment 180675 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15496533
Comment 3 Yury Semikhatsky 2012-12-24 20:59:11 PST
Comment on attachment 180675 [details]
Patch

You'll also need to update export symbols I think.

View in context: https://bugs.webkit.org/attachment.cgi?id=180675&action=review

> Source/WTF/wtf/MemoryInstrumentation.h:49
> +    ByPointer,

Let's rename MemoryOwningType to HeapGraphEdgeType and the values to PointerEdge, ReferenceEdge, OwnPtrEdge etc.(I'd prefer simply RefPtr, Pointer etc. but those would conflict with the classes).

> Source/WebCore/inspector/HeapGraphSerializer.cpp:68
> +        : m_refType(0)

I'd leave it as m_type.

> Source/WebCore/inspector/HeapGraphSerializer.cpp:89
> +    memset(m_refTypes, 0, sizeof(m_refTypes));

m_refTypes -> m_edgeTypes.
Comment 4 Ilya Tikhonovsky 2012-12-24 22:00:17 PST
Created attachment 180698 [details]
Patch
Comment 5 Ilya Tikhonovsky 2012-12-24 22:20:09 PST
(In reply to comment #3)
> (From update of attachment 180675 [details])
> You'll also need to update export symbols I think.
> 
> View in context: https://bugs.webkit.org/attachment.cgi?id=180675&action=review
> 
> > Source/WTF/wtf/MemoryInstrumentation.h:49
> > +    ByPointer,
> 
> Let's rename MemoryOwningType to HeapGraphEdgeType and the values to PointerEdge, ReferenceEdge, OwnPtrEdge etc.(I'd prefer simply RefPtr, Pointer etc. but those would conflict with the classes).


MemoryOwningType -> MemberType
ByPointer -> PointerMember,
ByReference -> ReferenceMember,
new type OwnPtrMember,
new type RefPtrMember,
new type LastMemberTypeEntry


> 
> > Source/WebCore/inspector/HeapGraphSerializer.cpp:68
> > +        : m_refType(0)
> 
> I'd leave it as m_type.

done.

> 
> > Source/WebCore/inspector/HeapGraphSerializer.cpp:89
> > +    memset(m_refTypes, 0, sizeof(m_refTypes));
> 
> m_refTypes -> m_edgeTypes.

done.
Comment 6 Ilya Tikhonovsky 2012-12-24 23:03:10 PST
Committed r138452: <http://trac.webkit.org/changeset/138452>