RESOLVED FIXED95420
Use ASCIILiteral for DEFINE_STATIC_LOCAL string
https://bugs.webkit.org/show_bug.cgi?id=95420
Summary Use ASCIILiteral for DEFINE_STATIC_LOCAL string
Gyuyoung Kim
Reported 2012-08-29 22:12:53 PDT
As recommended by http://trac.webkit.org/wiki/EfficientStrings, WebKit needs to use ASCIILiteral for the string of DEFINE_STATIC_LOCAL.
Attachments
Patch (21.23 KB, patch)
2012-08-29 22:14 PDT, Gyuyoung Kim
no flags
Patch (16.27 KB, patch)
2012-08-29 22:42 PDT, Gyuyoung Kim
no flags
Gyuyoung Kim
Comment 1 2012-08-29 22:14:43 PDT
Gyuyoung Kim
Comment 2 2012-08-29 22:17:42 PDT
CC'ing Benjamin
Benjamin Poulain
Comment 3 2012-08-29 22:32:51 PDT
Comment on attachment 161400 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=161400&action=review r- because of the AtomicStrings. My apologies about that, I should have documented it earlier. It is very nice of you to update all the ports. > Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp:240 > + DEFINE_STATIC_LOCAL(AtomicString, Default, (ASCIILiteral("default"))); > + DEFINE_STATIC_LOCAL(AtomicString, Url, (ASCIILiteral("url"))); > + DEFINE_STATIC_LOCAL(AtomicString, Email, (ASIILiteral("email"))); > + DEFINE_STATIC_LOCAL(AtomicString, Password, (ASCIILiteral("password"))); > + DEFINE_STATIC_LOCAL(AtomicString, Web, (ASCIILiteral("web"))); > + DEFINE_STATIC_LOCAL(AtomicString, Number, (ASCIILiteral("number"))); > + DEFINE_STATIC_LOCAL(AtomicString, Symbol, (ASCIILiteral("symbol"))); > + DEFINE_STATIC_LOCAL(AtomicString, Phone, (ASCIILiteral("phone"))); > + DEFINE_STATIC_LOCAL(AtomicString, Pin, (ASCIILiteral("pin"))); > + DEFINE_STATIC_LOCAL(AtomicString, Hex, (ASCIILiteral("hexadecimal"))); AtomicString should not use ASCIILiteral, I updated the Wiki this afternoon. You should use the constructor with AtomicString::ConstructFromLiteral so that I can do more optimizations later for AtomicString. > Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp:295 > + DEFINE_STATIC_LOCAL(AtomicString, Default, (ASCIILiteral("default"))); > + DEFINE_STATIC_LOCAL(AtomicString, Connect, (ASCIILiteral("connect"))); > + DEFINE_STATIC_LOCAL(AtomicString, Done, (ASCIILiteral("done"))); > + DEFINE_STATIC_LOCAL(AtomicString, Go, (ASCIILiteral("go"))); > + DEFINE_STATIC_LOCAL(AtomicString, Join, (ASCIILiteral("join"))); > + DEFINE_STATIC_LOCAL(AtomicString, Next, (ASCIILiteral("next"))); > + DEFINE_STATIC_LOCAL(AtomicString, Search, (ASCIILiteral("search"))); > + DEFINE_STATIC_LOCAL(AtomicString, Send, (ASCIILiteral("send"))); > + DEFINE_STATIC_LOCAL(AtomicString, Submit, (ASCIILiteral("submit"))); Ditto. > Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp:99 > + DEFINE_STATIC_LOCAL(AtomicString, name, (ASCIILiteral("ContextFeaturesCache"))); Ditto. > Source/WebKit/gtk/webkit/webkitwebsettings.cpp:137 > - DEFINE_STATIC_LOCAL(const String, uaPlatform, (String(""))); > + DEFINE_STATIC_LOCAL(const String, uaPlatform, (ASCIILiteral(""))); Please leave this one as it is. There is no construction from literal for empty strings, it is gonna assert. I need to do some measurement to find the fastest way to initialize empty strings. I'll update the wiki as soon as I have the solution.
Gyuyoung Kim
Comment 4 2012-08-29 22:42:47 PDT
Gyuyoung Kim
Comment 5 2012-08-29 22:44:23 PDT
Thank you for your review. I would like to fix the stuff you pointed out in new bug.
Benjamin Poulain
Comment 6 2012-08-29 22:47:24 PDT
Comment on attachment 161403 [details] Patch Everything looks good.
WebKit Review Bot
Comment 7 2012-08-30 03:25:56 PDT
Comment on attachment 161403 [details] Patch Clearing flags on attachment: 161403 Committed r127121: <http://trac.webkit.org/changeset/127121>
WebKit Review Bot
Comment 8 2012-08-30 03:25:59 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.