RESOLVED FIXED 99230
StringPrototype::jsSpliceSubstringsWithSeparators() doesn't optimally handle 8 bit strings
https://bugs.webkit.org/show_bug.cgi?id=99230
Summary StringPrototype::jsSpliceSubstringsWithSeparators() doesn't optimally handle ...
Michael Saboff
Reported 2012-10-12 18:33:00 PDT
jsSpliceSubstringsWithSeparators() handles the case where both the source an separators are all 8 bit strings, but doesn't handle when they are mixed sizes.
Attachments
Patch (2.27 KB, patch)
2012-10-12 18:36 PDT, Michael Saboff
no flags
Michael Saboff
Comment 1 2012-10-12 18:36:18 PDT
Eric Seidel (no email)
Comment 2 2012-10-15 12:51:33 PDT
Comment on attachment 168528 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168528&action=review > Source/JavaScriptCore/runtime/StringPrototype.cpp:404 > + StringImpl::copyChars(buffer + bufferPos, separators[i].characters8(), sepLen); > + else > + StringImpl::copyChars(buffer + bufferPos, separators[i].characters16(), sepLen); Why not just have a StringImpl::copyChars() which takes a StringImpl and does this if internally?
Michael Saboff
Comment 3 2012-10-16 16:17:52 PDT
(In reply to comment #2) > (From update of attachment 168528 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=168528&action=review > > > Source/JavaScriptCore/runtime/StringPrototype.cpp:404 > > + StringImpl::copyChars(buffer + bufferPos, separators[i].characters8(), sepLen); > > + else > > + StringImpl::copyChars(buffer + bufferPos, separators[i].characters16(), sepLen); > > Why not just have a StringImpl::copyChars() which takes a StringImpl and does this if internally? We would likely need a few flavors. This flavor would use the string length, but at least another one would need a string offset and a reduced length.
Geoffrey Garen
Comment 4 2012-10-17 14:48:19 PDT
Comment on attachment 168528 [details] Patch r=me
WebKit Review Bot
Comment 5 2012-10-17 14:54:47 PDT
Comment on attachment 168528 [details] Patch Clearing flags on attachment: 168528 Committed r131648: <http://trac.webkit.org/changeset/131648>
WebKit Review Bot
Comment 6 2012-10-17 14:54:51 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.