• benjamin@webkit.org's avatar
    Replace JSC::UString by WTF::String · cff06e46
    benjamin@webkit.org authored
    Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-30
    Reviewed by Geoffrey Garen.
    Having JSC::UString and WTF::String increase the complexity of working on WebKit, and
    add useless conversions in the bindings. It also cause some code bloat.
    The performance advantages of UString have been ported over in previous patches. This patch
    is the last step: getting rid of UString.
    In addition to the simplified code, this also reduce the binary size by 15kb on x86_64.
    * API/OpaqueJSString.cpp:
    * runtime/Identifier.h:
    To avoid changing everything at once, the function named ustring() were kept as is. They
    will be renamed in a follow up patch.
    * runtime/JSString.h:
    Since JSValue::toString() already exist (and return the JSString), the direct accessor is renamed
    to ::toWTFString(). We may change ::string() to ::jsString() and ::toWTFString() to ::toString()
    in the future.
    * runtime/StringPrototype.cpp:
    (JSC::substituteBackreferencesSlow): Replace the use of UString::getCharacters<>() by String::getCharactersWithUpconvert<>().
    Update the code to use String instead of UString.
    On x86_64, this reduces the binary size by 22kb.
    Since it is no longer possible to differenciate JSC::jsString() and WebCore::jsString() by the input
    types, WebCore::jsString() is renated to WebCore::jsStringWithCache().
    Since the cache is using a PtrHash, JSC::jsString() is used in place of the old WebCore::jsString() when
    the string is generated locally. This is because the cache can never match in those cases.
    Replace UString by String.
    * WebCoreSupport/ClientExtension.cpp:
    * WebCoreSupport/PagePopupBlackBerry.cpp:
    Replace UString by String.
    * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
    * ewk/ewk_frame.cpp:
    Replace UString by String.
    * gdom/ConvertToGCharPrivate.h:
    Get rid of UString, replace it by String, and simplify the code when possible.
    On x86_64, this reduces the binary size by 7kb.
    * Plugins/Hosted/NetscapePluginHostProxy.mm:
    * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
    * Plugins/Hosted/ProxyInstance.mm:
    * WebView/WebFrame.mm:
    (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
    (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
    * WebView/WebScriptDebugDelegate.mm:
    (-[WebScriptCallFrame functionName]):
    (-[WebScriptCallFrame evaluateWebScript:]):
    * WebView/WebScriptDebugger.h:
    * WebView/WebScriptDebugger.mm:
    * WebView/WebView.mm:
    Replace UString by String.
    * Api/qwebelement.cpp:
    Replace UString by String.
    * WebFrame.cpp:
    * WebView.cpp:
    Update the #includes to use the correct types.
    * WebFrame.cpp:
    * WebView.cpp:
    Update to code to switch from UString to String.
    * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
    * WebProcess/Plugins/Netscape/JSNPMethod.h:
    * WebProcess/Plugins/Netscape/JSNPObject.cpp:
    * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
    * wtf/Platform.h: Useless edit to force a full build. This is needed for some bots for some reason.
    * wtf/text/WTFString.h: Export a symbol that was exported on UString and needed in WebCore.
    Add String::getCharactersWithUpconvert<>(), which is similar to String::getCharacters<>() but with the same
    behaviors as UString::getCharacters<>().
    String::getCharactersWithUpconvert<>() is useful when manipulating multiple strings, it allow writting code
    using 16bits characters if any of the input String is not 8bit.
    Get rid of UString.
    * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
    * gdb/webkit.py:
    Update the coding style to avoid mentioning a class that no longer exist.
    * coding/coding-style.html:
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Platform.h 32.2 KB