RESOLVED FIXED Bug 94571
[V8] Move String related code in V8Binding to a separate file
https://bugs.webkit.org/show_bug.cgi?id=94571
Summary [V8] Move String related code in V8Binding to a separate file
Kentaro Hara
Reported 2012-08-20 21:50:44 PDT
We can move V8Parameter, V8ParameterBase and String related code in V8Binding to a separate file.
Attachments
Patch (21.66 KB, patch)
2012-08-20 22:03 PDT, Kentaro Hara
no flags
patch for landing (21.64 KB, patch)
2012-08-21 03:21 PDT, Kentaro Hara
no flags
patch for landing (21.50 KB, patch)
2012-08-21 20:47 PDT, Kentaro Hara
no flags
Kentaro Hara
Comment 1 2012-08-20 22:03:35 PDT
Kentaro Hara
Comment 2 2012-08-20 22:07:21 PDT
I'll do the following things in follow-up patches: - Remove V8ParameterBase. It's redundant. Only V8Parameter will work. - Rename V8Parameter to V8GenericString, because it's an adapter class for String and AtomicString.
Adam Barth
Comment 3 2012-08-20 23:13:32 PDT
Comment on attachment 159618 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=159618&action=review > Source/WebCore/bindings/v8/V8StringResource.cpp:35 > + I'd remove this blank line. > Source/WebCore/bindings/v8/V8StringResource.cpp:52 > + String result = String::createUninitialized(length, buffer); Does this really use int as the type for length? > Source/WebCore/bindings/v8/V8StringResource.cpp:75 > + String tmp = String::createUninitialized(length, buffer); tmp -> string ? > Source/WebCore/bindings/v8/V8StringResource.cpp:88 > + int length = v8String->Length(); Oh, V8 uses int for the length of a string? > Source/WebCore/bindings/v8/V8StringResource.cpp:91 > + return StringImpl::empty(); Is this ok for background threads? Typically we can't use these sorts of functions if we're not on the main thread.
Kentaro Hara
Comment 4 2012-08-21 03:21:05 PDT
Created attachment 159640 [details] patch for landing
Kentaro Hara
Comment 5 2012-08-21 03:23:15 PDT
Kentaro Hara
Comment 6 2012-08-21 03:24:01 PDT
(In reply to comment #3) > (From update of attachment 159618 [details]) > > Source/WebCore/bindings/v8/V8StringResource.cpp:35 > > + > > I'd remove this blank line. > > > Source/WebCore/bindings/v8/V8StringResource.cpp:75 > > + String tmp = String::createUninitialized(length, buffer); > > tmp -> string ? > > > Source/WebCore/bindings/v8/V8StringResource.cpp:91 > > + return StringImpl::empty(); > > Is this ok for background threads? Typically we can't use these sorts of functions if we're not on the main thread. Done. Replaced with String().
WebKit Review Bot
Comment 7 2012-08-21 08:20:01 PDT
Re-opened since this is blocked by 94605
Kentaro Hara
Comment 8 2012-08-21 20:47:23 PDT
Created attachment 159852 [details] patch for landing
Kentaro Hara
Comment 9 2012-08-21 20:49:43 PDT
(In reply to comment #6) > > > Source/WebCore/bindings/v8/V8StringResource.cpp:91 > > > + return StringImpl::empty(); > > > > Is this ok for background threads? Typically we can't use these sorts of functions if we're not on the main thread. > > Replaced with String(). This was the cause of the crashes. I replaced it with String(""). Given that this is not a fast path of v8String(), it would be OK to create String("") every time.
WebKit Review Bot
Comment 10 2012-08-21 21:42:01 PDT
Comment on attachment 159852 [details] patch for landing Clearing flags on attachment: 159852 Committed r126262: <http://trac.webkit.org/changeset/126262>
WebKit Review Bot
Comment 11 2012-08-21 21:42:07 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.