[Webkit-unassigned] [Bug 31415] [v8] do not copy data twice when converting short v8 string into WebCore::String

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 12 11:11:16 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=31415





--- Comment #4 from anton muhin <antonm at chromium.org>  2009-11-12 11:11:16 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > Created an attachment (id=43070)
 --> (https://bugs.webkit.org/attachment.cgi?id=43070) [details] [details]
> > First take
> 
> LGTM.
> 
> 
> > +    static String convertFromV8(v8::Handle<v8::String> v8String, int length) {
> 
> ASSERT v8String->Length() == length.
> 
> > +        UChar* buffer;
> > +        String result = String::createUninitialized(length, buffer);
> > +        v8String->Write(reinterpret_cast<uint16_t*>(buffer), 0, length);
> > +        return result;
> > +    }
> 
> Perhaps add a comment that using an inline buffer doesn't make sense here to
> prevent future attempts to "optimize" this.

Done.

> > +    static AtomicString convertFromV8(v8::Handle<v8::String> v8String, int length) {
> 
> ASSERT v8String->Length() == length.

Done.

Thanks a lot for comments, Vitaly.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list