Bug 105026 - Web Inspector: Native Memory Instrumentation: MemoryInstrumentation doesn't detect reportMemoryUsage method defined in a base class.
Summary: Web Inspector: Native Memory Instrumentation: MemoryInstrumentation doesn't d...
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-14 07:50 PST by Ilya Tikhonovsky
Modified: 2012-12-17 08:32 PST (History)
11 users (show)

See Also:


Attachments
Patch (6.43 KB, patch)
2012-12-14 08:00 PST, Ilya Tikhonovsky
yurys: review+
Details | Formatted Diff | Diff
for try-bots. speculative fix for windows (6.43 KB, patch)
2012-12-17 00:08 PST, Ilya Tikhonovsky
no flags 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-14 07:50:44 PST
It is relatively frequent case when we report a pointer to an object of a class
and this class does not have reportMemoryUsage method but its parent does.
Current implementation does not detect such cases.
As a result we count such objects via sizeof and do not call reportMemoryUsage.

I found a working solution and need to check it against all the WebKit compilers.

http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions
Comment 1 Ilya Tikhonovsky 2012-12-14 08:00:38 PST
Created attachment 179485 [details]
Patch
Comment 2 Ilya Tikhonovsky 2012-12-14 08:03:06 PST
The coverage increases by ~3% on cnn, nytimes and google.
Comment 3 Build Bot 2012-12-14 09:01:36 PST
Comment on attachment 179485 [details]
Patch

Attachment 179485 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15310752
Comment 4 Yury Semikhatsky 2012-12-14 22:48:26 PST
Comment on attachment 179485 [details]
Patch

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

> Source/WTF/wtf/MemoryInstrumentation.h:133
> +        struct Base : public Type, public BaseMixin { };

Will it compile if there is no default constructor for Type ?
Comment 5 Ilya Tikhonovsky 2012-12-17 00:08:54 PST
Created attachment 179698 [details]
for try-bots. speculative fix for windows
Comment 6 Yury Semikhatsky 2012-12-17 02:03:49 PST
Comment on attachment 179485 [details]
Patch

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

>> Source/WTF/wtf/MemoryInstrumentation.h:133
>> +        struct Base : public Type, public BaseMixin { };
> 
> Will it compile if there is no default constructor for Type ?

Why is it called Base, shouldn't it be Derived instead?

> Source/WTF/wtf/MemoryInstrumentation.h:144
> +    template <int>

template <bool> ?
Comment 7 Ilya Tikhonovsky 2012-12-17 03:30:50 PST
Committed r137892: <http://trac.webkit.org/changeset/137892>
Comment 8 Ilya Tikhonovsky 2012-12-17 03:36:43 PST
Reverted r137892 for reason:

it broke compilation on windows

Committed r137893: <http://trac.webkit.org/changeset/137893>
Comment 9 Ilya Tikhonovsky 2012-12-17 08:32:26 PST
Committed r137911: <http://trac.webkit.org/changeset/137911>