RESOLVED FIXED 89754
Web Inspector: add external resources size to the native memory diagram
https://bugs.webkit.org/show_bug.cgi?id=89754
Summary Web Inspector: add external resources size to the native memory diagram
Yury Semikhatsky
Reported 2012-06-22 04:38:08 PDT
Some javascript strings and arrays store their data in C++ heap. We should plot them on the diagram.
Attachments
Patch (10.03 KB, patch)
2012-06-22 04:51 PDT, Yury Semikhatsky
no flags
Patch (27.93 KB, patch)
2012-06-22 06:06 PDT, Yury Semikhatsky
no flags
Patch (28.84 KB, patch)
2012-06-22 06:53 PDT, Yury Semikhatsky
no flags
Patch (30.11 KB, patch)
2012-06-24 23:54 PDT, Yury Semikhatsky
vsevik: review+
Yury Semikhatsky
Comment 1 2012-06-22 04:51:22 PDT
Ilya Tikhonovsky
Comment 2 2012-06-22 05:02:12 PDT
Comment on attachment 148998 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148998&action=review > Source/WebCore/inspector/DOMWrapperVisitor.h:46 > + virtual void visitNode(Node*) { } > + virtual void visitJSExternalString(WTF::StringImpl*) { } > + virtual void visitJSExternalArray(WTF::ArrayBufferView*) { } > protected: I'd expect to see three abstract classes DOMNodeVisitor, JSExternalStringVisitor etc and the single abstract visit method in each with corresponding param.
Yury Semikhatsky
Comment 3 2012-06-22 06:06:54 PDT
Yury Semikhatsky
Comment 4 2012-06-22 06:07:40 PDT
(In reply to comment #2) > (From update of attachment 148998 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=148998&action=review > > > Source/WebCore/inspector/DOMWrapperVisitor.h:46 > > + virtual void visitNode(Node*) { } > > + virtual void visitJSExternalString(WTF::StringImpl*) { } > > + virtual void visitJSExternalArray(WTF::ArrayBufferView*) { } > > protected: > > I'd expect to see three abstract classes DOMNodeVisitor, JSExternalStringVisitor etc and the single abstract visit method in each with corresponding param. Done. Renamed the file to BindingVisitors.h and split the class into three classes.
Ilya Tikhonovsky
Comment 5 2012-06-22 06:14:12 PDT
Comment on attachment 149011 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149011&action=review > Source/WebCore/inspector/InspectorMemoryAgent.cpp:334 > + if (m_arrayBuffers.add(buffer).isNewEntry) > + m_externalArraySize += buffer->byteLength(); > + } > + virtual void visitJSExternalString(StringImpl* string) > + { > + int size = stringSize(string); > + m_jsExternalStringSize += size; is it possible to meet with a single string twice? If yes then we have to have a hash set for strings too.
Yury Semikhatsky
Comment 6 2012-06-22 06:21:08 PDT
(In reply to comment #5) > (From update of attachment 149011 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=149011&action=review > > is it possible to meet with a single string twice? If yes then we have to have a hash set for strings too. It shouldn't be possible as we cache created external strings by StringImpl* key (see StringCache::v8ExternalStringSlow).
Ilya Tikhonovsky
Comment 7 2012-06-22 06:43:27 PDT
Comment on attachment 149011 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149011&action=review nits. Otherwise looks good to me. > Source/WebCore/bindings/js/ScriptProfiler.h:77 > + static void visitJSDOMWrappers(NodeWrapperVisitor*) { } nit: visitNodeWrappers > Source/WebCore/bindings/js/ScriptProfiler.h:79 > + static void visitExternalJSStrings(ExternalStringVisitor*) { } > + static void visitExternalJSArrays(ExternalArrayVisitor*) { } visitExternalStrings ? visitExternalArrays ? > Source/WebCore/bindings/v8/ScriptProfiler.h:81 > + static void visitJSDOMWrappers(NodeWrapperVisitor*); ditto
Yury Semikhatsky
Comment 8 2012-06-22 06:53:50 PDT
Yury Semikhatsky
Comment 9 2012-06-22 06:54:12 PDT
(In reply to comment #7) > (From update of attachment 149011 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=149011&action=review > > nits. Otherwise looks good to me. > > > Source/WebCore/bindings/js/ScriptProfiler.h:77 > > + static void visitJSDOMWrappers(NodeWrapperVisitor*) { } > > nit: visitNodeWrappers > Done. > > Source/WebCore/bindings/js/ScriptProfiler.h:79 > > + static void visitExternalJSStrings(ExternalStringVisitor*) { } > > + static void visitExternalJSArrays(ExternalArrayVisitor*) { } > > visitExternalStrings ? > visitExternalArrays ? > Done. > > Source/WebCore/bindings/v8/ScriptProfiler.h:81 > > + static void visitJSDOMWrappers(NodeWrapperVisitor*); > > ditto Done.
Early Warning System Bot
Comment 10 2012-06-22 07:27:55 PDT
Early Warning System Bot
Comment 11 2012-06-22 07:34:43 PDT
Alexei Filippov
Comment 12 2012-06-22 08:00:31 PDT
Comment on attachment 149017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149017&action=review lgtm > Source/WebCore/inspector/InspectorMemoryAgent.cpp:338 > + int m_externalArraySize; nit: size_t
Gyuyoung Kim
Comment 13 2012-06-22 08:50:57 PDT
Yury Semikhatsky
Comment 14 2012-06-24 23:34:26 PDT
Comment on attachment 149017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149017&action=review >> Source/WebCore/inspector/InspectorMemoryAgent.cpp:338 >> + int m_externalArraySize; > > nit: size_t Done.
Yury Semikhatsky
Comment 15 2012-06-24 23:54:53 PDT
Yury Semikhatsky
Comment 16 2012-06-25 02:27:08 PDT
Note You need to log in before you can comment on or make changes to this bug.