Bug 97198 - Web Inspector: extract HashSet instrumentation from core NMI code and put it into MemoryInstrumentationHashSet.h
Summary: Web Inspector: extract HashSet instrumentation from core NMI code and put it ...
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: 96650
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-20 04:50 PDT by Ilya Tikhonovsky
Modified: 2012-09-27 08:09 PDT (History)
20 users (show)

See Also:


Attachments
patch for try bots. HashSet + Vector. (52.98 KB, patch)
2012-09-21 01:28 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (29.17 KB, patch)
2012-09-25 01:55 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (32.41 KB, patch)
2012-09-25 05:21 PDT, 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-09-20 04:50:11 PDT
Current implementation has overloads for HashSet.
This prevents us from instrumenting complex cases like Vector<HashSet<...> >.
Comment 1 Ilya Tikhonovsky 2012-09-21 01:28:55 PDT
Created attachment 165077 [details]
patch for try bots. HashSet + Vector.
Comment 2 Yury Semikhatsky 2012-09-24 23:22:31 PDT
Comment on attachment 165077 [details]
patch for try bots. HashSet + Vector.

Clearing r?. Please remove changes to vector.
Comment 3 Ilya Tikhonovsky 2012-09-25 01:55:48 PDT
Created attachment 165558 [details]
Patch
Comment 4 Yury Semikhatsky 2012-09-25 02:16:50 PDT
Comment on attachment 165558 [details]
Patch

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

> Source/WTF/wtf/MemoryInstrumentationHashSet.h:57
> +void reportMemoryUsage(const HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>* const& hashTable, MemoryObjectInfo* memoryObjectInfo)

Please put HashTable memory instrumentation into a separate file as it is going to be reused by HashMap and LinkedHashSet instrumentations.
Comment 5 Yury Semikhatsky 2012-09-25 02:20:26 PDT
Comment on attachment 165558 [details]
Patch

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

> Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp:446
> +    VisitedObjects visitedObjects;

Please add a test for HashTable instrumentation and a test for HashSet owned by value.
Comment 6 Ilya Tikhonovsky 2012-09-25 05:21:23 PDT
Created attachment 165587 [details]
Patch
Comment 7 Ilya Tikhonovsky 2012-09-25 05:28:09 PDT
(In reply to comment #4)
> (From update of attachment 165558 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=165558&action=review
> 
> > Source/WTF/wtf/MemoryInstrumentationHashSet.h:57
> > +void reportMemoryUsage(const HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>* const& hashTable, MemoryObjectInfo* memoryObjectInfo)
> 
> Please put HashTable memory instrumentation into a separate file as it is going to be reused by HashMap and LinkedHashSet instrumentations.

done.

> > Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp:446
> > +    VisitedObjects visitedObjects;
> 
> Please add a test for HashTable instrumentation and a test for HashSet owned by value.

HashTable is a wtf internal class which is used by HashSet, HashMap, etc and is never used directly in WebCore. Also it knows nothing about the internal structure of the values inside it. Thus it is not necessary to test its instrumentation directly.
Comment 8 Yury Semikhatsky 2012-09-25 22:39:53 PDT
(In reply to comment #7)
> > Please add a test for HashTable instrumentation and a test for HashSet owned by value.
> 
> HashTable is a wtf internal class which is used by HashSet, HashMap, etc and is never used directly in WebCore. Also it knows nothing about the internal structure of the values inside it. Thus it is not necessary to test its instrumentation directly.

What about the second part of the commentary?
Comment 9 Ilya Tikhonovsky 2012-09-26 00:21:35 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > > Please add a test for HashTable instrumentation and a test for HashSet owned by value.
> > 
> > HashTable is a wtf internal class which is used by HashSet, HashMap, etc and is never used directly in WebCore. Also it knows nothing about the internal structure of the values inside it. Thus it is not necessary to test its instrumentation directly.
> 
> What about the second part of the commentary?

addMember function has its own mechanic for pointer vs reference instrumentation. And it is covered by ptrVsRef test.
Comment 10 Yury Semikhatsky 2012-09-26 05:31:40 PDT
Comment on attachment 165587 [details]
Patch

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

> Source/WTF/wtf/MemoryInstrumentation.h:193
> +    template<typename I> void addMembers(I iterator, I end)

Can you change this to addCollectionElements(const T& collection) so that we don't need to .begin() and .end() in all call sites?
Comment 11 Ilya Tikhonovsky 2012-09-26 07:10:37 PDT
Committed r129637: <http://trac.webkit.org/changeset/129637>
Comment 12 Yury Semikhatsky 2012-09-27 08:08:07 PDT
Reopening to attach new patch.
Comment 13 Yury Semikhatsky 2012-09-27 08:09:00 PDT
(In reply to comment #12)
> Reopening to attach new patch.

Sorry, wrong bug.