RESOLVED FIXED Bug 89889
Web Inspector: replace recursion with a stack in DOM nodes snapshot traversal.
https://bugs.webkit.org/show_bug.cgi?id=89889
Summary Web Inspector: replace recursion with a stack in DOM nodes snapshot traversal.
Alexei Filippov
Reported 2012-06-25 09:59:52 PDT
Number of DOM nodes native snapshots can handle is currently limited by the process stack size because of recursion used to traverse the nodes. Change the recursion to a stack based algorithm.
Attachments
Patch (5.29 KB, patch)
2012-06-25 10:20 PDT, Alexei Filippov
no flags
Patch (5.90 KB, patch)
2012-06-26 08:23 PDT, Alexei Filippov
no flags
Patch (5.95 KB, patch)
2012-06-27 03:55 PDT, Alexei Filippov
no flags
Patch (6.38 KB, patch)
2012-07-02 05:48 PDT, Alexei Filippov
no flags
Alexei Filippov
Comment 1 2012-06-25 10:20:34 PDT
Yury Semikhatsky
Comment 2 2012-06-26 05:49:55 PDT
Comment on attachment 149315 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149315&action=review > Source/WebCore/dom/MemoryInstrumentation.h:40 > +class MemoryInstrumentedPointerBase; Forward declarations should go in alphabetic order. > Source/WebCore/dom/MemoryInstrumentation.h:111 > + void countObjectSize() Please inline this method instead. > Source/WebCore/dom/MemoryInstrumentation.h:134 > + void processInstrumentedPointer(MemoryInstrumentation* memoryInstrumentation) missing virtual and OVERRIDE > Source/WebCore/inspector/InspectorMemoryAgent.cpp:451 > + delete pointer; Please use queue of OwnPtr's to avoid manual delete. > Source/WebCore/inspector/InspectorMemoryAgent.cpp:475 > + Vector<MemoryInstrumentedPointerBase*> m_worklist; m_instrumentedPointers?
Alexei Filippov
Comment 3 2012-06-26 08:23:26 PDT
Alexei Filippov
Comment 4 2012-06-26 08:25:15 PDT
Comment on attachment 149315 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149315&action=review >> Source/WebCore/dom/MemoryInstrumentation.h:40 >> +class MemoryInstrumentedPointerBase; > > Forward declarations should go in alphabetic order. done >> Source/WebCore/dom/MemoryInstrumentation.h:111 >> + void countObjectSize() > > Please inline this method instead. done >> Source/WebCore/dom/MemoryInstrumentation.h:134 >> + void processInstrumentedPointer(MemoryInstrumentation* memoryInstrumentation) > > missing virtual and OVERRIDE done >> Source/WebCore/inspector/InspectorMemoryAgent.cpp:451 >> + delete pointer; > > Please use queue of OwnPtr's to avoid manual delete. done >> Source/WebCore/inspector/InspectorMemoryAgent.cpp:475 >> + Vector<MemoryInstrumentedPointerBase*> m_worklist; > > m_instrumentedPointers? m_deferredInstrumentedPointers
Ilya Tikhonovsky
Comment 5 2012-06-26 12:53:59 PDT
Comment on attachment 149536 [details] Patch lgtm
Yury Semikhatsky
Comment 6 2012-06-27 00:43:08 PDT
Comment on attachment 149536 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149536&action=review > Source/WebCore/dom/MemoryInstrumentation.h:120 > +class MemoryInstrumentedPointerBase { I'd move these classes into MemoryInstrumentation as they are just implementation details. It would also allow us to give them shorter names. > Source/WebCore/inspector/InspectorMemoryAgent.cpp:476 > + Vector<PassOwnPtr<MemoryInstrumentedPointerBase> > m_deferredInstrumentedPointers; PassOwnPtr is supposed to be used for passing objects ownership only, you should use Vector<OwnPtr<...> > here.
Alexei Filippov
Comment 7 2012-06-27 03:55:55 PDT
Alexei Filippov
Comment 8 2012-07-02 05:48:16 PDT
Alexei Filippov
Comment 9 2012-07-02 05:53:22 PDT
Comment on attachment 149536 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149536&action=review >> Source/WebCore/dom/MemoryInstrumentation.h:120 >> +class MemoryInstrumentedPointerBase { > > I'd move these classes into MemoryInstrumentation as they are just implementation details. It would also allow us to give them shorter names. done >> Source/WebCore/inspector/InspectorMemoryAgent.cpp:476 >> + Vector<PassOwnPtr<MemoryInstrumentedPointerBase> > m_deferredInstrumentedPointers; > > PassOwnPtr is supposed to be used for passing objects ownership only, you should use Vector<OwnPtr<...> > here. done
WebKit Review Bot
Comment 10 2012-07-02 07:18:42 PDT
Comment on attachment 150405 [details] Patch Clearing flags on attachment: 150405 Committed r121677: <http://trac.webkit.org/changeset/121677>
WebKit Review Bot
Comment 11 2012-07-02 07:18:46 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.