Bug 113507

Summary: Web Inspector: add memory instrumentation for StringBuffer
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: Web Inspector (Deprecated)Assignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, benjamin, buildbot, cc-bugs, cmarcelo, jamesr, keishi, loislo, ojan.autocc, pfeldman, pmuellr, rniwa, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Yury Semikhatsky 2013-03-28 08:25:07 PDT
We see quite big blocks allocated by StringBuffer, they should be instrumented.
Comment 1 Yury Semikhatsky 2013-03-28 08:27:10 PDT
Created attachment 195572 [details]
Patch
Comment 2 Ilya Tikhonovsky 2013-03-28 08:55:39 PDT
Comment on attachment 195572 [details]
Patch

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

> Source/WTF/wtf/MemoryInstrumentationString.h:77
> +    MemoryClassInfo info(memoryObjectInfo, stringBuffer->characters(), 0, sizeof(CharType) * stringBuffer->length());

You have to report the address of stringBuffer and report characters() as the member.
if it is a part of memory chunk of stringBuilder then you need to calculate the size for stringBuilder explicitly.
See the instrumentation for String.
Comment 3 Build Bot 2013-03-28 09:02:39 PDT
Comment on attachment 195572 [details]
Patch

Attachment 195572 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/17358068
Comment 4 Yury Semikhatsky 2013-03-29 05:47:06 PDT
Created attachment 195730 [details]
Patch
Comment 5 Yury Semikhatsky 2013-03-29 05:47:42 PDT
(In reply to comment #2)
> (From update of attachment 195572 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=195572&action=review
> 
> > Source/WTF/wtf/MemoryInstrumentationString.h:77
> > +    MemoryClassInfo info(memoryObjectInfo, stringBuffer->characters(), 0, sizeof(CharType) * stringBuffer->length());
> 
> You have to report the address of stringBuffer and report characters() as the member.
> if it is a part of memory chunk of stringBuilder then you need to calculate the size for stringBuilder explicitly.
> See the instrumentation for String.

You're right. Fixed.
Comment 6 Ilya Tikhonovsky 2013-03-29 06:26:48 PDT
Comment on attachment 195730 [details]
Patch

please extract libjpeg change into a separate patch
Comment 7 Yury Semikhatsky 2013-03-29 06:52:43 PDT
Created attachment 195738 [details]
Patch
Comment 8 Ilya Tikhonovsky 2013-03-29 06:54:04 PDT
Comment on attachment 195738 [details]
Patch

LGTM
Comment 9 WebKit Review Bot 2013-04-01 02:39:49 PDT
Comment on attachment 195738 [details]
Patch

Clearing flags on attachment: 195738

Committed r147313: <http://trac.webkit.org/changeset/147313>
Comment 10 WebKit Review Bot 2013-04-01 02:39:54 PDT
All reviewed patches have been landed.  Closing bug.