Replace JSC::UString by WTF::String
https://bugs.webkit.org/show_bug.cgi?id=95271
Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-30
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
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:
(OpaqueJSString::ustring):
* runtime/Identifier.h:
(JSC::Identifier::ustring):
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:
(JSC::JSString::string):
(JSC::JSValue::toWTFString):
(JSC::inlineJSValueNotStringtoString):
(JSC::JSValue::toWTFStringInline):
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<>().
Source/WebCore:
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.
Source/WebKit/blackberry:
Replace UString by String.
* WebCoreSupport/ClientExtension.cpp:
* WebCoreSupport/PagePopupBlackBerry.cpp:
(WebCore::PagePopupBlackBerry::installDomFunction):
Source/WebKit/efl:
Replace UString by String.
* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::sendWebIntentResponse):
* ewk/ewk_frame.cpp:
(ewk_frame_script_execute):
Source/WebKit/gtk:
Replace UString by String.
* gdom/ConvertToGCharPrivate.h:
(copyAsGchar):
Source/WebKit/mac:
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:
(identifierFromIdentifierRep):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::addValueToArray):
(WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyRuntimeMethod::create):
(WebKit::ProxyRuntimeMethod::finishCreation):
(WebKit::ProxyInstance::getPropertyNames):
(WebKit::ProxyInstance::methodsNamed):
(WebKit::ProxyInstance::fieldNamed):
* WebView/WebFrame.mm:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
* WebView/WebScriptDebugDelegate.mm:
(-[WebScriptCallFrame functionName]):
(-[WebScriptCallFrame evaluateWebScript:]):
* WebView/WebScriptDebugger.h:
(WTF):
(JSC):
(WebScriptDebugger):
* WebView/WebScriptDebugger.mm:
(toNSURL):
(WebScriptDebugger::sourceParsed):
* WebView/WebView.mm:
(aeDescFromJSValue):
Source/WebKit/qt:
Replace UString by String.
* Api/qwebelement.cpp:
(QWebElement::evaluateJavaScript):
Source/WebKit/win:
Replace UString by String.
* WebFrame.cpp:
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
* WebView.cpp:
(WebView::stringByEvaluatingJavaScriptFromString):
Source/WebKit/wx:
Update the #includes to use the correct types.
* WebFrame.cpp:
* WebView.cpp:
Source/WebKit2:
Update to code to switch from UString to String.
* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::JSNPMethod::finishCreation):
* WebProcess/Plugins/Netscape/JSNPMethod.h:
(WebKit::JSNPMethod::create):
(JSNPMethod):
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::npIdentifierFromIdentifier):
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::evaluate):
(WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
Source/WTF:
* 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.
Tools:
Get rid of UString.
* DumpRenderTree/efl/WorkQueueItemEfl.cpp:
* gdb/webkit.py:
(WTFStringPrinter.to_string):
(JSCIdentifierPrinter.to_string):
(JSCJSStringPrinter.to_string):
(add_pretty_printers):
Websites/webkit.org:
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
diff --git a/Source/JavaScriptCore/API/JSCallbackFunction.cpp b/Source/JavaScriptCore/API/JSCallbackFunction.cpp
index 59de186..0f63d3c 100644
--- a/Source/JavaScriptCore/API/JSCallbackFunction.cpp
+++ b/Source/JavaScriptCore/API/JSCallbackFunction.cpp
@@ -49,7 +49,7 @@
{
}
-void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const UString& name)
+void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
diff --git a/Source/JavaScriptCore/API/JSCallbackFunction.h b/Source/JavaScriptCore/API/JSCallbackFunction.h
index 40bef8c..50630b5 100644
--- a/Source/JavaScriptCore/API/JSCallbackFunction.h
+++ b/Source/JavaScriptCore/API/JSCallbackFunction.h
@@ -34,12 +34,12 @@
class JSCallbackFunction : public InternalFunction {
protected:
JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback);
- void finishCreation(JSGlobalData&, const UString& name);
+ void finishCreation(JSGlobalData&, const String& name);
public:
typedef InternalFunction Base;
- static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const UString& name)
+ static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const String& name)
{
JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
function->finishCreation(exec->globalData(), name);
diff --git a/Source/JavaScriptCore/API/JSCallbackObject.h b/Source/JavaScriptCore/API/JSCallbackObject.h
index 2c3e0e8..36d7fa9 100644
--- a/Source/JavaScriptCore/API/JSCallbackObject.h
+++ b/Source/JavaScriptCore/API/JSCallbackObject.h
@@ -171,7 +171,7 @@
static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags;
private:
- static UString className(const JSObject*);
+ static String className(const JSObject*);
static void destroy(JSCell*);
diff --git a/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h b/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
index 160f488..8326c05 100644
--- a/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
+++ b/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
@@ -111,10 +111,10 @@
}
template <class Parent>
-UString JSCallbackObject<Parent>::className(const JSObject* object)
+String JSCallbackObject<Parent>::className(const JSObject* object)
{
const JSCallbackObject* thisObject = jsCast<const JSCallbackObject*>(object);
- UString thisClassName = thisObject->classRef()->className();
+ String thisClassName = thisObject->classRef()->className();
if (!thisClassName.isEmpty())
return thisClassName;
diff --git a/Source/JavaScriptCore/API/JSClassRef.cpp b/Source/JavaScriptCore/API/JSClassRef.cpp
index 1344316..a95d42e 100644
--- a/Source/JavaScriptCore/API/JSClassRef.cpp
+++ b/Source/JavaScriptCore/API/JSClassRef.cpp
@@ -42,20 +42,6 @@
const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-static inline UString tryCreateStringFromUTF8(const char* string)
-{
- if (!string)
- return UString();
-
- size_t length = strlen(string);
- Vector<UChar, 1024> buffer(length);
- UChar* p = buffer.data();
- if (conversionOK != convertUTF8ToUTF16(&string, string + length, &p, p + length))
- return UString();
-
- return UString(buffer.data(), p - buffer.data());
-}
-
OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* protoClass)
: parentClass(definition->parentClass)
, prototypeClass(0)
@@ -70,14 +56,14 @@
, callAsConstructor(definition->callAsConstructor)
, hasInstance(definition->hasInstance)
, convertToType(definition->convertToType)
- , m_className(tryCreateStringFromUTF8(definition->className))
+ , m_className(String::fromUTF8(definition->className))
{
initializeThreading();
if (const JSStaticValue* staticValue = definition->staticValues) {
m_staticValues = adoptPtr(new OpaqueJSClassStaticValuesTable);
while (staticValue->name) {
- UString valueName = tryCreateStringFromUTF8(staticValue->name);
+ String valueName = String::fromUTF8(staticValue->name);
if (!valueName.isNull())
m_staticValues->set(valueName.impl(), adoptPtr(new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes)));
++staticValue;
@@ -87,7 +73,7 @@
if (const JSStaticFunction* staticFunction = definition->staticFunctions) {
m_staticFunctions = adoptPtr(new OpaqueJSClassStaticFunctionsTable);
while (staticFunction->name) {
- UString functionName = tryCreateStringFromUTF8(staticFunction->name);
+ String functionName = String::fromUTF8(staticFunction->name);
if (!functionName.isNull())
m_staticFunctions->set(functionName.impl(), adoptPtr(new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes)));
++staticFunction;
@@ -170,10 +156,10 @@
return *contextData;
}
-UString OpaqueJSClass::className()
+String OpaqueJSClass::className()
{
// Make a deep copy, so that the caller has no chance to put the original into IdentifierTable.
- return UString(m_className.characters(), m_className.length());
+ return m_className.isolatedCopy();
}
OpaqueJSClassStaticValuesTable* OpaqueJSClass::staticValues(JSC::ExecState* exec)
diff --git a/Source/JavaScriptCore/API/JSClassRef.h b/Source/JavaScriptCore/API/JSClassRef.h
index 82c7ab3..44d5d11 100644
--- a/Source/JavaScriptCore/API/JSClassRef.h
+++ b/Source/JavaScriptCore/API/JSClassRef.h
@@ -31,8 +31,8 @@
#include "Weak.h"
#include "JSObject.h"
#include "Protect.h"
-#include "UString.h"
#include <wtf/HashMap.h>
+#include <wtf/text/WTFString.h>
struct StaticValueEntry {
WTF_MAKE_FAST_ALLOCATED;
@@ -89,7 +89,7 @@
static PassRefPtr<OpaqueJSClass> createNoAutomaticPrototype(const JSClassDefinition*);
~OpaqueJSClass();
- JSC::UString className();
+ String className();
OpaqueJSClassStaticValuesTable* staticValues(JSC::ExecState*);
OpaqueJSClassStaticFunctionsTable* staticFunctions(JSC::ExecState*);
JSC::JSObject* prototype(JSC::ExecState*);
@@ -118,8 +118,8 @@
OpaqueJSClassContextData& contextData(JSC::ExecState*);
- // UStrings in these data members should not be put into any IdentifierTable.
- JSC::UString m_className;
+ // Strings in these data members should not be put into any IdentifierTable.
+ String m_className;
OwnPtr<OpaqueJSClassStaticValuesTable> m_staticValues;
OwnPtr<OpaqueJSClassStaticFunctionsTable> m_staticFunctions;
};
diff --git a/Source/JavaScriptCore/API/JSContextRef.cpp b/Source/JavaScriptCore/API/JSContextRef.cpp
index 7a57287..bae3101 100644
--- a/Source/JavaScriptCore/API/JSContextRef.cpp
+++ b/Source/JavaScriptCore/API/JSContextRef.cpp
@@ -35,7 +35,7 @@
#include "JSClassRef.h"
#include "JSGlobalObject.h"
#include "JSObject.h"
-#include "UStringBuilder.h"
+#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringHash.h>
#if OS(DARWIN)
@@ -167,9 +167,9 @@
JSLockHolder lock(exec);
unsigned count = 0;
- UStringBuilder builder;
+ StringBuilder builder;
CallFrame* callFrame = exec;
- UString functionName;
+ String functionName;
if (exec->callee()) {
if (asObject(exec->callee())->inherits(&InternalFunction::s_info)) {
functionName = asInternalFunction(exec->callee())->name(exec);
@@ -183,10 +183,10 @@
ASSERT(callFrame);
int signedLineNumber;
intptr_t sourceID;
- UString urlString;
+ String urlString;
JSValue function;
- UString levelStr = UString::number(count);
+ String levelStr = String::number(count);
exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function);
@@ -208,12 +208,12 @@
builder.append("() at ");
builder.append(urlString);
builder.append(":");
- builder.append(UString::number(lineNumber));
+ builder.append(String::number(lineNumber));
if (!function || ++count == maxStackSize)
break;
callFrame = callFrame->callerFrame();
}
- return OpaqueJSString::create(builder.toUString()).leakRef();
+ return OpaqueJSString::create(builder.toString()).leakRef();
}
diff --git a/Source/JavaScriptCore/API/JSStringRefCF.cpp b/Source/JavaScriptCore/API/JSStringRefCF.cpp
index 0877a13..e87fd83 100644
--- a/Source/JavaScriptCore/API/JSStringRefCF.cpp
+++ b/Source/JavaScriptCore/API/JSStringRefCF.cpp
@@ -30,7 +30,6 @@
#include "InitializeThreading.h"
#include "JSStringRef.h"
#include "OpaqueJSString.h"
-#include <runtime/UString.h>
#include <runtime/JSValue.h>
#include <wtf/OwnArrayPtr.h>
diff --git a/Source/JavaScriptCore/API/JSValueRef.cpp b/Source/JavaScriptCore/API/JSValueRef.cpp
index 9b7268a..0a11339 100644
--- a/Source/JavaScriptCore/API/JSValueRef.cpp
+++ b/Source/JavaScriptCore/API/JSValueRef.cpp
@@ -36,11 +36,11 @@
#include <runtime/LiteralParser.h>
#include <runtime/Operations.h>
#include <runtime/Protect.h>
-#include <runtime/UString.h>
#include <runtime/JSValue.h>
#include <wtf/Assertions.h>
#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
#include <algorithm> // for std::min
@@ -234,7 +234,7 @@
{
ExecState* exec = toJS(ctx);
APIEntryShim entryShim(exec);
- UString str = string->ustring();
+ String str = string->ustring();
if (str.is8Bit()) {
LiteralParser<LChar> parser(exec, str.characters8(), str.length(), StrictJSON);
return toRef(exec, parser.tryLiteralParse());
@@ -248,7 +248,7 @@
ExecState* exec = toJS(ctx);
APIEntryShim entryShim(exec);
JSValue value = toJS(exec, apiValue);
- UString result = JSONStringify(exec, value, indent);
+ String result = JSONStringify(exec, value, indent);
if (exception)
*exception = 0;
if (exec->hadException()) {
diff --git a/Source/JavaScriptCore/API/OpaqueJSString.cpp b/Source/JavaScriptCore/API/OpaqueJSString.cpp
index 9a116e6..cde57acd 100644
--- a/Source/JavaScriptCore/API/OpaqueJSString.cpp
+++ b/Source/JavaScriptCore/API/OpaqueJSString.cpp
@@ -32,18 +32,18 @@
using namespace JSC;
-PassRefPtr<OpaqueJSString> OpaqueJSString::create(const UString& ustring)
+PassRefPtr<OpaqueJSString> OpaqueJSString::create(const String& string)
{
- if (!ustring.isNull())
- return adoptRef(new OpaqueJSString(ustring.characters(), ustring.length()));
+ if (!string.isNull())
+ return adoptRef(new OpaqueJSString(string.characters(), string.length()));
return 0;
}
-UString OpaqueJSString::ustring() const
+String OpaqueJSString::ustring() const
{
if (this && m_characters)
- return UString(m_characters, m_length);
- return UString();
+ return String(m_characters, m_length);
+ return String();
}
Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
diff --git a/Source/JavaScriptCore/API/OpaqueJSString.h b/Source/JavaScriptCore/API/OpaqueJSString.h
index 1c63150..7e222c5 100644
--- a/Source/JavaScriptCore/API/OpaqueJSString.h
+++ b/Source/JavaScriptCore/API/OpaqueJSString.h
@@ -27,7 +27,7 @@
#define OpaqueJSString_h
#include <wtf/ThreadSafeRefCounted.h>
-#include <runtime/UString.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
class Identifier;
@@ -46,12 +46,13 @@
return adoptRef(new OpaqueJSString(characters, length));
}
- JS_EXPORT_PRIVATE static PassRefPtr<OpaqueJSString> create(const JSC::UString&);
+ JS_EXPORT_PRIVATE static PassRefPtr<OpaqueJSString> create(const String&);
UChar* characters() { return this ? m_characters : 0; }
unsigned length() { return this ? m_length : 0; }
- JSC::UString ustring() const;
+ // FIXME: rename to string().
+ String ustring() const;
JSC::Identifier identifier(JSC::JSGlobalData*) const;
private:
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 72f4213..272b73f 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -255,7 +255,6 @@
runtime/StructureChain.cpp
runtime/SymbolTable.cpp
runtime/TimeoutChecker.cpp
- runtime/UString.cpp
tools/CodeProfile.cpp
tools/CodeProfiling.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index aa6f1a5..7e41e4b 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,37 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ 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:
+ (OpaqueJSString::ustring):
+ * runtime/Identifier.h:
+ (JSC::Identifier::ustring):
+ 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:
+ (JSC::JSString::string):
+ (JSC::JSValue::toWTFString):
+ (JSC::inlineJSValueNotStringtoString):
+ (JSC::JSValue::toWTFStringInline):
+ 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<>().
+
2012-08-24 Mark Hahnenberg <mhahnenberg@apple.com>
Remove uses of ClassInfo in StrictEq and CompareEq in the DFG
diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am
index 0363fd6..979645e 100644
--- a/Source/JavaScriptCore/GNUmakefile.list.am
+++ b/Source/JavaScriptCore/GNUmakefile.list.am
@@ -658,10 +658,6 @@
Source/JavaScriptCore/runtime/TimeoutChecker.h \
Source/JavaScriptCore/runtime/Tracing.h \
Source/JavaScriptCore/runtime/Uint16WithFraction.h \
- Source/JavaScriptCore/runtime/UString.cpp \
- Source/JavaScriptCore/runtime/UString.h \
- Source/JavaScriptCore/runtime/UStringBuilder.h \
- Source/JavaScriptCore/runtime/UStringConcatenate.h \
Source/JavaScriptCore/runtime/WeakGCMap.h \
Source/JavaScriptCore/runtime/WeakRandom.h \
Source/JavaScriptCore/runtime/WriteBarrier.h \
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 9d8d015..856f71b 100755
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -24,12 +24,8 @@
??0StringObject@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z
??0Structure@JSC@@AAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@VJSValue@1@ABVTypeInfo@1@PBUClassInfo@1@@Z
??0ThreadCondition@WTF@@QAE@XZ
- ??0UString@JSC@@QAE@PBD@Z
- ??0UString@JSC@@QAE@PBDI@Z
- ??0UString@JSC@@QAE@PB_W@Z
- ??0UString@JSC@@QAE@PB_WI@Z
??0WTFThreadData@WTF@@QAE@XZ
- ??0YarrPattern@Yarr@JSC@@QAE@ABVUString@2@_N1PAPBD@Z
+ ??0YarrPattern@Yarr@JSC@@QAE@ABVString@WTF@@_N1PAPBD@Z
??1ArrayBufferView@WTF@@UAE@XZ
??1ClientData@JSGlobalData@JSC@@UAE@XZ
??1Collator@WTF@@QAE@XZ
@@ -44,7 +40,6 @@
??1ThreadCondition@WTF@@QAE@XZ
??1WTFThreadData@WTF@@QAE@XZ
??1WeakHandleOwner@JSC@@UAE@XZ
- ??8JSC@@YA_NABVUString@0@0@Z
??8WTF@@YA_NABVCString@0@0@Z
?EcmaScriptConverter@DoubleToStringConverter@double_conversion@WTF@@SAABV123@XZ
?StringToDouble@StringToDoubleConverter@double_conversion@WTF@@SANPBDIPAI@Z
@@ -71,7 +66,6 @@
?allocateSlowCase@MarkedAllocator@JSC@@AAEPAXXZ
?append@StringBuilder@WTF@@QAEXPBEI@Z
?append@StringBuilder@WTF@@QAEXPB_WI@Z
- ?ascii@UString@JSC@@QBE?AVCString@WTF@@XZ
?attach@Debugger@JSC@@QAEXPAVJSGlobalObject@2@@Z
?base64Decode@WTF@@YA_NABVString@1@AAV?$Vector@D$0A@@1@W4Base64DecodePolicy@1@@Z
?base64Encode@WTF@@YA?AVString@1@PBDIW4Base64EncodePolicy@1@@Z
@@ -84,7 +78,7 @@
?calculateDSTOffset@WTF@@YANNN@Z
?calculateStringHashAndLengthFromUTF8MaskingTop8Bits@Unicode@WTF@@YAIPBD0AAI1@Z
?calculateUTCOffset@WTF@@YAHXZ
- ?calculatedFunctionName@DebuggerCallFrame@JSC@@QBE?AVUString@2@XZ
+ ?calculatedFunctionName@DebuggerCallFrame@JSC@@QBE?AVString@WTF@@XZ
?call@JSC@@YA?AVJSValue@1@PAVExecState@1@V21@W4CallType@1@ABTCallData@1@1ABVArgList@1@@Z
?callHostFunctionAsConstructor@JSC@@YI_JPAVExecState@1@@Z
?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
@@ -97,7 +91,7 @@
?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z
?checkSyntax@JSC@@YA_NPAVExecState@1@ABVSourceCode@1@PAVJSValue@1@@Z
?checksum@MD5@WTF@@QAEXAAV?$Vector@E$0BA@@2@@Z
- ?className@JSObject@JSC@@SA?AVUString@2@PBV12@@Z
+ ?className@JSObject@JSC@@SA?AVString@WTF@@PBV12@@Z
?clear@SourceProviderCache@JSC@@QAEXXZ
?clearRareData@JSGlobalObject@JSC@@CAXPAVJSCell@2@@Z
?collate@Collator@WTF@@QBE?AW4Result@12@PB_WI0I@Z
@@ -107,31 +101,30 @@
?construct@JSC@@YAPAVJSObject@1@PAVExecState@1@VJSValue@1@W4ConstructType@1@ABTConstructData@1@ABVArgList@1@@Z
?constructArray@JSC@@YAPAVJSArray@1@PAVExecState@1@ABVArgList@1@@Z
?constructEmptyObject@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
- ?constructFunctionSkippingEvalEnabledCheck@JSC@@YAPAVJSObject@1@PAVExecState@1@PAVJSGlobalObject@1@ABVArgList@1@ABVIdentifier@1@ABVUString@1@ABVTextPosition@WTF@@@Z
+ ?constructFunctionSkippingEvalEnabledCheck@JSC@@YAPAVJSObject@1@PAVExecState@1@PAVJSGlobalObject@1@ABVArgList@1@ABVIdentifier@1@ABVString@WTF@@ABVTextPosition@8@@Z
?constructNumber@JSC@@YAPAVNumberObject@1@PAVExecState@1@PAVJSGlobalObject@1@VJSValue@1@@Z
?constructString@JSC@@YAPAVStringObject@1@PAVExecState@1@PAVJSGlobalObject@1@VJSValue@1@@Z
?convertLatin1ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBEPBEPAPADPAD@Z
?convertUTF16ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPB_WPB_WPAPADPAD_N@Z
?convertUTF8ToUTF16@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBDPBDPAPA_WPA_W_N@Z
- ?create@JSFunction@JSC@@SAPAV12@PAVExecState@2@PAVJSGlobalObject@2@HABVUString@2@P6I_J0@ZW4Intrinsic@2@3@Z
+ ?create@JSFunction@JSC@@SAPAV12@PAVExecState@2@PAVJSGlobalObject@2@HABVString@WTF@@P6I_J0@ZW4Intrinsic@2@3@Z
?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@W4HeapType@2@@Z
- ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVUString@JSC@@@Z
- ?create@RegExp@JSC@@SAPAV12@AAVJSGlobalData@2@ABVUString@2@W4RegExpFlags@2@@Z
+ ?create@RegExp@JSC@@SAPAV12@AAVJSGlobalData@2@ABVString@WTF@@W4RegExpFlags@2@@Z
?createEmptyString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@@Z
- ?createError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
+ ?createError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
?createInterruptedExecutionException@JSC@@YAPAVJSObject@1@PAVJSGlobalData@1@@Z
?createLeaked@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@W4HeapType@2@@Z
?createNotEnoughArgumentsError@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
- ?createRangeError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
- ?createReferenceError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
+ ?createRangeError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
+ ?createReferenceError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
?createSingleCharacterString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@E@Z
?createStackOverflowError@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
- ?createSyntaxError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
+ ?createSyntaxError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
?createTable@HashTable@JSC@@ABEXPAVJSGlobalData@2@@Z
?createThread@WTF@@YAIP6APAXPAX@Z0@Z
?createThread@WTF@@YAIP6APAXPAX@Z0PBD@Z
?createThread@WTF@@YAIP6AXPAX@Z0PBD@Z
- ?createTypeError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
+ ?createTypeError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
?cryptographicallyRandomNumber@WTF@@YAIXZ
?cryptographicallyRandomValues@WTF@@YAXPAXI@Z
?currentThread@WTF@@YAIXZ
@@ -164,7 +157,7 @@
?detachThread@WTF@@YAXI@Z
?didTimeOut@TimeoutChecker@JSC@@QAE_NPAVExecState@2@@Z
?deleteAllCompiledCode@Heap@JSC@@QAEXXZ
- ?displayName@JSFunction@JSC@@QAE?BVUString@2@PAVExecState@2@@Z
+ ?displayName@JSFunction@JSC@@QAE?BVString@WTF@@PAVExecState@2@@Z
?dtoa@WTF@@YAXQADNAA_NAAHAAI@Z
?dumpAllOptions@Options@JSC@@SAXPAU_iobuf@@@Z
?dumpCallFrame@Interpreter@JSC@@QAEXPAVExecState@2@@Z
@@ -172,7 +165,7 @@
?empty@StringImpl@WTF@@SAPAV12@XZ
?enumerable@PropertyDescriptor@JSC@@QBE_NXZ
?equalUTF16WithUTF8@Unicode@WTF@@YA_NPB_W0PBD1@Z
- ?evaluate@DebuggerCallFrame@JSC@@QBE?AVJSValue@2@ABVUString@2@AAV32@@Z
+ ?evaluate@DebuggerCallFrame@JSC@@QBE?AVJSValue@2@ABVString@WTF@@AAV32@@Z
?evaluate@JSC@@YA?AVJSValue@1@PAVExecState@1@PAVScopeChainNode@1@ABVSourceCode@1@V21@PAV21@@Z
?exclude@Profile@JSC@@QAEXPBVProfileNode@2@@Z
?execute@ParallelEnvironment@WTF@@QAEXPAX@Z
@@ -191,7 +184,7 @@
?findAllocator@WeakSet@JSC@@AAEPAUFreeCell@WeakBlock@2@XZ
?finishCreation@BooleanObject@JSC@@IAEXAAVJSGlobalData@2@@Z
?finishCreation@DateInstance@JSC@@IAEXAAVJSGlobalData@2@N@Z
- ?finishCreation@InternalFunction@JSC@@IAEXAAVJSGlobalData@2@ABVUString@2@@Z
+ ?finishCreation@InternalFunction@JSC@@IAEXAAVJSGlobalData@2@ABVString@WTF@@@Z
?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@I@Z
?finishCreation@RegExpObject@JSC@@IAEXPAVJSGlobalObject@2@@Z
?finishCreation@StringObject@JSC@@IAEXAAVJSGlobalData@2@PAVJSString@2@@Z
@@ -200,8 +193,7 @@
?from@Identifier@JSC@@SA?AV12@PAVExecState@2@H@Z
?from@Identifier@JSC@@SA?AV12@PAVExecState@2@I@Z
?functionGetter@PropertySlot@JSC@@ABE?AVJSValue@2@PAVExecState@2@@Z
- ?functionName@DebuggerCallFrame@JSC@@QBEPBVUString@2@XZ
- ?getCalculatedDisplayName@JSC@@YA?AVUString@1@PAVExecState@1@PAVJSObject@1@@Z
+ ?getCalculatedDisplayName@JSC@@YA?AVString@WTF@@PAVExecState@1@PAVJSObject@1@@Z
?getCallData@JSCell@JSC@@SA?AW4CallType@2@PAV12@AATCallData@2@@Z
?getCallableObjectSlow@JSC@@YAPAVJSCell@1@PAV21@@Z
?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z
@@ -216,8 +208,8 @@
?getPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
?getSlice@ArgList@JSC@@QBEXHAAV12@@Z
?getStackTrace@Interpreter@JSC@@SAXPAVJSGlobalData@2@AAV?$Vector@UStackFrame@JSC@@$0A@@WTF@@@Z
- ?getString@JSCell@JSC@@QBE?AVUString@2@PAVExecState@2@@Z
- ?getString@JSCell@JSC@@QBE_NPAVExecState@2@AAVUString@2@@Z
+ ?getString@JSCell@JSC@@QBE?AVString@WTF@@PAVExecState@2@@Z
+ ?getString@JSCell@JSC@@QBE_NPAVExecState@2@AAVString@WTF@@@Z
?get@Structure@JSC@@QAEHAAVJSGlobalData@2@VPropertyName@2@AAIAAPAVJSCell@2@@Z
?getter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ
?globalExec@JSGlobalObject@JSC@@QAEPAVExecState@2@XZ
@@ -236,7 +228,7 @@
?initializeMainThread@WTF@@YAXXZ
?initializeThreading@JSC@@YAXXZ
?initializeThreading@WTF@@YAXXZ
- ?interpret@Yarr@JSC@@YAIPAUBytecodePattern@12@ABVUString@2@IPAI@Z
+ ?interpret@Yarr@JSC@@YAIPAUBytecodePattern@12@ABVString@WTF@@IPAI@Z
?isAccessorDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
?isBusy@Heap@JSC@@QAE_NXZ
?isDataDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
@@ -246,19 +238,16 @@
?isTerminatedExecutionException@JSC@@YA_NVJSValue@1@@Z
?isValidAllocation@Heap@JSC@@AAE_NI@Z
?isValidCallee@JSValue@JSC@@QAE_NXZ
- ?jsOwnedString@JSC@@YAPAVJSString@1@PAVJSGlobalData@1@ABVUString@1@@Z
- ?jsString@JSC@@YAPAVJSString@1@PAVJSGlobalData@1@ABVUString@1@@Z
?length@CString@WTF@@QBEIXZ
?lock@JSLock@JSC@@QAEXXZ
?lock@Mutex@WTF@@QAEXXZ
?lockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
- ?match@RegExp@JSC@@QAEHAAVJSGlobalData@2@ABVUString@2@IAAV?$Vector@H$0CA@@WTF@@@Z
+ ?match@RegExp@JSC@@QAEHAAVJSGlobalData@2@ABVString@WTF@@IAAV?$Vector@H$0CA@@5@@Z
?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z
?monotonicallyIncreasingTime@WTF@@YANXZ
?monthFromDayInYear@WTF@@YAHH_N@Z
?msToYear@WTF@@YAHN@Z
- ?name@InternalFunction@JSC@@QAEABVUString@2@PAVExecState@2@@Z
- ?name@JSFunction@JSC@@QAEABVUString@2@PAVExecState@2@@Z
+ ?name@JSFunction@JSC@@QAEABVString@WTF@@PAVExecState@2@@Z
?neuter@ArrayBufferView@WTF@@MAEXXZ
?newUninitialized@CString@WTF@@SA?AV12@IAAPAD@Z
?notifyWriteSlow@SymbolTableEntry@JSC@@AAEXXZ
@@ -293,7 +282,7 @@
?putDirectVirtual@JSObject@JSC@@SAXPAV12@PAVExecState@2@VPropertyName@2@VJSValue@2@I@Z
?randomNumber@WTF@@YANXZ
?recompileAllJSFunctions@Debugger@JSC@@QAEXPAVJSGlobalData@2@@Z
- ?regExpFlags@JSC@@YA?AW4RegExpFlags@1@ABVUString@1@@Z
+ ?regExpFlags@JSC@@YA?AW4RegExpFlags@1@ABVString@WTF@@@Z
?reifyString@StringBuilder@WTF@@ABEXXZ
?releaseDecommitted@OSAllocator@WTF@@SAXPAXI@Z
?releaseExecutableMemory@JSGlobalData@JSC@@QAEXXZ
@@ -310,7 +299,7 @@
?resolveRope@JSRopeString@JSC@@ABEXPAVExecState@2@@Z
?restoreAll@Profile@JSC@@QAEXXZ
?retrieveCallerFromVMCode@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z
- ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z
+ ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVString@WTF@@AAVJSValue@2@@Z
?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z
?setDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@I@Z
?setDumpsGeneratedCode@BytecodeGenerator@JSC@@SAX_N@Z
@@ -337,11 +326,10 @@
?slowValidateCell@JSC@@YAXPAVJSCell@1@@Z
?slowValidateCell@JSC@@YAXPAVJSGlobalObject@1@@Z
?sourceCode@JSFunction@JSC@@QBEPBVSourceCode@2@XZ
- ?startProfiling@Profiler@JSC@@QAEXPAVExecState@2@ABVUString@2@@Z
+ ?startProfiling@Profiler@JSC@@QAEXPAVExecState@2@ABVString@WTF@@@Z
?startSampling@JSGlobalData@JSC@@QAEXXZ
- ?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z
+ ?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVString@4@@Z
?stopSampling@JSGlobalData@JSC@@QAEXXZ
- ?substringSharingImpl@UString@JSC@@QBE?AV12@II@Z
?suggestedNewOutOfLineStorageCapacity@Structure@JSC@@QAEIXZ
?sweeper@Heap@JSC@@QAEPAVIncrementalSweeper@2@XZ
?synthesizePrototype@JSValue@JSC@@QBEPAVJSObject@2@PAVExecState@2@@Z
@@ -350,7 +338,7 @@
?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@PAV21@@Z
?throwSyntaxError@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
?throwTypeError@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
- ?throwTypeError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
+ ?throwTypeError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVString@WTF@@@Z
?timedWait@ThreadCondition@WTF@@QAE_NAAVMutex@2@N@Z
?tlsKeyCount@WTF@@YAAAJXZ
?tlsKeys@WTF@@YAPAKXZ
@@ -366,6 +354,7 @@
?toStringSlowCase@JSValue@JSC@@ABEPAVJSString@2@PAVExecState@2@@Z
?toThisObject@JSObject@JSC@@SAPAV12@PAVJSCell@2@PAVExecState@2@@Z
?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
+ ?toWTFStringSlowCase@JSValue@JSC@@ABE?AVString@WTF@@PAVExecState@2@@Z
?transfer@ArrayBuffer@WTF@@QAE_NAAVArrayBufferContents@2@AAV?$Vector@V?$RefPtr@VArrayBufferView@WTF@@@WTF@@$0A@@2@@Z
?tryFastCalloc@WTF@@YA?AUTryMallocReturnValue@1@II@Z
?tryFastMalloc@WTF@@YA?AUTryMallocReturnValue@1@I@Z
@@ -377,7 +366,6 @@
?unlock@Mutex@WTF@@QAEXXZ
?unlockAtomicallyInitializedStaticMutex@WTF@@YAXXZ
?unprotect@Heap@JSC@@QAE_NVJSValue@2@@Z
- ?utf8@UString@JSC@@QBE?AVCString@WTF@@_N@Z
?validate@MarkStack@JSC@@KAXPAVJSCell@2@@Z
?visitChildren@JSGlobalObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
?visitChildren@JSGlobalThis@JSC@@KAXPAVJSCell@2@AAVSlotVisitor@2@@Z
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 32b17a8..cec658b 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -1294,26 +1294,6 @@
>
</File>
<File
- RelativePath="..\..\runtime\UString.cpp"
- >
- </File>
- <File
- RelativePath="..\..\runtime\UString.h"
- >
- </File>
- <File
- RelativePath="..\..\runtime\UStringBuilder.h"
- >
- </File>
- <File
- RelativePath="..\..\runtime\UStringConcatenate.h"
- >
- </File>
- <File
- RelativePath="..\..\runtime\UStringImpl.h"
- >
- </File>
- <File
RelativePath="..\..\runtime\WeakGCMap.h"
>
</File>
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 00859b8..d3db618 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -58,7 +58,6 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
- 08DDA5C11264631700751732 /* UStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 08DDA5BB12645F1D00751732 /* UStringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0776BD14FF002800102332 /* JITCompilationEffort.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0B839A14BCF45D00885B4F /* LLIntEntrypoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B839514BCF45A00885B4F /* LLIntEntrypoints.cpp */; };
0F0B839B14BCF46000885B4F /* LLIntEntrypoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B839614BCF45A00885B4F /* LLIntEntrypoints.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -331,7 +330,6 @@
14469DEB107EC7E700650446 /* StringConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */; };
14469DEC107EC7E700650446 /* StringObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C20E16EE3300B34460 /* StringObject.cpp */; };
14469DED107EC7E700650446 /* StringPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C50E16EE3300B34460 /* StringPrototype.cpp */; };
- 14469DEE107EC7E700650446 /* UString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8850255597D01FF60F7 /* UString.cpp */; };
144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */ = {isa = PBXBuildFile; fileRef = 149DAAF212EB559D0083B12B /* ConservativeRoots.h */; settings = {ATTRIBUTES = (Private, ); }; };
145722861437E140005FDE26 /* StrongInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 145722851437E140005FDE26 /* StrongInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
146AAB380B66A94400E55F16 /* JSStringRefCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */; };
@@ -663,7 +661,6 @@
BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C30E16EE3300B34460 /* StringObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C46A0E16F5CD00B34460 /* StringPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C60E16EE3300B34460 /* StringPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C46B0E16F5CD00B34460 /* SymbolTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A396A60CD2933100B5B4FF /* SymbolTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
- BC18C4760E16F5CD00B34460 /* UString.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8860255597D01FF60F7 /* UString.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
BC18C5240E16FC8A00B34460 /* ArrayPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */; };
BC18C5260E16FCA700B34460 /* StringPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5250E16FCA700B34460 /* StringPrototype.lut.h */; };
@@ -817,8 +814,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 0896C29B1265AAF600B1CDD3 /* UStringConcatenate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringConcatenate.h; sourceTree = "<group>"; };
- 08DDA5BB12645F1D00751732 /* UStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringBuilder.h; sourceTree = "<group>"; };
0F0776BD14FF002800102332 /* JITCompilationEffort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCompilationEffort.h; sourceTree = "<group>"; };
0F0B839514BCF45A00885B4F /* LLIntEntrypoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntEntrypoints.cpp; path = llint/LLIntEntrypoints.cpp; sourceTree = "<group>"; };
0F0B839614BCF45A00885B4F /* LLIntEntrypoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntEntrypoints.h; path = llint/LLIntEntrypoints.h; sourceTree = "<group>"; };
@@ -1518,8 +1513,6 @@
F692A87C0255597D01FF60F7 /* RegExpObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RegExpObject.h; sourceTree = "<group>"; tabWidth = 8; };
F692A87D0255597D01FF60F7 /* RegExp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExp.cpp; sourceTree = "<group>"; tabWidth = 8; };
F692A87E0255597D01FF60F7 /* RegExp.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RegExp.h; sourceTree = "<group>"; tabWidth = 8; };
- F692A8850255597D01FF60F7 /* UString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UString.cpp; sourceTree = "<group>"; tabWidth = 8; };
- F692A8860255597D01FF60F7 /* UString.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = UString.h; sourceTree = "<group>"; tabWidth = 8; };
F692A8870255597D01FF60F7 /* JSValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSValue.cpp; sourceTree = "<group>"; tabWidth = 8; };
FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMInspector.cpp; sourceTree = "<group>"; };
FE4A331E15BD2E07006F54F3 /* VMInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspector.h; sourceTree = "<group>"; };
@@ -2235,10 +2228,6 @@
5D53726D0E1C546B0021E549 /* Tracing.d */,
5D53726E0E1C54880021E549 /* Tracing.h */,
866739D113BFDE710023D87C /* Uint16WithFraction.h */,
- F692A8850255597D01FF60F7 /* UString.cpp */,
- F692A8860255597D01FF60F7 /* UString.h */,
- 08DDA5BB12645F1D00751732 /* UStringBuilder.h */,
- 0896C29B1265AAF600B1CDD3 /* UStringConcatenate.h */,
14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */,
1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */,
A7DCB77912E3D90500911940 /* WriteBarrier.h */,
@@ -2786,8 +2775,6 @@
5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
866739D313BFDE710023D87C /* Uint16WithFraction.h in Headers */,
0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */,
- BC18C4760E16F5CD00B34460 /* UString.h in Headers */,
- 08DDA5C11264631700751732 /* UStringBuilder.h in Headers */,
0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */,
@@ -3433,7 +3420,6 @@
BCCF0D0C0EF0B8A500413C8F /* StructureStubInfo.cpp in Sources */,
A7386555118697B400540279 /* ThunkGenerators.cpp in Sources */,
14A42E3F0F4F60EE00599099 /* TimeoutChecker.cpp in Sources */,
- 14469DEE107EC7E700650446 /* UString.cpp in Sources */,
0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */,
0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
86704B8412DBA33700A9FE7B /* YarrInterpreter.cpp in Sources */,
diff --git a/Source/JavaScriptCore/Target.pri b/Source/JavaScriptCore/Target.pri
index e5af1f7..5453a8e 100644
--- a/Source/JavaScriptCore/Target.pri
+++ b/Source/JavaScriptCore/Target.pri
@@ -255,7 +255,6 @@
runtime/Structure.cpp \
runtime/SymbolTable.cpp \
runtime/TimeoutChecker.cpp \
- runtime/UString.cpp \
tools/CodeProfile.cpp \
tools/CodeProfiling.cpp \
yarr/YarrJIT.cpp \
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 06be770..5bfe9d0 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -45,7 +45,6 @@
#include "LowLevelInterpreter.h"
#include "MethodCallLinkStatus.h"
#include "RepatchBuffer.h"
-#include "UStringConcatenate.h"
#include <stdio.h>
#include <wtf/StringExtras.h>
#include <wtf/UnusedParam.h>
@@ -62,36 +61,36 @@
using namespace DFG;
#endif
-static UString escapeQuotes(const UString& str)
+static String escapeQuotes(const String& str)
{
- UString result = str;
+ String result = str;
size_t pos = 0;
while ((pos = result.find('\"', pos)) != notFound) {
- result = makeUString(result.substringSharingImpl(0, pos), "\"\\\"\"", result.substringSharingImpl(pos + 1));
+ result = makeString(result.substringSharingImpl(0, pos), "\"\\\"\"", result.substringSharingImpl(pos + 1));
pos += 4;
}
return result;
}
-static UString valueToSourceString(ExecState* exec, JSValue val)
+static String valueToSourceString(ExecState* exec, JSValue val)
{
if (!val)
return "0";
if (val.isString())
- return makeUString("\"", escapeQuotes(val.toString(exec)->value(exec)), "\"");
+ return makeString("\"", escapeQuotes(val.toString(exec)->value(exec)), "\"");
return val.description();
}
static CString constantName(ExecState* exec, int k, JSValue value)
{
- return makeUString(valueToSourceString(exec, value), "(@k", UString::number(k - FirstConstantRegisterIndex), ")").utf8();
+ return makeString(valueToSourceString(exec, value), "(@k", String::number(k - FirstConstantRegisterIndex), ")").utf8();
}
static CString idName(int id0, const Identifier& ident)
{
- return makeUString(ident.ustring(), "(@id", UString::number(id0), ")").utf8();
+ return makeString(ident.ustring(), "(@id", String::number(id0), ")").utf8();
}
void CodeBlock::dumpBytecodeCommentAndNewLine(int location)
@@ -114,10 +113,10 @@
if (isConstantRegisterIndex(r))
return constantName(exec, r, getConstant(r));
- return makeUString("r", UString::number(r)).utf8();
+ return makeString("r", String::number(r)).utf8();
}
-static UString regexpToSourceString(RegExp* regExp)
+static String regexpToSourceString(RegExp* regExp)
{
char postfix[5] = { '/', 0, 0, 0, 0 };
int index = 1;
@@ -128,15 +127,15 @@
if (regExp->multiline())
postfix[index] = 'm';
- return makeUString("/", regExp->pattern(), postfix);
+ return makeString("/", regExp->pattern(), postfix);
}
static CString regexpName(int re, RegExp* regexp)
{
- return makeUString(regexpToSourceString(regexp), "(@re", UString::number(re), ")").utf8();
+ return makeString(regexpToSourceString(regexp), "(@re", String::number(re), ")").utf8();
}
-static UString pointerToSourceString(void* p)
+static String pointerToSourceString(void* p)
{
char buffer[2 + 2 * sizeof(void*) + 1]; // 0x [two characters per byte] \0
snprintf(buffer, sizeof(buffer), "%p", p);
@@ -642,7 +641,7 @@
continue;
ASSERT(!((i + m_rareData->m_characterSwitchJumpTables[i].min) & ~0xFFFF));
UChar ch = static_cast<UChar>(entry + m_rareData->m_characterSwitchJumpTables[i].min);
- dataLog("\t\t\"%s\" => %04d\n", UString(&ch, 1).utf8().data(), *iter);
+ dataLog("\t\t\"%s\" => %04d\n", String(&ch, 1).utf8().data(), *iter);
}
dataLog(" }\n");
++i;
@@ -656,7 +655,7 @@
dataLog(" %1d = {\n", i);
StringJumpTable::StringOffsetTable::const_iterator end = m_rareData->m_stringSwitchJumpTables[i].offsetTable.end();
for (StringJumpTable::StringOffsetTable::const_iterator iter = m_rareData->m_stringSwitchJumpTables[i].offsetTable.begin(); iter != end; ++iter)
- dataLog("\t\t\"%s\" => %04d\n", UString(iter->first).utf8().data(), iter->second.branchOffset);
+ dataLog("\t\t\"%s\" => %04d\n", String(iter->first).utf8().data(), iter->second.branchOffset);
dataLog(" }\n");
++i;
} while (i < m_rareData->m_stringSwitchJumpTables.size());
@@ -3002,12 +3001,12 @@
return false;
}
-UString CodeBlock::nameForRegister(int registerNumber)
+String CodeBlock::nameForRegister(int registerNumber)
{
SymbolTable::iterator end = m_symbolTable->end();
for (SymbolTable::iterator ptr = m_symbolTable->begin(); ptr != end; ++ptr) {
if (ptr->second.getIndex() == registerNumber)
- return UString(ptr->first);
+ return String(ptr->first);
}
if (needsActivation() && registerNumber == activationRegister())
return "activation";
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index 4a5080b..a64fd6d 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -64,7 +64,6 @@
#include "Nodes.h"
#include "RegExpObject.h"
#include "StructureStubInfo.h"
-#include "UString.h"
#include "UnconditionalFinalizer.h"
#include "ValueProfile.h"
#include "Watchpoint.h"
@@ -75,6 +74,7 @@
#include <wtf/RefPtr.h>
#include <wtf/SegmentedVector.h>
#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
// Set ENABLE_BYTECODE_COMMENTS to 1 to enable recording bytecode generator
// comments for the bytecodes that it generates. This will allow
@@ -583,7 +583,7 @@
void clearEvalCache();
- UString nameForRegister(int registerNumber);
+ String nameForRegister(int registerNumber);
void addPropertyAccessInstruction(unsigned propertyAccessInstruction)
{
diff --git a/Source/JavaScriptCore/bytecode/EvalCodeCache.h b/Source/JavaScriptCore/bytecode/EvalCodeCache.h
index 6c1bb97..88e9e5c 100644
--- a/Source/JavaScriptCore/bytecode/EvalCodeCache.h
+++ b/Source/JavaScriptCore/bytecode/EvalCodeCache.h
@@ -34,7 +34,6 @@
#include "Nodes.h"
#include "Parser.h"
#include "SourceCode.h"
-#include "UString.h"
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
#include <wtf/text/StringHash.h>
@@ -45,14 +44,14 @@
class EvalCodeCache {
public:
- EvalExecutable* tryGet(bool inStrictContext, const UString& evalSource, ScopeChainNode* scopeChain)
+ EvalExecutable* tryGet(bool inStrictContext, const String& evalSource, ScopeChainNode* scopeChain)
{
if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && scopeChain->begin()->isVariableObject())
return m_cacheMap.get(evalSource.impl()).get();
return 0;
}
- EvalExecutable* getSlow(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue)
+ EvalExecutable* getSlow(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const String& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue)
{
EvalExecutable* evalExecutable = EvalExecutable::create(exec, makeSource(evalSource), inStrictContext);
exceptionValue = evalExecutable->compile(exec, scopeChain);
@@ -65,7 +64,7 @@
return evalExecutable;
}
- EvalExecutable* get(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue)
+ EvalExecutable* get(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const String& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue)
{
EvalExecutable* evalExecutable = tryGet(inStrictContext, evalSource, scopeChain);
diff --git a/Source/JavaScriptCore/bytecode/JumpTable.h b/Source/JavaScriptCore/bytecode/JumpTable.h
index 5bbe047..cb0def5 100644
--- a/Source/JavaScriptCore/bytecode/JumpTable.h
+++ b/Source/JavaScriptCore/bytecode/JumpTable.h
@@ -31,7 +31,6 @@
#define JumpTable_h
#include "MacroAssembler.h"
-#include "UString.h"
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 9d2dd7b..a8aacf4 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -39,7 +39,7 @@
#include "LowLevelInterpreter.h"
#include "ScopeChain.h"
#include "StrongInlines.h"
-#include "UString.h"
+#include <wtf/text/WTFString.h>
using namespace std;
@@ -1158,7 +1158,7 @@
&& src1->isTemporary()
&& m_codeBlock->isConstantRegisterIndex(src2->index())
&& m_codeBlock->constantRegister(src2->index()).get().isString()) {
- const UString& value = asString(m_codeBlock->constantRegister(src2->index()).get())->tryGetValue();
+ const String& value = asString(m_codeBlock->constantRegister(src2->index()).get())->tryGetValue();
if (value == "undefined") {
rewindUnaryOp();
emitOpcode(op_is_undefined);
@@ -2446,7 +2446,7 @@
return targetRegister;
}
-void BytecodeGenerator::emitThrowReferenceError(const UString& message)
+void BytecodeGenerator::emitThrowReferenceError(const String& message)
{
emitOpcode(op_throw_reference_error);
instructions().append(addConstantValue(jsString(globalData(), message))->index());
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index bc0f6db..79a3f36 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -520,7 +520,7 @@
emitUnaryNoDstOp(op_throw, exc);
}
- void emitThrowReferenceError(const UString& message);
+ void emitThrowReferenceError(const String& message);
void emitPushNewScope(RegisterID* dst, const Identifier& property, RegisterID* value);
diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 0d63808..ac37545 100644
--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -43,7 +43,6 @@
#include "RegExpCache.h"
#include "RegExpObject.h"
#include "SamplingTool.h"
-#include "UStringConcatenate.h"
#include <wtf/Assertions.h>
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/Threading.h>
@@ -77,7 +76,7 @@
// ------------------------------ ThrowableExpressionData --------------------------------
-RegisterID* ThrowableExpressionData::emitThrowReferenceError(BytecodeGenerator& generator, const UString& message)
+RegisterID* ThrowableExpressionData::emitThrowReferenceError(BytecodeGenerator& generator, const String& message)
{
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
generator.emitThrowReferenceError(message);
@@ -1808,7 +1807,7 @@
typeForTable = SwitchNeither;
break;
}
- const UString& value = static_cast<StringNode*>(clauseExpression)->value().ustring();
+ const String& value = static_cast<StringNode*>(clauseExpression)->value().ustring();
if (singleCharacterSwitch &= value.length() == 1) {
int32_t intVal = value[0];
if (intVal < min_num)
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp
index 0a66d6f..ed56a53 100644
--- a/Source/JavaScriptCore/debugger/Debugger.cpp
+++ b/Source/JavaScriptCore/debugger/Debugger.cpp
@@ -59,7 +59,7 @@
// JavaScript in the inspector.
SourceProviderMap::const_iterator end = m_sourceProviders.end();
for (SourceProviderMap::const_iterator iter = m_sourceProviders.begin(); iter != end; ++iter)
- m_debugger->sourceParsed(iter->second, iter->first, -1, UString());
+ m_debugger->sourceParsed(iter->second, iter->first, -1, String());
}
inline void Recompiler::operator()(JSCell* cell)
@@ -121,7 +121,7 @@
globalData->heap.objectSpace().forEachCell(recompiler);
}
-JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSGlobalObject* globalObject)
+JSValue evaluateInGlobalCallFrame(const String& script, JSValue& exception, JSGlobalObject* globalObject)
{
CallFrame* globalCallFrame = globalObject->globalExec();
JSGlobalData& globalData = globalObject->globalData();
diff --git a/Source/JavaScriptCore/debugger/Debugger.h b/Source/JavaScriptCore/debugger/Debugger.h
index bc74367..3c4a4ed 100644
--- a/Source/JavaScriptCore/debugger/Debugger.h
+++ b/Source/JavaScriptCore/debugger/Debugger.h
@@ -32,7 +32,6 @@
class JSGlobalObject;
class JSValue;
class SourceProvider;
- class UString;
class JS_EXPORT_PRIVATE Debugger {
public:
@@ -41,7 +40,7 @@
void attach(JSGlobalObject*);
virtual void detach(JSGlobalObject*);
- virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const UString& errorMessage) = 0;
+ virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
virtual void exception(const DebuggerCallFrame&, intptr_t, int, int, bool) = 0;
virtual void atStatement(const DebuggerCallFrame&, intptr_t, int, int) = 0;
@@ -60,7 +59,7 @@
};
// This function exists only for backwards compatibility with existing WebScriptDebugger clients.
- JS_EXPORT_PRIVATE JSValue evaluateInGlobalCallFrame(const UString&, JSValue& exception, JSGlobalObject*);
+ JS_EXPORT_PRIVATE JSValue evaluateInGlobalCallFrame(const WTF::String&, JSValue& exception, JSGlobalObject*);
} // namespace JSC
diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
index 4c2554f..e234680 100644
--- a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
@@ -58,7 +58,7 @@
visitor.append(&thisObject->m_activation);
}
-UString DebuggerActivation::className(const JSObject* object)
+String DebuggerActivation::className(const JSObject* object)
{
const DebuggerActivation* thisObject = jsCast<const DebuggerActivation*>(object);
return thisObject->m_activation->methodTable()->className(thisObject->m_activation.get());
diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.h b/Source/JavaScriptCore/debugger/DebuggerActivation.h
index 07d2014..c934407 100644
--- a/Source/JavaScriptCore/debugger/DebuggerActivation.h
+++ b/Source/JavaScriptCore/debugger/DebuggerActivation.h
@@ -42,7 +42,7 @@
}
static void visitChildren(JSCell*, SlotVisitor&);
- static UString className(const JSObject*);
+ static String className(const JSObject*);
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index a48e7d1..3f8c9ca 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -36,7 +36,7 @@
namespace JSC {
-const UString* DebuggerCallFrame::functionName() const
+const String* DebuggerCallFrame::functionName() const
{
if (!m_callFrame->codeBlock())
return 0;
@@ -50,15 +50,15 @@
return &jsCast<JSFunction*>(function)->name(m_callFrame);
}
-UString DebuggerCallFrame::calculatedFunctionName() const
+String DebuggerCallFrame::calculatedFunctionName() const
{
if (!m_callFrame->codeBlock())
- return UString();
+ return String();
JSObject* function = m_callFrame->callee();
if (!function)
- return UString();
+ return String();
return getCalculatedDisplayName(m_callFrame, function);
}
@@ -84,7 +84,7 @@
return asObject(thisValue);
}
-JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) const
+JSValue DebuggerCallFrame::evaluate(const String& script, JSValue& exception) const
{
if (!m_callFrame->codeBlock())
return JSValue();
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
index dca7487..c457775 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.h
@@ -51,11 +51,11 @@
CallFrame* callFrame() const { return m_callFrame; }
JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); }
ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); }
- JS_EXPORT_PRIVATE const UString* functionName() const;
- JS_EXPORT_PRIVATE UString calculatedFunctionName() const;
+ JS_EXPORT_PRIVATE const String* functionName() const;
+ JS_EXPORT_PRIVATE String calculatedFunctionName() const;
JS_EXPORT_PRIVATE Type type() const;
JS_EXPORT_PRIVATE JSObject* thisObject() const;
- JS_EXPORT_PRIVATE JSValue evaluate(const UString&, JSValue& exception) const;
+ JS_EXPORT_PRIVATE JSValue evaluate(const String&, JSValue& exception) const;
JSValue exception() const { return m_exception; }
private:
diff --git a/Source/JavaScriptCore/heap/Handle.h b/Source/JavaScriptCore/heap/Handle.h
index 62f267e..3b62e20 100644
--- a/Source/JavaScriptCore/heap/Handle.h
+++ b/Source/JavaScriptCore/heap/Handle.h
@@ -102,7 +102,7 @@
Handle<JSObject> asObject() const;
bool isObject() const { return jsValue().isObject(); }
bool getNumber(double number) const { return jsValue().getNumber(number); }
- UString getString(ExecState*) const;
+ WTF::String getString(ExecState*) const;
bool isUndefinedOrNull() const { return jsValue().isUndefinedOrNull(); }
private:
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h
index 6f13afb..e3493ac 100644
--- a/Source/JavaScriptCore/heap/Heap.h
+++ b/Source/JavaScriptCore/heap/Heap.h
@@ -59,11 +59,10 @@
class LLIntOffsetsExtractor;
class MarkedArgumentBuffer;
class RegisterFile;
- class UString;
class WeakGCHandlePool;
class SlotVisitor;
- typedef std::pair<JSValue, UString> ValueStringPair;
+ typedef std::pair<JSValue, WTF::String> ValueStringPair;
typedef HashCountedSet<JSCell*> ProtectCountSet;
typedef HashCountedSet<const char*> TypeCountSet;
diff --git a/Source/JavaScriptCore/heap/MarkStack.cpp b/Source/JavaScriptCore/heap/MarkStack.cpp
index b313664..6ef9f9e 100644
--- a/Source/JavaScriptCore/heap/MarkStack.cpp
+++ b/Source/JavaScriptCore/heap/MarkStack.cpp
@@ -38,7 +38,6 @@
#include "ScopeChain.h"
#include "SlotVisitorInlineMethods.h"
#include "Structure.h"
-#include "UString.h"
#include "WriteBarrier.h"
#include <wtf/Atomics.h>
#include <wtf/DataLog.h>
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.cpp b/Source/JavaScriptCore/interpreter/CallFrame.cpp
index cfbfb3e..f8212ea 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.cpp
+++ b/Source/JavaScriptCore/interpreter/CallFrame.cpp
@@ -36,7 +36,7 @@
{
int signedLineNumber;
intptr_t sourceID;
- UString urlString;
+ String urlString;
JSValue function;
interpreter()->retrieveLastCaller(this, signedLineNumber, sourceID, urlString, function);
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 57f1e1e..75e13b7 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -62,7 +62,6 @@
#include "SamplingTool.h"
#include "StrictEvalActivation.h"
#include "StrongInlines.h"
-#include "UStringConcatenate.h"
#include <limits.h>
#include <stdio.h>
#include <wtf/Threading.h>
@@ -151,7 +150,7 @@
return program;
TopCallFrameSetter topCallFrame(callFrame->globalData(), callFrame);
- UString programSource = asString(program)->value(callFrame);
+ String programSource = asString(program)->value(callFrame);
if (callFrame->hadException())
return JSValue();
@@ -362,7 +361,7 @@
while (it < end) {
JSValue v = it->jsValue();
int registerNumber = it - callFrame->registers();
- UString name = codeBlock->nameForRegister(registerNumber);
+ String name = codeBlock->nameForRegister(registerNumber);
#if USE(JSVALUE32_64)
dataLog("[r% 3d %14s] | %10p | %-16s 0x%llx \n", registerNumber, name.ascii().data(), it, v.description(), JSValue::encode(v));
#else
@@ -401,7 +400,7 @@
do {
JSValue v = it->jsValue();
int registerNumber = it - callFrame->registers();
- UString name = codeBlock->nameForRegister(registerNumber);
+ String name = codeBlock->nameForRegister(registerNumber);
#if USE(JSVALUE32_64)
dataLog("[r% 3d %14s] | %10p | %-16s 0x%llx \n", registerNumber, name.ascii().data(), it, v.description(), JSValue::encode(v));
#else
@@ -532,10 +531,10 @@
if (!jsMessage || !jsMessage.isString())
return;
- UString message = asString(jsMessage)->value(callFrame);
+ String message = asString(jsMessage)->value(callFrame);
if (expressionStart < expressionStop)
- message = makeUString(message, " (evaluating '", codeBlock->source()->getRange(expressionStart, expressionStop), "')");
+ message = makeString(message, " (evaluating '", codeBlock->source()->getRange(expressionStart, expressionStop), "')");
else {
// No range information, so give a few characters of context
const StringImpl* data = codeBlock->source()->data();
@@ -552,7 +551,7 @@
stop++;
while (stop > expressionStart && isStrWhiteSpace((*data)[stop - 1]))
stop--;
- message = makeUString(message, " (near '...", codeBlock->source()->getRange(start, stop), "...')");
+ message = makeString(message, " (near '...", codeBlock->source()->getRange(start, stop), "...')");
}
exception->putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, message));
@@ -665,7 +664,7 @@
return callerFrame;
}
-static ALWAYS_INLINE const UString getSourceURLFromCallFrame(CallFrame* callFrame)
+static ALWAYS_INLINE const String getSourceURLFromCallFrame(CallFrame* callFrame)
{
ASSERT(!callFrame->hasHostCallFrameFlag());
#if ENABLE(CLASSIC_INTERPRETER)
@@ -706,13 +705,13 @@
callFrame = callFrame->trueCallFrameFromVMCode();
while (callFrame && callFrame != CallFrame::noCaller()) {
- UString sourceURL;
+ String sourceURL;
if (callFrame->codeBlock()) {
sourceURL = getSourceURLFromCallFrame(callFrame);
StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), getStackFrameCodeType(callFrame), Strong<ExecutableBase>(*globalData, callFrame->codeBlock()->ownerExecutable()), line, sourceURL};
results.append(s);
} else {
- StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), StackFrameNativeCode, Strong<ExecutableBase>(), -1, UString()};
+ StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), StackFrameNativeCode, Strong<ExecutableBase>(), -1, String()};
results.append(s);
}
unsigned unusedBytecodeOffset = 0;
@@ -745,7 +744,7 @@
builder.append('\n');
}
- error->putDirect(*globalData, globalData->propertyNames->stack, jsString(globalData, UString(builder.toString().impl())), ReadOnly | DontDelete);
+ error->putDirect(*globalData, globalData->propertyNames->stack, jsString(globalData, builder.toString()), ReadOnly | DontDelete);
}
NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue& exceptionValue, unsigned bytecodeOffset)
@@ -848,7 +847,7 @@
DynamicGlobalObjectScope globalObjectScope(*scopeChain->globalData, scopeChain->globalObject.get());
Vector<JSONPData> JSONPData;
bool parseResult;
- const UString programSource = program->source().toString();
+ const String programSource = program->source().toString();
if (programSource.isNull())
return jsUndefined();
if (programSource.is8Bit()) {
@@ -4956,7 +4955,7 @@
original constructor, using constant message as the
message string. The result is thrown.
*/
- UString message = callFrame->r(vPC[1].u.operand).jsValue().toString(callFrame)->value(callFrame);
+ String message = callFrame->r(vPC[1].u.operand).jsValue().toString(callFrame)->value(callFrame);
exceptionValue = JSValue(createReferenceError(callFrame, message));
goto vm_throw;
}
@@ -5140,11 +5139,11 @@
return caller;
}
-void Interpreter::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue& function) const
+void Interpreter::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, String& sourceURL, JSValue& function) const
{
function = JSValue();
lineNumber = -1;
- sourceURL = UString();
+ sourceURL = String();
CallFrame* callerFrame = callFrame->callerFrame();
if (callerFrame->hasHostCallFrameFlag())
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.h b/Source/JavaScriptCore/interpreter/Interpreter.h
index 834f7de..aa0d403 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.h
+++ b/Source/JavaScriptCore/interpreter/Interpreter.h
@@ -79,8 +79,8 @@
StackFrameCodeType codeType;
Strong<ExecutableBase> executable;
int line;
- UString sourceURL;
- UString toString(CallFrame* callFrame) const
+ String sourceURL;
+ String toString(CallFrame* callFrame) const
{
StringBuilder traceBuild;
String functionName = friendlyFunctionName(callFrame);
@@ -233,7 +233,7 @@
JSValue retrieveArgumentsFromVMCode(CallFrame*, JSFunction*) const;
JSValue retrieveCallerFromVMCode(CallFrame*, JSFunction*) const;
- JS_EXPORT_PRIVATE void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue& function) const;
+ JS_EXPORT_PRIVATE void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, String& sourceURL, JSValue& function) const;
void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
@@ -241,7 +241,7 @@
NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset);
NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine, int column);
- static const UString getTraceLine(CallFrame*, StackFrameCodeType, const UString&, int);
+ static const String getTraceLine(CallFrame*, StackFrameCodeType, const String&, int);
JS_EXPORT_PRIVATE static void getStackTrace(JSGlobalData*, Vector<StackFrame>& results);
static void addStackTraceIfNecessary(CallFrame*, JSObject* error);
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index d51a740..7c03562 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -3410,7 +3410,7 @@
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
- UString message = stackFrame.args[0].jsValue().toString(callFrame)->value(callFrame);
+ String message = stackFrame.args[0].jsValue().toString(callFrame)->value(callFrame);
stackFrame.globalData->exception = createReferenceError(callFrame, message);
VM_THROW_EXCEPTION_AT_END();
}
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index 17ab515..f3d9b2e 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -80,7 +80,7 @@
using namespace JSC;
using namespace WTF;
-static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer);
+static bool fillBufferWithContentsOfFile(const String& fileName, Vector<char>& buffer);
static EncodedJSValue JSC_HOST_CALL functionPrint(ExecState*);
static EncodedJSValue JSC_HOST_CALL functionDebug(ExecState*);
@@ -129,7 +129,7 @@
bool m_dump;
bool m_exitCode;
Vector<Script> m_scripts;
- Vector<UString> m_arguments;
+ Vector<String> m_arguments;
void parseArguments(int, char**);
};
@@ -169,7 +169,7 @@
public:
typedef JSGlobalObject Base;
- static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
+ static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<String>& arguments)
{
GlobalObject* object = new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
object->finishCreation(globalData, arguments);
@@ -187,7 +187,7 @@
static bool javaScriptExperimentsEnabled(const JSGlobalObject*) { return true; }
protected:
- void finishCreation(JSGlobalData& globalData, const Vector<UString>& arguments)
+ void finishCreation(JSGlobalData& globalData, const Vector<String>& arguments)
{
Base::finishCreation(globalData);
@@ -252,7 +252,7 @@
{
}
-static inline SourceCode jscSource(const char* utf8, const UString& filename)
+static inline SourceCode jscSource(const char* utf8, const String& filename)
{
// Find the the first non-ascii character, or nul.
const char* pos = utf8;
@@ -262,7 +262,7 @@
// Fast case - string is all ascii.
if (!*pos)
- return makeSource(UString(utf8, asciiLength), filename);
+ return makeSource(String(utf8, asciiLength), filename);
// Slow case - contains non-ascii characters, use fromUTF8WithLatin1Fallback.
ASSERT(*pos < 0);
@@ -347,12 +347,12 @@
EncodedJSValue JSC_HOST_CALL functionRun(ExecState* exec)
{
- UString fileName = exec->argument(0).toString(exec)->value(exec);
+ String fileName = exec->argument(0).toString(exec)->value(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return JSValue::encode(throwError(exec, createError(exec, "Could not open file.")));
- GlobalObject* globalObject = GlobalObject::create(exec->globalData(), GlobalObject::createStructure(exec->globalData(), jsNull()), Vector<UString>());
+ GlobalObject* globalObject = GlobalObject::create(exec->globalData(), GlobalObject::createStructure(exec->globalData(), jsNull()), Vector<String>());
JSValue exception;
StopWatch stopWatch;
@@ -370,7 +370,7 @@
EncodedJSValue JSC_HOST_CALL functionLoad(ExecState* exec)
{
- UString fileName = exec->argument(0).toString(exec)->value(exec);
+ String fileName = exec->argument(0).toString(exec)->value(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return JSValue::encode(throwError(exec, createError(exec, "Could not open file.")));
@@ -386,7 +386,7 @@
EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec)
{
- UString fileName = exec->argument(0).toString(exec)->value(exec);
+ String fileName = exec->argument(0).toString(exec)->value(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return JSValue::encode(throwError(exec, createError(exec, "Could not open file.")));
@@ -523,7 +523,7 @@
static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scripts, bool dump)
{
const char* script;
- UString fileName;
+ String fileName;
Vector<char> scriptBuffer;
if (dump)
@@ -586,7 +586,7 @@
static void runInteractive(GlobalObject* globalObject)
{
- UString interpreterName("Interpreter");
+ String interpreterName("Interpreter");
while (true) {
#if HAVE(READLINE) && !RUNNING_FROM_XCODE
@@ -750,7 +750,7 @@
return result;
}
-static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer)
+static bool fillBufferWithContentsOfFile(const String& fileName, Vector<char>& buffer)
{
FILE* f = fopen(fileName.utf8().data(), "r");
if (!f) {
diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp
index 2a8a8dc..063168b 100644
--- a/Source/JavaScriptCore/parser/Lexer.cpp
+++ b/Source/JavaScriptCore/parser/Lexer.cpp
@@ -368,7 +368,7 @@
}
template <typename T>
-UString Lexer<T>::invalidCharacterMessage() const
+String Lexer<T>::invalidCharacterMessage() const
{
switch (m_current) {
case 0:
@@ -418,7 +418,7 @@
m_error = false;
m_atLineStart = true;
m_columnNumber = 0;
- m_lexErrorMessage = UString();
+ m_lexErrorMessage = String();
m_buffer8.reserveInitialCapacity(initialReadBufferCapacity);
m_buffer16.reserveInitialCapacity((m_codeEnd - m_code) / 2);
diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h
index 1ac832a..d75f202 100644
--- a/Source/JavaScriptCore/parser/Lexer.h
+++ b/Source/JavaScriptCore/parser/Lexer.h
@@ -100,12 +100,12 @@
// Functions for use after parsing.
bool sawError() const { return m_error; }
- UString getErrorMessage() const { return m_lexErrorMessage; }
+ String getErrorMessage() const { return m_lexErrorMessage; }
void clear();
void setOffset(int offset)
{
m_error = 0;
- m_lexErrorMessage = UString();
+ m_lexErrorMessage = String();
m_code = m_codeStart + offset;
m_buffer8.resize(0);
m_buffer16.resize(0);
@@ -137,7 +137,7 @@
int parseFourDigitUnicodeHex();
void shiftLineTerminator();
- UString invalidCharacterMessage() const;
+ String invalidCharacterMessage() const;
ALWAYS_INLINE const T* currentCharacter() const;
ALWAYS_INLINE int currentOffset() const { return m_code - m_codeStart; }
ALWAYS_INLINE void setOffsetFromCharOffset(const T* charOffset) { setOffset(charOffset - m_codeStart); }
@@ -181,7 +181,7 @@
bool m_isReparsing;
bool m_atLineStart;
bool m_error;
- UString m_lexErrorMessage;
+ String m_lexErrorMessage;
T m_current;
diff --git a/Source/JavaScriptCore/parser/Nodes.h b/Source/JavaScriptCore/parser/Nodes.h
index ed1a85a..dc694cc 100644
--- a/Source/JavaScriptCore/parser/Nodes.h
+++ b/Source/JavaScriptCore/parser/Nodes.h
@@ -279,7 +279,7 @@
uint16_t endOffset() const { return m_endOffset; }
protected:
- RegisterID* emitThrowReferenceError(BytecodeGenerator&, const UString& message);
+ RegisterID* emitThrowReferenceError(BytecodeGenerator&, const String& message);
private:
uint32_t m_divot;
@@ -1389,7 +1389,7 @@
}
const SourceCode& source() const { return m_source; }
- const UString& sourceURL() const { return m_source.provider()->url(); }
+ const String& sourceURL() const { return m_source.provider()->url(); }
intptr_t sourceID() const { return m_source.providerID(); }
void setFeatures(CodeFeatures features) { m_features = features; }
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp
index 4fd671f..fdda73c 100644
--- a/Source/JavaScriptCore/parser/Parser.cpp
+++ b/Source/JavaScriptCore/parser/Parser.cpp
@@ -81,9 +81,9 @@
}
template <typename LexerType>
-UString Parser<LexerType>::parseInner()
+String Parser<LexerType>::parseInner()
{
- UString parseError = UString();
+ String parseError = String();
unsigned oldFunctionCacheSize = m_functionCache ? m_functionCache->byteSize() : 0;
ASTBuilder context(const_cast<JSGlobalData*>(m_globalData), const_cast<SourceCode*>(m_source));
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h
index 79a95b6..28317d5 100644
--- a/Source/JavaScriptCore/parser/Parser.h
+++ b/Source/JavaScriptCore/parser/Parser.h
@@ -56,7 +56,6 @@
class JSGlobalData;
class ProgramNode;
class SourceCode;
-class UString;
#define fail() do { if (!m_error) updateErrorMessage(); return 0; } while (0)
#define failWithToken(tok) do { if (!m_error) updateErrorMessage(tok); return 0; } while (0)
@@ -489,7 +488,7 @@
}
Parser();
- UString parseInner();
+ String parseInner();
void didFinishParsing(SourceElements*, ParserArenaData<DeclarationStacks::VarStack>*,
ParserArenaData<DeclarationStacks::FunctionStack>*, CodeFeatures,
@@ -529,9 +528,9 @@
return result;
}
- ALWAYS_INLINE UString getToken() {
+ ALWAYS_INLINE String getToken() {
SourceProvider* sourceProvider = m_source->provider();
- return UString(sourceProvider->getRange(tokenStart(), tokenEnd()).impl());
+ return sourceProvider->getRange(tokenStart(), tokenEnd());
}
ALWAYS_INLINE bool match(JSTokenType expected)
@@ -793,7 +792,7 @@
if (!name)
updateErrorMessageSpecialCase(m_token.m_type);
else
- m_errorMessage = UString(String::format("Unexpected token '%s'", name).impl());
+ m_errorMessage = String::format("Unexpected token '%s'", name);
}
NEVER_INLINE void updateErrorMessage(JSTokenType expectedToken)
@@ -801,7 +800,7 @@
m_error = true;
const char* name = getTokenName(expectedToken);
if (name)
- m_errorMessage = UString(String::format("Expected token '%s'", name).impl());
+ m_errorMessage = String::format("Expected token '%s'", name);
else {
if (!getTokenName(m_token.m_type))
updateErrorMessageSpecialCase(m_token.m_type);
@@ -810,7 +809,7 @@
}
}
- NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, UString name, const char* afterMsg)
+ NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, String name, const char* afterMsg)
{
m_error = true;
String prefix(beforeMsg);
@@ -825,7 +824,7 @@
NEVER_INLINE void updateErrorMessage(const char* msg)
{
m_error = true;
- m_errorMessage = UString(msg);
+ m_errorMessage = String(msg);
}
void startLoop() { currentScope()->startLoop(); }
@@ -938,7 +937,7 @@
StackBounds m_stack;
bool m_error;
- UString m_errorMessage;
+ String m_errorMessage;
JSToken m_token;
bool m_allowsIn;
int m_lastLine;
@@ -982,7 +981,7 @@
ASSERT(lexicalGlobalObject);
ASSERT(exception && !*exception);
int errLine;
- UString errMsg;
+ String errMsg;
if (ParsedNode::scopeIsFunction)
m_lexer->setIsReparsing();
@@ -990,13 +989,13 @@
m_sourceElements = 0;
errLine = -1;
- errMsg = UString();
+ errMsg = String();
- UString parseError = parseInner();
+ String parseError = parseInner();
int lineNumber = m_lexer->lineNumber();
bool lexError = m_lexer->sawError();
- UString lexErrorMessage = lexError ? m_lexer->getErrorMessage() : UString();
+ String lexErrorMessage = lexError ? m_lexer->getErrorMessage() : String();
ASSERT(lexErrorMessage.isNull() != lexError);
m_lexer->clear();
diff --git a/Source/JavaScriptCore/parser/ParserArena.h b/Source/JavaScriptCore/parser/ParserArena.h
index 2fffd27..2f5b447 100644
--- a/Source/JavaScriptCore/parser/ParserArena.h
+++ b/Source/JavaScriptCore/parser/ParserArena.h
@@ -113,7 +113,7 @@
inline const Identifier& IdentifierArena::makeNumericIdentifier(JSGlobalData* globalData, double number)
{
- m_identifiers.append(Identifier(globalData, UString::numberToStringECMAScript(number)));
+ m_identifiers.append(Identifier(globalData, String::numberToStringECMAScript(number)));
return m_identifiers.last();
}
diff --git a/Source/JavaScriptCore/parser/SourceCode.h b/Source/JavaScriptCore/parser/SourceCode.h
index 11a0033..bda91b3 100644
--- a/Source/JavaScriptCore/parser/SourceCode.h
+++ b/Source/JavaScriptCore/parser/SourceCode.h
@@ -60,10 +60,10 @@
{
}
- UString toString() const
+ String toString() const
{
if (!m_provider)
- return UString();
+ return String();
return m_provider->getRange(m_startChar, m_endChar);
}
@@ -90,9 +90,9 @@
int m_firstLine;
};
- inline SourceCode makeSource(const UString& source, const UString& url = UString(), const TextPosition& startPosition = TextPosition::minimumPosition())
+ inline SourceCode makeSource(const String& source, const String& url = String(), const TextPosition& startPosition = TextPosition::minimumPosition())
{
- return SourceCode(UStringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt());
+ return SourceCode(StringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt());
}
inline SourceCode SourceCode::subExpression(unsigned openBrace, unsigned closeBrace, int firstLine)
diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h
index 2e7f717..7f2e8d9 100644
--- a/Source/JavaScriptCore/parser/SourceProvider.h
+++ b/Source/JavaScriptCore/parser/SourceProvider.h
@@ -30,7 +30,6 @@
#define SourceProvider_h
#include "SourceProviderCache.h"
-#include "UString.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/UnusedParam.h>
@@ -42,7 +41,7 @@
public:
static const intptr_t nullID = 1;
- SourceProvider(const UString& url, const TextPosition& startPosition, SourceProviderCache* cache = 0)
+ SourceProvider(const String& url, const TextPosition& startPosition, SourceProviderCache* cache = 0)
: m_url(url)
, m_startPosition(startPosition)
, m_validated(false)
@@ -57,11 +56,11 @@
delete m_cache;
}
- virtual UString getRange(int start, int end) const = 0;
+ virtual String getRange(int start, int end) const = 0;
virtual const StringImpl* data() const = 0;
virtual int length() const = 0;
- const UString& url() { return m_url; }
+ const String& url() { return m_url; }
TextPosition startPosition() const { return m_startPosition; }
intptr_t asID()
{
@@ -80,21 +79,21 @@
private:
virtual void cacheSizeChanged(int delta) { UNUSED_PARAM(delta); }
- UString m_url;
+ String m_url;
TextPosition m_startPosition;
bool m_validated;
SourceProviderCache* m_cache;
bool m_cacheOwned;
};
- class UStringSourceProvider : public SourceProvider {
+ class StringSourceProvider : public SourceProvider {
public:
- static PassRefPtr<UStringSourceProvider> create(const UString& source, const UString& url, const TextPosition& startPosition = TextPosition::minimumPosition())
+ static PassRefPtr<StringSourceProvider> create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition())
{
- return adoptRef(new UStringSourceProvider(source, url, startPosition));
+ return adoptRef(new StringSourceProvider(source, url, startPosition));
}
- virtual UString getRange(int start, int end) const OVERRIDE
+ virtual String getRange(int start, int end) const OVERRIDE
{
return m_source.substringSharingImpl(start, end - start);
}
@@ -102,13 +101,13 @@
int length() const { return m_source.length(); }
private:
- UStringSourceProvider(const UString& source, const UString& url, const TextPosition& startPosition)
+ StringSourceProvider(const String& source, const String& url, const TextPosition& startPosition)
: SourceProvider(url, startPosition)
, m_source(source)
{
}
- UString m_source;
+ String m_source;
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/profiler/CallIdentifier.h b/Source/JavaScriptCore/profiler/CallIdentifier.h
index 2da8a2f..bf9f904 100644
--- a/Source/JavaScriptCore/profiler/CallIdentifier.h
+++ b/Source/JavaScriptCore/profiler/CallIdentifier.h
@@ -27,17 +27,17 @@
#ifndef CallIdentifier_h
#define CallIdentifier_h
-#include <runtime/UString.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
struct CallIdentifier {
WTF_MAKE_FAST_ALLOCATED;
public:
- UString m_name;
- UString m_url;
+ String m_name;
+ String m_url;
unsigned m_lineNumber;
CallIdentifier()
@@ -45,7 +45,7 @@
{
}
- CallIdentifier(const UString& name, const UString& url, int lineNumber)
+ CallIdentifier(const String& name, const String& url, int lineNumber)
: m_name(name)
, m_url(!url.isNull() ? url : "")
, m_lineNumber(lineNumber)
@@ -87,7 +87,7 @@
template<> struct HashTraits<JSC::CallIdentifier> : GenericHashTraits<JSC::CallIdentifier> {
static void constructDeletedValue(JSC::CallIdentifier& slot)
{
- new (NotNull, &slot) JSC::CallIdentifier(JSC::UString(), JSC::UString(), std::numeric_limits<unsigned>::max());
+ new (NotNull, &slot) JSC::CallIdentifier(String(), String(), std::numeric_limits<unsigned>::max());
}
static bool isDeletedValue(const JSC::CallIdentifier& value)
{
diff --git a/Source/JavaScriptCore/profiler/Profile.cpp b/Source/JavaScriptCore/profiler/Profile.cpp
index 92e32c4..51f8718 100644
--- a/Source/JavaScriptCore/profiler/Profile.cpp
+++ b/Source/JavaScriptCore/profiler/Profile.cpp
@@ -32,18 +32,18 @@
namespace JSC {
-PassRefPtr<Profile> Profile::create(const UString& title, unsigned uid)
+PassRefPtr<Profile> Profile::create(const String& title, unsigned uid)
{
return adoptRef(new Profile(title, uid));
}
-Profile::Profile(const UString& title, unsigned uid)
+Profile::Profile(const String& title, unsigned uid)
: m_title(title)
, m_uid(uid)
{
// FIXME: When multi-threading is supported this will be a vector and calls
// into the profiler will need to know which thread it is executing on.
- m_head = ProfileNode::create(0, CallIdentifier("Thread_1", UString(), 0), 0, 0);
+ m_head = ProfileNode::create(0, CallIdentifier("Thread_1", String(), 0), 0, 0);
}
Profile::~Profile()
@@ -128,7 +128,7 @@
std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
- dataLog(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data());
+ dataLog(" %-12d%s\n", (*it).second, String((*it).first).utf8().data());
dataLog("\nSort by top of stack, same collapsed (when >= 5):\n");
}
diff --git a/Source/JavaScriptCore/profiler/Profile.h b/Source/JavaScriptCore/profiler/Profile.h
index 9455e35..c1c6919 100644
--- a/Source/JavaScriptCore/profiler/Profile.h
+++ b/Source/JavaScriptCore/profiler/Profile.h
@@ -27,18 +27,18 @@
#define Profile_h
#include "ProfileNode.h"
-#include <runtime/UString.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
class Profile : public RefCounted<Profile> {
public:
- static PassRefPtr<Profile> create(const UString& title, unsigned uid);
+ static PassRefPtr<Profile> create(const String& title, unsigned uid);
virtual ~Profile();
- const UString& title() const { return m_title; }
+ const String& title() const { return m_title; }
ProfileNode* head() const { return m_head.get(); }
void setHead(PassRefPtr<ProfileNode> head) { m_head = head; }
double totalTime() const { return m_head->totalTime(); }
@@ -56,13 +56,13 @@
#endif
protected:
- Profile(const UString& title, unsigned uid);
+ Profile(const String& title, unsigned uid);
private:
void removeProfileStart();
void removeProfileEnd();
- UString m_title;
+ String m_title;
RefPtr<ProfileNode> m_head;
unsigned int m_uid;
};
diff --git a/Source/JavaScriptCore/profiler/ProfileGenerator.cpp b/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
index 5db38bc..09877d3 100644
--- a/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -40,12 +40,12 @@
static const char* NonJSExecution = "(idle)";
-PassRefPtr<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const UString& title, unsigned uid)
+PassRefPtr<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const String& title, unsigned uid)
{
return adoptRef(new ProfileGenerator(exec, title, uid));
}
-ProfileGenerator::ProfileGenerator(ExecState* exec, const UString& title, unsigned uid)
+ProfileGenerator::ProfileGenerator(ExecState* exec, const String& title, unsigned uid)
: m_origin(exec ? exec->lexicalGlobalObject() : 0)
, m_profileGroup(exec ? exec->lexicalGlobalObject()->profileGroup() : 0)
{
@@ -59,7 +59,7 @@
{
int lineNumber;
intptr_t sourceID;
- UString sourceURL;
+ String sourceURL;
JSValue function;
exec->interpreter()->retrieveLastCaller(exec, lineNumber, sourceID, sourceURL, function);
@@ -67,7 +67,7 @@
m_head->insertNode(m_currentNode.get());
}
-const UString& ProfileGenerator::title() const
+const String& ProfileGenerator::title() const
{
return m_profile->title();
}
@@ -135,7 +135,7 @@
m_currentNode = m_currentNode->parent();
if (double headSelfTime = m_head->selfTime()) {
- RefPtr<ProfileNode> idleNode = ProfileNode::create(0, CallIdentifier(NonJSExecution, UString(), 0), m_head.get(), m_head.get());
+ RefPtr<ProfileNode> idleNode = ProfileNode::create(0, CallIdentifier(NonJSExecution, String(), 0), m_head.get(), m_head.get());
idleNode->setTotalTime(headSelfTime);
idleNode->setSelfTime(headSelfTime);
diff --git a/Source/JavaScriptCore/profiler/ProfileGenerator.h b/Source/JavaScriptCore/profiler/ProfileGenerator.h
index 8c8b817..40cc8de 100644
--- a/Source/JavaScriptCore/profiler/ProfileGenerator.h
+++ b/Source/JavaScriptCore/profiler/ProfileGenerator.h
@@ -37,15 +37,14 @@
class JSGlobalObject;
class Profile;
class ProfileNode;
- class UString;
struct CallIdentifier;
class ProfileGenerator : public RefCounted<ProfileGenerator> {
public:
- static PassRefPtr<ProfileGenerator> create(ExecState*, const UString& title, unsigned uid);
+ static PassRefPtr<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid);
// Members
- const UString& title() const;
+ const WTF::String& title() const;
PassRefPtr<Profile> profile() const { return m_profile; }
JSGlobalObject* origin() const { return m_origin; }
unsigned profileGroup() const { return m_profileGroup; }
@@ -62,7 +61,7 @@
typedef void (ProfileGenerator::*ProfileFunction)(ExecState* callerOrHandlerCallFrame, const CallIdentifier& callIdentifier);
private:
- ProfileGenerator(ExecState*, const UString& title, unsigned uid);
+ ProfileGenerator(ExecState*, const WTF::String& title, unsigned uid);
void addParentForConsoleStart(ExecState*);
void removeProfileStart();
diff --git a/Source/JavaScriptCore/profiler/ProfileNode.h b/Source/JavaScriptCore/profiler/ProfileNode.h
index ffe7b6f..26000a8 100644
--- a/Source/JavaScriptCore/profiler/ProfileNode.h
+++ b/Source/JavaScriptCore/profiler/ProfileNode.h
@@ -64,8 +64,8 @@
// CallIdentifier members
ExecState* callerCallFrame() const { return m_callerCallFrame; }
const CallIdentifier& callIdentifier() const { return m_callIdentifier; }
- const UString& functionName() const { return m_callIdentifier.m_name; }
- const UString& url() const { return m_callIdentifier.m_url; }
+ const String& functionName() const { return m_callIdentifier.m_name; }
+ const String& url() const { return m_callIdentifier.m_url; }
unsigned lineNumber() const { return m_callIdentifier.m_lineNumber; }
// Relationships
@@ -146,8 +146,8 @@
static inline bool selfTimeAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->selfTime() < b->selfTime(); }
static inline bool callsDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->numberOfCalls() > b->numberOfCalls(); }
static inline bool callsAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->numberOfCalls() < b->numberOfCalls(); }
- static inline bool functionNameDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->functionName() > b->functionName(); }
- static inline bool functionNameAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->functionName() < b->functionName(); }
+ static inline bool functionNameDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return codePointCompareLessThan(b->functionName(), a->functionName()); }
+ static inline bool functionNameAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return codePointCompareLessThan(a->functionName(), b->functionName()); }
ExecState* m_callerCallFrame;
CallIdentifier m_callIdentifier;
diff --git a/Source/JavaScriptCore/profiler/Profiler.cpp b/Source/JavaScriptCore/profiler/Profiler.cpp
index 723393b..9642a06 100644
--- a/Source/JavaScriptCore/profiler/Profiler.cpp
+++ b/Source/JavaScriptCore/profiler/Profiler.cpp
@@ -39,7 +39,6 @@
#include "Profile.h"
#include "ProfileGenerator.h"
#include "ProfileNode.h"
-#include "UStringConcatenate.h"
#include <stdio.h>
namespace JSC {
@@ -48,7 +47,7 @@
static const char* AnonymousFunction = "(anonymous function)";
static unsigned ProfilesUID = 0;
-static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const UString& defaultSourceURL, int defaultLineNumber);
+static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const String& defaultSourceURL, int defaultLineNumber);
Profiler* Profiler::s_sharedProfiler = 0;
@@ -59,7 +58,7 @@
return s_sharedProfiler;
}
-void Profiler::startProfiling(ExecState* exec, const UString& title)
+void Profiler::startProfiling(ExecState* exec, const String& title)
{
ASSERT_ARG(title, !title.isNull());
@@ -78,7 +77,7 @@
m_currentProfiles.append(profileGenerator);
}
-PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const UString& title)
+PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const String& title)
{
JSGlobalObject* origin = exec ? exec->lexicalGlobalObject() : 0;
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
@@ -126,7 +125,7 @@
dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::willExecute, createCallIdentifier(callerCallFrame, function, "", 0), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
-void Profiler::willExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber)
+void Profiler::willExecute(ExecState* callerCallFrame, const String& sourceURL, int startingLineNumber)
{
ASSERT(!m_currentProfiles.isEmpty());
@@ -142,7 +141,7 @@
dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(callerCallFrame, function, "", 0), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
-void Profiler::didExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber)
+void Profiler::didExecute(ExecState* callerCallFrame, const String& sourceURL, int startingLineNumber)
{
ASSERT(!m_currentProfiles.isEmpty());
@@ -156,7 +155,7 @@
dispatchFunctionToProfiles(handlerCallFrame, m_currentProfiles, &ProfileGenerator::exceptionUnwind, createCallIdentifier(handlerCallFrame, JSValue(), "", 0), handlerCallFrame->lexicalGlobalObject()->profileGroup());
}
-CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const UString& defaultSourceURL, int defaultLineNumber)
+CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, int defaultLineNumber)
{
if (!functionValue)
return CallIdentifier(GlobalCodeExecution, defaultSourceURL, defaultLineNumber);
@@ -164,12 +163,12 @@
return CallIdentifier("(unknown)", defaultSourceURL, defaultLineNumber);
if (asObject(functionValue)->inherits(&JSFunction::s_info) || asObject(functionValue)->inherits(&InternalFunction::s_info))
return createCallIdentifierFromFunctionImp(exec, asObject(functionValue), defaultSourceURL, defaultLineNumber);
- return CallIdentifier(makeUString("(", asObject(functionValue)->methodTable()->className(asObject(functionValue)), " object)"), defaultSourceURL, defaultLineNumber);
+ return CallIdentifier(makeString("(", asObject(functionValue)->methodTable()->className(asObject(functionValue)), " object)"), defaultSourceURL, defaultLineNumber);
}
-CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JSObject* function, const UString& defaultSourceURL, int defaultLineNumber)
+CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JSObject* function, const String& defaultSourceURL, int defaultLineNumber)
{
- const UString& name = getCalculatedDisplayName(exec, function);
+ const String& name = getCalculatedDisplayName(exec, function);
JSFunction* jsFunction = jsDynamicCast<JSFunction*>(function);
if (jsFunction && !jsFunction->isHostFunction())
return CallIdentifier(name.isEmpty() ? AnonymousFunction : name, jsFunction->jsExecutable()->sourceURL(), jsFunction->jsExecutable()->lineNo());
diff --git a/Source/JavaScriptCore/profiler/Profiler.h b/Source/JavaScriptCore/profiler/Profiler.h
index 877065e..6852457 100644
--- a/Source/JavaScriptCore/profiler/Profiler.h
+++ b/Source/JavaScriptCore/profiler/Profiler.h
@@ -42,23 +42,22 @@
class JSObject;
class JSValue;
class ProfileGenerator;
- class UString;
- struct CallIdentifier;
+ struct CallIdentifier;
class Profiler {
WTF_MAKE_FAST_ALLOCATED;
public:
JS_EXPORT_PRIVATE static Profiler* profiler();
- static CallIdentifier createCallIdentifier(ExecState* exec, JSValue, const UString& sourceURL, int lineNumber);
+ static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String& sourceURL, int lineNumber);
- JS_EXPORT_PRIVATE void startProfiling(ExecState*, const UString& title);
- JS_EXPORT_PRIVATE PassRefPtr<Profile> stopProfiling(ExecState*, const UString& title);
+ JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title);
+ JS_EXPORT_PRIVATE PassRefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
void stopProfiling(JSGlobalObject*);
void willExecute(ExecState* callerCallFrame, JSValue function);
- void willExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber);
+ void willExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, int startingLineNumber);
void didExecute(ExecState* callerCallFrame, JSValue function);
- void didExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber);
+ void didExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, int startingLineNumber);
void exceptionUnwind(ExecState* handlerCallFrame);
diff --git a/Source/JavaScriptCore/runtime/Arguments.cpp b/Source/JavaScriptCore/runtime/Arguments.cpp
index 2579376..fe79f74 100644
--- a/Source/JavaScriptCore/runtime/Arguments.cpp
+++ b/Source/JavaScriptCore/runtime/Arguments.cpp
@@ -98,7 +98,7 @@
return true;
}
- return JSObject::getOwnPropertySlot(thisObject, exec, Identifier(exec, UString::number(i)), slot);
+ return JSObject::getOwnPropertySlot(thisObject, exec, Identifier(exec, String::number(i)), slot);
}
void Arguments::createStrictModeCallerIfNecessary(ExecState* exec)
@@ -186,7 +186,7 @@
Arguments* thisObject = jsCast<Arguments*>(object);
for (unsigned i = 0; i < thisObject->d->numArguments; ++i) {
if (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])
- propertyNames.add(Identifier(exec, UString::number(i)));
+ propertyNames.add(Identifier(exec, String::number(i)));
}
if (mode == IncludeDontEnumProperties) {
propertyNames.add(exec->propertyNames().callee);
@@ -204,7 +204,7 @@
}
PutPropertySlot slot(shouldThrow);
- JSObject::put(thisObject, exec, Identifier(exec, UString::number(i)), value, slot);
+ JSObject::put(thisObject, exec, Identifier(exec, String::number(i)), value, slot);
}
void Arguments::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
@@ -255,7 +255,7 @@
}
}
- return JSObject::deleteProperty(thisObject, exec, Identifier(exec, UString::number(i)));
+ return JSObject::deleteProperty(thisObject, exec, Identifier(exec, String::number(i)));
}
bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
diff --git a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
index a97cf82..e47c3f4 100644
--- a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -300,7 +300,7 @@
if (element.isUndefinedOrNull())
continue;
- UString str = element.toUString(exec);
+ String str = element.toWTFString(exec);
strBuffer[k] = str.impl();
totalSize += str.length();
allStrings8Bit = allStrings8Bit && str.is8Bit();
@@ -328,7 +328,7 @@
buffer.append(rep->characters8(), rep->length());
}
ASSERT(buffer.size() == totalSize);
- return JSValue::encode(jsString(exec, UString::adopt(buffer)));
+ return JSValue::encode(jsString(exec, String::adopt(buffer)));
}
Vector<UChar> buffer;
@@ -343,7 +343,7 @@
buffer.append(rep->characters(), rep->length());
}
ASSERT(buffer.size() == totalSize);
- return JSValue::encode(jsString(exec, UString::adopt(buffer)));
+ return JSValue::encode(jsString(exec, String::adopt(buffer)));
}
EncodedJSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState* exec)
@@ -362,7 +362,7 @@
if (JSValue earlyReturnValue = checker.earlyReturnValue())
return JSValue::encode(earlyReturnValue);
- UString separator(",");
+ String separator(",", String::ConstructFromLiteral);
JSStringJoiner stringJoiner(separator, length);
for (unsigned k = 0; k < length; k++) {
JSValue element = thisObj->get(exec, k);
@@ -373,13 +373,13 @@
JSValue conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
if (exec->hadException())
return JSValue::encode(jsUndefined());
- UString str;
+ String str;
CallData callData;
CallType callType = getCallData(conversionFunction, callData);
if (callType != CallTypeNone)
- str = call(exec, conversionFunction, callType, callData, element, exec->emptyList()).toUString(exec);
+ str = call(exec, conversionFunction, callType, callData, element, exec->emptyList()).toWTFString(exec);
else
- str = element.toUString(exec);
+ str = element.toWTFString(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
stringJoiner.append(str);
@@ -400,11 +400,11 @@
if (JSValue earlyReturnValue = checker.earlyReturnValue())
return JSValue::encode(earlyReturnValue);
- UString separator;
+ String separator;
if (!exec->argument(0).isUndefined())
- separator = exec->argument(0).toUString(exec);
+ separator = exec->argument(0).toWTFString(exec);
if (separator.isNull())
- separator = UString(",");
+ separator = String(",", String::ConstructFromLiteral);
JSStringJoiner stringJoiner(separator, length);
@@ -418,18 +418,18 @@
JSValue element = array->getIndex(k);
if (!element.isUndefinedOrNull())
- stringJoiner.append(element.toUStringInline(exec));
+ stringJoiner.append(element.toWTFStringInline(exec));
else
- stringJoiner.append(UString());
+ stringJoiner.append(String());
}
}
for (; k < length; k++) {
JSValue element = thisObj->get(exec, k);
if (!element.isUndefinedOrNull())
- stringJoiner.append(element.toUStringInline(exec));
+ stringJoiner.append(element.toWTFStringInline(exec));
else
- stringJoiner.append(UString());
+ stringJoiner.append(String());
}
return JSValue::encode(stringJoiner.build(exec));
@@ -520,7 +520,7 @@
thisObj->methodTable()->putByIndex(thisObj, exec, length + n, exec->argument(n), true);
else {
PutPropertySlot slot;
- Identifier propertyName(exec, JSValue(static_cast<int64_t>(length) + static_cast<int64_t>(n)).toUString(exec));
+ Identifier propertyName(exec, JSValue(static_cast<int64_t>(length) + static_cast<int64_t>(n)).toWTFString(exec));
thisObj->methodTable()->put(thisObj, exec, propertyName, exec->argument(n), slot);
}
if (exec->hadException())
@@ -661,7 +661,7 @@
l.append(minObj);
compareResult = call(exec, function, callType, callData, jsUndefined(), l).toNumber(exec);
} else
- compareResult = (jObj.toUStringInline(exec) < minObj.toUStringInline(exec)) ? -1 : 1;
+ compareResult = codePointCompareLessThan(jObj.toWTFStringInline(exec), minObj.toWTFStringInline(exec)) ? -1 : 1;
if (compareResult < 0) {
themin = j;
diff --git a/Source/JavaScriptCore/runtime/ClassInfo.h b/Source/JavaScriptCore/runtime/ClassInfo.h
index b0adab3..4c72f3e 100644
--- a/Source/JavaScriptCore/runtime/ClassInfo.h
+++ b/Source/JavaScriptCore/runtime/ClassInfo.h
@@ -75,7 +75,7 @@
typedef void (*GetPropertyNamesFunctionPtr)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
GetPropertyNamesFunctionPtr getPropertyNames;
- typedef UString (*ClassNameFunctionPtr)(const JSObject*);
+ typedef String (*ClassNameFunctionPtr)(const JSObject*);
ClassNameFunctionPtr className;
typedef bool (*HasInstanceFunctionPtr)(JSObject*, ExecState*, JSValue, JSValue);
diff --git a/Source/JavaScriptCore/runtime/DateConversion.cpp b/Source/JavaScriptCore/runtime/DateConversion.cpp
index 4783981..9331541 100644
--- a/Source/JavaScriptCore/runtime/DateConversion.cpp
+++ b/Source/JavaScriptCore/runtime/DateConversion.cpp
@@ -25,10 +25,10 @@
#include "config.h"
#include "DateConversion.h"
-#include "UString.h"
#include <wtf/Assertions.h>
#include <wtf/DateMath.h>
#include <wtf/text/StringBuilder.h>
+#include <wtf/text/WTFString.h>
#if OS(WINDOWS)
#include <windows.h>
@@ -62,7 +62,7 @@
builder.append(static_cast<char>('0' + value % 10));
}
-UString formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool asUTCVariant)
+String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool asUTCVariant)
{
bool appendDate = format & DateTimeFormatDate;
bool appendTime = format & DateTimeFormatTime;
diff --git a/Source/JavaScriptCore/runtime/DateConversion.h b/Source/JavaScriptCore/runtime/DateConversion.h
index fd1a7eb..8ea4c17 100644
--- a/Source/JavaScriptCore/runtime/DateConversion.h
+++ b/Source/JavaScriptCore/runtime/DateConversion.h
@@ -27,9 +27,11 @@
#include <wtf/GregorianDateTime.h>
-namespace JSC {
+namespace WTF {
+class String;
+} // namespace WTF
-class UString;
+namespace JSC {
enum DateTimeFormat {
DateTimeFormatDate = 1,
@@ -37,7 +39,7 @@
DateTimeFormatDateAndTime = DateTimeFormatDate | DateTimeFormatTime
};
-UString formatDateTime(const GregorianDateTime&, DateTimeFormat, bool asUTCVariant);
+WTF::String formatDateTime(const GregorianDateTime&, DateTimeFormat, bool asUTCVariant);
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/DatePrototype.cpp b/Source/JavaScriptCore/runtime/DatePrototype.cpp
index 363eec03..8cfd44e 100644
--- a/Source/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/Source/JavaScriptCore/runtime/DatePrototype.cpp
@@ -131,7 +131,7 @@
// FIXME: Since this is superior to the strftime-based version, why limit this to PLATFORM(MAC)?
// Instead we should consider using this whenever USE(CF) is true.
-static CFDateFormatterStyle styleFromArgString(const UString& string, CFDateFormatterStyle defaultStyle)
+static CFDateFormatterStyle styleFromArgString(const String& string, CFDateFormatterStyle defaultStyle)
{
if (string == "short")
return kCFDateFormatterShortStyle;
@@ -150,9 +150,9 @@
CFDateFormatterStyle timeStyle = (format != LocaleDate ? kCFDateFormatterLongStyle : kCFDateFormatterNoStyle);
bool useCustomFormat = false;
- UString customFormatString;
+ String customFormatString;
- UString arg0String = exec->argument(0).toString(exec)->value(exec);
+ String arg0String = exec->argument(0).toString(exec)->value(exec);
if (arg0String == "custom" && !exec->argument(1).isUndefined()) {
useCustomFormat = true;
customFormatString = exec->argument(1).toString(exec)->value(exec);
@@ -190,7 +190,7 @@
CFRelease(string);
- return jsNontrivialString(exec, UString(buffer, length));
+ return jsNontrivialString(exec, String(buffer, length));
}
#elif USE(ICU_UNICODE) && !UCONFIG_NO_FORMATTING
@@ -212,7 +212,7 @@
if (status != U_ZERO_ERROR)
return jsEmptyString(exec);
- return jsNontrivialString(exec, UString(buffer, length));
+ return jsNontrivialString(exec, String(buffer, length));
}
#else
@@ -253,7 +253,7 @@
if (length)
length--;
- return jsNontrivialString(exec, UString(buffer.data(), length));
+ return jsNontrivialString(exec, String(buffer.data(), length));
#else // OS(WINDOWS)
@@ -322,7 +322,7 @@
if (length != static_cast<size_t>(-1)) {
for (size_t i = 0; i < length; ++i)
buffer[i] = static_cast<UChar>(tempbuffer[i]);
- return jsNontrivialString(exec, UString(buffer, length));
+ return jsNontrivialString(exec, String(buffer, length));
}
#endif
diff --git a/Source/JavaScriptCore/runtime/Error.cpp b/Source/JavaScriptCore/runtime/Error.cpp
index a3a990d..0a522c4 100644
--- a/Source/JavaScriptCore/runtime/Error.cpp
+++ b/Source/JavaScriptCore/runtime/Error.cpp
@@ -43,37 +43,37 @@
static const char* linePropertyName = "line";
static const char* sourceURLPropertyName = "sourceURL";
-JSObject* createError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->errorStructure(), message);
}
-JSObject* createEvalError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createEvalError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->evalErrorConstructor()->errorStructure(), message);
}
-JSObject* createRangeError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createRangeError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->rangeErrorConstructor()->errorStructure(), message);
}
-JSObject* createReferenceError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createReferenceError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->referenceErrorConstructor()->errorStructure(), message);
}
-JSObject* createSyntaxError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createSyntaxError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->syntaxErrorConstructor()->errorStructure(), message);
}
-JSObject* createTypeError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createTypeError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->typeErrorConstructor()->errorStructure(), message);
@@ -84,38 +84,38 @@
return createTypeError(globalObject, "Not enough arguments");
}
-JSObject* createURIError(JSGlobalObject* globalObject, const UString& message)
+JSObject* createURIError(JSGlobalObject* globalObject, const String& message)
{
ASSERT(!message.isEmpty());
return ErrorInstance::create(globalObject->globalData(), globalObject->URIErrorConstructor()->errorStructure(), message);
}
-JSObject* createError(ExecState* exec, const UString& message)
+JSObject* createError(ExecState* exec, const String& message)
{
return createError(exec->lexicalGlobalObject(), message);
}
-JSObject* createEvalError(ExecState* exec, const UString& message)
+JSObject* createEvalError(ExecState* exec, const String& message)
{
return createEvalError(exec->lexicalGlobalObject(), message);
}
-JSObject* createRangeError(ExecState* exec, const UString& message)
+JSObject* createRangeError(ExecState* exec, const String& message)
{
return createRangeError(exec->lexicalGlobalObject(), message);
}
-JSObject* createReferenceError(ExecState* exec, const UString& message)
+JSObject* createReferenceError(ExecState* exec, const String& message)
{
return createReferenceError(exec->lexicalGlobalObject(), message);
}
-JSObject* createSyntaxError(ExecState* exec, const UString& message)
+JSObject* createSyntaxError(ExecState* exec, const String& message)
{
return createSyntaxError(exec->lexicalGlobalObject(), message);
}
-JSObject* createTypeError(ExecState* exec, const UString& message)
+JSObject* createTypeError(ExecState* exec, const String& message)
{
return createTypeError(exec->lexicalGlobalObject(), message);
}
@@ -125,7 +125,7 @@
return createNotEnoughArgumentsError(exec->lexicalGlobalObject());
}
-JSObject* createURIError(ExecState* exec, const UString& message)
+JSObject* createURIError(ExecState* exec, const String& message)
{
return createURIError(exec->lexicalGlobalObject(), message);
}
@@ -133,7 +133,7 @@
JSObject* addErrorInfo(CallFrame* callFrame, JSObject* error, int line, const SourceCode& source)
{
JSGlobalData* globalData = &callFrame->globalData();
- const UString& sourceURL = source.provider()->url();
+ const String& sourceURL = source.provider()->url();
if (line != -1)
error->putDirect(*globalData, Identifier(globalData, linePropertyName), jsNumber(line), ReadOnly | DontDelete);
diff --git a/Source/JavaScriptCore/runtime/Error.h b/Source/JavaScriptCore/runtime/Error.h
index 65aea3e..bc71f70 100644
--- a/Source/JavaScriptCore/runtime/Error.h
+++ b/Source/JavaScriptCore/runtime/Error.h
@@ -36,26 +36,25 @@
class JSObject;
class SourceCode;
class Structure;
- class UString;
// Methods to create a range of internal errors.
- JSObject* createError(JSGlobalObject*, const UString&);
- JSObject* createEvalError(JSGlobalObject*, const UString&);
- JSObject* createRangeError(JSGlobalObject*, const UString&);
- JSObject* createReferenceError(JSGlobalObject*, const UString&);
- JSObject* createSyntaxError(JSGlobalObject*, const UString&);
- JSObject* createTypeError(JSGlobalObject*, const UString&);
+ JSObject* createError(JSGlobalObject*, const String&);
+ JSObject* createEvalError(JSGlobalObject*, const String&);
+ JSObject* createRangeError(JSGlobalObject*, const String&);
+ JSObject* createReferenceError(JSGlobalObject*, const String&);
+ JSObject* createSyntaxError(JSGlobalObject*, const String&);
+ JSObject* createTypeError(JSGlobalObject*, const String&);
JSObject* createNotEnoughArgumentsError(JSGlobalObject*);
- JSObject* createURIError(JSGlobalObject*, const UString&);
+ JSObject* createURIError(JSGlobalObject*, const String&);
// ExecState wrappers.
- JS_EXPORT_PRIVATE JSObject* createError(ExecState*, const UString&);
- JSObject* createEvalError(ExecState*, const UString&);
- JS_EXPORT_PRIVATE JSObject* createRangeError(ExecState*, const UString&);
- JS_EXPORT_PRIVATE JSObject* createReferenceError(ExecState*, const UString&);
- JS_EXPORT_PRIVATE JSObject* createSyntaxError(ExecState*, const UString&);
- JS_EXPORT_PRIVATE JSObject* createTypeError(ExecState*, const UString&);
+ JS_EXPORT_PRIVATE JSObject* createError(ExecState*, const String&);
+ JSObject* createEvalError(ExecState*, const String&);
+ JS_EXPORT_PRIVATE JSObject* createRangeError(ExecState*, const String&);
+ JS_EXPORT_PRIVATE JSObject* createReferenceError(ExecState*, const String&);
+ JS_EXPORT_PRIVATE JSObject* createSyntaxError(ExecState*, const String&);
+ JS_EXPORT_PRIVATE JSObject* createTypeError(ExecState*, const String&);
JS_EXPORT_PRIVATE JSObject* createNotEnoughArgumentsError(ExecState*);
- JSObject* createURIError(ExecState*, const UString&);
+ JSObject* createURIError(ExecState*, const String&);
// Methods to add
bool hasErrorInfo(ExecState*, JSObject* error);
@@ -76,7 +75,7 @@
class StrictModeTypeErrorFunction : public InternalFunction {
private:
- StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const UString& message)
+ StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const String& message)
: InternalFunction(globalObject, structure)
, m_message(message)
{
@@ -87,7 +86,7 @@
public:
typedef InternalFunction Base;
- static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
+ static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& message)
{
StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
function->finishCreation(exec->globalData(), "");
@@ -126,7 +125,7 @@
}
private:
- UString m_message;
+ String m_message;
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.h b/Source/JavaScriptCore/runtime/ErrorInstance.h
index d6fa32f..8946763 100644
--- a/Source/JavaScriptCore/runtime/ErrorInstance.h
+++ b/Source/JavaScriptCore/runtime/ErrorInstance.h
@@ -36,7 +36,7 @@
return Structure::create(globalData, globalObject, prototype, TypeInfo(ErrorInstanceType, StructureFlags), &s_info);
}
- static ErrorInstance* create(JSGlobalData& globalData, Structure* structure, const UString& message)
+ static ErrorInstance* create(JSGlobalData& globalData, Structure* structure, const String& message)
{
ErrorInstance* instance = new (NotNull, allocateCell<ErrorInstance>(globalData.heap)) ErrorInstance(globalData, structure);
instance->finishCreation(globalData, message);
@@ -45,7 +45,7 @@
static ErrorInstance* create(ExecState* exec, Structure* structure, JSValue message)
{
- return create(exec->globalData(), structure, message.isUndefined() ? UString() : message.toString(exec)->value(exec));
+ return create(exec->globalData(), structure, message.isUndefined() ? String() : message.toString(exec)->value(exec));
}
bool appendSourceToMessage() { return m_appendSourceToMessage; }
@@ -55,7 +55,7 @@
protected:
explicit ErrorInstance(JSGlobalData&, Structure*);
- void finishCreation(JSGlobalData& globalData, const UString& message)
+ void finishCreation(JSGlobalData& globalData, const String& message)
{
Base::finishCreation(globalData);
ASSERT(inherits(&s_info));
diff --git a/Source/JavaScriptCore/runtime/ErrorPrototype.cpp b/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
index 5dd3e85..354a312 100644
--- a/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
@@ -27,7 +27,6 @@
#include "JSStringBuilder.h"
#include "ObjectPrototype.h"
#include "StringRecursionChecker.h"
-#include "UString.h"
namespace JSC {
@@ -97,7 +96,7 @@
return JSValue::encode(jsUndefined());
// 4. If name is undefined, then let name be "Error"; else let name be ToString(name).
- UString nameString;
+ String nameString;
if (name.isUndefined())
nameString = "Error";
else {
@@ -114,7 +113,7 @@
// (sic)
// 6. If msg is undefined, then let msg be the empty String; else let msg be ToString(msg).
// 7. If msg is undefined, then let msg be the empty String; else let msg be ToString(msg).
- UString messageString;
+ String messageString;
if (message.isUndefined())
messageString = "";
else {
diff --git a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
index ce63ae9..83a4e03 100644
--- a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
+++ b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
@@ -37,7 +37,6 @@
#include "JSNotAnObject.h"
#include "Interpreter.h"
#include "Nodes.h"
-#include "UStringConcatenate.h"
namespace JSC {
@@ -107,13 +106,13 @@
JSObject* createUndefinedVariableError(ExecState* exec, const Identifier& ident)
{
- UString message(makeUString("Can't find variable: ", ident.ustring()));
+ String message(makeString("Can't find variable: ", ident.ustring()));
return createReferenceError(exec, message);
}
JSObject* createInvalidParamError(ExecState* exec, const char* op, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not a valid argument for '", op, "'");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not a valid argument for '", op, "'");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
@@ -122,7 +121,7 @@
JSObject* createNotAConstructorError(ExecState* exec, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not a constructor");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not a constructor");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
@@ -131,7 +130,7 @@
JSObject* createNotAFunctionError(ExecState* exec, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not a function");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not a function");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
@@ -140,16 +139,16 @@
JSObject* createNotAnObjectError(ExecState* exec, JSValue value)
{
- UString errorMessage = makeUString("'", value.toString(exec)->value(exec), "' is not an object");
+ String errorMessage = makeString("'", value.toString(exec)->value(exec), "' is not an object");
JSObject* exception = createTypeError(exec, errorMessage);
ASSERT(exception->isErrorInstance());
static_cast<ErrorInstance*>(exception)->setAppendSourceToMessage();
return exception;
}
-JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const UString& propertyName)
+JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const String& propertyName)
{
- return createReferenceError(exec, makeUString("Strict mode forbids implicit creation of global property '", propertyName, "'"));
+ return createReferenceError(exec, makeString("Strict mode forbids implicit creation of global property '", propertyName, "'"));
}
JSObject* createOutOfMemoryError(JSGlobalObject* globalObject)
diff --git a/Source/JavaScriptCore/runtime/ExceptionHelpers.h b/Source/JavaScriptCore/runtime/ExceptionHelpers.h
index 7bffd294..d2daaa0 100644
--- a/Source/JavaScriptCore/runtime/ExceptionHelpers.h
+++ b/Source/JavaScriptCore/runtime/ExceptionHelpers.h
@@ -49,7 +49,7 @@
JSObject* createInvalidParamError(ExecState*, const char* op, JSValue);
JSObject* createNotAConstructorError(ExecState*, JSValue);
JSObject* createNotAFunctionError(ExecState*, JSValue);
-JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const UString&);
+JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const String&);
JSObject* throwOutOfMemoryError(ExecState*);
JSObject* throwStackOverflowError(ExecState*);
diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp
index 96b8b93..4ac5f88 100644
--- a/Source/JavaScriptCore/runtime/Executable.cpp
+++ b/Source/JavaScriptCore/runtime/Executable.cpp
@@ -33,8 +33,8 @@
#include "JIT.h"
#include "JITDriver.h"
#include "Parser.h"
-#include "UStringBuilder.h"
#include <wtf/Vector.h>
+#include <wtf/text/StringBuilder.h>
namespace JSC {
@@ -669,16 +669,16 @@
return FunctionExecutable::create(exec->globalData(), functionName, functionName, body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine());
}
-UString FunctionExecutable::paramString() const
+String FunctionExecutable::paramString() const
{
FunctionParameters& parameters = *m_parameters;
- UStringBuilder builder;
+ StringBuilder builder;
for (size_t pos = 0; pos < parameters.size(); ++pos) {
if (!builder.isEmpty())
builder.append(", ");
builder.append(parameters[pos].ustring());
}
- return builder.toUString();
+ return builder.toString();
}
}
diff --git a/Source/JavaScriptCore/runtime/Executable.h b/Source/JavaScriptCore/runtime/Executable.h
index 38c39f9..e13d28e 100644
--- a/Source/JavaScriptCore/runtime/Executable.h
+++ b/Source/JavaScriptCore/runtime/Executable.h
@@ -320,7 +320,7 @@
const SourceCode& source() { return m_source; }
intptr_t sourceID() const { return m_source.providerID(); }
- const UString& sourceURL() const { return m_source.provider()->url(); }
+ const String& sourceURL() const { return m_source.provider()->url(); }
int lineNo() const { return m_firstLine; }
int lastLine() const { return m_lastLine; }
@@ -661,7 +661,7 @@
JSString* nameValue() const { return m_nameValue.get(); }
size_t parameterCount() const { return m_parameters->size(); } // Excluding 'this'!
unsigned capturedVariableCount() const { return m_numCapturedVariables; }
- UString paramString() const;
+ String paramString() const;
SharedSymbolTable* symbolTable() const { return m_symbolTable.get(); }
void clearCodeIfNotCompiling();
diff --git a/Source/JavaScriptCore/runtime/FunctionConstructor.cpp b/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
index 7f82a74..0b953fd 100644
--- a/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
@@ -30,8 +30,7 @@
#include "Lexer.h"
#include "Nodes.h"
#include "Parser.h"
-#include "UStringBuilder.h"
-#include "UStringConcatenate.h"
+#include <wtf/text/StringBuilder.h>
namespace JSC {
@@ -80,25 +79,25 @@
}
// ECMA 15.3.2 The Function Constructor
-JSObject* constructFunction(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args, const Identifier& functionName, const UString& sourceURL, const TextPosition& position)
+JSObject* constructFunction(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args, const Identifier& functionName, const String& sourceURL, const TextPosition& position)
{
if (!globalObject->evalEnabled())
return throwError(exec, createEvalError(exec, "Function constructor is disabled"));
return constructFunctionSkippingEvalEnabledCheck(exec, globalObject, args, functionName, sourceURL, position);
}
-JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args, const Identifier& functionName, const UString& sourceURL, const TextPosition& position)
+JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args, const Identifier& functionName, const String& sourceURL, const TextPosition& position)
{
// Functions need to have a space following the opening { due to for web compatibility
// see https://bugs.webkit.org/show_bug.cgi?id=24350
// We also need \n before the closing } to handle // comments at the end of the last line
- UString program;
+ String program;
if (args.isEmpty())
program = "(function() { \n})";
else if (args.size() == 1)
- program = makeUString("(function() { ", args.at(0).toString(exec)->value(exec), "\n})");
+ program = makeString("(function() { ", args.at(0).toString(exec)->value(exec), "\n})");
else {
- UStringBuilder builder;
+ StringBuilder builder;
builder.append("(function(");
builder.append(args.at(0).toString(exec)->value(exec));
for (size_t i = 1; i < args.size() - 1; i++) {
@@ -108,7 +107,7 @@
builder.append(") { ");
builder.append(args.at(args.size() - 1).toString(exec)->value(exec));
builder.append("\n})");
- program = builder.toUString();
+ program = builder.toString();
}
JSGlobalData& globalData = globalObject->globalData();
@@ -127,7 +126,7 @@
// ECMA 15.3.2 The Function Constructor
JSObject* constructFunction(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args)
{
- return constructFunction(exec, globalObject, args, Identifier(exec, "anonymous"), UString(), TextPosition::minimumPosition());
+ return constructFunction(exec, globalObject, args, Identifier(exec, "anonymous"), String(), TextPosition::minimumPosition());
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/FunctionConstructor.h b/Source/JavaScriptCore/runtime/FunctionConstructor.h
index 31986b7..99eafee 100644
--- a/Source/JavaScriptCore/runtime/FunctionConstructor.h
+++ b/Source/JavaScriptCore/runtime/FunctionConstructor.h
@@ -56,10 +56,10 @@
static CallType getCallData(JSCell*, CallData&);
};
- JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const UString& sourceURL, const WTF::TextPosition&);
+ JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const String& sourceURL, const WTF::TextPosition&);
JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&);
- JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, const UString&, const WTF::TextPosition&);
+ JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, const String&, const WTF::TextPosition&);
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/FunctionPrototype.cpp b/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
index 4206cf2..a200dca 100644
--- a/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
@@ -47,7 +47,7 @@
{
}
-void FunctionPrototype::finishCreation(ExecState* exec, const UString& name)
+void FunctionPrototype::finishCreation(ExecState* exec, const String& name)
{
Base::finishCreation(exec->globalData(), name);
putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
@@ -83,7 +83,7 @@
// Functions
// Compatibility hack for the Optimost JavaScript library. (See <rdar://problem/6595040>.)
-static inline void insertSemicolonIfNeeded(UString& functionBody)
+static inline void insertSemicolonIfNeeded(String& functionBody)
{
ASSERT(functionBody[0] == '{');
ASSERT(functionBody[functionBody.length() - 1] == '}');
@@ -92,7 +92,7 @@
UChar ch = functionBody[i];
if (!Lexer<UChar>::isWhiteSpace(ch) && !Lexer<UChar>::isLineTerminator(ch)) {
if (ch != ';' && ch != '}')
- functionBody = makeUString(functionBody.substringSharingImpl(0, i + 1), ";", functionBody.substringSharingImpl(i + 1, functionBody.length() - (i + 1)));
+ functionBody = makeString(functionBody.substringSharingImpl(0, i + 1), ";", functionBody.substringSharingImpl(i + 1, functionBody.length() - (i + 1)));
return;
}
}
@@ -106,7 +106,7 @@
if (function->isHostFunction())
return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}"));
FunctionExecutable* executable = function->jsExecutable();
- UString sourceString = executable->source().toString();
+ String sourceString = executable->source().toString();
insertSemicolonIfNeeded(sourceString);
return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "(", executable->paramString(), ") ", sourceString));
}
diff --git a/Source/JavaScriptCore/runtime/FunctionPrototype.h b/Source/JavaScriptCore/runtime/FunctionPrototype.h
index 5942791..9ffebf7 100644
--- a/Source/JavaScriptCore/runtime/FunctionPrototype.h
+++ b/Source/JavaScriptCore/runtime/FunctionPrototype.h
@@ -46,7 +46,7 @@
static const ClassInfo s_info;
protected:
- void finishCreation(ExecState*, const UString& name);
+ void finishCreation(ExecState*, const String& name);
private:
FunctionPrototype(JSGlobalObject*, Structure*);
diff --git a/Source/JavaScriptCore/runtime/Identifier.h b/Source/JavaScriptCore/runtime/Identifier.h
index 196fdca..e52b5a9 100644
--- a/Source/JavaScriptCore/runtime/Identifier.h
+++ b/Source/JavaScriptCore/runtime/Identifier.h
@@ -23,9 +23,9 @@
#include "JSGlobalData.h"
#include <wtf/ThreadSpecific.h>
-#include "UString.h"
#include <wtf/WTFThreadData.h>
#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
@@ -45,14 +45,15 @@
Identifier(JSGlobalData* globalData, const char (&characters)[charactersCount]) : m_string(add(globalData, characters)) { }
Identifier(ExecState* exec, StringImpl* rep) : m_string(add(exec, rep)) { }
- Identifier(ExecState* exec, const UString& s) : m_string(add(exec, s.impl())) { }
+ Identifier(ExecState* exec, const String& s) : m_string(add(exec, s.impl())) { }
Identifier(JSGlobalData* globalData, const LChar* s, int length) : m_string(add(globalData, s, length)) { }
Identifier(JSGlobalData* globalData, const UChar* s, int length) : m_string(add(globalData, s, length)) { }
Identifier(JSGlobalData* globalData, StringImpl* rep) : m_string(add(globalData, rep)) { }
- Identifier(JSGlobalData* globalData, const UString& s) : m_string(add(globalData, s.impl())) { }
+ Identifier(JSGlobalData* globalData, const String& s) : m_string(add(globalData, s.impl())) { }
- const UString& ustring() const { return m_string; }
+ // FIXME: fix this name.
+ const String& ustring() const { return m_string; }
StringImpl* impl() const { return m_string.impl(); }
const UChar* characters() const { return m_string.characters(); }
@@ -91,7 +92,7 @@
JS_EXPORT_PRIVATE static PassRefPtr<StringImpl> add(ExecState*, const char*);
private:
- UString m_string;
+ String m_string;
template <typename CharType>
ALWAYS_INLINE static uint32_t toUInt32FromCharacters(const CharType* characters, unsigned length, bool& ok);
diff --git a/Source/JavaScriptCore/runtime/InitializeThreading.cpp b/Source/JavaScriptCore/runtime/InitializeThreading.cpp
index 6de292a..6e7eddb 100644
--- a/Source/JavaScriptCore/runtime/InitializeThreading.cpp
+++ b/Source/JavaScriptCore/runtime/InitializeThreading.cpp
@@ -36,7 +36,6 @@
#include "JSDateMath.h"
#include "JSGlobalObject.h"
#include "LLIntData.h"
-#include "UString.h"
#include "WriteBarrier.h"
#include <wtf/dtoa.h>
#include <wtf/Threading.h>
diff --git a/Source/JavaScriptCore/runtime/InternalFunction.cpp b/Source/JavaScriptCore/runtime/InternalFunction.cpp
index 985ab73..216dce3 100644
--- a/Source/JavaScriptCore/runtime/InternalFunction.cpp
+++ b/Source/JavaScriptCore/runtime/InternalFunction.cpp
@@ -39,7 +39,7 @@
{
}
-void InternalFunction::finishCreation(JSGlobalData& globalData, const UString& name)
+void InternalFunction::finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData);
ASSERT(inherits(&s_info));
@@ -47,19 +47,19 @@
putDirect(globalData, globalData.propertyNames->name, jsString(&globalData, name.isNull() ? "" : name), DontDelete | ReadOnly | DontEnum);
}
-const UString& InternalFunction::name(ExecState* exec)
+const String& InternalFunction::name(ExecState* exec)
{
return asString(getDirect(exec->globalData(), exec->globalData().propertyNames->name))->tryGetValue();
}
-const UString InternalFunction::displayName(ExecState* exec)
+const String InternalFunction::displayName(ExecState* exec)
{
JSValue displayName = getDirect(exec->globalData(), exec->globalData().propertyNames->displayName);
if (displayName && isJSString(displayName))
return asString(displayName)->tryGetValue();
- return UString();
+ return String();
}
CallType InternalFunction::getCallData(JSCell*, CallData&)
@@ -68,9 +68,9 @@
return CallTypeNone;
}
-const UString InternalFunction::calculatedDisplayName(ExecState* exec)
+const String InternalFunction::calculatedDisplayName(ExecState* exec)
{
- const UString explicitName = displayName(exec);
+ const String explicitName = displayName(exec);
if (!explicitName.isEmpty())
return explicitName;
diff --git a/Source/JavaScriptCore/runtime/InternalFunction.h b/Source/JavaScriptCore/runtime/InternalFunction.h
index 150fb75..e26b9f9 100644
--- a/Source/JavaScriptCore/runtime/InternalFunction.h
+++ b/Source/JavaScriptCore/runtime/InternalFunction.h
@@ -37,9 +37,9 @@
static JS_EXPORTDATA const ClassInfo s_info;
- JS_EXPORT_PRIVATE const UString& name(ExecState*);
- const UString displayName(ExecState*);
- const UString calculatedDisplayName(ExecState*);
+ JS_EXPORT_PRIVATE const String& name(ExecState*);
+ const String displayName(ExecState*);
+ const String calculatedDisplayName(ExecState*);
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto)
{
@@ -51,7 +51,7 @@
JS_EXPORT_PRIVATE InternalFunction(JSGlobalObject*, Structure*);
- JS_EXPORT_PRIVATE void finishCreation(JSGlobalData&, const UString& name);
+ JS_EXPORT_PRIVATE void finishCreation(JSGlobalData&, const String& name);
static CallType getCallData(JSCell*, CallData&);
};
diff --git a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp
index 8517085..cd1d830 100644
--- a/Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp
+++ b/Source/JavaScriptCore/runtime/JSAPIValueWrapper.cpp
@@ -24,7 +24,6 @@
#include "JSAPIValueWrapper.h"
#include "NumberObject.h"
-#include "UString.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp
index 7218604..f24dc75 100644
--- a/Source/JavaScriptCore/runtime/JSArray.cpp
+++ b/Source/JavaScriptCore/runtime/JSArray.cpp
@@ -1479,7 +1479,7 @@
// a toString call raises an exception.
for (size_t i = 0; i < lengthNotIncludingUndefined; i++)
- values[i].second = values[i].first.toUStringInline(exec);
+ values[i].second = values[i].first.toWTFStringInline(exec);
if (exec->hadException()) {
Heap::heap(this)->popTempSortVector(&values);
diff --git a/Source/JavaScriptCore/runtime/JSBoundFunction.cpp b/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
index 3f64308..7540d43 100644
--- a/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
@@ -76,7 +76,7 @@
return JSValue::encode(construct(exec, targetFunction, constructType, constructData, args));
}
-JSBoundFunction* JSBoundFunction::create(ExecState* exec, JSGlobalObject* globalObject, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int length, const UString& name)
+JSBoundFunction* JSBoundFunction::create(ExecState* exec, JSGlobalObject* globalObject, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int length, const String& name)
{
ConstructData constructData;
ConstructType constructType = JSC::getConstructData(targetFunction, constructData);
@@ -107,7 +107,7 @@
{
}
-void JSBoundFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const UString& name)
+void JSBoundFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const String& name)
{
Base::finishCreation(exec, executable, length, name);
ASSERT(inherits(&s_info));
diff --git a/Source/JavaScriptCore/runtime/JSBoundFunction.h b/Source/JavaScriptCore/runtime/JSBoundFunction.h
index dd12292..5067d19 100644
--- a/Source/JavaScriptCore/runtime/JSBoundFunction.h
+++ b/Source/JavaScriptCore/runtime/JSBoundFunction.h
@@ -37,7 +37,7 @@
public:
typedef JSFunction Base;
- static JSBoundFunction* create(ExecState*, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const UString&);
+ static JSBoundFunction* create(ExecState*, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const String&);
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue proto);
@@ -61,7 +61,7 @@
private:
JSBoundFunction(ExecState*, JSGlobalObject*, Structure*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs);
- void finishCreation(ExecState*, NativeExecutable*, int, const UString&);
+ void finishCreation(ExecState*, NativeExecutable*, int, const String&);
WriteBarrier<JSObject> m_targetFunction;
WriteBarrier<Unknown> m_boundThis;
diff --git a/Source/JavaScriptCore/runtime/JSCell.cpp b/Source/JavaScriptCore/runtime/JSCell.cpp
index 61e8549..ffb76ff 100644
--- a/Source/JavaScriptCore/runtime/JSCell.cpp
+++ b/Source/JavaScriptCore/runtime/JSCell.cpp
@@ -38,7 +38,7 @@
cell->JSCell::~JSCell();
}
-bool JSCell::getString(ExecState* exec, UString&stringValue) const
+bool JSCell::getString(ExecState* exec, String& stringValue) const
{
if (!isString())
return false;
@@ -46,9 +46,9 @@
return true;
}
-UString JSCell::getString(ExecState* exec) const
+String JSCell::getString(ExecState* exec) const
{
- return isString() ? static_cast<const JSString*>(this)->value(exec) : UString();
+ return isString() ? static_cast<const JSString*>(this)->value(exec) : String();
}
JSObject* JSCell::getObject()
@@ -178,10 +178,10 @@
ASSERT_NOT_REACHED();
}
-UString JSCell::className(const JSObject*)
+String JSCell::className(const JSObject*)
{
ASSERT_NOT_REACHED();
- return UString();
+ return String();
}
const char* JSCell::className()
diff --git a/Source/JavaScriptCore/runtime/JSCell.h b/Source/JavaScriptCore/runtime/JSCell.h
index 130f970..ef06b1e 100644
--- a/Source/JavaScriptCore/runtime/JSCell.h
+++ b/Source/JavaScriptCore/runtime/JSCell.h
@@ -89,8 +89,8 @@
const char* className();
// Extracting the value.
- JS_EXPORT_PRIVATE bool getString(ExecState* exec, UString&) const;
- JS_EXPORT_PRIVATE UString getString(ExecState* exec) const; // null string if not a string
+ JS_EXPORT_PRIVATE bool getString(ExecState*, String&) const;
+ JS_EXPORT_PRIVATE String getString(ExecState*) const; // null string if not a string
JS_EXPORT_PRIVATE JSObject* getObject(); // NULL if not an object
const JSObject* getObject() const; // NULL if not an object
@@ -126,7 +126,7 @@
// call this function, not its slower virtual counterpart. (For integer
// property names, we want a similar interface with appropriate optimizations.)
bool fastGetOwnPropertySlot(ExecState*, PropertyName, PropertySlot&);
- JSValue fastGetOwnProperty(ExecState*, const UString&);
+ JSValue fastGetOwnProperty(ExecState*, const String&);
static ptrdiff_t structureOffset()
{
@@ -161,7 +161,7 @@
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
static NO_RETURN_DUE_TO_ASSERT void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static NO_RETURN_DUE_TO_ASSERT void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
- static UString className(const JSObject*);
+ static String className(const JSObject*);
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty);
static NO_RETURN_DUE_TO_ASSERT void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
@@ -223,17 +223,17 @@
return isCell() && asCell()->isObject();
}
- inline bool JSValue::getString(ExecState* exec, UString& s) const
+ inline bool JSValue::getString(ExecState* exec, String& s) const
{
return isCell() && asCell()->getString(exec, s);
}
- inline UString JSValue::getString(ExecState* exec) const
+ inline String JSValue::getString(ExecState* exec) const
{
- return isCell() ? asCell()->getString(exec) : UString();
+ return isCell() ? asCell()->getString(exec) : String();
}
- template <typename Base> UString HandleConverter<Base, Unknown>::getString(ExecState* exec) const
+ template <typename Base> String HandleConverter<Base, Unknown>::getString(ExecState* exec) const
{
return jsValue().getString(exec);
}
diff --git a/Source/JavaScriptCore/runtime/JSDateMath.cpp b/Source/JavaScriptCore/runtime/JSDateMath.cpp
index fcf1c43..f934391 100644
--- a/Source/JavaScriptCore/runtime/JSDateMath.cpp
+++ b/Source/JavaScriptCore/runtime/JSDateMath.cpp
@@ -258,7 +258,7 @@
return ms - (offset * WTF::msPerMinute);
}
-double parseDate(ExecState* exec, const UString& date)
+double parseDate(ExecState* exec, const String& date)
{
if (date == exec->globalData().cachedDateString)
return exec->globalData().cachedDateStringValue;
diff --git a/Source/JavaScriptCore/runtime/JSDateMath.h b/Source/JavaScriptCore/runtime/JSDateMath.h
index c7fb5a9..a6dd96f 100644
--- a/Source/JavaScriptCore/runtime/JSDateMath.h
+++ b/Source/JavaScriptCore/runtime/JSDateMath.h
@@ -49,13 +49,12 @@
namespace JSC {
class ExecState;
-class UString;
void msToGregorianDateTime(ExecState*, double, bool outputIsUTC, GregorianDateTime&);
double gregorianDateTimeToMS(ExecState*, const GregorianDateTime&, double, bool inputIsUTC);
double getUTCOffset(ExecState*);
double parseDateFromNullTerminatedCharacters(ExecState*, const char* dateString);
-double parseDate(ExecState*, const UString&);
+double parseDate(ExecState*, const WTF::String&);
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp
index 694d838..8082f4d 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp
@@ -59,7 +59,7 @@
return isHostFunction();
}
-JSFunction* JSFunction::create(ExecState* exec, JSGlobalObject* globalObject, int length, const UString& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor)
+JSFunction* JSFunction::create(ExecState* exec, JSGlobalObject* globalObject, int length, const String& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor)
{
NativeExecutable* executable;
#if !ENABLE(JIT)
@@ -92,7 +92,7 @@
{
}
-void JSFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const UString& name)
+void JSFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const String& name)
{
Base::finishCreation(exec->globalData());
ASSERT(inherits(&s_info));
@@ -125,29 +125,29 @@
return m_cachedInheritorID.get();
}
-const UString& JSFunction::name(ExecState* exec)
+const String& JSFunction::name(ExecState* exec)
{
return asString(getDirect(exec->globalData(), exec->globalData().propertyNames->name))->tryGetValue();
}
-const UString JSFunction::displayName(ExecState* exec)
+const String JSFunction::displayName(ExecState* exec)
{
JSValue displayName = getDirect(exec->globalData(), exec->globalData().propertyNames->displayName);
if (displayName && isJSString(displayName))
return asString(displayName)->tryGetValue();
- return UString();
+ return String();
}
-const UString JSFunction::calculatedDisplayName(ExecState* exec)
+const String JSFunction::calculatedDisplayName(ExecState* exec)
{
- const UString explicitName = displayName(exec);
+ const String explicitName = displayName(exec);
if (!explicitName.isEmpty())
return explicitName;
- const UString actualName = name(exec);
+ const String actualName = name(exec);
if (!actualName.isEmpty() || isHostFunction())
return actualName;
@@ -455,7 +455,7 @@
}
-UString getCalculatedDisplayName(CallFrame* callFrame, JSObject* object)
+String getCalculatedDisplayName(CallFrame* callFrame, JSObject* object)
{
if (JSFunction* function = jsDynamicCast<JSFunction*>(object))
return function->calculatedDisplayName(callFrame);
diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h
index 56faf00..cde0c0b 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.h
+++ b/Source/JavaScriptCore/runtime/JSFunction.h
@@ -44,7 +44,7 @@
JS_EXPORT_PRIVATE EncodedJSValue JSC_HOST_CALL callHostFunctionAsConstructor(ExecState*);
- JS_EXPORT_PRIVATE UString getCalculatedDisplayName(CallFrame*, JSObject*);
+ JS_EXPORT_PRIVATE String getCalculatedDisplayName(CallFrame*, JSObject*);
class JSFunction : public JSNonFinalObject {
friend class JIT;
@@ -55,7 +55,7 @@
public:
typedef JSNonFinalObject Base;
- JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const UString& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor);
+ JS_EXPORT_PRIVATE static JSFunction* create(ExecState*, JSGlobalObject*, int length, const String& name, NativeFunction, Intrinsic = NoIntrinsic, NativeFunction nativeConstructor = callHostFunctionAsConstructor);
static JSFunction* create(ExecState* exec, FunctionExecutable* executable, ScopeChainNode* scopeChain)
{
@@ -65,9 +65,9 @@
return function;
}
- JS_EXPORT_PRIVATE const UString& name(ExecState*);
- JS_EXPORT_PRIVATE const UString displayName(ExecState*);
- const UString calculatedDisplayName(ExecState*);
+ JS_EXPORT_PRIVATE const String& name(ExecState*);
+ JS_EXPORT_PRIVATE const String displayName(ExecState*);
+ const String calculatedDisplayName(ExecState*);
ScopeChainNode* scope()
{
@@ -139,7 +139,7 @@
JS_EXPORT_PRIVATE JSFunction(ExecState*, JSGlobalObject*, Structure*);
JSFunction(ExecState*, FunctionExecutable*, ScopeChainNode*);
- void finishCreation(ExecState*, NativeExecutable*, int length, const UString& name);
+ void finishCreation(ExecState*, NativeExecutable*, int length, const String& name);
void finishCreation(ExecState*, FunctionExecutable*, ScopeChainNode*);
Structure* cacheInheritorID(ExecState*);
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.cpp b/Source/JavaScriptCore/runtime/JSGlobalData.cpp
index 893dbba..3e8d449 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -390,7 +390,7 @@
{
cachedUTCOffset = std::numeric_limits<double>::quiet_NaN();
dstOffsetCache.reset();
- cachedDateString = UString();
+ cachedDateString = String();
cachedDateStringValue = std::numeric_limits<double>::quiet_NaN();
dateInstanceCache.reset();
}
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.h b/Source/JavaScriptCore/runtime/JSGlobalData.h
index b1b7ad8..0ddc24d8 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.h
@@ -76,7 +76,6 @@
class RegExpCache;
class Stringifier;
class Structure;
- class UString;
#if ENABLE(REGEXP_TRACING)
class RegExp;
#endif
@@ -366,7 +365,7 @@
double cachedUTCOffset;
DSTOffsetCache dstOffsetCache;
- UString cachedDateString;
+ String cachedDateString;
double cachedDateStringValue;
int maxReentryDepth;
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index e8017b9..741f0ab 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -34,7 +34,6 @@
#include "LiteralParser.h"
#include "Nodes.h"
#include "Parser.h"
-#include "UStringBuilder.h"
#include <wtf/dtoa.h>
#include <stdio.h>
#include <stdlib.h>
@@ -42,6 +41,7 @@
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
#include <wtf/StringExtras.h>
+#include <wtf/text/StringBuilder.h>
#include <wtf/unicode/UTF8.h>
using namespace WTF;
@@ -142,7 +142,7 @@
static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict)
{
JSStringBuilder builder;
- UString str = exec->argument(0).toString(exec)->value(exec);
+ String str = exec->argument(0).toString(exec)->value(exec);
if (str.is8Bit())
return decode(exec, str.characters8(), str.length(), doNotUnescape, strict);
@@ -232,7 +232,7 @@
// ES5.1 15.1.2.2
template <typename CharType>
ALWAYS_INLINE
-static double parseInt(const UString& s, const CharType* data, int radix)
+static double parseInt(const String& s, const CharType* data, int radix)
{
// 1. Let inputString be ToString(string).
// 2. Let S be a newly created substring of inputString consisting of the first character that is not a
@@ -313,7 +313,7 @@
return sign * number;
}
-static double parseInt(const UString& s, int radix)
+static double parseInt(const String& s, int radix)
{
if (s.is8Bit())
return parseInt(s, s.characters8(), radix);
@@ -432,7 +432,7 @@
}
// See ecma-262 9.3.1
-double jsToNumber(const UString& s)
+double jsToNumber(const String& s)
{
unsigned size = s.length();
@@ -450,7 +450,7 @@
return toDouble(s.characters16(), size);
}
-static double parseFloat(const UString& s)
+static double parseFloat(const String& s)
{
unsigned size = s.length();
@@ -505,7 +505,7 @@
if (!x.isString())
return JSValue::encode(x);
- UString s = x.toString(exec)->value(exec);
+ String s = x.toString(exec)->value(exec);
if (s.is8Bit()) {
LiteralParser<LChar> preparser(exec, s.characters8(), s.length(), NonStrictJSON);
@@ -548,7 +548,7 @@
}
// If ToString throws, we shouldn't call ToInt32.
- UString s = value.toString(exec)->value(exec);
+ String s = value.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -615,7 +615,7 @@
"*+-./@_";
JSStringBuilder builder;
- UString str = exec->argument(0).toString(exec)->value(exec);
+ String str = exec->argument(0).toString(exec)->value(exec);
if (str.is8Bit()) {
const LChar* c = str.characters8();
for (unsigned k = 0; k < str.length(); k++, c++) {
@@ -653,8 +653,8 @@
EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState* exec)
{
- UStringBuilder builder;
- UString str = exec->argument(0).toString(exec)->value(exec);
+ StringBuilder builder;
+ String str = exec->argument(0).toString(exec)->value(exec);
int k = 0;
int len = str.length();
@@ -699,7 +699,7 @@
}
}
- return JSValue::encode(jsString(exec, builder.toUString()));
+ return JSValue::encode(jsString(exec, builder.toString()));
}
EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeError(ExecState* exec)
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
index 8833bf6..757c9dc 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
@@ -56,7 +56,7 @@
ALWAYS_INLINE double parseIntOverflow(const char* s, int length, int radix) { return parseIntOverflow(reinterpret_cast<const LChar*>(s), length, radix); }
double parseIntOverflow(const UChar*, int length, int radix);
bool isStrWhiteSpace(UChar);
- double jsToNumber(const UString& s);
+ double jsToNumber(const WTF::String&);
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSONObject.cpp b/Source/JavaScriptCore/runtime/JSONObject.cpp
index ba887f3..9c01895 100644
--- a/Source/JavaScriptCore/runtime/JSONObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSONObject.cpp
@@ -36,9 +36,8 @@
#include "LocalScope.h"
#include "Lookup.h"
#include "PropertyNameArray.h"
-#include "UStringBuilder.h"
-#include "UStringConcatenate.h"
#include <wtf/MathExtras.h>
+#include <wtf/text/StringBuilder.h>
namespace JSC {
@@ -94,7 +93,7 @@
JSObject* object() const { return m_object.get(); }
- bool appendNextProperty(Stringifier&, UStringBuilder&);
+ bool appendNextProperty(Stringifier&, StringBuilder&);
private:
Local<JSObject> m_object;
@@ -107,17 +106,17 @@
friend class Holder;
- static void appendQuotedString(UStringBuilder&, const UString&);
+ static void appendQuotedString(StringBuilder&, const String&);
JSValue toJSON(JSValue, const PropertyNameForFunctionCall&);
enum StringifyResult { StringifyFailed, StringifySucceeded, StringifyFailedDueToUndefinedValue };
- StringifyResult appendStringifiedValue(UStringBuilder&, JSValue, JSObject* holder, const PropertyNameForFunctionCall&);
+ StringifyResult appendStringifiedValue(StringBuilder&, JSValue, JSObject* holder, const PropertyNameForFunctionCall&);
bool willIndent() const;
void indent();
void unindent();
- void startNewLine(UStringBuilder&) const;
+ void startNewLine(StringBuilder&) const;
ExecState* const m_exec;
const Local<Unknown> m_replacer;
@@ -125,11 +124,11 @@
PropertyNameArray m_arrayReplacerPropertyNames;
CallType m_replacerCallType;
CallData m_replacerCallData;
- const UString m_gap;
+ const String m_gap;
Vector<Holder, 16> m_holderStack;
- UString m_repeatedGap;
- UString m_indent;
+ String m_repeatedGap;
+ String m_indent;
};
// ------------------------------ helper functions --------------------------------
@@ -148,7 +147,7 @@
return value;
}
-static inline UString gap(ExecState* exec, JSValue space)
+static inline String gap(ExecState* exec, JSValue space)
{
const unsigned maxGapLength = 10;
space = unwrapBoxedPrimitive(exec, space);
@@ -166,11 +165,11 @@
UChar spaces[maxGapLength];
for (int i = 0; i < count; ++i)
spaces[i] = ' ';
- return UString(spaces, count);
+ return String(spaces, count);
}
// If the space value is a string, use it as the gap string, otherwise use no gap string.
- UString spaces = space.getString(exec);
+ String spaces = space.getString(exec);
if (spaces.length() > maxGapLength) {
spaces = spaces.substringSharingImpl(0, maxGapLength);
}
@@ -245,17 +244,17 @@
PropertyNameForFunctionCall emptyPropertyName(m_exec->globalData().propertyNames->emptyIdentifier);
object->putDirect(m_exec->globalData(), m_exec->globalData().propertyNames->emptyIdentifier, value.get());
- UStringBuilder result;
+ StringBuilder result;
if (appendStringifiedValue(result, value.get(), object, emptyPropertyName) != StringifySucceeded)
return Local<Unknown>(m_exec->globalData(), jsUndefined());
if (m_exec->hadException())
return Local<Unknown>(m_exec->globalData(), jsNull());
- return Local<Unknown>(m_exec->globalData(), jsString(m_exec, result.toUString()));
+ return Local<Unknown>(m_exec->globalData(), jsString(m_exec, result.toString()));
}
template <typename CharType>
-static void appendStringToUStringBuilder(UStringBuilder& builder, const CharType* data, int length)
+static void appendStringToStringBuilder(StringBuilder& builder, const CharType* data, int length)
{
for (int i = 0; i < length; ++i) {
int start = i;
@@ -303,16 +302,16 @@
}
}
-void Stringifier::appendQuotedString(UStringBuilder& builder, const UString& value)
+void Stringifier::appendQuotedString(StringBuilder& builder, const String& value)
{
int length = value.length();
builder.append('"');
if (value.is8Bit())
- appendStringToUStringBuilder<LChar>(builder, value.characters8(), length);
+ appendStringToStringBuilder<LChar>(builder, value.characters8(), length);
else
- appendStringToUStringBuilder<UChar>(builder, value.characters16(), length);
+ appendStringToStringBuilder<UChar>(builder, value.characters16(), length);
builder.append('"');
}
@@ -341,7 +340,7 @@
return call(m_exec, object, callType, callData, value, args);
}
-Stringifier::StringifyResult Stringifier::appendStringifiedValue(UStringBuilder& builder, JSValue value, JSObject* holder, const PropertyNameForFunctionCall& propertyName)
+Stringifier::StringifyResult Stringifier::appendStringifiedValue(StringBuilder& builder, JSValue value, JSObject* holder, const PropertyNameForFunctionCall& propertyName)
{
// Call the toJSON function.
value = toJSON(value, propertyName);
@@ -376,7 +375,7 @@
return StringifySucceeded;
}
- UString stringValue;
+ String stringValue;
if (value.getString(m_exec, stringValue)) {
appendQuotedString(builder, stringValue);
return StringifySucceeded;
@@ -387,7 +386,7 @@
if (!isfinite(number))
builder.append("null");
else
- builder.append(UString::numberToStringECMAScript(number));
+ builder.append(String::numberToStringECMAScript(number));
return StringifySucceeded;
}
@@ -448,7 +447,7 @@
// Use a single shared string, m_repeatedGap, so we don't keep allocating new ones as we indent and unindent.
unsigned newSize = m_indent.length() + m_gap.length();
if (newSize > m_repeatedGap.length())
- m_repeatedGap = makeUString(m_repeatedGap, m_gap);
+ m_repeatedGap = makeString(m_repeatedGap, m_gap);
ASSERT(newSize <= m_repeatedGap.length());
m_indent = m_repeatedGap.substringSharingImpl(0, newSize);
}
@@ -459,7 +458,7 @@
m_indent = m_repeatedGap.substringSharingImpl(0, m_indent.length() - m_gap.length());
}
-inline void Stringifier::startNewLine(UStringBuilder& builder) const
+inline void Stringifier::startNewLine(StringBuilder& builder) const
{
if (m_gap.isEmpty())
return;
@@ -477,7 +476,7 @@
{
}
-bool Stringifier::Holder::appendNextProperty(Stringifier& stringifier, UStringBuilder& builder)
+bool Stringifier::Holder::appendNextProperty(Stringifier& stringifier, StringBuilder& builder)
{
ASSERT(m_index <= m_size);
@@ -704,7 +703,7 @@
}
case ArrayEndVisitMember: {
JSArray* array = arrayStack.peek();
- JSValue filteredValue = callReviver(array, jsString(m_exec, UString::number(indexStack.last())), outValue);
+ JSValue filteredValue = callReviver(array, jsString(m_exec, String::number(indexStack.last())), outValue);
if (filteredValue.isUndefined())
array->methodTable()->deletePropertyByIndex(array, m_exec, indexStack.last());
else
@@ -811,7 +810,7 @@
{
if (!exec->argumentCount())
return throwVMError(exec, createError(exec, "JSON.parse requires at least one parameter"));
- UString source = exec->argument(0).toString(exec)->value(exec);
+ String source = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsNull());
@@ -852,12 +851,12 @@
return JSValue::encode(Stringifier(exec, replacer, space).stringify(value).get());
}
-UString JSONStringify(ExecState* exec, JSValue value, unsigned indent)
+String JSONStringify(ExecState* exec, JSValue value, unsigned indent)
{
LocalScope scope(exec->globalData());
Local<Unknown> result = Stringifier(exec, Local<Unknown>(exec->globalData(), jsNull()), Local<Unknown>(exec->globalData(), jsNumber(indent))).stringify(Local<Unknown>(exec->globalData(), value));
if (result.isUndefinedOrNull())
- return UString();
+ return String();
return result.getString(exec);
}
diff --git a/Source/JavaScriptCore/runtime/JSONObject.h b/Source/JavaScriptCore/runtime/JSONObject.h
index 3b86477..b537b91 100644
--- a/Source/JavaScriptCore/runtime/JSONObject.h
+++ b/Source/JavaScriptCore/runtime/JSONObject.h
@@ -61,7 +61,7 @@
};
- UString JSONStringify(ExecState* exec, JSValue value, unsigned indent);
+ String JSONStringify(ExecState*, JSValue, unsigned indent);
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index c40c625..3275b22 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -154,7 +154,7 @@
#endif
}
-UString JSObject::className(const JSObject* object)
+String JSObject::className(const JSObject* object)
{
const ClassInfo* info = object->classInfo();
ASSERT(info);
@@ -818,7 +818,7 @@
return true;
}
-JSObject* throwTypeError(ExecState* exec, const UString& message)
+JSObject* throwTypeError(ExecState* exec, const String& message)
{
return throwError(exec, createTypeError(exec, message));
}
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index 9e1445e..ff3fb2a 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -65,7 +65,7 @@
class Structure;
struct HashTable;
- JS_EXPORT_PRIVATE JSObject* throwTypeError(ExecState*, const UString&);
+ JS_EXPORT_PRIVATE JSObject* throwTypeError(ExecState*, const String&);
extern JS_EXPORTDATA const char* StrictModeReadonlyPropertyWriteError;
// ECMA 262-3 8.6.1
@@ -99,7 +99,7 @@
JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
- JS_EXPORT_PRIVATE static UString className(const JSObject*);
+ JS_EXPORT_PRIVATE static String className(const JSObject*);
JSValue prototype() const;
void setPrototype(JSGlobalData&, JSValue prototype);
@@ -620,7 +620,7 @@
// identifier. The first time we perform a property access with a given string, try
// performing the property map lookup without forming an identifier. We detect this
// case by checking whether the hash has yet been set for this string.
-ALWAYS_INLINE JSValue JSCell::fastGetOwnProperty(ExecState* exec, const UString& name)
+ALWAYS_INLINE JSValue JSCell::fastGetOwnProperty(ExecState* exec, const String& name)
{
if (!structure()->typeInfo().overridesGetOwnPropertySlot() && !structure()->hasGetterSetterProperties()) {
PropertyOffset offset = name.impl()->hasHash()
diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp
index 4eb2a52..977f0d1 100644
--- a/Source/JavaScriptCore/runtime/JSString.cpp
+++ b/Source/JavaScriptCore/runtime/JSString.cpp
@@ -139,7 +139,7 @@
}
// Overview: These functions convert a JSString from holding a string in rope form
-// down to a simple UString representation. It does so by building up the string
+// down to a simple String representation. It does so by building up the string
// backwards, since we want to avoid recursion, we expect that the tree structure
// representing the rope is likely imbalanced with more nodes down the left side
// (since appending to the string is likely more common) - and as such resolving
@@ -214,7 +214,7 @@
for (size_t i = 0; i < s_maxInternalRopeLength && m_fibers[i]; ++i)
m_fibers[i].clear();
ASSERT(isRope());
- ASSERT(m_value == UString());
+ ASSERT(m_value.isNull());
if (exec)
throwOutOfMemoryError(exec);
}
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index e91553a..e009ecb 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -37,27 +37,27 @@
JSString* jsEmptyString(JSGlobalData*);
JSString* jsEmptyString(ExecState*);
- JSString* jsString(JSGlobalData*, const UString&); // returns empty string if passed null string
- JSString* jsString(ExecState*, const UString&); // returns empty string if passed null string
+ JSString* jsString(JSGlobalData*, const String&); // returns empty string if passed null string
+ JSString* jsString(ExecState*, const String&); // returns empty string if passed null string
JSString* jsSingleCharacterString(JSGlobalData*, UChar);
JSString* jsSingleCharacterString(ExecState*, UChar);
- JSString* jsSingleCharacterSubstring(ExecState*, const UString&, unsigned offset);
- JSString* jsSubstring(JSGlobalData*, const UString&, unsigned offset, unsigned length);
- JSString* jsSubstring(ExecState*, const UString&, unsigned offset, unsigned length);
+ JSString* jsSingleCharacterSubstring(ExecState*, const String&, unsigned offset);
+ JSString* jsSubstring(JSGlobalData*, const String&, unsigned offset, unsigned length);
+ JSString* jsSubstring(ExecState*, const String&, unsigned offset, unsigned length);
// Non-trivial strings are two or more characters long.
// These functions are faster than just calling jsString.
- JSString* jsNontrivialString(JSGlobalData*, const UString&);
- JSString* jsNontrivialString(ExecState*, const UString&);
+ JSString* jsNontrivialString(JSGlobalData*, const String&);
+ JSString* jsNontrivialString(ExecState*, const String&);
JSString* jsNontrivialString(JSGlobalData*, const char*);
JSString* jsNontrivialString(ExecState*, const char*);
// Should be used for strings that are owned by an object that will
// likely outlive the JSValue this makes, such as the parse tree or a
- // DOM object that contains a UString
- JSString* jsOwnedString(JSGlobalData*, const UString&);
- JSString* jsOwnedString(ExecState*, const UString&);
+ // DOM object that contains a String
+ JSString* jsOwnedString(JSGlobalData*, const String&);
+ JSString* jsOwnedString(ExecState*, const String&);
JSRopeString* jsStringBuilder(JSGlobalData*);
@@ -136,8 +136,8 @@
return newString;
}
- const UString& value(ExecState*) const;
- const UString& tryGetValue() const;
+ const String& value(ExecState*) const;
+ const String& tryGetValue() const;
unsigned length() { return m_length; }
JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
@@ -190,9 +190,9 @@
Is8Bit = 1u
};
- // A string is represented either by a UString or a rope of fibers.
+ // A string is represented either by a String or a rope of fibers.
unsigned m_length;
- mutable UString m_value;
+ mutable String m_value;
private:
friend class LLIntOffsetsExtractor;
@@ -203,7 +203,7 @@
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
- UString& string() { ASSERT(!isRope()); return m_value; }
+ String& string() { ASSERT(!isRope()); return m_value; }
friend JSValue jsString(ExecState*, JSString*, JSString*);
friend JSString* jsSubstring(ExecState*, JSString*, unsigned offset, unsigned length);
@@ -340,10 +340,10 @@
{
if (c <= maxSingleCharacterString)
return globalData->smallStrings.singleCharacterString(globalData, c);
- return JSString::create(*globalData, UString(&c, 1).impl());
+ return JSString::create(*globalData, String(&c, 1).impl());
}
- ALWAYS_INLINE JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset)
+ ALWAYS_INLINE JSString* jsSingleCharacterSubstring(ExecState* exec, const String& s, unsigned offset)
{
JSGlobalData* globalData = &exec->globalData();
ASSERT(offset < static_cast<unsigned>(s.length()));
@@ -358,23 +358,23 @@
ASSERT(s);
ASSERT(s[0]);
ASSERT(s[1]);
- return JSString::create(*globalData, UString(s).impl());
+ return JSString::create(*globalData, String(s).impl());
}
- inline JSString* jsNontrivialString(JSGlobalData* globalData, const UString& s)
+ inline JSString* jsNontrivialString(JSGlobalData* globalData, const String& s)
{
ASSERT(s.length() > 1);
return JSString::create(*globalData, s.impl());
}
- inline const UString& JSString::value(ExecState* exec) const
+ inline const String& JSString::value(ExecState* exec) const
{
if (isRope())
static_cast<const JSRopeString*>(this)->resolveRope(exec);
return m_value;
}
- inline const UString& JSString::tryGetValue() const
+ inline const String& JSString::tryGetValue() const
{
if (isRope())
static_cast<const JSRopeString*>(this)->resolveRope(0);
@@ -390,7 +390,7 @@
return jsSingleCharacterSubstring(exec, m_value, i);
}
- inline JSString* jsString(JSGlobalData* globalData, const UString& s)
+ inline JSString* jsString(JSGlobalData* globalData, const String& s)
{
int size = s.length();
if (!size)
@@ -414,7 +414,7 @@
return jsSubstring(globalData, s->value(exec), offset, length);
}
- inline JSString* jsSubstring8(JSGlobalData* globalData, const UString& s, unsigned offset, unsigned length)
+ inline JSString* jsSubstring8(JSGlobalData* globalData, const String& s, unsigned offset, unsigned length)
{
ASSERT(offset <= static_cast<unsigned>(s.length()));
ASSERT(length <= static_cast<unsigned>(s.length()));
@@ -429,7 +429,7 @@
return JSString::createHasOtherOwner(*globalData, StringImpl::create8(s.impl(), offset, length));
}
- inline JSString* jsSubstring(JSGlobalData* globalData, const UString& s, unsigned offset, unsigned length)
+ inline JSString* jsSubstring(JSGlobalData* globalData, const String& s, unsigned offset, unsigned length)
{
ASSERT(offset <= static_cast<unsigned>(s.length()));
ASSERT(length <= static_cast<unsigned>(s.length()));
@@ -444,7 +444,7 @@
return JSString::createHasOtherOwner(*globalData, StringImpl::create(s.impl(), offset, length));
}
- inline JSString* jsOwnedString(JSGlobalData* globalData, const UString& s)
+ inline JSString* jsOwnedString(JSGlobalData* globalData, const String& s)
{
int size = s.length();
if (!size)
@@ -463,13 +463,13 @@
}
inline JSString* jsEmptyString(ExecState* exec) { return jsEmptyString(&exec->globalData()); }
- inline JSString* jsString(ExecState* exec, const UString& s) { return jsString(&exec->globalData(), s); }
+ inline JSString* jsString(ExecState* exec, const String& s) { return jsString(&exec->globalData(), s); }
inline JSString* jsSingleCharacterString(ExecState* exec, UChar c) { return jsSingleCharacterString(&exec->globalData(), c); }
- inline JSString* jsSubstring8(ExecState* exec, const UString& s, unsigned offset, unsigned length) { return jsSubstring8(&exec->globalData(), s, offset, length); }
- inline JSString* jsSubstring(ExecState* exec, const UString& s, unsigned offset, unsigned length) { return jsSubstring(&exec->globalData(), s, offset, length); }
- inline JSString* jsNontrivialString(ExecState* exec, const UString& s) { return jsNontrivialString(&exec->globalData(), s); }
+ inline JSString* jsSubstring8(ExecState* exec, const String& s, unsigned offset, unsigned length) { return jsSubstring8(&exec->globalData(), s, offset, length); }
+ inline JSString* jsSubstring(ExecState* exec, const String& s, unsigned offset, unsigned length) { return jsSubstring(&exec->globalData(), s, offset, length); }
+ inline JSString* jsNontrivialString(ExecState* exec, const String& s) { return jsNontrivialString(&exec->globalData(), s); }
inline JSString* jsNontrivialString(ExecState* exec, const char* s) { return jsNontrivialString(&exec->globalData(), s); }
- inline JSString* jsOwnedString(ExecState* exec, const UString& s) { return jsOwnedString(&exec->globalData(), s); }
+ inline JSString* jsOwnedString(ExecState* exec, const String& s) { return jsOwnedString(&exec->globalData(), s); }
ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
@@ -527,14 +527,14 @@
return toStringSlowCase(exec);
}
- inline UString JSValue::toUString(ExecState* exec) const
+ inline String JSValue::toWTFString(ExecState* exec) const
{
if (isString())
return static_cast<JSString*>(asCell())->value(exec);
- return toUStringSlowCase(exec);
+ return toWTFStringSlowCase(exec);
}
- ALWAYS_INLINE UString inlineJSValueNotStringtoUString(const JSValue& value, ExecState* exec)
+ ALWAYS_INLINE String inlineJSValueNotStringtoString(const JSValue& value, ExecState* exec)
{
JSGlobalData& globalData = exec->globalData();
if (value.isInt32())
@@ -552,12 +552,12 @@
return value.toString(exec)->value(exec);
}
- ALWAYS_INLINE UString JSValue::toUStringInline(ExecState* exec) const
+ ALWAYS_INLINE String JSValue::toWTFStringInline(ExecState* exec) const
{
if (isString())
return static_cast<JSString*>(asCell())->value(exec);
- return inlineJSValueNotStringtoUString(*this, exec);
+ return inlineJSValueNotStringtoString(*this, exec);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSStringBuilder.h b/Source/JavaScriptCore/runtime/JSStringBuilder.h
index 1a2b812..e7778e4 100644
--- a/Source/JavaScriptCore/runtime/JSStringBuilder.h
+++ b/Source/JavaScriptCore/runtime/JSStringBuilder.h
@@ -28,7 +28,6 @@
#include "ExceptionHelpers.h"
#include "JSString.h"
-#include "UStringConcatenate.h"
#include <wtf/Vector.h>
namespace JSC {
@@ -92,7 +91,7 @@
m_okay &= buffer16.tryAppend(str, len);
}
- void append(const UString& str)
+ void append(const String& str)
{
unsigned length = str.length();
@@ -129,12 +128,12 @@
buffer8.shrinkToFit();
if (!buffer8.data())
return throwOutOfMemoryError(exec);
- return jsString(exec, UString::adopt(buffer8));
+ return jsString(exec, String::adopt(buffer8));
}
buffer16.shrinkToFit();
if (!buffer16.data())
return throwOutOfMemoryError(exec);
- return jsString(exec, UString::adopt(buffer16));
+ return jsString(exec, String::adopt(buffer16));
}
protected:
diff --git a/Source/JavaScriptCore/runtime/JSStringJoiner.cpp b/Source/JavaScriptCore/runtime/JSStringJoiner.cpp
index ea260243..0178cd8 100644
--- a/Source/JavaScriptCore/runtime/JSStringJoiner.cpp
+++ b/Source/JavaScriptCore/runtime/JSStringJoiner.cpp
@@ -35,7 +35,7 @@
namespace JSC {
// The destination is 16bits, at least one string is 16 bits.
-static inline void appendStringToData(UChar*& data, const UString& string)
+static inline void appendStringToData(UChar*& data, const String& string)
{
if (string.isNull())
return;
@@ -57,7 +57,7 @@
}
// If the destination is 8bits, we know every string has to be 8bit.
-static inline void appendStringToData(LChar*& data, const UString& string)
+static inline void appendStringToData(LChar*& data, const String& string)
{
if (string.isNull())
return;
@@ -73,7 +73,7 @@
}
template<typename CharacterType>
-static inline PassRefPtr<StringImpl> joinStrings(const Vector<UString>& strings, const UString& separator, unsigned outputLength)
+static inline PassRefPtr<StringImpl> joinStrings(const Vector<String>& strings, const String& separator, unsigned outputLength)
{
ASSERT(outputLength);
@@ -82,7 +82,7 @@
if (!outputStringImpl)
return PassRefPtr<StringImpl>();
- const UString firstString = strings.first();
+ const String firstString = strings.first();
appendStringToData(data, firstString);
for (size_t i = 1; i < strings.size(); ++i) {
diff --git a/Source/JavaScriptCore/runtime/JSStringJoiner.h b/Source/JavaScriptCore/runtime/JSStringJoiner.h
index 49f846c..5cb841a 100644
--- a/Source/JavaScriptCore/runtime/JSStringJoiner.h
+++ b/Source/JavaScriptCore/runtime/JSStringJoiner.h
@@ -27,8 +27,8 @@
#define JSStringJoiner_h
#include "JSValue.h"
-#include "UString.h"
#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
@@ -37,21 +37,21 @@
class JSStringJoiner {
public:
- JSStringJoiner(const UString& separator, size_t stringCount);
+ JSStringJoiner(const String& separator, size_t stringCount);
- void append(const UString&);
+ void append(const String&);
JSValue build(ExecState*);
private:
- UString m_separator;
- Vector<UString> m_strings;
+ String m_separator;
+ Vector<String> m_strings;
unsigned m_cumulatedStringsLength;
bool m_isValid;
bool m_is8Bits;
};
-inline JSStringJoiner::JSStringJoiner(const UString& separator, size_t stringCount)
+inline JSStringJoiner::JSStringJoiner(const String& separator, size_t stringCount)
: m_separator(separator)
, m_cumulatedStringsLength(0)
, m_isValid(true)
@@ -61,7 +61,7 @@
m_isValid = m_strings.tryReserveCapacity(stringCount);
}
-inline void JSStringJoiner::append(const UString& str)
+inline void JSStringJoiner::append(const String& str)
{
if (!m_isValid)
return;
diff --git a/Source/JavaScriptCore/runtime/JSValue.cpp b/Source/JavaScriptCore/runtime/JSValue.cpp
index c344311..0bedaa33 100644
--- a/Source/JavaScriptCore/runtime/JSValue.cpp
+++ b/Source/JavaScriptCore/runtime/JSValue.cpp
@@ -283,9 +283,9 @@
return value.toString(exec);
}
-UString JSValue::toUStringSlowCase(ExecState* exec) const
+String JSValue::toWTFStringSlowCase(ExecState* exec) const
{
- return inlineJSValueNotStringtoUString(*this, exec);
+ return inlineJSValueNotStringtoString(*this, exec);
}
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSValue.h b/Source/JavaScriptCore/runtime/JSValue.h
index 1d82233..a8a438f 100644
--- a/Source/JavaScriptCore/runtime/JSValue.h
+++ b/Source/JavaScriptCore/runtime/JSValue.h
@@ -44,7 +44,6 @@
class PropertyName;
class PropertySlot;
class PutPropertySlot;
- class UString;
#if ENABLE(DFG_JIT)
namespace DFG {
class AssemblyHelpers;
@@ -197,8 +196,8 @@
bool inherits(const ClassInfo*) const;
// Extracting the value.
- bool getString(ExecState* exec, UString&) const;
- UString getString(ExecState* exec) const; // null string if not a string
+ bool getString(ExecState*, WTF::String&) const;
+ WTF::String getString(ExecState*) const; // null string if not a string
JSObject* getObject() const; // 0 if not an object
// Extracting integer values.
@@ -214,8 +213,8 @@
// been set in the ExecState already.
double toNumber(ExecState*) const;
JSString* toString(ExecState*) const;
- UString toUString(ExecState*) const;
- UString toUStringInline(ExecState*) const;
+ WTF::String toWTFString(ExecState*) const;
+ WTF::String toWTFStringInline(ExecState*) const;
JSObject* toObject(ExecState*) const;
JSObject* toObject(ExecState*, JSGlobalObject*) const;
@@ -266,7 +265,7 @@
inline const JSValue asValue() const { return *this; }
JS_EXPORT_PRIVATE double toNumberSlowCase(ExecState*) const;
JS_EXPORT_PRIVATE JSString* toStringSlowCase(ExecState*) const;
- JS_EXPORT_PRIVATE UString toUStringSlowCase(ExecState*) const;
+ JS_EXPORT_PRIVATE WTF::String toWTFStringSlowCase(ExecState*) const;
JS_EXPORT_PRIVATE JSObject* toObjectSlowCase(ExecState*, JSGlobalObject*) const;
JS_EXPORT_PRIVATE JSObject* toThisObjectSlowCase(ExecState*) const;
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp
index e1f85ce..aa6541b 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp
+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp
@@ -31,9 +31,9 @@
#include "JSString.h"
#include "Lexer.h"
#include "StrongInlines.h"
-#include "UStringBuilder.h"
#include <wtf/ASCIICType.h>
#include <wtf/dtoa.h>
+#include <wtf/text/StringBuilder.h>
namespace JSC {
@@ -344,7 +344,7 @@
{
++m_ptr;
const CharType* runStart = m_ptr;
- UStringBuilder builder;
+ StringBuilder builder;
do {
runStart = m_ptr;
while (m_ptr < m_end && isSafeStringCharacter<mode, CharType, terminator>(*m_ptr))
@@ -400,7 +400,7 @@
} // uNNNN == 5 characters
for (int i = 1; i < 5; i++) {
if (!isASCIIHexDigit(m_ptr[i])) {
- m_lexErrorMessage = String::format("\"\\%s\" is not a valid unicode escape", UString(m_ptr, 5).ascii().data()).impl();
+ m_lexErrorMessage = String::format("\"\\%s\" is not a valid unicode escape", String(m_ptr, 5).ascii().data()).impl();
return TokError;
}
}
@@ -426,11 +426,11 @@
}
if (builder.isEmpty()) {
- token.stringBuffer = UString();
+ token.stringBuffer = String();
setParserTokenString<CharType>(token, runStart);
token.stringLength = m_ptr - runStart;
} else {
- token.stringBuffer = builder.toUString();
+ token.stringBuffer = builder.toString();
if (token.stringBuffer.is8Bit()) {
token.stringIs8Bit = 1;
token.stringToken8 = token.stringBuffer.characters8();
@@ -698,9 +698,9 @@
case TokIdentifier: {
const LiteralParserToken<CharType>& token = m_lexer.currentToken();
if (token.stringIs8Bit)
- m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", UString(m_lexer.currentToken().stringToken8, m_lexer.currentToken().stringLength).ascii().data()).impl();
+ m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", String(m_lexer.currentToken().stringToken8, m_lexer.currentToken().stringLength).ascii().data()).impl();
else
- m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", UString(m_lexer.currentToken().stringToken16, m_lexer.currentToken().stringLength).ascii().data()).impl();
+ m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", String(m_lexer.currentToken().stringToken16, m_lexer.currentToken().stringLength).ascii().data()).impl();
return JSValue();
}
case TokColon:
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.h b/Source/JavaScriptCore/runtime/LiteralParser.h
index abe3f95..61a8ef3 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.h
+++ b/Source/JavaScriptCore/runtime/LiteralParser.h
@@ -29,7 +29,7 @@
#include "Identifier.h"
#include "JSGlobalObjectFunctions.h"
#include "JSValue.h"
-#include "UString.h"
+#include <wtf/text/WTFString.h>
namespace JSC {
@@ -67,7 +67,7 @@
TokenType type;
const CharType* start;
const CharType* end;
- UString stringBuffer;
+ String stringBuffer;
union {
double numberToken;
struct {
@@ -94,7 +94,7 @@
{
}
- UString getErrorMessage()
+ String getErrorMessage()
{
if (!m_lexer.getErrorMessage().isEmpty())
return String::format("JSON Parse error: %s", m_lexer.getErrorMessage().ascii().data()).impl();
@@ -133,10 +133,10 @@
return m_currentToken;
}
- UString getErrorMessage() { return m_lexErrorMessage; }
+ String getErrorMessage() { return m_lexErrorMessage; }
private:
- UString m_lexErrorMessage;
+ String m_lexErrorMessage;
template <ParserMode mode> TokenType lex(LiteralParserToken<CharType>&);
ALWAYS_INLINE TokenType lexIdentifier(LiteralParserToken<CharType>&);
template <ParserMode mode, char terminator> ALWAYS_INLINE TokenType lexString(LiteralParserToken<CharType>&);
@@ -153,7 +153,7 @@
ExecState* m_exec;
typename LiteralParser<CharType>::Lexer m_lexer;
ParserMode m_mode;
- UString m_parseErrorMessage;
+ String m_parseErrorMessage;
static unsigned const MaximumCachableCharacter = 128;
FixedArray<Identifier, MaximumCachableCharacter> m_shortIdentifiers;
FixedArray<Identifier, MaximumCachableCharacter> m_recentIdentifiers;
diff --git a/Source/JavaScriptCore/runtime/NativeErrorConstructor.h b/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
index 76aea9d..8db2370 100644
--- a/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
+++ b/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
@@ -34,7 +34,7 @@
public:
typedef InternalFunction Base;
- static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
+ static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name)
{
NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
constructor->finishCreation(exec, globalObject, prototypeStructure, name);
@@ -51,7 +51,7 @@
Structure* errorStructure() { return m_errorStructure.get(); }
protected:
- void finishCreation(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const UString& name)
+ void finishCreation(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name)
{
Base::finishCreation(exec->globalData(), name);
ASSERT(inherits(&s_info));
diff --git a/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp b/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
index dfdd87f..7fee213 100644
--- a/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
@@ -24,7 +24,6 @@
#include "JSGlobalObject.h"
#include "JSString.h"
#include "NativeErrorConstructor.h"
-#include "UString.h"
namespace JSC {
@@ -35,7 +34,7 @@
{
}
-void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const UString& nameAndMessage, NativeErrorConstructor* constructor)
+void NativeErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, const WTF::String& nameAndMessage, NativeErrorConstructor* constructor)
{
Base::finishCreation(exec, globalObject);
putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), DontEnum);
diff --git a/Source/JavaScriptCore/runtime/NativeErrorPrototype.h b/Source/JavaScriptCore/runtime/NativeErrorPrototype.h
index 4bceb88..c94f2b7 100644
--- a/Source/JavaScriptCore/runtime/NativeErrorPrototype.h
+++ b/Source/JavaScriptCore/runtime/NativeErrorPrototype.h
@@ -33,7 +33,7 @@
public:
typedef ErrorPrototype Base;
- static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor)
+ static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& name, NativeErrorConstructor* constructor)
{
NativeErrorPrototype* prototype = new (NotNull, allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure);
prototype->finishCreation(exec, globalObject, name, constructor);
@@ -41,7 +41,7 @@
}
protected:
- void finishCreation(ExecState*, JSGlobalObject*, const UString& nameAndMessage, NativeErrorConstructor*);
+ void finishCreation(ExecState*, JSGlobalObject*, const String& nameAndMessage, NativeErrorConstructor*);
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/NumberPrototype.cpp b/Source/JavaScriptCore/runtime/NumberPrototype.cpp
index 692a584..1d79392 100644
--- a/Source/JavaScriptCore/runtime/NumberPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/NumberPrototype.cpp
@@ -339,7 +339,7 @@
return startOfResultString;
}
-static UString toUStringWithRadix(int32_t number, unsigned radix)
+static String toStringWithRadix(int32_t number, unsigned radix)
{
LChar buf[1 + 32]; // Worst case is radix == 2, which gives us 32 digits + sign.
LChar* end = buf + WTF_ARRAY_LENGTH(buf);
@@ -361,7 +361,7 @@
if (negative)
*--p = '-';
- return UString(p, static_cast<unsigned>(end - p));
+ return String(p, static_cast<unsigned>(end - p));
}
// toExponential converts a number to a string, always formatting as an expoential.
@@ -382,7 +382,7 @@
// Handle NaN and Infinity.
if (!isfinite(x))
- return JSValue::encode(jsString(exec, UString::numberToStringECMAScript(x)));
+ return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));
// Round if the argument is not undefined, always format as exponential.
char buffer[WTF::NumberToStringBufferLength];
@@ -392,7 +392,7 @@
isUndefined
? converter.ToExponential(x, -1, &builder)
: converter.ToExponential(x, decimalPlacesInExponent, &builder);
- return JSValue::encode(jsString(exec, UString(builder.Finalize())));
+ return JSValue::encode(jsString(exec, String(builder.Finalize())));
}
// toFixed converts a number to a string, always formatting as an a decimal fraction.
@@ -415,14 +415,14 @@
// This also covers Ininity, and structure the check so that NaN
// values are also handled by numberToString
if (!(fabs(x) < 1e+21))
- return JSValue::encode(jsString(exec, UString::numberToStringECMAScript(x)));
+ return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));
// The check above will return false for NaN or Infinity, these will be
// handled by numberToString.
ASSERT(isfinite(x));
NumberToStringBuffer buffer;
- return JSValue::encode(jsString(exec, UString(numberToFixedWidthString(x, decimalPlaces, buffer))));
+ return JSValue::encode(jsString(exec, String(numberToFixedWidthString(x, decimalPlaces, buffer))));
}
// toPrecision converts a number to a string, takeing an argument specifying a
@@ -446,14 +446,14 @@
// To precision called with no argument is treated as ToString.
if (isUndefined)
- return JSValue::encode(jsString(exec, UString::numberToStringECMAScript(x)));
+ return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));
// Handle NaN and Infinity.
if (!isfinite(x))
- return JSValue::encode(jsString(exec, UString::numberToStringECMAScript(x)));
+ return JSValue::encode(jsString(exec, String::numberToStringECMAScript(x)));
NumberToStringBuffer buffer;
- return JSValue::encode(jsString(exec, UString(numberToFixedPrecisionString(x, significantFigures, buffer))));
+ return JSValue::encode(jsString(exec, String(numberToFixedPrecisionString(x, significantFigures, buffer))));
}
static inline int32_t extractRadixFromArgs(ExecState* exec)
@@ -485,7 +485,7 @@
return JSValue::encode(jsString(globalData, globalData->numericStrings.add(value)));
}
- return JSValue::encode(jsString(exec, toUStringWithRadix(value, radix)));
+ return JSValue::encode(jsString(exec, toStringWithRadix(value, radix)));
}
@@ -509,7 +509,7 @@
}
if (!isfinite(doubleValue))
- return JSValue::encode(jsString(exec, UString::numberToStringECMAScript(doubleValue)));
+ return JSValue::encode(jsString(exec, String::numberToStringECMAScript(doubleValue)));
RadixBuffer s;
return JSValue::encode(jsString(exec, toStringWithRadix(s, doubleValue, radix)));
diff --git a/Source/JavaScriptCore/runtime/NumericStrings.h b/Source/JavaScriptCore/runtime/NumericStrings.h
index 07e8494..4cd92fc 100644
--- a/Source/JavaScriptCore/runtime/NumericStrings.h
+++ b/Source/JavaScriptCore/runtime/NumericStrings.h
@@ -26,25 +26,25 @@
#ifndef NumericStrings_h
#define NumericStrings_h
-#include "UString.h"
#include <wtf/FixedArray.h>
#include <wtf/HashFunctions.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
class NumericStrings {
public:
- ALWAYS_INLINE UString add(double d)
+ ALWAYS_INLINE String add(double d)
{
CacheEntry<double>& entry = lookup(d);
if (d == entry.key && !entry.value.isNull())
return entry.value;
entry.key = d;
- entry.value = UString::numberToStringECMAScript(d);
+ entry.value = String::numberToStringECMAScript(d);
return entry.value;
}
- ALWAYS_INLINE UString add(int i)
+ ALWAYS_INLINE String add(int i)
{
if (static_cast<unsigned>(i) < cacheSize)
return lookupSmallString(static_cast<unsigned>(i));
@@ -52,11 +52,11 @@
if (i == entry.key && !entry.value.isNull())
return entry.value;
entry.key = i;
- entry.value = UString::number(i);
+ entry.value = String::number(i);
return entry.value;
}
- ALWAYS_INLINE UString add(unsigned i)
+ ALWAYS_INLINE String add(unsigned i)
{
if (i < cacheSize)
return lookupSmallString(static_cast<unsigned>(i));
@@ -64,7 +64,7 @@
if (i == entry.key && !entry.value.isNull())
return entry.value;
entry.key = i;
- entry.value = UString::number(i);
+ entry.value = String::number(i);
return entry.value;
}
private:
@@ -73,24 +73,24 @@
template<typename T>
struct CacheEntry {
T key;
- UString value;
+ String value;
};
CacheEntry<double>& lookup(double d) { return doubleCache[WTF::FloatHash<double>::hash(d) & (cacheSize - 1)]; }
CacheEntry<int>& lookup(int i) { return intCache[WTF::IntHash<int>::hash(i) & (cacheSize - 1)]; }
CacheEntry<unsigned>& lookup(unsigned i) { return unsignedCache[WTF::IntHash<unsigned>::hash(i) & (cacheSize - 1)]; }
- ALWAYS_INLINE const UString& lookupSmallString(unsigned i)
+ ALWAYS_INLINE const String& lookupSmallString(unsigned i)
{
ASSERT(i < cacheSize);
if (smallIntCache[i].isNull())
- smallIntCache[i] = UString::number(i);
+ smallIntCache[i] = String::number(i);
return smallIntCache[i];
}
FixedArray<CacheEntry<double>, cacheSize> doubleCache;
FixedArray<CacheEntry<int>, cacheSize> intCache;
FixedArray<CacheEntry<unsigned>, cacheSize> unsignedCache;
- FixedArray<UString, cacheSize> smallIntCache;
+ FixedArray<String, cacheSize> smallIntCache;
};
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
index 5a6fcdd..21eccd3 100644
--- a/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
@@ -148,7 +148,7 @@
{
if (!exec->argument(0).isObject())
return throwVMError(exec, createTypeError(exec, "Requested property descriptor of a value that is not an object."));
- UString propertyName = exec->argument(1).toString(exec)->value(exec);
+ String propertyName = exec->argument(1).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsNull());
JSObject* object = asObject(exec->argument(0));
@@ -291,7 +291,7 @@
if (!exec->argument(0).isObject())
return throwVMError(exec, createTypeError(exec, "Properties can only be defined on Objects."));
JSObject* O = asObject(exec->argument(0));
- UString propertyName = exec->argument(1).toString(exec)->value(exec);
+ String propertyName = exec->argument(1).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsNull());
PropertyDescriptor descriptor;
diff --git a/Source/JavaScriptCore/runtime/Operations.h b/Source/JavaScriptCore/runtime/Operations.h
index 24053c5..30ba0b2 100644
--- a/Source/JavaScriptCore/runtime/Operations.h
+++ b/Source/JavaScriptCore/runtime/Operations.h
@@ -50,7 +50,7 @@
return JSRopeString::create(globalData, s1, s2);
}
- ALWAYS_INLINE JSValue jsString(ExecState* exec, const UString& u1, const UString& u2, const UString& u3)
+ ALWAYS_INLINE JSValue jsString(ExecState* exec, const String& u1, const String& u2, const String& u3)
{
JSGlobalData* globalData = &exec->globalData();
@@ -221,7 +221,7 @@
return v1.asNumber() < v2.asNumber();
if (isJSString(v1) && isJSString(v2))
- return asString(v1)->value(callFrame) < asString(v2)->value(callFrame);
+ return codePointCompareLessThan(asString(v1)->value(callFrame), asString(v2)->value(callFrame));
double n1;
double n2;
@@ -239,7 +239,7 @@
if (wasNotString1 | wasNotString2)
return n1 < n2;
- return asString(p1)->value(callFrame) < asString(p2)->value(callFrame);
+ return codePointCompareLessThan(asString(p1)->value(callFrame), asString(p2)->value(callFrame));
}
// See ES5 11.8.3/11.8.4/11.8.5 for definition of leftFirst, this value ensures correct
@@ -255,7 +255,7 @@
return v1.asNumber() <= v2.asNumber();
if (isJSString(v1) && isJSString(v2))
- return !(asString(v2)->value(callFrame) < asString(v1)->value(callFrame));
+ return !codePointCompareLessThan(asString(v2)->value(callFrame), asString(v1)->value(callFrame));
double n1;
double n2;
@@ -273,7 +273,7 @@
if (wasNotString1 | wasNotString2)
return n1 <= n2;
- return !(asString(p2)->value(callFrame) < asString(p1)->value(callFrame));
+ return !codePointCompareLessThan(asString(p2)->value(callFrame), asString(p1)->value(callFrame));
}
// Fast-path choices here are based on frequency data from SunSpider:
diff --git a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h b/Source/JavaScriptCore/runtime/PropertyMapHashTable.h
index 5953f5e..2d0f27a 100644
--- a/Source/JavaScriptCore/runtime/PropertyMapHashTable.h
+++ b/Source/JavaScriptCore/runtime/PropertyMapHashTable.h
@@ -22,11 +22,11 @@
#define PropertyMapHashTable_h
#include "PropertyOffset.h"
-#include "UString.h"
#include "WriteBarrier.h"
#include <wtf/HashTable.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringImpl.h>
#ifndef NDEBUG
@@ -44,7 +44,7 @@
#endif
-#define PROPERTY_MAP_DELETED_ENTRY_KEY ((StringImpl*)1)
+#define PROPERTY_MAP_DELETED_ENTRY_KEY ((StringImpl*)1)
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/RegExp.cpp b/Source/JavaScriptCore/runtime/RegExp.cpp
index 64e553b..7757274 100644
--- a/Source/JavaScriptCore/runtime/RegExp.cpp
+++ b/Source/JavaScriptCore/runtime/RegExp.cpp
@@ -40,7 +40,7 @@
const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0, CREATE_METHOD_TABLE(RegExp) };
-RegExpFlags regExpFlags(const UString& string)
+RegExpFlags regExpFlags(const String& string)
{
RegExpFlags flags = NoFlags;
@@ -83,7 +83,7 @@
~RegExpFunctionalTestCollector();
- void outputOneTest(RegExp*, UString, int, int*, int);
+ void outputOneTest(RegExp*, String, int, int*, int);
void clearRegExp(RegExp* regExp)
{
if (regExp == m_lastRegExp)
@@ -93,7 +93,7 @@
private:
RegExpFunctionalTestCollector();
- void outputEscapedUString(const UString&, bool escapeSlash = false);
+ void outputEscapedString(const String&, bool escapeSlash = false);
static RegExpFunctionalTestCollector* s_instance;
FILE* m_file;
@@ -111,12 +111,12 @@
return s_instance;
}
-void RegExpFunctionalTestCollector::outputOneTest(RegExp* regExp, UString s, int startOffset, int* ovector, int result)
+void RegExpFunctionalTestCollector::outputOneTest(RegExp* regExp, String s, int startOffset, int* ovector, int result)
{
if ((!m_lastRegExp) || (m_lastRegExp != regExp)) {
m_lastRegExp = regExp;
fputc('/', m_file);
- outputEscapedUString(regExp->pattern(), true);
+ outputEscapedString(regExp->pattern(), true);
fputc('/', m_file);
if (regExp->global())
fputc('g', m_file);
@@ -128,7 +128,7 @@
}
fprintf(m_file, " \"");
- outputEscapedUString(s);
+ outputEscapedString(s);
fprintf(m_file, "\", %d, %d, (", startOffset, result);
for (unsigned i = 0; i <= regExp->numSubpatterns(); i++) {
int subpatternBegin = ovector[i * 2];
@@ -159,7 +159,7 @@
s_instance = 0;
}
-void RegExpFunctionalTestCollector::outputEscapedUString(const UString& s, bool escapeSlash)
+void RegExpFunctionalTestCollector::outputEscapedString(const String& s, bool escapeSlash)
{
int len = s.length();
@@ -217,7 +217,7 @@
}
#endif
-RegExp::RegExp(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
+RegExp::RegExp(JSGlobalData& globalData, const String& patternString, RegExpFlags flags)
: JSCell(globalData, globalData.regExpStructure.get())
, m_state(NotCompiled)
, m_patternString(patternString)
@@ -250,14 +250,14 @@
thisObject->RegExp::~RegExp();
}
-RegExp* RegExp::createWithoutCaching(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
+RegExp* RegExp::createWithoutCaching(JSGlobalData& globalData, const String& patternString, RegExpFlags flags)
{
RegExp* regExp = new (NotNull, allocateCell<RegExp>(globalData.heap)) RegExp(globalData, patternString, flags);
regExp->finishCreation(globalData);
return regExp;
}
-RegExp* RegExp::create(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
+RegExp* RegExp::create(JSGlobalData& globalData, const String& patternString, RegExpFlags flags)
{
return globalData.regExpCache()->lookupOrCreate(patternString, flags);
}
@@ -318,7 +318,7 @@
compile(&globalData, charSize);
}
-int RegExp::match(JSGlobalData& globalData, const UString& s, unsigned startOffset, Vector<int, 32>& ovector)
+int RegExp::match(JSGlobalData& globalData, const String& s, unsigned startOffset, Vector<int, 32>& ovector)
{
#if ENABLE(REGEXP_TRACING)
m_rtMatchCallCount++;
@@ -440,7 +440,7 @@
compileMatchOnly(&globalData, charSize);
}
-MatchResult RegExp::match(JSGlobalData& globalData, const UString& s, unsigned startOffset)
+MatchResult RegExp::match(JSGlobalData& globalData, const String& s, unsigned startOffset)
{
#if ENABLE(REGEXP_TRACING)
m_rtMatchCallCount++;
@@ -494,7 +494,7 @@
}
#if ENABLE(YARR_JIT_DEBUG)
-void RegExp::matchCompareWithInterpreter(const UString& s, int startOffset, int* offsetVector, int jitResult)
+void RegExp::matchCompareWithInterpreter(const String& s, int startOffset, int* offsetVector, int jitResult)
{
int offsetVectorSize = (m_numSubpatterns + 1) * 2;
Vector<int, 32> interpreterOvector;
diff --git a/Source/JavaScriptCore/runtime/RegExp.h b/Source/JavaScriptCore/runtime/RegExp.h
index ad10203..287444b 100644
--- a/Source/JavaScriptCore/runtime/RegExp.h
+++ b/Source/JavaScriptCore/runtime/RegExp.h
@@ -26,10 +26,10 @@
#include "MatchResult.h"
#include "RegExpKey.h"
#include "Structure.h"
-#include "UString.h"
#include "yarr/Yarr.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
#if ENABLE(YARR_JIT)
#include "yarr/YarrJIT.h"
@@ -40,26 +40,26 @@
struct RegExpRepresentation;
class JSGlobalData;
- JS_EXPORT_PRIVATE RegExpFlags regExpFlags(const UString&);
+ JS_EXPORT_PRIVATE RegExpFlags regExpFlags(const String&);
class RegExp : public JSCell {
public:
typedef JSCell Base;
- JS_EXPORT_PRIVATE static RegExp* create(JSGlobalData&, const UString& pattern, RegExpFlags);
+ JS_EXPORT_PRIVATE static RegExp* create(JSGlobalData&, const String& pattern, RegExpFlags);
static void destroy(JSCell*);
bool global() const { return m_flags & FlagGlobal; }
bool ignoreCase() const { return m_flags & FlagIgnoreCase; }
bool multiline() const { return m_flags & FlagMultiline; }
- const UString& pattern() const { return m_patternString; }
+ const String& pattern() const { return m_patternString; }
bool isValid() const { return !m_constructionError && m_flags != InvalidFlags; }
const char* errorMessage() const { return m_constructionError; }
- JS_EXPORT_PRIVATE int match(JSGlobalData&, const UString&, unsigned startOffset, Vector<int, 32>& ovector);
- MatchResult match(JSGlobalData&, const UString&, unsigned startOffset);
+ JS_EXPORT_PRIVATE int match(JSGlobalData&, const String&, unsigned startOffset, Vector<int, 32>& ovector);
+ MatchResult match(JSGlobalData&, const String&, unsigned startOffset);
unsigned numSubpatterns() const { return m_numSubpatterns; }
bool hasCode()
@@ -87,9 +87,9 @@
private:
friend class RegExpCache;
- RegExp(JSGlobalData&, const UString&, RegExpFlags);
+ RegExp(JSGlobalData&, const String&, RegExpFlags);
- static RegExp* createWithoutCaching(JSGlobalData&, const UString&, RegExpFlags);
+ static RegExp* createWithoutCaching(JSGlobalData&, const String&, RegExpFlags);
enum RegExpState {
ParseError,
@@ -105,10 +105,10 @@
void compileIfNecessaryMatchOnly(JSGlobalData&, Yarr::YarrCharSize);
#if ENABLE(YARR_JIT_DEBUG)
- void matchCompareWithInterpreter(const UString&, int startOffset, int* offsetVector, int jitResult);
+ void matchCompareWithInterpreter(const String&, int startOffset, int* offsetVector, int jitResult);
#endif
- UString m_patternString;
+ String m_patternString;
RegExpFlags m_flags;
const char* m_constructionError;
unsigned m_numSubpatterns;
diff --git a/Source/JavaScriptCore/runtime/RegExpCache.cpp b/Source/JavaScriptCore/runtime/RegExpCache.cpp
index 53a13a4..c67dab8 100644
--- a/Source/JavaScriptCore/runtime/RegExpCache.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpCache.cpp
@@ -33,7 +33,7 @@
namespace JSC {
-RegExp* RegExpCache::lookupOrCreate(const UString& patternString, RegExpFlags flags)
+RegExp* RegExpCache::lookupOrCreate(const String& patternString, RegExpFlags flags)
{
RegExpKey key(flags, patternString);
if (RegExp* regExp = m_weakCache.get(key))
@@ -63,7 +63,7 @@
void RegExpCache::addToStrongCache(RegExp* regExp)
{
- UString pattern = regExp->pattern();
+ String pattern = regExp->pattern();
if (pattern.length() > maxStrongCacheablePatternLength)
return;
m_strongCache[m_nextEntryInStrongCache].set(*m_globalData, regExp);
diff --git a/Source/JavaScriptCore/runtime/RegExpCache.h b/Source/JavaScriptCore/runtime/RegExpCache.h
index 4f3ea15..c6a4a0a 100644
--- a/Source/JavaScriptCore/runtime/RegExpCache.h
+++ b/Source/JavaScriptCore/runtime/RegExpCache.h
@@ -28,7 +28,6 @@
#include "RegExp.h"
#include "RegExpKey.h"
#include "Strong.h"
-#include "UString.h"
#include "Weak.h"
#include <wtf/FixedArray.h>
#include <wtf/HashMap.h>
@@ -54,7 +53,7 @@
virtual void finalize(Handle<Unknown>, void* context);
- RegExp* lookupOrCreate(const UString& patternString, RegExpFlags);
+ RegExp* lookupOrCreate(const WTF::String& patternString, RegExpFlags);
void addToStrongCache(RegExp*);
RegExpCacheMap m_weakCache; // Holds all regular expressions currently live.
int m_nextEntryInStrongCache;
diff --git a/Source/JavaScriptCore/runtime/RegExpConstructor.cpp b/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
index 0b46347..57ee7df 100644
--- a/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -271,7 +271,7 @@
return asObject(arg0);
}
- UString pattern = arg0.isUndefined() ? UString("") : arg0.toString(exec)->value(exec);
+ String pattern = arg0.isUndefined() ? String("") : arg0.toString(exec)->value(exec);
if (exec->hadException())
return 0;
diff --git a/Source/JavaScriptCore/runtime/RegExpConstructor.h b/Source/JavaScriptCore/runtime/RegExpConstructor.h
index d714f21..2cb1c12 100644
--- a/Source/JavaScriptCore/runtime/RegExpConstructor.h
+++ b/Source/JavaScriptCore/runtime/RegExpConstructor.h
@@ -55,8 +55,8 @@
static const ClassInfo s_info;
- MatchResult performMatch(JSGlobalData&, RegExp*, JSString*, const UString&, int startOffset, int** ovector);
- MatchResult performMatch(JSGlobalData&, RegExp*, JSString*, const UString&, int startOffset);
+ MatchResult performMatch(JSGlobalData&, RegExp*, JSString*, const String&, int startOffset, int** ovector);
+ MatchResult performMatch(JSGlobalData&, RegExp*, JSString*, const String&, int startOffset);
void setMultiline(bool multiline) { m_multiline = multiline; }
bool multiline() const { return m_multiline; }
@@ -101,7 +101,7 @@
expression matching through the performMatch function. We use cached results to calculate,
e.g., RegExp.lastMatch and RegExp.leftParen.
*/
- ALWAYS_INLINE MatchResult RegExpConstructor::performMatch(JSGlobalData& globalData, RegExp* regExp, JSString* string, const UString& input, int startOffset, int** ovector)
+ ALWAYS_INLINE MatchResult RegExpConstructor::performMatch(JSGlobalData& globalData, RegExp* regExp, JSString* string, const String& input, int startOffset, int** ovector)
{
int position = regExp->match(globalData, input, startOffset, m_ovector);
@@ -120,7 +120,7 @@
return MatchResult(position, end);
}
- ALWAYS_INLINE MatchResult RegExpConstructor::performMatch(JSGlobalData& globalData, RegExp* regExp, JSString* string, const UString& input, int startOffset)
+ ALWAYS_INLINE MatchResult RegExpConstructor::performMatch(JSGlobalData& globalData, RegExp* regExp, JSString* string, const String& input, int startOffset)
{
MatchResult result = regExp->match(globalData, input, startOffset);
if (result)
diff --git a/Source/JavaScriptCore/runtime/RegExpKey.h b/Source/JavaScriptCore/runtime/RegExpKey.h
index cdaff27..f93fbbc 100644
--- a/Source/JavaScriptCore/runtime/RegExpKey.h
+++ b/Source/JavaScriptCore/runtime/RegExpKey.h
@@ -28,8 +28,8 @@
#ifndef RegExpKey_h
#define RegExpKey_h
-#include "UString.h"
#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
@@ -56,7 +56,7 @@
{
}
- RegExpKey(RegExpFlags flags, const UString& pattern)
+ RegExpKey(RegExpFlags flags, const String& pattern)
: flagsValue(flags)
, pattern(pattern.impl())
{
diff --git a/Source/JavaScriptCore/runtime/RegExpObject.cpp b/Source/JavaScriptCore/runtime/RegExpObject.cpp
index aefa1b4..6fd9db2 100644
--- a/Source/JavaScriptCore/runtime/RegExpObject.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpObject.cpp
@@ -31,9 +31,8 @@
#include "RegExpConstructor.h"
#include "RegExpMatchesArray.h"
#include "RegExpPrototype.h"
-#include "UStringBuilder.h"
-#include "UStringConcatenate.h"
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringBuilder.h>
namespace JSC {
@@ -179,7 +178,7 @@
JSValue regExpObjectSource(ExecState* exec, JSValue slotBase, PropertyName)
{
- UString pattern = asRegExpObject(slotBase)->regExp()->pattern();
+ String pattern = asRegExpObject(slotBase)->regExp()->pattern();
unsigned length = pattern.length();
const UChar* characters = pattern.characters();
bool previousCharacterWasBackslash = false;
@@ -227,7 +226,7 @@
previousCharacterWasBackslash = false;
inBrackets = false;
- UStringBuilder result;
+ StringBuilder result;
for (unsigned i = 0; i < length; ++i) {
UChar ch = characters[i];
if (!previousCharacterWasBackslash) {
@@ -264,7 +263,7 @@
previousCharacterWasBackslash = ch == '\\';
}
- return jsString(exec, result.toUString());
+ return jsString(exec, result.toString());
}
void RegExpObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
@@ -288,7 +287,7 @@
{
RegExp* regExp = this->regExp();
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
- UString input = string->value(exec);
+ String input = string->value(exec);
JSGlobalData& globalData = exec->globalData();
if (!regExp->global())
return regExpConstructor->performMatch(globalData, regExp, string, input, 0);
diff --git a/Source/JavaScriptCore/runtime/RegExpPrototype.cpp b/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
index 24c7c80..c22e6d0 100644
--- a/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
@@ -34,7 +34,6 @@
#include "RegExp.h"
#include "RegExpCache.h"
#include "StringRecursionChecker.h"
-#include "UStringConcatenate.h"
namespace JSC {
@@ -110,7 +109,7 @@
return throwVMError(exec, createTypeError(exec, "Cannot supply flags when constructing one RegExp from another."));
regExp = asRegExpObject(arg0)->regExp();
} else {
- UString pattern = !exec->argumentCount() ? UString("") : arg0.toString(exec)->value(exec);
+ String pattern = !exec->argumentCount() ? String("") : arg0.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -153,7 +152,7 @@
postfix[index++] = 'i';
if (thisObject->get(exec, exec->propertyNames().multiline).toBoolean(exec))
postfix[index] = 'm';
- UString source = thisObject->get(exec, exec->propertyNames().source).toString(exec)->value(exec);
+ String source = thisObject->get(exec, exec->propertyNames().source).toString(exec)->value(exec);
// If source is empty, use "/(?:)/" to avoid colliding with comment syntax
return JSValue::encode(jsMakeNontrivialString(exec, "/", source, postfix));
}
diff --git a/Source/JavaScriptCore/runtime/SmallStrings.cpp b/Source/JavaScriptCore/runtime/SmallStrings.cpp
index f50f73d..56a3592 100644
--- a/Source/JavaScriptCore/runtime/SmallStrings.cpp
+++ b/Source/JavaScriptCore/runtime/SmallStrings.cpp
@@ -31,6 +31,7 @@
#include "JSString.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringImpl.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/SmallStrings.h b/Source/JavaScriptCore/runtime/SmallStrings.h
index e609c50..5bc9d22 100644
--- a/Source/JavaScriptCore/runtime/SmallStrings.h
+++ b/Source/JavaScriptCore/runtime/SmallStrings.h
@@ -26,8 +26,8 @@
#ifndef SmallStrings_h
#define SmallStrings_h
-#include "UString.h"
#include <wtf/FixedArray.h>
+#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#define JSC_COMMON_STRINGS_EACH_NAME(macro) \
@@ -41,6 +41,10 @@
macro(string) \
macro(true)
+namespace WTF {
+class StringImpl;
+}
+
namespace JSC {
class HeapRootVisitor;
@@ -71,7 +75,7 @@
return m_singleCharacterStrings[character];
}
- JS_EXPORT_PRIVATE StringImpl* singleCharacterStringRep(unsigned char character);
+ JS_EXPORT_PRIVATE WTF::StringImpl* singleCharacterStringRep(unsigned char character);
void finalizeSmallStrings();
diff --git a/Source/JavaScriptCore/runtime/StringObject.cpp b/Source/JavaScriptCore/runtime/StringObject.cpp
index 3c037bc..6c1f16d 100644
--- a/Source/JavaScriptCore/runtime/StringObject.cpp
+++ b/Source/JavaScriptCore/runtime/StringObject.cpp
@@ -138,7 +138,7 @@
StringObject* thisObject = jsCast<StringObject*>(object);
int size = thisObject->internalValue()->length();
for (int i = 0; i < size; ++i)
- propertyNames.add(Identifier(exec, UString::number(i)));
+ propertyNames.add(Identifier(exec, String::number(i)));
if (mode == IncludeDontEnumProperties)
propertyNames.add(exec->propertyNames().length);
return JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
diff --git a/Source/JavaScriptCore/runtime/StringPrototype.cpp b/Source/JavaScriptCore/runtime/StringPrototype.cpp
index 001e5e8..795e4e6 100644
--- a/Source/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/StringPrototype.cpp
@@ -162,7 +162,7 @@
// Helper for producing a JSString for 'string', where 'string' was been produced by
// calling ToString on 'originalValue'. In cases where 'originalValue' already was a
// string primitive we can just use this, otherwise we need to allocate a new JSString.
-static inline JSString* jsStringWithReuse(ExecState* exec, JSValue originalValue, const UString& string)
+static inline JSString* jsStringWithReuse(ExecState* exec, JSValue originalValue, const String& string)
{
if (originalValue.isString()) {
ASSERT(asString(originalValue)->value(exec) == string);
@@ -172,7 +172,7 @@
}
template <typename CharType>
-static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacement, const UString& source, const int* ovector, RegExp* reg, size_t i)
+static NEVER_INLINE String substituteBackreferencesSlow(const String& replacement, const String& source, const int* ovector, RegExp* reg, size_t i)
{
Vector<CharType> substitutedReplacement;
int offset = 0;
@@ -184,7 +184,7 @@
if (ref == '$') {
// "$$" -> "$"
++i;
- substitutedReplacement.append(replacement.getCharacters<CharType>() + offset, i - offset);
+ substitutedReplacement.append(replacement.getCharactersWithUpconvert<CharType>() + offset, i - offset);
offset = i + 1;
continue;
}
@@ -224,21 +224,21 @@
continue;
if (i - offset)
- substitutedReplacement.append(replacement.getCharacters<CharType>() + offset, i - offset);
+ substitutedReplacement.append(replacement.getCharactersWithUpconvert<CharType>() + offset, i - offset);
i += 1 + advance;
offset = i + 1;
if (backrefStart >= 0)
- substitutedReplacement.append(source.getCharacters<CharType>() + backrefStart, backrefLength);
+ substitutedReplacement.append(source.getCharactersWithUpconvert<CharType>() + backrefStart, backrefLength);
} while ((i = replacement.find('$', i + 1)) != notFound);
if (replacement.length() - offset)
- substitutedReplacement.append(replacement.getCharacters<CharType>() + offset, replacement.length() - offset);
+ substitutedReplacement.append(replacement.getCharactersWithUpconvert<CharType>() + offset, replacement.length() - offset);
substitutedReplacement.shrinkToFit();
- return UString::adopt(substitutedReplacement);
+ return String::adopt(substitutedReplacement);
}
-static inline UString substituteBackreferences(const UString& replacement, const UString& source, const int* ovector, RegExp* reg)
+static inline String substituteBackreferences(const String& replacement, const String& source, const int* ovector, RegExp* reg)
{
size_t i = replacement.find('$');
if (UNLIKELY(i != notFound)) {
@@ -249,7 +249,7 @@
return replacement;
}
-static inline int localeCompare(const UString& a, const UString& b)
+static inline int localeCompare(const String& a, const String& b)
{
return Collator::userDefault()->collate(reinterpret_cast<const ::UChar*>(a.characters()), a.length(), reinterpret_cast<const ::UChar*>(b.characters()), b.length());
}
@@ -270,7 +270,7 @@
int length;
};
-static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount)
+static ALWAYS_INLINE JSValue jsSpliceSubstrings(ExecState* exec, JSString* sourceVal, const String& source, const StringRange* substringRanges, int rangeCount)
{
if (rangeCount == 1) {
int sourceSize = source.length();
@@ -278,7 +278,7 @@
int length = substringRanges[0].length;
if (position <= 0 && length >= sourceSize)
return sourceVal;
- // We could call UString::substr, but this would result in redundant checks
+ // We could call String::substringSharingImpl(), but this would result in redundant checks.
return jsString(exec, StringImpl::create(source.impl(), max(0, position), min(sourceSize, length)));
}
@@ -325,7 +325,7 @@
return jsString(exec, impl.release());
}
-static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount, const UString* separators, int separatorCount)
+static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const String& source, const StringRange* substringRanges, int rangeCount, const String* separators, int separatorCount)
{
if (rangeCount == 1 && separatorCount == 0) {
int sourceSize = source.length();
@@ -333,7 +333,7 @@
int length = substringRanges[0].length;
if (position <= 0 && length >= sourceSize)
return sourceVal;
- // We could call UString::substr, but this would result in redundant checks
+ // We could call String::substringSharingImpl(), but this would result in redundant checks.
return jsString(exec, StringImpl::create(source.impl(), max(0, position), min(sourceSize, length)));
}
@@ -403,7 +403,7 @@
return jsString(exec, impl.release());
}
-static NEVER_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSString* string, const UString& source, RegExp* regExp)
+static NEVER_INLINE EncodedJSValue removeUsingRegExpSearch(ExecState* exec, JSString* string, const String& source, RegExp* regExp)
{
size_t lastIndex = 0;
unsigned startPosition = 0;
@@ -444,13 +444,13 @@
static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSString* string, JSValue searchValue)
{
JSValue replaceValue = exec->argument(1);
- UString replacementString;
+ String replacementString;
CallData callData;
CallType callType = getCallData(replaceValue, callData);
if (callType == CallTypeNone)
replacementString = replaceValue.toString(exec)->value(exec);
- const UString& source = string->value(exec);
+ const String& source = string->value(exec);
unsigned sourceLen = source.length();
if (exec->hadException())
return JSValue::encode(JSValue());
@@ -474,7 +474,7 @@
unsigned startPosition = 0;
Vector<StringRange, 16> sourceRanges;
- Vector<UString, 16> replacements;
+ Vector<String, 16> replacements;
// This is either a loop (if global is set) or a one-way (if not).
if (global && callType == CallTypeJS) {
@@ -601,7 +601,7 @@
if (replLen)
replacements.append(substituteBackreferences(replacementString, source, ovector, regExp));
else
- replacements.append(UString());
+ replacements.append(String());
}
}
@@ -628,8 +628,8 @@
static inline EncodedJSValue replaceUsingStringSearch(ExecState* exec, JSString* jsString, JSValue searchValue)
{
- const UString& string = jsString->value(exec);
- UString searchString = searchValue.toUString(exec);
+ const String& string = jsString->value(exec);
+ String searchString = searchValue.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -651,19 +651,19 @@
return JSValue::encode(jsUndefined());
}
- UString replaceString = replaceValue.toUString(exec);
+ String replaceString = replaceValue.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
StringImpl* stringImpl = string.impl();
- UString leftPart(StringImpl::create(stringImpl, 0, matchStart));
+ String leftPart(StringImpl::create(stringImpl, 0, matchStart));
size_t matchEnd = matchStart + searchString.impl()->length();
int ovector[2] = { matchStart, matchEnd};
- UString middlePart = substituteBackreferences(replaceString, string, ovector, 0);
+ String middlePart = substituteBackreferences(replaceString, string, ovector, 0);
size_t leftLength = stringImpl->length() - matchEnd;
- UString rightPart(StringImpl::create(stringImpl, matchEnd, leftLength));
+ String rightPart(StringImpl::create(stringImpl, matchEnd, leftLength));
return JSValue::encode(JSC::jsString(exec, leftPart, middlePart, rightPart));
}
@@ -699,7 +699,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
unsigned len = s.length();
JSValue a0 = exec->argument(0);
if (a0.isUInt32()) {
@@ -719,7 +719,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
unsigned len = s.length();
JSValue a0 = exec->argument(0);
if (a0.isUInt32()) {
@@ -753,11 +753,11 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
- UString u2 = a0.toString(exec)->value(exec);
+ String u2 = a0.toString(exec)->value(exec);
size_t result;
if (a1.isUndefined())
@@ -788,13 +788,13 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
- UString u2 = a0.toString(exec)->value(exec);
+ String u2 = a0.toString(exec)->value(exec);
double dpos = a1.toIntegerPreserveNaN(exec);
if (dpos < 0)
dpos = 0;
@@ -813,7 +813,7 @@
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* string = thisValue.toString(exec);
- UString s = string->value(exec);
+ String s = string->value(exec);
JSGlobalData* globalData = &exec->globalData();
JSValue a0 = exec->argument(0);
@@ -836,7 +836,7 @@
* replaced with the result of the expression new RegExp(regexp).
* Per ECMA 15.10.4.1, if a0 is undefined substitute the empty string.
*/
- regExp = RegExp::create(exec->globalData(), a0.isUndefined() ? UString("") : a0.toString(exec)->value(exec), NoFlags);
+ regExp = RegExp::create(exec->globalData(), a0.isUndefined() ? String("") : a0.toString(exec)->value(exec), NoFlags);
if (!regExp->isValid())
return throwVMError(exec, createSyntaxError(exec, regExp->errorMessage()));
}
@@ -872,7 +872,7 @@
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* string = thisValue.toString(exec);
- UString s = string->value(exec);
+ String s = string->value(exec);
JSGlobalData* globalData = &exec->globalData();
JSValue a0 = exec->argument(0);
@@ -887,7 +887,7 @@
* replaced with the result of the expression new RegExp(regexp).
* Per ECMA 15.10.4.1, if a0 is undefined substitute the empty string.
*/
- reg = RegExp::create(exec->globalData(), a0.isUndefined() ? UString("") : a0.toString(exec)->value(exec), NoFlags);
+ reg = RegExp::create(exec->globalData(), a0.isUndefined() ? String("") : a0.toString(exec)->value(exec), NoFlags);
if (!reg->isValid())
return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
}
@@ -901,7 +901,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
int len = s.length();
JSValue a0 = exec->argument(0);
@@ -925,7 +925,7 @@
// Return true in case of early return (resultLength got to limitLength).
template<typename CharacterType>
-static ALWAYS_INLINE bool splitStringByOneCharacterImpl(ExecState* exec, JSArray* result, const UString& input, StringImpl* string, UChar separatorCharacter, size_t& position, unsigned& resultLength, unsigned limitLength)
+static ALWAYS_INLINE bool splitStringByOneCharacterImpl(ExecState* exec, JSArray* result, const String& input, StringImpl* string, UChar separatorCharacter, size_t& position, unsigned& resultLength, unsigned limitLength)
{
// 12. Let q = p.
size_t matchPosition;
@@ -962,7 +962,7 @@
// 2. Let S be the result of calling ToString, giving it the this value as its argument.
// 6. Let s be the number of characters in S.
- UString input = thisValue.toString(exec)->value(exec);
+ String input = thisValue.toString(exec)->value(exec);
// 3. Let A be a new array created as if by the expression new Array()
// where Array is the standard built-in constructor with that name.
@@ -1064,7 +1064,7 @@
}
}
} else {
- UString separator = separatorValue.toString(exec)->value(exec);
+ String separator = separatorValue.toString(exec)->value(exec);
// 9. If lim == 0, return A.
if (!limit)
@@ -1167,7 +1167,7 @@
JSValue thisValue = exec->hostThisValue();
unsigned len;
JSString* jsString = 0;
- UString uString;
+ String uString;
if (thisValue.isString()) {
jsString = jsCast<JSString*>(thisValue.asCell());
len = jsString->length();
@@ -1247,7 +1247,7 @@
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* sVal = thisValue.toString(exec);
- const UString& s = sVal->value(exec);
+ const String& s = sVal->value(exec);
int sSize = s.length();
if (!sSize)
@@ -1257,7 +1257,7 @@
RefPtr<StringImpl> lower = ourImpl->lower();
if (ourImpl == lower)
return JSValue::encode(sVal);
- return JSValue::encode(jsString(exec, UString(lower.release())));
+ return JSValue::encode(jsString(exec, String(lower.release())));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec)
@@ -1266,7 +1266,7 @@
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
JSString* sVal = thisValue.toString(exec);
- const UString& s = sVal->value(exec);
+ const String& s = sVal->value(exec);
int sSize = s.length();
if (!sSize)
@@ -1276,7 +1276,7 @@
RefPtr<StringImpl> upper = sImpl->upper();
if (sImpl == upper)
return JSValue::encode(sVal);
- return JSValue::encode(jsString(exec, UString(upper.release())));
+ return JSValue::encode(jsString(exec, String(upper.release())));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec)
@@ -1287,7 +1287,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
return JSValue::encode(jsNumber(localeCompare(s, a0.toString(exec)->value(exec))));
@@ -1298,7 +1298,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<big>", s, "</big>"));
}
@@ -1307,7 +1307,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<small>", s, "</small>"));
}
@@ -1316,7 +1316,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<blink>", s, "</blink>"));
}
@@ -1325,7 +1325,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<b>", s, "</b>"));
}
@@ -1334,7 +1334,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<tt>", s, "</tt>"));
}
@@ -1343,7 +1343,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<i>", s, "</i>"));
}
@@ -1352,7 +1352,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<strike>", s, "</strike>"));
}
@@ -1361,7 +1361,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<sub>", s, "</sub>"));
}
@@ -1370,7 +1370,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
return JSValue::encode(jsMakeNontrivialString(exec, "<sup>", s, "</sup>"));
}
@@ -1379,7 +1379,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
return JSValue::encode(jsMakeNontrivialString(exec, "<font color=\"", a0.toString(exec)->value(exec), "\">", s, "</font>"));
}
@@ -1389,7 +1389,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
uint32_t smallInteger;
@@ -1434,7 +1434,7 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
return JSValue::encode(jsMakeNontrivialString(exec, "<a name=\"", a0.toString(exec)->value(exec), "\">", s, "</a>"));
}
@@ -1444,9 +1444,9 @@
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
- UString s = thisValue.toString(exec)->value(exec);
+ String s = thisValue.toString(exec)->value(exec);
JSValue a0 = exec->argument(0);
- UString linkText = a0.toString(exec)->value(exec);
+ String linkText = a0.toString(exec)->value(exec);
unsigned linkTextSize = linkText.length();
unsigned stringSize = s.length();
@@ -1489,7 +1489,7 @@
{
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwTypeError(exec);
- UString str = thisValue.toString(exec)->value(exec);
+ String str = thisValue.toString(exec)->value(exec);
unsigned left = 0;
if (trimKind & TrimLeft) {
while (left < str.length() && isTrimWhitespace(str[left]))
diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h
index e3a25bb..57368be 100644
--- a/Source/JavaScriptCore/runtime/Structure.h
+++ b/Source/JavaScriptCore/runtime/Structure.h
@@ -36,12 +36,12 @@
#include "Protect.h"
#include "StructureTransitionTable.h"
#include "JSTypeInfo.h"
-#include "UString.h"
#include "Watchpoint.h"
#include "Weak.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringImpl.h>
namespace JSC {
@@ -259,7 +259,7 @@
bool masqueradesAsUndefined(JSGlobalObject* lexicalGlobalObject);
PropertyOffset get(JSGlobalData&, PropertyName);
- PropertyOffset get(JSGlobalData&, const UString& name);
+ PropertyOffset get(JSGlobalData&, const WTF::String& name);
JS_EXPORT_PRIVATE PropertyOffset get(JSGlobalData&, PropertyName, unsigned& attributes, JSCell*& specificValue);
bool hasGetterSetterProperties() const { return m_hasGetterSetterProperties; }
@@ -501,7 +501,7 @@
return entry ? entry->offset : invalidOffset;
}
- inline PropertyOffset Structure::get(JSGlobalData& globalData, const UString& name)
+ inline PropertyOffset Structure::get(JSGlobalData& globalData, const WTF::String& name)
{
ASSERT(structure()->classInfo() == &s_info);
materializePropertyMapIfNecessary(globalData);
diff --git a/Source/JavaScriptCore/runtime/StructureTransitionTable.h b/Source/JavaScriptCore/runtime/StructureTransitionTable.h
index 2067a89..7c9d508 100644
--- a/Source/JavaScriptCore/runtime/StructureTransitionTable.h
+++ b/Source/JavaScriptCore/runtime/StructureTransitionTable.h
@@ -26,11 +26,11 @@
#ifndef StructureTransitionTable_h
#define StructureTransitionTable_h
-#include "UString.h"
#include "WeakGCMap.h"
#include <wtf/HashFunctions.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/StringImpl.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/SymbolTable.h b/Source/JavaScriptCore/runtime/SymbolTable.h
index b3cf202..08ea8c1 100644
--- a/Source/JavaScriptCore/runtime/SymbolTable.h
+++ b/Source/JavaScriptCore/runtime/SymbolTable.h
@@ -30,10 +30,10 @@
#define SymbolTable_h
#include "JSObject.h"
-#include "UString.h"
#include "Watchpoint.h"
#include <wtf/AlwaysInline.h>
#include <wtf/HashTraits.h>
+#include <wtf/text/StringImpl.h>
namespace JSC {
diff --git a/Source/JavaScriptCore/runtime/UString.cpp b/Source/JavaScriptCore/runtime/UString.cpp
deleted file mode 100644
index da5735c..0000000
--- a/Source/JavaScriptCore/runtime/UString.cpp
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca)
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "UString.h"
-
-#include "JSGlobalObjectFunctions.h"
-#include "Heap.h"
-#include "Identifier.h"
-#include "Operations.h"
-#include <ctype.h>
-#include <stdlib.h>
-#include <wtf/ASCIICType.h>
-#include <wtf/Assertions.h>
-#include <wtf/MathExtras.h>
-#include <wtf/Vector.h>
-#include <wtf/dtoa.h>
-#include <wtf/unicode/UTF8.h>
-
-#if HAVE(STRINGS_H)
-#include <strings.h>
-#endif
-
-using namespace WTF;
-using namespace WTF::Unicode;
-using namespace std;
-
-namespace JSC {
-
-COMPILE_ASSERT(sizeof(UString) == sizeof(void*), UString_should_stay_small);
-
-// Construct a string with UTF-16 data.
-UString::UString(const UChar* characters, unsigned length)
- : m_impl(characters ? StringImpl::create(characters, length) : 0)
-{
-}
-
-// Construct a string with UTF-16 data, from a null-terminated source.
-UString::UString(const UChar* characters)
-{
- if (!characters)
- return;
-
- int length = 0;
- while (characters[length] != UChar(0))
- ++length;
-
- m_impl = StringImpl::create(characters, length);
-}
-
-// Construct a string with latin1 data.
-UString::UString(const LChar* characters, unsigned length)
- : m_impl(characters ? StringImpl::create(characters, length) : 0)
-{
-}
-
-UString::UString(const char* characters, unsigned length)
- : m_impl(characters ? StringImpl::create(reinterpret_cast<const LChar*>(characters), length) : 0)
-{
-}
-
-// Construct a string with latin1 data, from a null-terminated source.
-UString::UString(const LChar* characters)
- : m_impl(characters ? StringImpl::create(characters) : 0)
-{
-}
-
-UString::UString(const char* characters)
- : m_impl(characters ? StringImpl::create(reinterpret_cast<const LChar*>(characters)) : 0)
-{
-}
-
-UString UString::numberToStringECMAScript(double d)
-{
- NumberToStringBuffer buffer;
- return UString(numberToString(d, buffer));
-}
-
-UString UString::substringSharingImpl(unsigned offset, unsigned length) const
-{
- // FIXME: We used to check against a limit of Heap::minExtraCost / sizeof(UChar).
-
- unsigned stringLength = this->length();
- offset = min(offset, stringLength);
- length = min(length, stringLength - offset);
-
- if (!offset && length == stringLength)
- return *this;
- return UString(StringImpl::create(m_impl, offset, length));
-}
-
-bool operator==(const UString& s1, const char *s2)
-{
- if (s1.isEmpty())
- return !s2;
-
- return equal(s1.impl(), s2);
-}
-
-// This method assumes that all simple checks have been performed by
-// the inlined operator==() in the header file.
-bool equalSlowCase(const UString& s1, const UString& s2)
-{
- StringImpl* rep1 = s1.impl();
- StringImpl* rep2 = s2.impl();
- unsigned size1 = rep1->length();
-
- // At this point we know
- // (a) that the strings are the same length and
- // (b) that they are greater than zero length.
- bool s1Is8Bit = rep1->is8Bit();
- bool s2Is8Bit = rep2->is8Bit();
-
- if (s1Is8Bit) {
- const LChar* d1 = rep1->characters8();
- if (s2Is8Bit) {
- const LChar* d2 = rep2->characters8();
-
- if (d1 == d2) // Check to see if the data pointers are the same.
- return true;
-
- // Do quick checks for sizes 1 and 2.
- switch (size1) {
- case 1:
- return d1[0] == d2[0];
- case 2:
- return (d1[0] == d2[0]) & (d1[1] == d2[1]);
- default:
- return (!memcmp(d1, d2, size1 * sizeof(LChar)));
- }
- }
-
- const UChar* d2 = rep2->characters16();
-
- for (unsigned i = 0; i < size1; i++) {
- if (d1[i] != d2[i])
- return false;
- }
- return true;
- }
-
- if (s2Is8Bit) {
- const UChar* d1 = rep1->characters16();
- const LChar* d2 = rep2->characters8();
-
- for (unsigned i = 0; i < size1; i++) {
- if (d1[i] != d2[i])
- return false;
- }
- return true;
-
- }
-
- const UChar* d1 = rep1->characters16();
- const UChar* d2 = rep2->characters16();
-
- if (d1 == d2) // Check to see if the data pointers are the same.
- return true;
-
- // Do quick checks for sizes 1 and 2.
- switch (size1) {
- case 1:
- return d1[0] == d2[0];
- case 2:
- return (d1[0] == d2[0]) & (d1[1] == d2[1]);
- default:
- return (!memcmp(d1, d2, size1 * sizeof(UChar)));
- }
-}
-
-bool operator<(const UString& s1, const UString& s2)
-{
- const unsigned l1 = s1.length();
- const unsigned l2 = s2.length();
- const unsigned lmin = l1 < l2 ? l1 : l2;
- if (s1.is8Bit() && s2.is8Bit()) {
- const LChar* c1 = s1.characters8();
- const LChar* c2 = s2.characters8();
- unsigned length = 0;
- while (length < lmin && *c1 == *c2) {
- c1++;
- c2++;
- length++;
- }
- if (length < lmin)
- return (c1[0] < c2[0]);
-
- return (l1 < l2);
- }
- const UChar* c1 = s1.characters();
- const UChar* c2 = s2.characters();
- unsigned length = 0;
- while (length < lmin && *c1 == *c2) {
- c1++;
- c2++;
- length++;
- }
- if (length < lmin)
- return (c1[0] < c2[0]);
-
- return (l1 < l2);
-}
-
-bool operator>(const UString& s1, const UString& s2)
-{
- const unsigned l1 = s1.length();
- const unsigned l2 = s2.length();
- const unsigned lmin = l1 < l2 ? l1 : l2;
- const UChar* c1 = s1.characters();
- const UChar* c2 = s2.characters();
- unsigned l = 0;
- while (l < lmin && *c1 == *c2) {
- c1++;
- c2++;
- l++;
- }
- if (l < lmin)
- return (c1[0] > c2[0]);
-
- return (l1 > l2);
-}
-
-CString UString::ascii() const
-{
- // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
- // preserved, characters outside of this range are converted to '?'.
-
- unsigned length = this->length();
-
- if (this->is8Bit()) {
- const LChar* characters = this->characters8();
-
- char* characterBuffer;
- CString result = CString::newUninitialized(length, characterBuffer);
-
- for (unsigned i = 0; i < length; ++i) {
- LChar ch = characters[i];
- characterBuffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch;
- }
-
- return result;
- }
-
- const UChar* characters = this->characters16();
-
- char* characterBuffer;
- CString result = CString::newUninitialized(length, characterBuffer);
-
- for (unsigned i = 0; i < length; ++i) {
- UChar ch = characters[i];
- characterBuffer[i] = ch && (ch < 0x20 || ch >= 0x7f) ? '?' : ch;
- }
-
- return result;
-}
-
-CString UString::latin1() const
-{
- // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
- // preserved, characters outside of this range are converted to '?'.
-
- unsigned length = this->length();
- const UChar* characters = this->characters();
-
- char* characterBuffer;
- CString result = CString::newUninitialized(length, characterBuffer);
-
- for (unsigned i = 0; i < length; ++i) {
- UChar ch = characters[i];
- characterBuffer[i] = ch > 0xff ? '?' : ch;
- }
-
- return result;
-}
-
-// Helper to write a three-byte UTF-8 code point to the buffer, caller must check room is available.
-static inline void putUTF8Triple(char*& buffer, UChar ch)
-{
- ASSERT(ch >= 0x0800);
- *buffer++ = static_cast<char>(((ch >> 12) & 0x0F) | 0xE0);
- *buffer++ = static_cast<char>(((ch >> 6) & 0x3F) | 0x80);
- *buffer++ = static_cast<char>((ch & 0x3F) | 0x80);
-}
-
-CString UString::utf8(bool strict) const
-{
- unsigned length = this->length();
-
- if (!length)
- return CString("", 0);
-
- // Allocate a buffer big enough to hold all the characters
- // (an individual UTF-16 UChar can only expand to 3 UTF-8 bytes).
- // Optimization ideas, if we find this function is hot:
- // * We could speculatively create a CStringBuffer to contain 'length'
- // characters, and resize if necessary (i.e. if the buffer contains
- // non-ascii characters). (Alternatively, scan the buffer first for
- // ascii characters, so we know this will be sufficient).
- // * We could allocate a CStringBuffer with an appropriate size to
- // have a good chance of being able to write the string into the
- // buffer without reallocing (say, 1.5 x length).
- if (length > numeric_limits<unsigned>::max() / 3)
- return CString();
-
- Vector<char, 1024> bufferVector(length * 3);
- char* buffer = bufferVector.data();
-
- if (is8Bit()) {
- const LChar* characters = this->characters8();
-
- ConversionResult result = convertLatin1ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size());
- ASSERT_UNUSED(result, result != targetExhausted); // (length * 3) should be sufficient for any conversion
- } else {
- const UChar* characters = this->characters16();
-
- ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), strict);
- ASSERT(result != targetExhausted); // (length * 3) should be sufficient for any conversion
-
- // Only produced from strict conversion.
- if (result == sourceIllegal)
- return CString();
-
- // Check for an unconverted high surrogate.
- if (result == sourceExhausted) {
- if (strict)
- return CString();
- // This should be one unpaired high surrogate. Treat it the same
- // was as an unpaired high surrogate would have been handled in
- // the middle of a string with non-strict conversion - which is
- // to say, simply encode it to UTF-8.
- ASSERT((characters + 1) == (this->characters() + length));
- ASSERT((*characters >= 0xD800) && (*characters <= 0xDBFF));
- // There should be room left, since one UChar hasn't been converted.
- ASSERT((buffer + 3) <= (buffer + bufferVector.size()));
- putUTF8Triple(buffer, *characters);
- }
- }
-
- return CString(bufferVector.data(), buffer - bufferVector.data());
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/UString.h b/Source/JavaScriptCore/runtime/UString.h
deleted file mode 100644
index 06858f9..0000000
--- a/Source/JavaScriptCore/runtime/UString.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef UString_h
-#define UString_h
-
-#include <wtf/text/IntegerToStringConversion.h>
-#include <wtf/text/StringImpl.h>
-
-namespace JSC {
-
-class UString {
-public:
- // Construct a null string, distinguishable from an empty string.
- UString() { }
-
- // Construct a string with UTF-16 data.
- JS_EXPORT_PRIVATE UString(const UChar* characters, unsigned length);
-
- // Construct a string with UTF-16 data, from a null-terminated source.
- JS_EXPORT_PRIVATE UString(const UChar*);
-
- // Construct a string with latin1 data.
- UString(const LChar* characters, unsigned length);
- JS_EXPORT_PRIVATE UString(const char* characters, unsigned length);
-
- // Construct a string with latin1 data, from a null-terminated source.
- UString(const LChar* characters);
- JS_EXPORT_PRIVATE UString(const char* characters);
-
- // Construct a string referencing an existing StringImpl.
- UString(StringImpl* impl) : m_impl(impl) { }
- UString(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
- UString(RefPtr<StringImpl> impl) : m_impl(impl) { }
-
- // Inline the destructor.
- ALWAYS_INLINE ~UString() { }
-
- void swap(UString& o) { m_impl.swap(o.m_impl); }
-
- template<typename CharType, size_t inlineCapacity>
- static UString adopt(Vector<CharType, inlineCapacity>& vector) { return StringImpl::adopt(vector); }
-
- bool isNull() const { return !m_impl; }
- bool isEmpty() const { return !m_impl || !m_impl->length(); }
-
- StringImpl* impl() const { return m_impl.get(); }
-
- unsigned length() const
- {
- if (!m_impl)
- return 0;
- return m_impl->length();
- }
-
- const UChar* characters() const
- {
- if (!m_impl)
- return 0;
- return m_impl->characters();
- }
-
- const LChar* characters8() const
- {
- if (!m_impl)
- return 0;
- ASSERT(m_impl->is8Bit());
- return m_impl->characters8();
- }
-
- const UChar* characters16() const
- {
- if (!m_impl)
- return 0;
- ASSERT(!m_impl->is8Bit());
- return m_impl->characters16();
- }
-
- template <typename CharType>
- inline const CharType* getCharacters() const;
-
- bool is8Bit() const { return m_impl->is8Bit(); }
-
- JS_EXPORT_PRIVATE CString ascii() const;
- CString latin1() const;
- JS_EXPORT_PRIVATE CString utf8(bool strict = false) const;
-
- UChar operator[](unsigned index) const
- {
- if (!m_impl || index >= m_impl->length())
- return 0;
- if (is8Bit())
- return m_impl->characters8()[index];
- return m_impl->characters16()[index];
- }
-
- static UString number(int i) { return WTF::numberToStringImpl(i); }
- static UString number(unsigned u) { return WTF::numberToStringImpl(u); }
- static UString number(long i) { return WTF::numberToStringImpl(i); }
- static UString number(long long i) { return WTF::numberToStringImpl(i); }
-
- static UString numberToStringECMAScript(double);
-
- // Find a single character or string, also with match function & latin1 forms.
- size_t find(UChar c, unsigned start = 0) const
- { return m_impl ? m_impl->find(c, start) : notFound; }
-
- size_t find(const UString& str) const
- { return m_impl ? m_impl->find(str.impl()) : notFound; }
- size_t find(const UString& str, unsigned start) const
- { return m_impl ? m_impl->find(str.impl(), start) : notFound; }
-
- size_t find(const LChar* str, unsigned start = 0) const
- { return m_impl ? m_impl->find(str, start) : notFound; }
-
- // Find the last instance of a single character or string.
- size_t reverseFind(UChar c, unsigned start = UINT_MAX) const
- { return m_impl ? m_impl->reverseFind(c, start) : notFound; }
- size_t reverseFind(const UString& str, unsigned start = UINT_MAX) const
- { return m_impl ? m_impl->reverseFind(str.impl(), start) : notFound; }
-
- JS_EXPORT_PRIVATE UString substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
-
-private:
- RefPtr<StringImpl> m_impl;
-};
-
-template<>
-inline const LChar* UString::getCharacters<LChar>() const { return characters8(); }
-
-template<>
-inline const UChar* UString::getCharacters<UChar>() const { return characters(); }
-
-NEVER_INLINE bool equalSlowCase(const UString& s1, const UString& s2);
-
-ALWAYS_INLINE bool operator==(const UString& s1, const UString& s2)
-{
- StringImpl* rep1 = s1.impl();
- StringImpl* rep2 = s2.impl();
-
- if (rep1 == rep2) // If they're the same rep, they're equal.
- return true;
-
- unsigned size1 = 0;
- unsigned size2 = 0;
-
- if (rep1)
- size1 = rep1->length();
-
- if (rep2)
- size2 = rep2->length();
-
- if (size1 != size2) // If the lengths are not the same, we're done.
- return false;
-
- if (!size1)
- return true;
-
- if (size1 == 1)
- return (*rep1)[0u] == (*rep2)[0u];
-
- return equalSlowCase(s1, s2);
-}
-
-
-inline bool operator!=(const UString& s1, const UString& s2)
-{
- return !JSC::operator==(s1, s2);
-}
-
-JS_EXPORT_PRIVATE bool operator<(const UString& s1, const UString& s2);
-JS_EXPORT_PRIVATE bool operator>(const UString& s1, const UString& s2);
-
-JS_EXPORT_PRIVATE bool operator==(const UString& s1, const char* s2);
-
-inline bool operator!=(const UString& s1, const char* s2)
-{
- return !JSC::operator==(s1, s2);
-}
-
-inline bool operator==(const char *s1, const UString& s2)
-{
- return operator==(s2, s1);
-}
-
-inline bool operator!=(const char *s1, const UString& s2)
-{
- return !JSC::operator==(s1, s2);
-}
-
-inline int codePointCompare(const UString& s1, const UString& s2)
-{
- return codePointCompare(s1.impl(), s2.impl());
-}
-
-struct UStringHash {
- static unsigned hash(StringImpl* key) { return key->hash(); }
- static bool equal(const StringImpl* a, const StringImpl* b)
- {
- if (a == b)
- return true;
- if (!a || !b)
- return false;
-
- unsigned aLength = a->length();
- unsigned bLength = b->length();
- if (aLength != bLength)
- return false;
-
- // FIXME: perhaps we should have a more abstract macro that indicates when
- // going 4 bytes at a time is unsafe
-#if CPU(ARM) || CPU(SH4) || CPU(MIPS) || CPU(SPARC)
- const UChar* aChars = a->characters();
- const UChar* bChars = b->characters();
- for (unsigned i = 0; i != aLength; ++i) {
- if (*aChars++ != *bChars++)
- return false;
- }
- return true;
-#else
- /* Do it 4-bytes-at-a-time on architectures where it's safe */
- const uint32_t* aChars = reinterpret_cast<const uint32_t*>(a->characters());
- const uint32_t* bChars = reinterpret_cast<const uint32_t*>(b->characters());
-
- unsigned halfLength = aLength >> 1;
- for (unsigned i = 0; i != halfLength; ++i)
- if (*aChars++ != *bChars++)
- return false;
-
- if (aLength & 1 && *reinterpret_cast<const uint16_t*>(aChars) != *reinterpret_cast<const uint16_t*>(bChars))
- return false;
-
- return true;
-#endif
- }
-
- static unsigned hash(const RefPtr<StringImpl>& key) { return key->hash(); }
- static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
- {
- return equal(a.get(), b.get());
- }
-
- static unsigned hash(const UString& key) { return key.impl()->hash(); }
- static bool equal(const UString& a, const UString& b)
- {
- return equal(a.impl(), b.impl());
- }
-
- static const bool safeToCompareToEmptyOrDeleted = false;
-};
-
-} // namespace JSC
-
-namespace WTF {
-
-// UStringHash is the default hash for UString
-template<typename T> struct DefaultHash;
-template<> struct DefaultHash<JSC::UString> {
- typedef JSC::UStringHash Hash;
-};
-
-template <> struct VectorTraits<JSC::UString> : SimpleClassVectorTraits { };
-
-} // namespace WTF
-
-#endif
-
diff --git a/Source/JavaScriptCore/runtime/UStringBuilder.h b/Source/JavaScriptCore/runtime/UStringBuilder.h
deleted file mode 100644
index 31ccf38..0000000
--- a/Source/JavaScriptCore/runtime/UStringBuilder.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef UStringBuilder_h
-#define UStringBuilder_h
-
-#include <wtf/text/StringBuilder.h>
-
-namespace JSC {
-
-class UStringBuilder : public StringBuilder {
-public:
- using StringBuilder::append;
- void append(const UString& str) { append(String(str.impl())); }
-
- UString toUString() { return toString().impl(); }
-};
-
-} // namespace JSC
-
-#endif // UStringBuilder_h
diff --git a/Source/JavaScriptCore/runtime/UStringConcatenate.h b/Source/JavaScriptCore/runtime/UStringConcatenate.h
deleted file mode 100644
index cbd4e60..0000000
--- a/Source/JavaScriptCore/runtime/UStringConcatenate.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef UStringConcatenate_h
-#define UStringConcatenate_h
-
-#include "UString.h"
-#include <wtf/text/StringConcatenate.h>
-
-namespace WTF {
-
-template<>
-class StringTypeAdapter<JSC::UString> {
-public:
- StringTypeAdapter<JSC::UString>(JSC::UString& string)
- : m_string(string)
- , m_length(string.length())
- {
- }
-
- unsigned length() { return m_length; }
-
- bool is8Bit() { return m_string.isNull() || m_string.is8Bit(); }
-
- void writeTo(LChar* destination)
- {
- const LChar* characters = m_string.characters8();
- for (unsigned i = 0; i < m_length; ++i)
- destination[i] = characters[i];
- }
-
- void writeTo(UChar* destination)
- {
- if (is8Bit()) {
- const LChar* characters = m_string.characters8();
- for (unsigned i = 0; i < m_length; ++i)
- destination[i] = characters[i];
- } else {
- const UChar* characters = m_string.characters16();
- for (unsigned i = 0; i < m_length; ++i)
- destination[i] = characters[i];
- }
- }
-
-private:
- const JSC::UString& m_string;
- unsigned m_length;
-};
-
-}; // namespace WTF
-
-namespace JSC {
-
-template<typename StringType1, typename StringType2>
-UString makeUString(StringType1 string1, StringType2 string2)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-template<typename StringType1, typename StringType2, typename StringType3>
-UString makeUString(StringType1 string1, StringType2 string2, StringType3 string3)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2, string3);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
-UString makeUString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2, string3, string4);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
-UString makeUString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2, string3, string4, string5);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
-UString makeUString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2, string3, string4, string5, string6);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7>
-UString makeUString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2, string3, string4, string5, string6, string7);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7, typename StringType8>
-UString makeUString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7, StringType8 string8)
-{
- PassRefPtr<StringImpl> resultImpl = WTF::tryMakeString(string1, string2, string3, string4, string5, string6, string7, string8);
- if (!resultImpl)
- CRASH();
- return resultImpl;
-}
-
-} // namespace JSC
-
-#endif
diff --git a/Source/JavaScriptCore/testRegExp.cpp b/Source/JavaScriptCore/testRegExp.cpp
index 61c21c3..b0b126f 100644
--- a/Source/JavaScriptCore/testRegExp.cpp
+++ b/Source/JavaScriptCore/testRegExp.cpp
@@ -24,11 +24,11 @@
#include <wtf/CurrentTime.h>
#include "InitializeThreading.h"
#include "JSGlobalObject.h"
-#include "UStringBuilder.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <wtf/text/StringBuilder.h>
#if !OS(WINDOWS)
#include <unistd.h>
@@ -63,8 +63,8 @@
bool interactive;
bool verbose;
- Vector<UString> arguments;
- Vector<UString> files;
+ Vector<String> arguments;
+ Vector<String> files;
};
class StopWatch {
@@ -100,7 +100,7 @@
{
}
- UString subject;
+ String subject;
int offset;
int result;
Vector<int, 32> expectVector;
@@ -108,12 +108,12 @@
class GlobalObject : public JSGlobalObject {
private:
- GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
+ GlobalObject(JSGlobalData&, Structure*, const Vector<String>& arguments);
public:
typedef JSGlobalObject Base;
- static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
+ static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<String>& arguments)
{
return new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
}
@@ -126,7 +126,7 @@
}
protected:
- void finishCreation(JSGlobalData& globalData, const Vector<UString>& arguments)
+ void finishCreation(JSGlobalData& globalData, const Vector<String>& arguments)
{
Base::finishCreation(globalData);
UNUSED_PARAM(arguments);
@@ -138,7 +138,7 @@
const ClassInfo GlobalObject::s_info = { "global", &JSGlobalObject::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(GlobalObject) };
-GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
+GlobalObject::GlobalObject(JSGlobalData& globalData, Structure* structure, const Vector<String>& arguments)
: JSGlobalObject(globalData, structure)
{
finishCreation(globalData, arguments);
@@ -239,7 +239,7 @@
return result;
}
-static int scanString(char* buffer, int bufferLength, UStringBuilder& builder, char termChar)
+static int scanString(char* buffer, int bufferLength, StringBuilder& builder, char termChar)
{
bool escape = false;
@@ -307,7 +307,7 @@
static RegExp* parseRegExpLine(JSGlobalData& globalData, char* line, int lineLength)
{
- UStringBuilder pattern;
+ StringBuilder pattern;
if (line[0] != '/')
return 0;
@@ -319,12 +319,12 @@
++i;
- return RegExp::create(globalData, pattern.toUString(), regExpFlags(line + i));
+ return RegExp::create(globalData, pattern.toString(), regExpFlags(line + i));
}
static RegExpTest* parseTestLine(char* line, int lineLength)
{
- UStringBuilder subjectString;
+ StringBuilder subjectString;
if ((line[0] != ' ') || (line[1] != '"'))
return 0;
@@ -363,7 +363,7 @@
RegExpTest* result = new RegExpTest();
- result->subject = subjectString.toUString();
+ result->subject = subjectString.toString();
result->offset = offset;
result->result = matchResult;
@@ -394,10 +394,10 @@
return result;
}
-static bool runFromFiles(GlobalObject* globalObject, const Vector<UString>& files, bool verbose)
+static bool runFromFiles(GlobalObject* globalObject, const Vector<String>& files, bool verbose)
{
- UString script;
- UString fileName;
+ String script;
+ String fileName;
Vector<char> scriptBuffer;
unsigned tests = 0;
unsigned failures = 0;
diff --git a/Source/JavaScriptCore/yarr/YarrInterpreter.cpp b/Source/JavaScriptCore/yarr/YarrInterpreter.cpp
index ba10171..5c2a287 100644
--- a/Source/JavaScriptCore/yarr/YarrInterpreter.cpp
+++ b/Source/JavaScriptCore/yarr/YarrInterpreter.cpp
@@ -27,12 +27,12 @@
#include "config.h"
#include "YarrInterpreter.h"
-#include "UString.h"
#include "Yarr.h"
#include "YarrCanonicalizeUCS2.h"
#include <wtf/BumpPointerAllocator.h>
#include <wtf/DataLog.h>
#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
#ifndef NDEBUG
#include <stdio.h>
@@ -1934,7 +1934,7 @@
return ByteCompiler(pattern).compile(allocator);
}
-unsigned interpret(BytecodePattern* bytecode, const UString& input, unsigned start, unsigned* output)
+unsigned interpret(BytecodePattern* bytecode, const String& input, unsigned start, unsigned* output)
{
if (input.is8Bit())
return Interpreter<LChar>(bytecode, output, input.characters8(), input.length(), start).interpret();
diff --git a/Source/JavaScriptCore/yarr/YarrInterpreter.h b/Source/JavaScriptCore/yarr/YarrInterpreter.h
index 4ecd69e..fb60bd9 100644
--- a/Source/JavaScriptCore/yarr/YarrInterpreter.h
+++ b/Source/JavaScriptCore/yarr/YarrInterpreter.h
@@ -376,7 +376,7 @@
};
JS_EXPORT_PRIVATE PassOwnPtr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*);
-JS_EXPORT_PRIVATE unsigned interpret(BytecodePattern*, const UString& input, unsigned start, unsigned* output);
+JS_EXPORT_PRIVATE unsigned interpret(BytecodePattern*, const String& input, unsigned start, unsigned* output);
unsigned interpret(BytecodePattern*, const LChar* input, unsigned length, unsigned start, unsigned* output);
unsigned interpret(BytecodePattern*, const UChar* input, unsigned length, unsigned start, unsigned* output);
diff --git a/Source/JavaScriptCore/yarr/YarrJIT.cpp b/Source/JavaScriptCore/yarr/YarrJIT.cpp
index eb9861f..ee6e397 100644
--- a/Source/JavaScriptCore/yarr/YarrJIT.cpp
+++ b/Source/JavaScriptCore/yarr/YarrJIT.cpp
@@ -39,7 +39,7 @@
template<YarrJITCompileMode compileMode>
class YarrGenerator : private MacroAssembler {
- friend void jitCompile(JSGlobalData*, YarrCodeBlock& jitObject, const UString& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
+ friend void jitCompile(JSGlobalData*, YarrCodeBlock& jitObject, const String& pattern, unsigned& numSubpatterns, const char*& error, bool ignoreCase, bool multiline);
#if CPU(ARM)
static const RegisterID input = ARMRegisters::r0;
diff --git a/Source/JavaScriptCore/yarr/YarrJIT.h b/Source/JavaScriptCore/yarr/YarrJIT.h
index 71928e7..bb7033f 100644
--- a/Source/JavaScriptCore/yarr/YarrJIT.h
+++ b/Source/JavaScriptCore/yarr/YarrJIT.h
@@ -31,7 +31,6 @@
#include "JSGlobalData.h"
#include "MacroAssemblerCodeRef.h"
#include "MatchResult.h"
-#include "UString.h"
#include "Yarr.h"
#include "YarrPattern.h"
diff --git a/Source/JavaScriptCore/yarr/YarrParser.h b/Source/JavaScriptCore/yarr/YarrParser.h
index 1182d79..4bab1a0 100644
--- a/Source/JavaScriptCore/yarr/YarrParser.h
+++ b/Source/JavaScriptCore/yarr/YarrParser.h
@@ -26,9 +26,9 @@
#ifndef YarrParser_h
#define YarrParser_h
-#include <runtime/UString.h>
#include "Yarr.h"
#include <wtf/ASCIICType.h>
+#include <wtf/text/WTFString.h>
#include <wtf/unicode/Unicode.h>
namespace JSC { namespace Yarr {
@@ -47,7 +47,7 @@
class Parser {
private:
template<class FriendDelegate>
- friend const char* parse(FriendDelegate& delegate, const UString& pattern, unsigned backReferenceLimit);
+ friend const char* parse(FriendDelegate&, const String& pattern, unsigned backReferenceLimit);
enum ErrorCode {
NoError,
@@ -228,7 +228,7 @@
UChar m_character;
};
- Parser(Delegate& delegate, const UString& pattern, unsigned backReferenceLimit)
+ Parser(Delegate& delegate, const String& pattern, unsigned backReferenceLimit)
: m_delegate(delegate)
, m_backReferenceLimit(backReferenceLimit)
, m_err(NoError)
@@ -868,7 +868,7 @@
*/
template<class Delegate>
-const char* parse(Delegate& delegate, const UString& pattern, unsigned backReferenceLimit = quantifyInfinite)
+const char* parse(Delegate& delegate, const String& pattern, unsigned backReferenceLimit = quantifyInfinite)
{
if (pattern.is8Bit())
return Parser<Delegate, LChar>(delegate, pattern, backReferenceLimit).parse();
diff --git a/Source/JavaScriptCore/yarr/YarrPattern.cpp b/Source/JavaScriptCore/yarr/YarrPattern.cpp
index bbda9c5..5080929 100644
--- a/Source/JavaScriptCore/yarr/YarrPattern.cpp
+++ b/Source/JavaScriptCore/yarr/YarrPattern.cpp
@@ -820,7 +820,7 @@
bool m_invertParentheticalAssertion;
};
-const char* YarrPattern::compile(const UString& patternString)
+const char* YarrPattern::compile(const String& patternString)
{
YarrPatternConstructor constructor(*this);
@@ -853,7 +853,7 @@
return 0;
}
-YarrPattern::YarrPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error)
+YarrPattern::YarrPattern(const String& pattern, bool ignoreCase, bool multiline, const char** error)
: m_ignoreCase(ignoreCase)
, m_multiline(multiline)
, m_containsBackreferences(false)
diff --git a/Source/JavaScriptCore/yarr/YarrPattern.h b/Source/JavaScriptCore/yarr/YarrPattern.h
index a31deee..14e89b8 100644
--- a/Source/JavaScriptCore/yarr/YarrPattern.h
+++ b/Source/JavaScriptCore/yarr/YarrPattern.h
@@ -27,10 +27,10 @@
#ifndef YarrPattern_h
#define YarrPattern_h
-#include <runtime/UString.h>
#include <wtf/CheckedArithmetic.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
#include <wtf/unicode/Unicode.h>
namespace JSC { namespace Yarr {
@@ -316,7 +316,7 @@
};
struct YarrPattern {
- JS_EXPORT_PRIVATE YarrPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error);
+ JS_EXPORT_PRIVATE YarrPattern(const String& pattern, bool ignoreCase, bool multiline, const char** error);
~YarrPattern()
{
@@ -405,7 +405,7 @@
Vector<CharacterClass*> m_userCharacterClasses;
private:
- const char* compile(const UString& patternString);
+ const char* compile(const String& patternString);
CharacterClass* newlineCached;
CharacterClass* digitsCached;
diff --git a/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp b/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp
index 51fda94..aa98c4a 100644
--- a/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp
+++ b/Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp
@@ -50,7 +50,7 @@
void disjunction() {}
};
-const char* checkSyntax(const UString& pattern)
+const char* checkSyntax(const String& pattern)
{
SyntaxChecker syntaxChecker;
return parse(syntaxChecker, pattern);
diff --git a/Source/JavaScriptCore/yarr/YarrSyntaxChecker.h b/Source/JavaScriptCore/yarr/YarrSyntaxChecker.h
index 2013671..104ced3 100644
--- a/Source/JavaScriptCore/yarr/YarrSyntaxChecker.h
+++ b/Source/JavaScriptCore/yarr/YarrSyntaxChecker.h
@@ -26,11 +26,11 @@
#ifndef YarrSyntaxChecker_h
#define YarrSyntaxChecker_h
-#include <runtime/UString.h>
+#include <wtf/text/WTFString.h>
namespace JSC { namespace Yarr {
-const char* checkSyntax(const UString& pattern);
+const char* checkSyntax(const String& pattern);
}} // JSC::YARR
diff --git a/Source/JavaScriptCore/yarr/yarr.pri b/Source/JavaScriptCore/yarr/yarr.pri
index 623098f..7e9b4d3 100644
--- a/Source/JavaScriptCore/yarr/yarr.pri
+++ b/Source/JavaScriptCore/yarr/yarr.pri
@@ -10,9 +10,3 @@
$$PWD/YarrSyntaxChecker.cpp \
$$PWD/YarrCanonicalizeUCS2.cpp
-# For UString.h
-v8 {
- INCLUDEPATH += \
- $$PWD/.. \
- $$PWD/../runtime
-}
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 3c69652..0c3a9dc 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,19 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ * 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.
+
2012-08-30 Yong Li <yoli@rim.com>
Vector::shrinkToFit should use realloc when suitable.
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index d9ad5a5..4a4efe8 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -1169,4 +1169,3 @@
#endif
#endif /* WTF_Platform_h */
-
diff --git a/Source/WTF/wtf/text/WTFString.h b/Source/WTF/wtf/text/WTFString.h
index b507c49..3ab0adf 100644
--- a/Source/WTF/wtf/text/WTFString.h
+++ b/Source/WTF/wtf/text/WTFString.h
@@ -198,8 +198,13 @@
return m_impl->characters16();
}
- template <typename CharType>
- inline const CharType* getCharacters() const;
+ // Return characters8() or characters16() depending on CharacterType.
+ template <typename CharacterType>
+ inline const CharacterType* getCharacters() const;
+
+ // Like getCharacters() and upconvert if CharacterType is UChar on a 8bit string.
+ template <typename CharacterType>
+ inline const CharacterType* getCharactersWithUpconvert() const;
bool is8Bit() const { return m_impl->is8Bit(); }
@@ -315,7 +320,7 @@
WTF_EXPORT_STRING_API void remove(unsigned pos, int len = 1);
WTF_EXPORT_STRING_API String substring(unsigned pos, unsigned len = UINT_MAX) const;
- String substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
+ WTF_EXPORT_STRING_API String substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
String left(unsigned len) const { return substring(0, len); }
String right(unsigned len) const { return substring(length() - len, len); }
@@ -518,6 +523,19 @@
return characters16();
}
+template<>
+inline const LChar* String::getCharactersWithUpconvert<LChar>() const
+{
+ ASSERT(is8Bit());
+ return characters8();
+}
+
+template<>
+inline const UChar* String::getCharactersWithUpconvert<UChar>() const
+{
+ return characters();
+}
+
inline bool String::containsOnlyLatin1() const
{
if (isEmpty())
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 1dfb676..6cae5d7 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ 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.
+
2012-08-30 Rob Buis <rbuis@rim.com>
[CMake] Suppress ANGLE compilation warnings
diff --git a/Source/WebCore/ForwardingHeaders/runtime/UString.h b/Source/WebCore/ForwardingHeaders/runtime/UString.h
deleted file mode 100644
index d985aa5..0000000
--- a/Source/WebCore/ForwardingHeaders/runtime/UString.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_UString_h
-#define WebCore_FWD_UString_h
-#include <JavaScriptCore/UString.h>
-#endif
diff --git a/Source/WebCore/ForwardingHeaders/runtime/UStringBuilder.h b/Source/WebCore/ForwardingHeaders/runtime/UStringBuilder.h
deleted file mode 100644
index 592a783..0000000
--- a/Source/WebCore/ForwardingHeaders/runtime/UStringBuilder.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_UStringBuilder_h
-#define WebCore_FWD_UStringBuilder_h
-#include <JavaScriptCore/UStringBuilder.h>
-#endif
diff --git a/Source/WebCore/ForwardingHeaders/runtime/UStringImpl.h b/Source/WebCore/ForwardingHeaders/runtime/UStringImpl.h
deleted file mode 100644
index 94167a4..0000000
--- a/Source/WebCore/ForwardingHeaders/runtime/UStringImpl.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_UStringImpl_h
-#define WebCore_FWD_UStringImpl_h
-#include <JavaScriptCore/UStringImpl.h>
-#endif
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index bea14d8..ab5f62d 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -1833,7 +1833,7 @@
__ZN7WebCore16VisibleSelection27selectionFromContentsOfNodeEPNS_4NodeE
__ZN7WebCore16VisibleSelectionC1Ev
__ZN7WebCore16enclosingIntRectERK6CGRect
-__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_
+__ZN7WebCore16jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_
__ZN7WebCore16nextLinePositionERKNS_15VisiblePositionEiNS_12EditableTypeE
__ZN7WebCore16nextWordPositionERKNS_15VisiblePositionE
__ZN7WebCore17CredentialStorage16clearCredentialsEv
@@ -2309,8 +2309,8 @@
__NPN_UTF8FromIdentifier
__ZN7WebCore16ScriptController20windowScriptNPObjectEv
__ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
-__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
+__ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_
__ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
__ZNK7WebCore4KURL7hasPathEv
#endif
@@ -2338,7 +2338,7 @@
#if USE(PLUGIN_HOST_PROCESS)
__ZN3JSC13RuntimeMethod11getCallDataEPNS_6JSCellERNS_8CallDataE
-__ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_7UStringE
+__ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKN3WTF6StringE
__ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateENS_12PropertyNameERNS_12PropertySlotE
__ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateENS_12PropertyNameERNS_18PropertyDescriptorE
__ZN3JSC13RuntimeMethod6s_infoE
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index aec1279..894037c 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -73901,14 +73901,6 @@
RelativePath="..\ForwardingHeaders\runtime\StringObject.h"
>
</File>
- <File
- RelativePath="..\ForwardingHeaders\runtime\UString.h"
- >
- </File>
- <File
- RelativePath="..\ForwardingHeaders\runtime\UStringImpl.h"
- >
- </File>
</Filter>
<Filter
Name="yarr"
diff --git a/Source/WebCore/bindings/js/CachedScriptSourceProvider.h b/Source/WebCore/bindings/js/CachedScriptSourceProvider.h
index 8efb481..0dd3cf5 100644
--- a/Source/WebCore/bindings/js/CachedScriptSourceProvider.h
+++ b/Source/WebCore/bindings/js/CachedScriptSourceProvider.h
@@ -29,7 +29,6 @@
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
#include "CachedScript.h"
-#include "JSDOMBinding.h" // for stringToUString
#include "ScriptSourceProvider.h"
#include <parser/SourceCode.h>
@@ -45,14 +44,14 @@
m_cachedScript->removeClient(this);
}
- virtual JSC::UString getRange(int start, int end) const OVERRIDE
+ virtual String getRange(int start, int end) const OVERRIDE
{
int length = end - start;
ASSERT(length >= 0);
ASSERT(start + length <= this->length());
String script = m_cachedScript->script();
- return JSC::UString(StringImpl::create(script.impl(), start, length));
+ return String(StringImpl::create(script.impl(), start, length));
}
const StringImpl* data() const { return m_cachedScript->script().impl(); }
@@ -66,7 +65,7 @@
private:
CachedScriptSourceProvider(CachedScript* cachedScript)
- : ScriptSourceProvider(stringToUString(cachedScript->response().url()), TextPosition::minimumPosition(), cachedScript->sourceProviderCache())
+ : ScriptSourceProvider(cachedScript->response().url(), TextPosition::minimumPosition(), cachedScript->sourceProviderCache())
, m_cachedScript(cachedScript)
{
m_cachedScript->addClient(this);
diff --git a/Source/WebCore/bindings/js/Dictionary.cpp b/Source/WebCore/bindings/js/Dictionary.cpp
index d20b445..8fb00dc 100644
--- a/Source/WebCore/bindings/js/Dictionary.cpp
+++ b/Source/WebCore/bindings/js/Dictionary.cpp
@@ -65,13 +65,13 @@
PropertyNameArray propertyNames(exec);
JSObject::getOwnPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties);
for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != propertyNames.end(); it++) {
- String stringKey = ustringToString(it->ustring());
+ String stringKey = it->ustring();
if (stringKey.isEmpty())
continue;
JSValue value = object->get(exec, *it);
if (exec->hadException())
continue;
- String stringValue = ustringToString(value.toString(exec)->value(exec));
+ String stringValue = value.toString(exec)->value(exec);
if (!exec->hadException())
map.set(stringKey, stringValue);
}
@@ -90,7 +90,7 @@
PropertyNameArray propertyNames(exec);
JSObject::getOwnPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties);
for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != propertyNames.end(); it++) {
- String stringKey = ustringToString(it->ustring());
+ String stringKey = it->ustring();
if (!stringKey.isEmpty())
names.append(stringKey);
}
diff --git a/Source/WebCore/bindings/js/IDBBindingUtilities.cpp b/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
index cdc0c48..b55e76b 100644
--- a/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
+++ b/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
@@ -39,7 +39,7 @@
if (value.isInt32())
return IDBKey::createNumber(value.toNumber(exec));
if (value.isString())
- return IDBKey::createString(ustringToString(value.toString(exec)->value(exec)));
+ return IDBKey::createString(value.toString(exec)->value(exec));
// FIXME: Implement dates.
return 0;
}
diff --git a/Source/WebCore/bindings/js/JSBlobCustom.cpp b/Source/WebCore/bindings/js/JSBlobCustom.cpp
index 49ca296..3ee6184 100644
--- a/Source/WebCore/bindings/js/JSBlobCustom.cpp
+++ b/Source/WebCore/bindings/js/JSBlobCustom.cpp
@@ -129,7 +129,7 @@
if (item.inherits(&JSBlob::s_info))
blobBuilder->append(toBlob(item));
else {
- String string = ustringToString(item.toString(exec)->value(exec));
+ String string = item.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
blobBuilder->append(string, endings, ASSERT_NO_EXCEPTION);
diff --git a/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp b/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
index 464e8bb..4a19894 100644
--- a/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
+++ b/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -283,7 +283,7 @@
{
// If the property is a shorthand property (such as "padding"),
// it can only be accessed using getPropertyValue.
- return jsString(exec, thisObj->impl()->getPropertyValueInternal(static_cast<CSSPropertyID>(index)));
+ return jsStringWithCache(exec, thisObj->impl()->getPropertyValueInternal(static_cast<CSSPropertyID>(index)));
}
static inline JSValue cssPropertyGetterPixelOrPosPrefix(ExecState* exec, JSCSSStyleDeclaration* thisObj, unsigned propertyID)
@@ -377,7 +377,7 @@
JSValue JSCSSStyleDeclaration::getPropertyCSSValue(ExecState* exec)
{
- const String& propertyName(ustringToString(exec->argument(0).toString(exec)->value(exec)));
+ const String& propertyName = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
diff --git a/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
index 0c674cb..026b1ae 100644
--- a/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+++ b/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
@@ -44,7 +44,7 @@
return toJS(exec, globalObject, style->canvasGradient());
if (style->canvasPattern())
return toJS(exec, globalObject, style->canvasPattern());
- return jsString(exec, style->color());
+ return jsStringWithCache(exec, style->color());
}
static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState*, JSValue value)
@@ -69,7 +69,7 @@
{
CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
if (value.isString()) {
- context->setStrokeColor(ustringToString(asString(value)->value(exec)));
+ context->setStrokeColor(asString(value)->value(exec));
return;
}
context->setStrokeStyle(toHTMLCanvasStyle(exec, value));
@@ -85,7 +85,7 @@
{
CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
if (value.isString()) {
- context->setFillColor(ustringToString(asString(value)->value(exec)));
+ context->setFillColor(asString(value)->value(exec));
return;
}
context->setFillStyle(toHTMLCanvasStyle(exec, value));
diff --git a/Source/WebCore/bindings/js/JSClipboardCustom.cpp b/Source/WebCore/bindings/js/JSClipboardCustom.cpp
index 8cfd65a..3a93f89 100644
--- a/Source/WebCore/bindings/js/JSClipboardCustom.cpp
+++ b/Source/WebCore/bindings/js/JSClipboardCustom.cpp
@@ -59,7 +59,7 @@
MarkedArgumentBuffer list;
HashSet<String>::const_iterator end = types.end();
for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it)
- list.append(jsString(exec, stringToUString(*it)));
+ list.append(jsStringWithCache(exec, *it));
return constructArray(exec, globalObject(), list);
}
@@ -73,7 +73,7 @@
}
if (exec->argumentCount() == 1) {
- clipboard->clearData(ustringToString(exec->argument(0).toString(exec)->value(exec)));
+ clipboard->clearData(exec->argument(0).toString(exec)->value(exec));
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp b/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
index 847bce4..d1dc0b1 100644
--- a/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
+++ b/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
@@ -87,7 +87,7 @@
RefPtr<JSCustomXPathNSResolver> selfProtector(this);
MarkedArgumentBuffer args;
- args.append(jsString(exec, prefix));
+ args.append(jsStringWithCache(exec, prefix));
m_globalObject->globalData().timeoutChecker.start();
JSValue retval = JSMainThreadExecState::call(exec, function, callType, callData, m_customResolver.get(), args);
@@ -98,7 +98,7 @@
reportCurrentException(exec);
else {
if (!retval.isUndefinedOrNull())
- result = ustringToString(retval.toString(exec)->value(exec));
+ result = retval.toString(exec)->value(exec);
}
Document::updateStyleForAllDocuments();
diff --git a/Source/WebCore/bindings/js/JSDOMBinding.cpp b/Source/WebCore/bindings/js/JSDOMBinding.cpp
index 6551d66..344a807 100644
--- a/Source/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/Source/WebCore/bindings/js/JSDOMBinding.cpp
@@ -48,9 +48,9 @@
return DOMObjectHashTableMap::mapFor(globalData).get(staticTable);
}
-JSValue jsStringSlowCase(ExecState* exec, JSStringCache& stringCache, StringImpl* stringImpl)
+JSValue jsStringWithCacheSlowCase(ExecState* exec, JSStringCache& stringCache, StringImpl* stringImpl)
{
- JSString* wrapper = jsString(exec, UString(stringImpl));
+ JSString* wrapper = JSC::jsString(exec, String(stringImpl));
weakAdd(stringCache, stringImpl, PassWeak<JSString>(wrapper, currentWorld(exec)->stringWrapperOwner(), stringImpl));
return wrapper;
}
@@ -59,40 +59,40 @@
{
if (s.isNull())
return jsNull();
- return jsString(exec, s);
+ return jsStringWithCache(exec, s);
}
JSValue jsOwnedStringOrNull(ExecState* exec, const String& s)
{
if (s.isNull())
return jsNull();
- return jsOwnedString(exec, stringToUString(s));
+ return jsOwnedString(exec, s);
}
JSValue jsStringOrUndefined(ExecState* exec, const String& s)
{
if (s.isNull())
return jsUndefined();
- return jsString(exec, s);
+ return jsStringWithCache(exec, s);
}
JSValue jsString(ExecState* exec, const KURL& url)
{
- return jsString(exec, url.string());
+ return jsStringWithCache(exec, url.string());
}
JSValue jsStringOrNull(ExecState* exec, const KURL& url)
{
if (url.isNull())
return jsNull();
- return jsString(exec, url.string());
+ return jsStringWithCache(exec, url.string());
}
JSValue jsStringOrUndefined(ExecState* exec, const KURL& url)
{
if (url.isNull())
return jsUndefined();
- return jsString(exec, url.string());
+ return jsStringWithCache(exec, url.string());
}
AtomicStringImpl* findAtomicString(PropertyName propertyName)
@@ -108,14 +108,14 @@
{
if (value.isNull())
return String();
- return ustringToString(value.toString(exec)->value(exec));
+ return value.toString(exec)->value(exec);
}
String valueToStringWithUndefinedOrNullCheck(ExecState* exec, JSValue value)
{
if (value.isUndefinedOrNull())
return String();
- return ustringToString(value.toString(exec)->value(exec));
+ return value.toString(exec)->value(exec);
}
JSValue jsDateOrNull(ExecState* exec, double value)
@@ -139,7 +139,7 @@
JSC::MarkedArgumentBuffer list;
if (stringList) {
for (unsigned i = 0; i < stringList->length(); ++i)
- list.append(jsString(exec, stringList->item(i)));
+ list.append(jsStringWithCache(exec, stringList->item(i)));
}
return JSC::constructArray(exec, globalObject, list);
}
@@ -149,14 +149,14 @@
if (isTerminatedExecutionException(exception))
return;
- UString errorMessage = exception.toString(exec)->value(exec);
+ String errorMessage = exception.toString(exec)->value(exec);
JSObject* exceptionObject = exception.toObject(exec);
int lineNumber = exceptionObject->get(exec, Identifier(exec, "line")).toInt32(exec);
- UString exceptionSourceURL = exceptionObject->get(exec, Identifier(exec, "sourceURL")).toString(exec)->value(exec);
+ String exceptionSourceURL = exceptionObject->get(exec, Identifier(exec, "sourceURL")).toString(exec)->value(exec);
exec->clearException();
if (ExceptionBase* exceptionBase = toExceptionBase(exception))
- errorMessage = stringToUString(exceptionBase->message() + ": " + exceptionBase->description());
+ errorMessage = exceptionBase->message() + ": " + exceptionBase->description();
JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
if (JSDOMWindow* window = jsDynamicCast<JSDOMWindow*>(globalObject)) {
@@ -164,7 +164,7 @@
return;
}
ScriptExecutionContext* scriptExecutionContext = globalObject->scriptExecutionContext();
- scriptExecutionContext->reportException(ustringToString(errorMessage), lineNumber, ustringToString(exceptionSourceURL), 0);
+ scriptExecutionContext->reportException(errorMessage, lineNumber, exceptionSourceURL, 0);
}
void reportCurrentException(ExecState* exec)
diff --git a/Source/WebCore/bindings/js/JSDOMBinding.h b/Source/WebCore/bindings/js/JSDOMBinding.h
index 0c3d537..009b27c 100644
--- a/Source/WebCore/bindings/js/JSDOMBinding.h
+++ b/Source/WebCore/bindings/js/JSDOMBinding.h
@@ -233,12 +233,12 @@
// Convert a DOM implementation exception code into a JavaScript exception in the execution state.
void setDOMException(JSC::ExecState*, ExceptionCode);
- JSC::JSValue jsString(JSC::ExecState*, const String&); // empty if the string is null
- JSC::JSValue jsStringSlowCase(JSC::ExecState*, JSStringCache&, StringImpl*);
+ JSC::JSValue jsStringWithCache(JSC::ExecState*, const String&);
+ JSC::JSValue jsStringWithCacheSlowCase(JSC::ExecState*, JSStringCache&, StringImpl*);
JSC::JSValue jsString(JSC::ExecState*, const KURL&); // empty if the URL is null
- inline JSC::JSValue jsString(JSC::ExecState* exec, const AtomicString& s)
+ inline JSC::JSValue jsStringWithCache(JSC::ExecState* exec, const AtomicString& s)
{
- return jsString(exec, s.string());
+ return jsStringWithCache(exec, s.string());
}
JSC::JSValue jsStringOrNull(JSC::ExecState*, const String&); // null if the string is null
@@ -252,11 +252,8 @@
JSC::JSValue jsOwnedStringOrNull(JSC::ExecState*, const String&);
String propertyNameToString(JSC::PropertyName);
- String ustringToString(const JSC::UString&);
- JSC::UString stringToUString(const String&);
AtomicString propertyNameToAtomicString(JSC::PropertyName);
- AtomicString ustringToAtomicString(const JSC::UString&);
AtomicStringImpl* findAtomicString(JSC::PropertyName);
String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
@@ -317,7 +314,7 @@
struct JSValueTraits<String> {
static inline JSC::JSValue arrayJSValue(JSC::ExecState* exec, JSDOMGlobalObject*, const String& value)
{
- return jsString(exec, stringToUString(value));
+ return jsStringWithCache(exec, value);
}
};
@@ -358,7 +355,7 @@
struct NativeValueTraits<String> {
static inline bool arrayNativeValue(JSC::ExecState* exec, JSC::JSValue jsValue, String& indexedValue)
{
- indexedValue = ustringToString(jsValue.toString(exec)->value(exec));
+ indexedValue = jsValue.toString(exec)->value(exec);
return true;
}
};
@@ -409,30 +406,22 @@
void printErrorMessageForFrame(Frame*, const String& message);
JSC::JSValue objectToStringFunctionGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
- inline JSC::JSValue jsString(JSC::ExecState* exec, const String& s)
+ inline JSC::JSValue jsStringWithCache(JSC::ExecState* exec, const String& s)
{
StringImpl* stringImpl = s.impl();
if (!stringImpl || !stringImpl->length())
return jsEmptyString(exec);
+ // FIXME: we shouldn't invoke StringImpl::characters().
+ // FIXME: why not just return a SmallStrings when possible?
if (stringImpl->length() == 1 && stringImpl->characters()[0] <= 0xFF)
- return jsString(exec, stringToUString(s));
+ return JSC::jsString(exec, s);
JSStringCache& stringCache = currentWorld(exec)->m_stringCache;
if (JSC::JSString* string = stringCache.get(stringImpl))
return string;
- return jsStringSlowCase(exec, stringCache, stringImpl);
- }
-
- inline String ustringToString(const JSC::UString& u)
- {
- return u.impl();
- }
-
- inline JSC::UString stringToUString(const String& s)
- {
- return JSC::UString(s.impl());
+ return jsStringWithCacheSlowCase(exec, stringCache, stringImpl);
}
inline String propertyNameToString(JSC::PropertyName propertyName)
@@ -440,11 +429,6 @@
return propertyName.publicName();
}
- inline AtomicString ustringToAtomicString(const JSC::UString& u)
- {
- return AtomicString(u.impl());
- }
-
inline AtomicString propertyNameToAtomicString(JSC::PropertyName propertyName)
{
return AtomicString(propertyName.publicName());
diff --git a/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp b/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp
index 7be9332..4ed4497 100644
--- a/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp
@@ -60,15 +60,15 @@
JSValue JSDOMFormData::append(ExecState* exec)
{
if (exec->argumentCount() >= 2) {
- String name = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ String name = exec->argument(0).toString(exec)->value(exec);
JSValue value = exec->argument(1);
if (value.inherits(&JSBlob::s_info)) {
String filename;
if (exec->argumentCount() >= 3 && !exec->argument(2).isUndefinedOrNull())
- filename = ustringToString(exec->argument(2).toString(exec)->value(exec));
+ filename = exec->argument(2).toString(exec)->value(exec);
impl()->append(name, toBlob(value), filename);
} else
- impl()->append(name, ustringToString(value.toString(exec)->value(exec)));
+ impl()->append(name, value.toString(exec)->value(exec));
}
return jsUndefined();
diff --git a/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp b/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp
index 7f8d5ec..6869dce 100644
--- a/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp
@@ -34,7 +34,7 @@
JSArray* array = asArray(value);
RefPtr<DOMStringList> stringList = DOMStringList::create();
for (unsigned i = 0; i < array->length(); ++i)
- stringList->append(ustringToString(array->getIndex(i).toString(exec)->value(exec)));
+ stringList->append(array->getIndex(i).toString(exec)->value(exec));
return stringList.release();
}
diff --git a/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp b/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
index 891ea6a..d3979c4 100644
--- a/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
@@ -43,7 +43,7 @@
JSValue JSDOMStringMap::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSDOMStringMap* thisObj = jsCast<JSDOMStringMap*>(asObject(slotBase));
- return jsString(exec, thisObj->impl()->item(propertyNameToAtomicString(propertyName)));
+ return jsStringWithCache(exec, thisObj->impl()->item(propertyNameToAtomicString(propertyName)));
}
void JSDOMStringMap::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
@@ -53,7 +53,7 @@
thisObject->m_impl->getNames(names);
size_t length = names.size();
for (size_t i = 0; i < length; ++i)
- propertyNames.add(Identifier(exec, stringToUString(names[i])));
+ propertyNames.add(Identifier(exec, names[i]));
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
@@ -72,7 +72,7 @@
bool JSDOMStringMap::putDelegate(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&)
{
- String stringValue = ustringToString(value.toString(exec)->value(exec));
+ String stringValue = value.toString(exec)->value(exec);
if (exec->hadException())
return false;
ExceptionCode ec = 0;
diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
index a1f0c1b..3439afb4 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -421,12 +421,12 @@
}
#endif
- UString locationString = value.toString(exec)->value(exec);
+ String locationString = value.toString(exec)->value(exec);
if (exec->hadException())
return;
if (Location* location = impl()->location())
- location->setHref(ustringToString(locationString), activeDOMWindow(exec), firstDOMWindow(exec));
+ location->setHref(locationString, activeDOMWindow(exec), firstDOMWindow(exec));
}
JSValue JSDOMWindow::event(ExecState* exec) const
@@ -472,7 +472,7 @@
String urlString = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
if (exec->hadException())
return jsUndefined();
- AtomicString frameName = exec->argument(1).isUndefinedOrNull() ? "_blank" : ustringToAtomicString(exec->argument(1).toString(exec)->value(exec));
+ AtomicString frameName = exec->argument(1).isUndefinedOrNull() ? "_blank" : exec->argument(1).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
String windowFeaturesString = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(2));
@@ -641,7 +641,7 @@
if (!listener.isObject())
return jsUndefined();
- impl()->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
+ impl()->addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
return jsUndefined();
}
@@ -655,7 +655,7 @@
if (!listener.isObject())
return jsUndefined();
- impl()->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
+ impl()->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSDOMWindowShell.cpp b/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
index 758e727..55d99bc 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
@@ -85,7 +85,7 @@
// JSObject methods
// ----
-UString JSDOMWindowShell::className(const JSObject* object)
+String JSDOMWindowShell::className(const JSObject* object)
{
const JSDOMWindowShell* thisObject = jsCast<const JSDOMWindowShell*>(object);
return thisObject->window()->methodTable()->className(thisObject->window());
diff --git a/Source/WebCore/bindings/js/JSDOMWindowShell.h b/Source/WebCore/bindings/js/JSDOMWindowShell.h
index 5f22d7b..84ac4f3 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowShell.h
+++ b/Source/WebCore/bindings/js/JSDOMWindowShell.h
@@ -77,7 +77,7 @@
private:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
- static JSC::UString className(const JSC::JSObject*);
+ static String className(const JSC::JSObject*);
static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
diff --git a/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp b/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
index 8e9948f..193a6c4 100644
--- a/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
@@ -164,7 +164,7 @@
JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState* exec)
{
- const String& type = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ const String type = exec->argument(0).toString(exec)->value(exec);
bool bubbles = exec->argument(1).toBoolean(exec);
bool cancelable = exec->argument(2).toBoolean(exec);
diff --git a/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp b/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
index d03b740..1f070fe 100644
--- a/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
@@ -70,7 +70,7 @@
JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
{
- const String& type = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ const String type = exec->argument(0).toString(exec)->value(exec);
bool bubbles = exec->argument(1).toBoolean(exec);
bool cancelable = exec->argument(2).toBoolean(exec);
// If alpha, beta or gamma are null or undefined, mark them as not provided.
diff --git a/Source/WebCore/bindings/js/JSDictionary.cpp b/Source/WebCore/bindings/js/JSDictionary.cpp
index 85b7591..d4e2264 100644
--- a/Source/WebCore/bindings/js/JSDictionary.cpp
+++ b/Source/WebCore/bindings/js/JSDictionary.cpp
@@ -101,7 +101,7 @@
void JSDictionary::convertValue(ExecState* exec, JSValue value, String& result)
{
- result = ustringToString(value.toString(exec)->value(exec));
+ result = value.toString(exec)->value(exec);
}
void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector<String>& result)
@@ -118,7 +118,7 @@
JSValue itemValue = object->get(exec, i);
if (exec->hadException())
return;
- result.append(ustringToString(itemValue.toString(exec)->value(exec)));
+ result.append(itemValue.toString(exec)->value(exec));
}
}
@@ -182,7 +182,7 @@
JSValue itemValue = object->get(exec, i);
if (exec->hadException())
return;
- result.add(ustringToAtomicString(itemValue.toString(exec)->value(exec)));
+ result.add(itemValue.toString(exec)->value(exec));
}
}
#endif
@@ -202,7 +202,7 @@
if (tryGetProperty(propertyName.utf8().data(), value) != PropertyFound || value.isUndefinedOrNull())
return false;
- result = ustringToString(value.toString(m_exec)->value(m_exec));
+ result = value.toWTFString(m_exec);
return true;
}
diff --git a/Source/WebCore/bindings/js/JSDocumentCustom.cpp b/Source/WebCore/bindings/js/JSDocumentCustom.cpp
index 647b446..5488404 100644
--- a/Source/WebCore/bindings/js/JSDocumentCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDocumentCustom.cpp
@@ -69,12 +69,12 @@
if (!frame)
return;
- UString locationString = value.toString(exec)->value(exec);
+ String locationString = value.toString(exec)->value(exec);
if (exec->hadException())
return;
if (Location* location = frame->document()->domWindow()->location())
- location->setHref(ustringToString(locationString), activeDOMWindow(exec), firstDOMWindow(exec));
+ location->setHref(locationString, activeDOMWindow(exec), firstDOMWindow(exec));
}
JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* document)
diff --git a/Source/WebCore/bindings/js/JSErrorHandler.cpp b/Source/WebCore/bindings/js/JSErrorHandler.cpp
index 5b4b59f..b659256 100644
--- a/Source/WebCore/bindings/js/JSErrorHandler.cpp
+++ b/Source/WebCore/bindings/js/JSErrorHandler.cpp
@@ -85,8 +85,8 @@
globalObject->setCurrentEvent(event);
MarkedArgumentBuffer args;
- args.append(jsString(exec, errorEvent->message()));
- args.append(jsString(exec, errorEvent->filename()));
+ args.append(jsStringWithCache(exec, errorEvent->message()));
+ args.append(jsStringWithCache(exec, errorEvent->filename()));
args.append(jsNumber(errorEvent->lineno()));
JSGlobalData& globalData = globalObject->globalData();
diff --git a/Source/WebCore/bindings/js/JSEventListener.cpp b/Source/WebCore/bindings/js/JSEventListener.cpp
index 779e8d7..5eeb410 100644
--- a/Source/WebCore/bindings/js/JSEventListener.cpp
+++ b/Source/WebCore/bindings/js/JSEventListener.cpp
@@ -144,7 +144,7 @@
reportCurrentException(exec);
} else {
if (!retval.isUndefinedOrNull() && event->storesResultAsString())
- event->storeResult(ustringToString(retval.toString(exec)->value(exec)));
+ event->storeResult(retval.toString(exec)->value(exec));
if (m_isAttribute) {
if (retval.isFalse())
event->preventDefault();
diff --git a/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp b/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
index 8546729..5561bca 100644
--- a/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
@@ -70,7 +70,7 @@
if (exec->argumentCount() == 1) {
// Support for document.all(<index>) etc.
- UString string = exec->argument(0).toString(exec)->value(exec);
+ String string = exec->argument(0).toString(exec)->value(exec);
unsigned index = toUInt32FromStringImpl(string.impl());
if (index != PropertyName::NotAnIndex)
return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection->item(index)));
@@ -80,10 +80,10 @@
}
// The second arg, if set, is the index of the item we want
- UString string = exec->argument(0).toString(exec)->value(exec);
- unsigned index = toUInt32FromStringImpl(exec->argument(1).toString(exec)->value(exec).impl());
+ String string = exec->argument(0).toString(exec)->value(exec);
+ unsigned index = toUInt32FromStringImpl(exec->argument(1).toWTFString(exec).impl());
if (index != PropertyName::NotAnIndex) {
- if (Node* node = collection->namedItemWithIndex(ustringToAtomicString(string), index))
+ if (Node* node = collection->namedItemWithIndex(string, index))
return JSValue::encode(toJS(exec, jsCollection->globalObject(), node));
}
diff --git a/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
index 3f9a39f..80212a9 100644
--- a/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
@@ -45,7 +45,7 @@
JSValue JSHTMLCanvasElement::getContext(ExecState* exec)
{
HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl());
- const UString& contextId = exec->argument(0).toString(exec)->value(exec);
+ const String& contextId = exec->argument(0).toString(exec)->value(exec);
RefPtr<CanvasContextAttributes> attrs;
#if ENABLE(WEBGL)
if (contextId == "experimental-webgl" || contextId == "webkit-3d") {
@@ -74,7 +74,7 @@
}
}
#endif
- CanvasRenderingContext* context = canvas->getContext(ustringToString(contextId), attrs.get());
+ CanvasRenderingContext* context = canvas->getContext(contextId, attrs.get());
if (!context)
return jsNull();
JSValue jsValue = toJS(exec, globalObject(), WTF::getPtr(context));
@@ -105,7 +105,7 @@
}
}
- JSValue result = jsString(exec, canvas->toDataURL(type, qualityPtr, ec));
+ JSValue result = JSC::jsString(exec, canvas->toDataURL(type, qualityPtr, ec));
setDOMException(exec, ec);
return result;
}
diff --git a/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp b/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
index 5e2f35e..3c6893b 100644
--- a/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
@@ -136,15 +136,15 @@
size_t size = exec->argumentCount();
- UString firstString = exec->argument(0).toString(exec)->value(exec);
- SegmentedString segmentedString = ustringToString(firstString);
+ String firstString = exec->argument(0).toString(exec)->value(exec);
+ SegmentedString segmentedString = firstString;
if (size != 1) {
if (!size)
segmentedString.clear();
else {
for (size_t i = 1; i < size; ++i) {
- UString subsequentString = exec->argument(i).toString(exec)->value(exec);
- segmentedString.append(SegmentedString(ustringToString(subsequentString)));
+ String subsequentString = exec->argument(i).toString(exec)->value(exec);
+ segmentedString.append(SegmentedString(subsequentString));
}
}
}
diff --git a/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
index 36fd8b7..520ce65 100644
--- a/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
@@ -75,7 +75,7 @@
if (!input->canHaveSelection())
return throwTypeError(exec);
- return jsString(exec, input->selectionDirection());
+ return jsStringWithCache(exec, input->selectionDirection());
}
void JSHTMLInputElement::setSelectionDirection(ExecState* exec, JSValue value)
@@ -86,7 +86,7 @@
return;
}
- input->setSelectionDirection(ustringToString(value.toString(exec)->value(exec)));
+ input->setSelectionDirection(value.toString(exec)->value(exec));
}
JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec)
@@ -97,7 +97,7 @@
int start = exec->argument(0).toInt32(exec);
int end = exec->argument(1).toInt32(exec);
- String direction = ustringToString(exec->argument(2).toString(exec)->value(exec));
+ String direction = exec->argument(2).toString(exec)->value(exec);
input->setSelectionRange(start, end, direction);
return jsUndefined();
diff --git a/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp b/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp
index 3f907ac..77113c7 100644
--- a/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp
+++ b/Source/WebCore/bindings/js/JSIDBAnyCustom.cpp
@@ -65,7 +65,7 @@
case IDBAny::NullType:
return jsNull();
case IDBAny::StringType:
- return jsString(exec, idbAny->string());
+ return jsStringWithCache(exec, idbAny->string());
case IDBAny::DOMStringListType:
return toJS(exec, globalObject, idbAny->domStringList());
case IDBAny::IDBCursorType:
diff --git a/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp b/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp
index b2b78ec..4afa550 100644
--- a/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp
+++ b/Source/WebCore/bindings/js/JSIDBKeyCustom.cpp
@@ -56,7 +56,7 @@
return JSValue(outArray);
}
case IDBKey::StringType:
- return jsString(exec, key->string());
+ return jsStringWithCache(exec, key->string());
case IDBKey::DateType:
return jsDateOrNull(exec, key->date());
case IDBKey::NumberType:
diff --git a/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 1413750..9efed46 100644
--- a/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -109,8 +109,8 @@
return jsUndefined();
JSObject* thisObject = exec->argument(0).toThisObject(exec);
- UString result = thisObject->methodTable()->className(thisObject);
- return jsString(exec, result);
+ String result = thisObject->methodTable()->className(thisObject);
+ return jsStringWithCache(exec, result);
}
JSValue JSInjectedScriptHost::isHTMLAllCollection(ExecState* exec)
@@ -170,7 +170,7 @@
int lineNumber = sourceCode->firstLine();
if (lineNumber)
lineNumber -= 1; // In the inspector protocol all positions are 0-based while in SourceCode they are 1-based
- UString scriptId = UString::number(sourceCode->provider()->asID());
+ String scriptId = String::number(sourceCode->provider()->asID());
JSObject* location = constructEmptyObject(exec);
location->putDirect(exec->globalData(), Identifier(exec, "lineNumber"), jsNumber(lineNumber));
@@ -178,12 +178,12 @@
JSObject* result = constructEmptyObject(exec);
result->putDirect(exec->globalData(), Identifier(exec, "location"), location);
- UString name = function->name(exec);
+ String name = function->name(exec);
if (!name.isEmpty())
- result->putDirect(exec->globalData(), Identifier(exec, "name"), jsString(exec, name));
- UString displayName = function->displayName(exec);
+ result->putDirect(exec->globalData(), Identifier(exec, "name"), jsStringWithCache(exec, name));
+ String displayName = function->displayName(exec);
if (!displayName.isEmpty())
- result->putDirect(exec->globalData(), Identifier(exec, "displayName"), jsString(exec, displayName));
+ result->putDirect(exec->globalData(), Identifier(exec, "displayName"), jsStringWithCache(exec, displayName));
// FIXME: provide function scope data in "scopesRaw" property when JSC supports it.
// https://bugs.webkit.org/show_bug.cgi?id=87192
return result;
@@ -260,7 +260,7 @@
#if ENABLE(SQL_DATABASE)
Database* database = toDatabase(exec->argument(0));
if (database)
- return jsString(exec, impl()->databaseIdImpl(database));
+ return jsStringWithCache(exec, impl()->databaseIdImpl(database));
#endif
return jsUndefined();
}
@@ -271,7 +271,7 @@
return jsUndefined();
Storage* storage = toStorage(exec->argument(0));
if (storage)
- return jsString(exec, impl()->storageIdImpl(storage));
+ return jsStringWithCache(exec, impl()->storageIdImpl(storage));
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp b/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp
index e63f497..cde7875 100644
--- a/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp
+++ b/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp
@@ -54,7 +54,7 @@
{
JSLockHolder lock(scriptState);
- SourceCode sourceCode = makeSource(stringToUString(source));
+ SourceCode sourceCode = makeSource(source);
JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
JSValue globalThisValue = scriptState->globalThisValue();
diff --git a/Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
index 2978dea..89e772a 100644
--- a/Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
+++ b/Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
@@ -68,7 +68,7 @@
#else
DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("unknown")));
#endif
- return jsString(execState, platform);
+ return jsStringWithCache(execState, platform);
}
JSValue JSInspectorFrontendHost::port(ExecState* execState)
@@ -82,7 +82,7 @@
#else
DEFINE_STATIC_LOCAL(const String, port, (ASCIILiteral("unknown")));
#endif
- return jsString(execState, port);
+ return jsStringWithCache(execState, port);
}
#if ENABLE(CONTEXT_MENUS)
@@ -99,7 +99,7 @@
if (!type.isString())
continue;
- String typeString = ustringToString(type.toString(exec)->value(exec));
+ String typeString = type.toString(exec)->value(exec);
if (typeString == "separator") {
ContextMenuItem item(SeparatorType,
ContextMenuItemCustomTagNoAction,
@@ -111,12 +111,12 @@
populateContextMenuItems(exec, subItemsArray, subMenu);
ContextMenuItem item(SubmenuType,
ContextMenuItemCustomTagNoAction,
- ustringToString(label.toString(exec)->value(exec)),
+ label.toString(exec)->value(exec),
&subMenu);
menu.appendItem(item);
} else {
ContextMenuAction typedId = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + id.toInt32(exec));
- ContextMenuItem menuItem((typeString == "checkbox" ? CheckableActionType : ActionType), typedId, ustringToString(label.toString(exec)->value(exec)));
+ ContextMenuItem menuItem((typeString == "checkbox" ? CheckableActionType : ActionType), typedId, label.toString(exec)->value(exec));
if (!enabled.isUndefined())
menuItem.setEnabled(enabled.toBoolean(exec));
if (!checked.isUndefined())
diff --git a/Source/WebCore/bindings/js/JSIntentConstructor.cpp b/Source/WebCore/bindings/js/JSIntentConstructor.cpp
index 60a214a..4f29c74 100644
--- a/Source/WebCore/bindings/js/JSIntentConstructor.cpp
+++ b/Source/WebCore/bindings/js/JSIntentConstructor.cpp
@@ -61,11 +61,11 @@
return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), impl.get())));
}
- const String& action(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String action(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toWTFString(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& type(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String type(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toWTFString(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
diff --git a/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp b/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
index 12499fa..159f184 100644
--- a/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
+++ b/Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
@@ -63,9 +63,9 @@
{
switch (impl()->type()) {
case DebuggerCallFrame::FunctionType:
- return jsString(exec, UString("function"));
+ return jsString(exec, ASCIILiteral("function"));
case DebuggerCallFrame::ProgramType:
- return jsString(exec, UString("program"));
+ return jsString(exec, ASCIILiteral("program"));
}
ASSERT_NOT_REACHED();
diff --git a/Source/WebCore/bindings/js/JSLazyEventListener.cpp b/Source/WebCore/bindings/js/JSLazyEventListener.cpp
index 8879727..87dc492 100644
--- a/Source/WebCore/bindings/js/JSLazyEventListener.cpp
+++ b/Source/WebCore/bindings/js/JSLazyEventListener.cpp
@@ -94,10 +94,10 @@
ExecState* exec = globalObject->globalExec();
MarkedArgumentBuffer args;
- args.append(jsNontrivialString(exec, stringToUString(m_eventParameterName)));
- args.append(jsString(exec, m_code));
+ args.append(jsNontrivialString(exec, m_eventParameterName));
+ args.append(jsStringWithCache(exec, m_code));
- JSObject* jsFunction = constructFunctionSkippingEvalEnabledCheck(exec, exec->lexicalGlobalObject(), args, Identifier(exec, stringToUString(m_functionName)), stringToUString(m_sourceURL), m_position); // FIXME: is globalExec ok?
+ JSObject* jsFunction = constructFunctionSkippingEvalEnabledCheck(exec, exec->lexicalGlobalObject(), args, Identifier(exec, m_functionName), m_sourceURL, m_position); // FIXME: is globalExec ok?
if (exec->hadException()) {
reportCurrentException(exec);
exec->clearException();
diff --git a/Source/WebCore/bindings/js/JSLocationCustom.cpp b/Source/WebCore/bindings/js/JSLocationCustom.cpp
index 5cb0c07..14bd357 100644
--- a/Source/WebCore/bindings/js/JSLocationCustom.cpp
+++ b/Source/WebCore/bindings/js/JSLocationCustom.cpp
@@ -179,76 +179,76 @@
void JSLocation::setHref(ExecState* exec, JSValue value)
{
- UString href = value.toString(exec)->value(exec);
+ String href = value.toString(exec)->value(exec);
if (exec->hadException())
return;
- impl()->setHref(ustringToString(href), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setHref(href, activeDOMWindow(exec), firstDOMWindow(exec));
}
void JSLocation::setProtocol(ExecState* exec, JSValue value)
{
- UString protocol = value.toString(exec)->value(exec);
+ String protocol = value.toString(exec)->value(exec);
if (exec->hadException())
return;
ExceptionCode ec = 0;
- impl()->setProtocol(ustringToString(protocol), activeDOMWindow(exec), firstDOMWindow(exec), ec);
+ impl()->setProtocol(protocol, activeDOMWindow(exec), firstDOMWindow(exec), ec);
setDOMException(exec, ec);
}
void JSLocation::setHost(ExecState* exec, JSValue value)
{
- UString host = value.toString(exec)->value(exec);
+ String host = value.toString(exec)->value(exec);
if (exec->hadException())
return;
- impl()->setHost(ustringToString(host), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setHost(host, activeDOMWindow(exec), firstDOMWindow(exec));
}
void JSLocation::setHostname(ExecState* exec, JSValue value)
{
- UString hostname = value.toString(exec)->value(exec);
+ String hostname = value.toString(exec)->value(exec);
if (exec->hadException())
return;
- impl()->setHostname(ustringToString(hostname), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setHostname(hostname, activeDOMWindow(exec), firstDOMWindow(exec));
}
void JSLocation::setPort(ExecState* exec, JSValue value)
{
- UString port = value.toString(exec)->value(exec);
+ String port = value.toWTFString(exec);
if (exec->hadException())
return;
- impl()->setPort(ustringToString(port), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setPort(port, activeDOMWindow(exec), firstDOMWindow(exec));
}
void JSLocation::setPathname(ExecState* exec, JSValue value)
{
- UString pathname = value.toString(exec)->value(exec);
+ String pathname = value.toString(exec)->value(exec);
if (exec->hadException())
return;
- impl()->setPathname(ustringToString(pathname), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setPathname(pathname, activeDOMWindow(exec), firstDOMWindow(exec));
}
void JSLocation::setSearch(ExecState* exec, JSValue value)
{
- UString pathname = value.toString(exec)->value(exec);
+ String pathname = value.toString(exec)->value(exec);
if (exec->hadException())
return;
- impl()->setSearch(ustringToString(pathname), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setSearch(pathname, activeDOMWindow(exec), firstDOMWindow(exec));
}
void JSLocation::setHash(ExecState* exec, JSValue value)
{
- UString hash = value.toString(exec)->value(exec);
+ String hash = value.toString(exec)->value(exec);
if (exec->hadException())
return;
- impl()->setHash(ustringToString(hash), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->setHash(hash, activeDOMWindow(exec), firstDOMWindow(exec));
}
JSValue JSLocation::replace(ExecState* exec)
{
- UString urlString = exec->argument(0).toString(exec)->value(exec);
+ String urlString = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
- impl()->replace(ustringToString(urlString), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->replace(urlString, activeDOMWindow(exec), firstDOMWindow(exec));
return jsUndefined();
}
@@ -260,10 +260,10 @@
JSValue JSLocation::assign(ExecState* exec)
{
- UString urlString = exec->argument(0).toString(exec)->value(exec);
+ String urlString = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
- impl()->assign(ustringToString(urlString), activeDOMWindow(exec), firstDOMWindow(exec));
+ impl()->assign(urlString, activeDOMWindow(exec), firstDOMWindow(exec));
return jsUndefined();
}
@@ -273,7 +273,7 @@
if (!frame || !shouldAllowAccessToFrame(exec, frame))
return jsUndefined();
- return jsString(exec, impl()->toString());
+ return jsStringWithCache(exec, impl()->toString());
}
bool JSLocationPrototype::putDelegate(ExecState* exec, PropertyName propertyName, JSValue, PutPropertySlot&)
diff --git a/Source/WebCore/bindings/js/JSMainThreadExecState.h b/Source/WebCore/bindings/js/JSMainThreadExecState.h
index 838e3ed..960cbbf 100644
--- a/Source/WebCore/bindings/js/JSMainThreadExecState.h
+++ b/Source/WebCore/bindings/js/JSMainThreadExecState.h
@@ -63,7 +63,7 @@
String resourceName;
int lineNumber = 1;
if (callType == JSC::CallTypeJS) {
- resourceName = ustringToString(callData.js.functionExecutable->sourceURL());
+ resourceName = callData.js.functionExecutable->sourceURL();
lineNumber = callData.js.functionExecutable->lineNo();
} else
resourceName = "undefined";
diff --git a/Source/WebCore/bindings/js/JSMessageEventCustom.cpp b/Source/WebCore/bindings/js/JSMessageEventCustom.cpp
index 64fcef8..e44cddd 100644
--- a/Source/WebCore/bindings/js/JSMessageEventCustom.cpp
+++ b/Source/WebCore/bindings/js/JSMessageEventCustom.cpp
@@ -71,7 +71,7 @@
break;
case MessageEvent::DataTypeString:
- result = jsString(exec, event->dataAsString());
+ result = jsStringWithCache(exec, event->dataAsString());
break;
case MessageEvent::DataTypeBlob:
@@ -102,11 +102,11 @@
static JSC::JSValue handleInitMessageEvent(JSMessageEvent* jsEvent, JSC::ExecState* exec)
{
- const UString& typeArg = exec->argument(0).toString(exec)->value(exec);
+ const String& typeArg = exec->argument(0).toString(exec)->value(exec);
bool canBubbleArg = exec->argument(1).toBoolean(exec);
bool cancelableArg = exec->argument(2).toBoolean(exec);
- const UString& originArg = exec->argument(4).toString(exec)->value(exec);
- const UString& lastEventIdArg = exec->argument(5).toString(exec)->value(exec);
+ const String originArg = exec->argument(4).toString(exec)->value(exec);
+ const String lastEventIdArg = exec->argument(5).toString(exec)->value(exec);
DOMWindow* sourceArg = toDOMWindow(exec->argument(6));
OwnPtr<MessagePortArray> messagePorts;
OwnPtr<ArrayBufferArray> arrayBuffers;
@@ -122,7 +122,7 @@
return jsUndefined();
MessageEvent* event = static_cast<MessageEvent*>(jsEvent->impl());
- event->initMessageEvent(ustringToAtomicString(typeArg), canBubbleArg, cancelableArg, dataArg, ustringToString(originArg), ustringToString(lastEventIdArg), sourceArg, messagePorts.release());
+ event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, messagePorts.release());
jsEvent->m_data.set(exec->globalData(), jsEvent, dataArg.jsValue());
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSMicroDataItemValueCustom.cpp b/Source/WebCore/bindings/js/JSMicroDataItemValueCustom.cpp
index 09fc33d..a70709a 100644
--- a/Source/WebCore/bindings/js/JSMicroDataItemValueCustom.cpp
+++ b/Source/WebCore/bindings/js/JSMicroDataItemValueCustom.cpp
@@ -46,7 +46,7 @@
return jsNull();
if (itemValue->isNode())
return toJS(exec, globalObject, itemValue->getNode());
- return jsString(exec, itemValue->getString());
+ return jsStringWithCache(exec, itemValue->getString());
}
}
diff --git a/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
index 4800355..0d09375 100644
--- a/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
+++ b/Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
@@ -63,7 +63,7 @@
switch (value.type()) {
case SQLValue::StringValue:
- jsValue = jsString(exec, value.string());
+ jsValue = jsStringWithCache(exec, value.string());
break;
case SQLValue::NullValue:
jsValue = jsNull();
@@ -75,7 +75,7 @@
ASSERT_NOT_REACHED();
}
- object->putDirect(exec->globalData(), Identifier(exec, stringToUString(m_impl->columnNames()[i])), jsValue, DontDelete | ReadOnly);
+ object->putDirect(exec->globalData(), Identifier(exec, m_impl->columnNames()[i]), jsValue, DontDelete | ReadOnly);
}
return object;
diff --git a/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp b/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp
index a3c198f..7a90c43 100644
--- a/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp
+++ b/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp
@@ -50,7 +50,7 @@
return jsUndefined();
}
- String sqlStatement = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ String sqlStatement = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
@@ -81,7 +81,7 @@
sqlValues.append(value.asNumber());
else {
// Convert the argument to a string and append it
- sqlValues.append(ustringToString(value.toString(exec)->value(exec)));
+ sqlValues.append(value.toString(exec)->value(exec));
if (exec->hadException())
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp b/Source/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp
index 96c1884..33f8434 100644
--- a/Source/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp
+++ b/Source/WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp
@@ -49,7 +49,7 @@
return jsUndefined();
}
- String sqlStatement = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ String sqlStatement = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
@@ -80,7 +80,7 @@
sqlValues.append(value.asNumber());
else {
// Convert the argument to a string and append it
- sqlValues.append(ustringToString(value.toString(exec)->value(exec)));
+ sqlValues.append(value.toString(exec)->value(exec));
if (exec->hadException())
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp b/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
index c79b793..7f6eb28 100644
--- a/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
+++ b/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
@@ -62,8 +62,8 @@
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- UString scriptURL = exec->argument(0).toString(exec)->value(exec);
- UString name;
+ String scriptURL = exec->argument(0).toString(exec)->value(exec);
+ String name;
if (exec->argumentCount() > 1)
name = exec->argument(1).toString(exec)->value(exec);
@@ -73,7 +73,7 @@
// FIXME: We need to use both the dynamic scope and the lexical scope (dynamic scope for resolving the worker URL)
DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
ExceptionCode ec = 0;
- RefPtr<SharedWorker> worker = SharedWorker::create(window->document(), ustringToString(scriptURL), ustringToString(name), ec);
+ RefPtr<SharedWorker> worker = SharedWorker::create(window->document(), scriptURL, name, ec);
if (ec) {
setDOMException(exec, ec);
return JSValue::encode(JSValue());
diff --git a/Source/WebCore/bindings/js/JSStorageCustom.cpp b/Source/WebCore/bindings/js/JSStorageCustom.cpp
index a7937b0..52d7ec4 100644
--- a/Source/WebCore/bindings/js/JSStorageCustom.cpp
+++ b/Source/WebCore/bindings/js/JSStorageCustom.cpp
@@ -73,7 +73,7 @@
JSStorage* thisObject = jsCast<JSStorage*>(object);
unsigned length = thisObject->m_impl->length();
for (unsigned i = 0; i < length; ++i)
- propertyNames.add(Identifier(exec, stringToUString(thisObject->m_impl->key(i))));
+ propertyNames.add(Identifier(exec, thisObject->m_impl->key(i)));
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
@@ -91,7 +91,7 @@
if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
return false;
- String stringValue = ustringToString(value.toString(exec)->value(exec));
+ String stringValue = value.toString(exec)->value(exec);
if (exec->hadException())
return true;
diff --git a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
index af00807..f4af55d 100644
--- a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
@@ -107,7 +107,7 @@
case WebGLGetInfo::kTypeNull:
return jsNull();
case WebGLGetInfo::kTypeString:
- return jsString(exec, info.getString());
+ return jsStringWithCache(exec, info.getString());
case WebGLGetInfo::kTypeUnsignedInt:
return jsNumber(info.getUnsignedInt());
case WebGLGetInfo::kTypeWebGLBuffer:
@@ -254,7 +254,7 @@
return throwError(exec, createNotEnoughArgumentsError(exec));
WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
- const String& name = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ const String name = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
WebGLExtension* extension = context->getExtension(name);
@@ -363,7 +363,7 @@
Vector<String> value = context->getSupportedExtensions();
MarkedArgumentBuffer list;
for (size_t ii = 0; ii < value.size(); ++ii)
- list.append(jsString(exec, value[ii]));
+ list.append(jsStringWithCache(exec, value[ii]));
return constructArray(exec, globalObject(), list);
}
diff --git a/Source/WebCore/bindings/js/JSWebSocketCustom.cpp b/Source/WebCore/bindings/js/JSWebSocketCustom.cpp
index c42b3cb..3e350cc 100644
--- a/Source/WebCore/bindings/js/JSWebSocketCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWebSocketCustom.cpp
@@ -61,7 +61,7 @@
if (!exec->argumentCount())
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- String urlString = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ String urlString = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return throwVMError(exec, createSyntaxError(exec, "wrong URL"));
RefPtr<WebSocket> webSocket = WebSocket::create(context);
@@ -74,14 +74,14 @@
Vector<String> protocols;
JSArray* protocolsArray = asArray(protocolsValue);
for (unsigned i = 0; i < protocolsArray->length(); ++i) {
- String protocol = ustringToString(protocolsArray->getIndex(i).toString(exec)->value(exec));
+ String protocol = protocolsArray->getIndex(i).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
protocols.append(protocol);
}
webSocket->connect(urlString, protocols, ec);
} else {
- String protocol = ustringToString(protocolsValue.toString(exec)->value(exec));
+ String protocol = protocolsValue.toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
webSocket->connect(urlString, protocol, ec);
@@ -106,7 +106,7 @@
else if (message.inherits(&JSBlob::s_info))
result = impl()->send(toBlob(message), ec);
else {
- String stringMessage = ustringToString(message.toString(exec)->value(exec));
+ String stringMessage = message.toString(exec)->value(exec);
if (exec->hadException())
return jsUndefined();
result = impl()->send(stringMessage, ec);
diff --git a/Source/WebCore/bindings/js/JSWorkerContextCustom.cpp b/Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
index f3f6f56..ec56331 100644
--- a/Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
@@ -109,7 +109,7 @@
Vector<String> urls;
for (unsigned i = 0; i < exec->argumentCount(); i++) {
- urls.append(ustringToString(exec->argument(i).toString(exec)->value(exec)));
+ urls.append(exec->argument(i).toString(exec)->value(exec));
if (exec->hadException())
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JSWorkerCustom.cpp b/Source/WebCore/bindings/js/JSWorkerCustom.cpp
index 7145fcf..b1f38a5 100644
--- a/Source/WebCore/bindings/js/JSWorkerCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWorkerCustom.cpp
@@ -57,7 +57,7 @@
if (!exec->argumentCount())
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- UString scriptURL = exec->argument(0).toString(exec)->value(exec);
+ String scriptURL = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
@@ -65,7 +65,7 @@
DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
ExceptionCode ec = 0;
- RefPtr<Worker> worker = Worker::create(window->document(), ustringToString(scriptURL), ec);
+ RefPtr<Worker> worker = Worker::create(window->document(), scriptURL, ec);
if (ec) {
setDOMException(exec, ec);
return JSValue::encode(JSValue());
diff --git a/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp b/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
index c08c295..90bd48b 100644
--- a/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
+++ b/Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
@@ -84,8 +84,8 @@
if (exec->argumentCount() < 2)
return throwError(exec, createNotEnoughArgumentsError(exec));
- const KURL& url = impl()->scriptExecutionContext()->completeURL(ustringToString(exec->argument(1).toString(exec)->value(exec)));
- String method = ustringToString(exec->argument(0).toString(exec)->value(exec));
+ const KURL& url = impl()->scriptExecutionContext()->completeURL(exec->argument(1).toString(exec)->value(exec));
+ String method = exec->argument(0).toString(exec)->value(exec);
ExceptionCode ec = 0;
if (exec->argumentCount() >= 3) {
@@ -130,16 +130,16 @@
else if (val.inherits(&JSArrayBufferView::s_info))
impl()->send(toArrayBufferView(val), ec);
else
- impl()->send(ustringToString(val.toString(exec)->value(exec)), ec);
+ impl()->send(val.toString(exec)->value(exec), ec);
}
int signedLineNumber;
intptr_t sourceID;
- UString sourceURL;
+ String sourceURL;
JSValue function;
exec->interpreter()->retrieveLastCaller(exec, signedLineNumber, sourceID, sourceURL, function);
impl()->setLastSendLineNumber(signedLineNumber >= 0 ? signedLineNumber : 0);
- impl()->setLastSendURL(ustringToString(sourceURL));
+ impl()->setLastSendURL(sourceURL);
setDOMException(exec, ec);
return jsUndefined();
diff --git a/Source/WebCore/bindings/js/JSXSLTProcessorCustom.cpp b/Source/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
index 70b6980..d83ff38 100644
--- a/Source/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
+++ b/Source/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
@@ -89,9 +89,9 @@
{
if (exec->argument(1).isUndefinedOrNull() || exec->argument(2).isUndefinedOrNull())
return jsUndefined(); // Throw exception?
- String namespaceURI = ustringToString(exec->argument(0).toString(exec)->value(exec));
- String localName = ustringToString(exec->argument(1).toString(exec)->value(exec));
- String value = ustringToString(exec->argument(2).toString(exec)->value(exec));
+ String namespaceURI = exec->argument(0).toString(exec)->value(exec);
+ String localName = exec->argument(1).toString(exec)->value(exec);
+ String value = exec->argument(2).toString(exec)->value(exec);
impl()->setParameter(namespaceURI, localName, value);
return jsUndefined();
}
@@ -100,8 +100,8 @@
{
if (exec->argument(1).isUndefinedOrNull())
return jsUndefined();
- String namespaceURI = ustringToString(exec->argument(0).toString(exec)->value(exec));
- String localName = ustringToString(exec->argument(1).toString(exec)->value(exec));
+ String namespaceURI = exec->argument(0).toString(exec)->value(exec);
+ String localName = exec->argument(1).toString(exec)->value(exec);
String value = impl()->getParameter(namespaceURI, localName);
return jsStringOrUndefined(exec, value);
}
@@ -110,8 +110,8 @@
{
if (exec->argument(1).isUndefinedOrNull())
return jsUndefined();
- String namespaceURI = ustringToString(exec->argument(0).toString(exec)->value(exec));
- String localName = ustringToString(exec->argument(1).toString(exec)->value(exec));
+ String namespaceURI = exec->argument(0).toString(exec)->value(exec);
+ String localName = exec->argument(1).toString(exec)->value(exec);
impl()->removeParameter(namespaceURI, localName);
return jsUndefined();
}
diff --git a/Source/WebCore/bindings/js/JavaScriptCallFrame.cpp b/Source/WebCore/bindings/js/JavaScriptCallFrame.cpp
index 9ea9ec8..bb8f8de 100644
--- a/Source/WebCore/bindings/js/JavaScriptCallFrame.cpp
+++ b/Source/WebCore/bindings/js/JavaScriptCallFrame.cpp
@@ -78,10 +78,10 @@
ASSERT(m_isValid);
if (!m_isValid)
return String();
- UString functionName = m_debuggerCallFrame.calculatedFunctionName();
+ String functionName = m_debuggerCallFrame.calculatedFunctionName();
if (functionName.isEmpty())
return String();
- return ustringToString(functionName);
+ return functionName;
}
DebuggerCallFrame::Type JavaScriptCallFrame::type() const
@@ -109,7 +109,7 @@
}
// Evaluate some JavaScript code in the scope of this frame.
-JSValue JavaScriptCallFrame::evaluate(const UString& script, JSValue& exception) const
+JSValue JavaScriptCallFrame::evaluate(const String& script, JSValue& exception) const
{
ASSERT(m_isValid);
if (!m_isValid)
diff --git a/Source/WebCore/bindings/js/JavaScriptCallFrame.h b/Source/WebCore/bindings/js/JavaScriptCallFrame.h
index e987ecf..dc22913 100644
--- a/Source/WebCore/bindings/js/JavaScriptCallFrame.h
+++ b/Source/WebCore/bindings/js/JavaScriptCallFrame.h
@@ -74,7 +74,7 @@
JSC::ExecState* exec() const;
JSC::JSObject* thisObject() const;
- JSC::JSValue evaluate(const JSC::UString& script, JSC::JSValue& exception) const;
+ JSC::JSValue evaluate(const String& script, JSC::JSValue& exception) const;
private:
JavaScriptCallFrame(const JSC::DebuggerCallFrame&, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, const TextPosition&);
diff --git a/Source/WebCore/bindings/js/ScheduledAction.cpp b/Source/WebCore/bindings/js/ScheduledAction.cpp
index c469bf8..7682051 100644
--- a/Source/WebCore/bindings/js/ScheduledAction.cpp
+++ b/Source/WebCore/bindings/js/ScheduledAction.cpp
@@ -58,10 +58,10 @@
RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector(exec));
if (policy && !policy->allowEval(callStack.release()))
return nullptr;
- UString string = v.toString(exec)->value(exec);
+ String string = v.toString(exec)->value(exec);
if (exec->hadException())
return nullptr;
- return adoptPtr(new ScheduledAction(ustringToString(string), isolatedWorld));
+ return adoptPtr(new ScheduledAction(string, isolatedWorld));
}
return adoptPtr(new ScheduledAction(exec, v, isolatedWorld));
diff --git a/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp b/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp
index 3bb69f4..4faeeed 100644
--- a/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp
+++ b/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp
@@ -45,7 +45,7 @@
#include <runtime/JSFunction.h>
#include <runtime/JSGlobalData.h>
#include <runtime/JSValue.h>
-#include <runtime/UString.h>
+#include <wtf/text/WTFString.h>
using namespace JSC;
@@ -82,11 +82,11 @@
ASSERT(callFrame);
int signedLineNumber;
intptr_t sourceID;
- UString urlString;
+ String urlString;
JSValue function;
exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function);
- UString functionName;
+ String functionName;
if (function)
functionName = jsCast<JSFunction*>(function)->name(exec);
else {
@@ -96,7 +96,7 @@
break;
}
unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
- frames.append(ScriptCallFrame(ustringToString(functionName), ustringToString(urlString), lineNumber));
+ frames.append(ScriptCallFrame(functionName, urlString, lineNumber));
if (!function || frames.size() == maxStackSize)
break;
callFrame = callFrame->callerFrame();
diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp
index 41bbea8..d6ae61f 100644
--- a/Source/WebCore/bindings/js/ScriptController.cpp
+++ b/Source/WebCore/bindings/js/ScriptController.cpp
@@ -122,7 +122,7 @@
ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld* world)
{
const SourceCode& jsSourceCode = sourceCode.jsSourceCode();
- String sourceURL = ustringToString(jsSourceCode.provider()->url());
+ String sourceURL = jsSourceCode.provider()->url();
// evaluate code. Returns the JS return value or 0
// if there was none, an error occurred or the type couldn't be converted.
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
index bbcd542..52ff8f6 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -134,7 +134,7 @@
SourceProvider* source = reinterpret_cast<SourceProvider*>(sourceID);
if (m_currentSourceID != sourceID) {
- String sourceCode = ustringToString(JSC::UString(const_cast<StringImpl*>(source->data())));
+ String sourceCode(const_cast<StringImpl*>(source->data()));
m_currentSourceCode.clear();
sourceCode.split("\n", true, m_currentSourceCode);
m_currentSourceID = sourceID;
@@ -201,7 +201,7 @@
return true;
JSValue exception;
- JSValue result = m_currentCallFrame->evaluate(stringToUString(breaksVector.at(i).condition), exception);
+ JSValue result = m_currentCallFrame->evaluate(breaksVector.at(i).condition, exception);
if (exception) {
// An erroneous condition counts as "false".
return false;
@@ -316,11 +316,11 @@
void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, bool isContentScript)
{
- String sourceID = ustringToString(JSC::UString::number(sourceProvider->asID()));
+ String sourceID = String::number(sourceProvider->asID());
ScriptDebugListener::Script script;
- script.url = ustringToString(sourceProvider->url());
- script.source = ustringToString(JSC::UString(const_cast<StringImpl*>(sourceProvider->data())));
+ script.url = sourceProvider->url();
+ script.source = String(const_cast<StringImpl*>(sourceProvider->data()));
script.startLine = sourceProvider->startPosition().m_line.zeroBasedInt();
script.startColumn = sourceProvider->startPosition().m_column.zeroBasedInt();
script.isContentScript = isContentScript;
@@ -354,8 +354,8 @@
void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, int errorLine, const String& errorMessage)
{
- String url = ustringToString(sourceProvider->url());
- String data = ustringToString(JSC::UString(const_cast<StringImpl*>(sourceProvider->data())));
+ String url = sourceProvider->url();
+ String data = String(const_cast<StringImpl*>(sourceProvider->data()));
int firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
Vector<ScriptDebugListener*> copy;
@@ -382,7 +382,7 @@
Debugger::detach(globalObject);
}
-void ScriptDebugServer::sourceParsed(ExecState* exec, SourceProvider* sourceProvider, int errorLine, const UString& errorMessage)
+void ScriptDebugServer::sourceParsed(ExecState* exec, SourceProvider* sourceProvider, int errorLine, const String& errorMessage)
{
if (m_callingListeners)
return;
@@ -396,7 +396,7 @@
bool isError = errorLine != -1;
if (isError)
- dispatchFailedToParseSource(*listeners, sourceProvider, errorLine, ustringToString(errorMessage));
+ dispatchFailedToParseSource(*listeners, sourceProvider, errorLine, errorMessage);
else
dispatchDidParseSource(*listeners, sourceProvider, isContentScript(exec));
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.h b/Source/WebCore/bindings/js/ScriptDebugServer.h
index 935914c..28d97c5 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.h
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.h
@@ -38,12 +38,12 @@
#include "Timer.h"
#include <debugger/Debugger.h>
-#include <runtime/UString.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/TextPosition.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
class DebuggerCallFrame;
@@ -129,7 +129,7 @@
virtual void detach(JSC::JSGlobalObject*);
- virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const JSC::UString& errorMsg);
+ virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const String& errorMsg);
virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int columnNumber);
virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int firstLine, int columnNumber);
virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int columnNumber);
diff --git a/Source/WebCore/bindings/js/ScriptEventListener.cpp b/Source/WebCore/bindings/js/ScriptEventListener.cpp
index a7665e1..c0e9c3e 100644
--- a/Source/WebCore/bindings/js/ScriptEventListener.cpp
+++ b/Source/WebCore/bindings/js/ScriptEventListener.cpp
@@ -103,7 +103,7 @@
if (!jsFunction)
return "";
ScriptState* scriptState = scriptStateFromNode(jsListener->isolatedWorld(), document);
- return ustringToString(jsFunction->toString(scriptState)->value(scriptState));
+ return jsFunction->toString(scriptState)->value(scriptState);
}
bool eventListenerHandlerLocation(Document* document, EventListener* eventListener, String& sourceName, int& lineNumber)
@@ -123,7 +123,7 @@
if (!funcExecutable)
return false;
lineNumber = funcExecutable->lineNo();
- sourceName = ustringToString(funcExecutable->sourceURL());
+ sourceName = funcExecutable->sourceURL();
return true;
}
diff --git a/Source/WebCore/bindings/js/ScriptFunctionCall.cpp b/Source/WebCore/bindings/js/ScriptFunctionCall.cpp
index 5477825..e52842e 100644
--- a/Source/WebCore/bindings/js/ScriptFunctionCall.cpp
+++ b/Source/WebCore/bindings/js/ScriptFunctionCall.cpp
@@ -36,7 +36,7 @@
#include "ScriptValue.h"
#include <runtime/JSLock.h>
-#include <runtime/UString.h>
+#include <wtf/text/WTFString.h>
using namespace JSC;
@@ -59,19 +59,13 @@
void ScriptCallArgumentHandler::appendArgument(const String& argument)
{
JSLockHolder lock(m_exec);
- m_arguments.append(jsString(m_exec, argument));
-}
-
-void ScriptCallArgumentHandler::appendArgument(const JSC::UString& argument)
-{
- JSLockHolder lock(m_exec);
- m_arguments.append(jsString(m_exec, argument));
+ m_arguments.append(jsStringWithCache(m_exec, argument));
}
void ScriptCallArgumentHandler::appendArgument(const char* argument)
{
JSLockHolder lock(m_exec);
- m_arguments.append(jsString(m_exec, UString(argument)));
+ m_arguments.append(jsString(m_exec, String(argument)));
}
void ScriptCallArgumentHandler::appendArgument(JSC::JSValue argument)
@@ -127,7 +121,7 @@
JSLockHolder lock(m_exec);
- JSValue function = thisObject->get(m_exec, Identifier(m_exec, stringToUString(m_name)));
+ JSValue function = thisObject->get(m_exec, Identifier(m_exec, m_name));
if (m_exec->hadException()) {
if (reportExceptions)
reportException(m_exec, m_exec->exception());
@@ -165,7 +159,7 @@
JSLockHolder lock(m_exec);
- JSObject* constructor = asObject(thisObject->get(m_exec, Identifier(m_exec, stringToUString(m_name))));
+ JSObject* constructor = asObject(thisObject->get(m_exec, Identifier(m_exec, m_name)));
if (m_exec->hadException()) {
if (reportExceptions)
reportException(m_exec, m_exec->exception());
diff --git a/Source/WebCore/bindings/js/ScriptFunctionCall.h b/Source/WebCore/bindings/js/ScriptFunctionCall.h
index 69b5e28..4e9c202 100644
--- a/Source/WebCore/bindings/js/ScriptFunctionCall.h
+++ b/Source/WebCore/bindings/js/ScriptFunctionCall.h
@@ -31,14 +31,13 @@
#ifndef ScriptFunctionCall_h
#define ScriptFunctionCall_h
-#include "PlatformString.h"
#include "ScriptObject.h"
#include "ScriptState.h"
#include <runtime/ArgList.h>
+#include <wtf/text/WTFString.h>
namespace JSC {
- class UString;
class JSValue;
}
@@ -51,9 +50,8 @@
void appendArgument(const ScriptObject&);
void appendArgument(const ScriptValue&);
- void appendArgument(const String&);
void appendArgument(const char*);
- void appendArgument(const JSC::UString&);
+ void appendArgument(const String&);
void appendArgument(JSC::JSValue);
void appendArgument(long);
void appendArgument(long long);
diff --git a/Source/WebCore/bindings/js/ScriptProfile.cpp b/Source/WebCore/bindings/js/ScriptProfile.cpp
index 3c2b65f..4cef4cd 100644
--- a/Source/WebCore/bindings/js/ScriptProfile.cpp
+++ b/Source/WebCore/bindings/js/ScriptProfile.cpp
@@ -55,7 +55,7 @@
String ScriptProfile::title() const
{
- return ustringToString(m_profile->title());
+ return m_profile->title();
}
unsigned int ScriptProfile::uid() const
@@ -80,8 +80,8 @@
{
RefPtr<InspectorObject> result = InspectorObject::create();
- result->setString("functionName", ustringToString(node->functionName()));
- result->setString("url", ustringToString(node->url()));
+ result->setString("functionName", node->functionName());
+ result->setString("url", node->url());
result->setNumber("lineNumber", node->lineNumber());
result->setNumber("totalTime", node->totalTime());
result->setNumber("selfTime", node->selfTime());
diff --git a/Source/WebCore/bindings/js/ScriptProfiler.cpp b/Source/WebCore/bindings/js/ScriptProfiler.cpp
index d6afd89..5c7ebd7 100644
--- a/Source/WebCore/bindings/js/ScriptProfiler.cpp
+++ b/Source/WebCore/bindings/js/ScriptProfiler.cpp
@@ -58,7 +58,7 @@
void ScriptProfiler::start(ScriptState* state, const String& title)
{
- JSC::Profiler::profiler()->startProfiling(state, stringToUString(title));
+ JSC::Profiler::profiler()->startProfiling(state, title);
}
void ScriptProfiler::startForPage(Page* inspectedPage, const String& title)
@@ -76,7 +76,7 @@
PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title)
{
- RefPtr<JSC::Profile> profile = JSC::Profiler::profiler()->stopProfiling(state, stringToUString(title));
+ RefPtr<JSC::Profile> profile = JSC::Profiler::profiler()->stopProfiling(state, title);
return ScriptProfile::create(profile);
}
diff --git a/Source/WebCore/bindings/js/ScriptSourceProvider.h b/Source/WebCore/bindings/js/ScriptSourceProvider.h
index 8760185..8396082 100644
--- a/Source/WebCore/bindings/js/ScriptSourceProvider.h
+++ b/Source/WebCore/bindings/js/ScriptSourceProvider.h
@@ -34,7 +34,7 @@
class ScriptSourceProvider : public JSC::SourceProvider {
public:
- ScriptSourceProvider(const JSC::UString& url, const TextPosition& startPosition, JSC::SourceProviderCache* cache = 0)
+ ScriptSourceProvider(const String& url, const TextPosition& startPosition, JSC::SourceProviderCache* cache = 0)
: SourceProvider(url, startPosition, cache)
{
}
diff --git a/Source/WebCore/bindings/js/ScriptValue.cpp b/Source/WebCore/bindings/js/ScriptValue.cpp
index 83dfd5f..4310ffc 100644
--- a/Source/WebCore/bindings/js/ScriptValue.cpp
+++ b/Source/WebCore/bindings/js/ScriptValue.cpp
@@ -39,7 +39,6 @@
#include <heap/Strong.h>
#include <runtime/JSLock.h>
-#include <runtime/UString.h>
using namespace JSC;
@@ -50,16 +49,14 @@
if (!m_value)
return false;
JSLockHolder lock(scriptState);
- UString ustring;
- if (!m_value.get().getString(scriptState, ustring))
+ if (!m_value.get().getString(scriptState, result))
return false;
- result = ustringToString(ustring);
return true;
}
String ScriptValue::toString(ScriptState* scriptState) const
{
- String result = ustringToString(m_value.get().toString(scriptState)->value(scriptState));
+ String result = m_value.get().toString(scriptState)->value(scriptState);
// Handle the case where an exception is thrown as part of invoking toString on the object.
if (scriptState->hadException())
scriptState->clearException();
@@ -138,7 +135,7 @@
if (value.isNumber())
return InspectorBasicValue::create(value.asNumber());
if (value.isString()) {
- UString s = value.getString(scriptState);
+ String s = value.getString(scriptState);
return InspectorString::create(String(s.characters(), s.length()));
}
if (value.isObject()) {
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index ea70229..f29a13a 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -386,7 +386,7 @@
: CloneBase(exec)
, m_buffer(out)
, m_blobURLs(blobURLs)
- , m_emptyIdentifier(exec, UString("", 0))
+ , m_emptyIdentifier(exec, emptyString())
{
write(CurrentVersion);
fillTransferMap(messagePorts, m_transferredMessagePorts);
@@ -523,7 +523,7 @@
}
}
- void dumpString(UString str)
+ void dumpString(String str)
{
if (str.isEmpty())
write(EmptyStringTag);
@@ -533,7 +533,7 @@
}
}
- void dumpStringObject(UString str)
+ void dumpStringObject(String str)
{
if (str.isEmpty())
write(EmptyStringObjectTag);
@@ -589,7 +589,7 @@
}
if (value.isString()) {
- UString str = asString(value)->value(m_exec);
+ String str = asString(value)->value(m_exec);
dumpString(str);
return true;
}
@@ -620,7 +620,7 @@
if (obj->inherits(&StringObject::s_info)) {
if (!startObjectInternal(obj)) // handle duplicates
return true;
- UString str = asString(asStringObject(value)->internalValue())->value(m_exec);
+ String str = asString(asStringObject(value)->internalValue())->value(m_exec);
dumpStringObject(str);
return true;
}
@@ -676,7 +676,7 @@
flags[flagCount++] = 'm';
write(RegExpTag);
write(regExp->regExp()->pattern());
- write(UString(flags, flagCount));
+ write(String(flags, flagCount));
return true;
}
if (obj->inherits(&JSMessagePort::s_info)) {
@@ -792,7 +792,7 @@
void write(const Identifier& ident)
{
- UString str = ident.ustring();
+ const String& str = ident.ustring();
StringConstantPool::AddResult addResult = m_constantPool.add(str.impl(), m_constantPool.size());
if (!addResult.isNewEntry) {
write(StringPoolTag);
@@ -818,7 +818,7 @@
fail();
}
- void write(const UString& str)
+ void write(const String& str)
{
if (str.isNull())
write(m_emptyIdentifier);
@@ -826,14 +826,6 @@
write(Identifier(m_exec, str));
}
- void write(const String& str)
- {
- if (str.isEmpty())
- write(m_emptyIdentifier);
- else
- write(Identifier(m_exec, str.impl()));
- }
-
void write(const File* file)
{
m_blobURLs.append(file->url());
@@ -1037,7 +1029,7 @@
const uint8_t* start = value.begin();
const uint8_t* end = value.end();
const uint32_t length = value.size() / sizeof(UChar);
- UString str;
+ String str;
if (!CloneDeserializer::readString(start, end, str, length))
return String();
@@ -1057,7 +1049,7 @@
uint32_t length;
if (!readLittleEndian(ptr, end, length) || length >= StringPoolTag)
return String();
- UString str;
+ String str;
if (!readString(ptr, end, str, length))
return String();
return String(str.impl());
@@ -1077,7 +1069,7 @@
private:
struct CachedString {
- CachedString(const UString& string)
+ CachedString(const String& string)
: m_string(string)
{
}
@@ -1088,10 +1080,11 @@
m_jsString = JSC::jsString(exec, m_string);
return m_jsString;
}
- const UString& ustring() { return m_string; }
+ // FIXME: rename to string().
+ const String& ustring() { return m_string; }
private:
- UString m_string;
+ String m_string;
JSValue m_jsString;
};
@@ -1240,7 +1233,7 @@
return read(i);
}
- static bool readString(const uint8_t*& ptr, const uint8_t* end, UString& str, unsigned length)
+ static bool readString(const uint8_t*& ptr, const uint8_t* end, String& str, unsigned length)
{
if (length >= numeric_limits<int32_t>::max() / sizeof(UChar))
return false;
@@ -1250,7 +1243,7 @@
return false;
#if ASSUME_LITTLE_ENDIAN
- str = UString(reinterpret_cast<const UChar*>(ptr), length);
+ str = String(reinterpret_cast<const UChar*>(ptr), length);
ptr += length * sizeof(UChar);
#else
Vector<UChar> buffer;
@@ -1260,7 +1253,7 @@
readLittleEndian(ptr, end, ch);
buffer.append(ch);
}
- str = UString::adopt(buffer);
+ str = String::adopt(buffer);
#endif
return true;
}
@@ -1295,7 +1288,7 @@
cachedString = CachedStringRef(&m_constantPool, index);
return true;
}
- UString str;
+ String str;
if (!readString(m_ptr, m_end, str, length)) {
fail();
return false;
diff --git a/Source/WebCore/bindings/js/StringSourceProvider.h b/Source/WebCore/bindings/js/StringSourceProvider.h
index 8b67188..6b6bb4e 100644
--- a/Source/WebCore/bindings/js/StringSourceProvider.h
+++ b/Source/WebCore/bindings/js/StringSourceProvider.h
@@ -42,13 +42,13 @@
return adoptRef(new StringSourceProvider(source, url, startPosition));
}
- virtual JSC::UString getRange(int start, int end) const OVERRIDE
+ virtual String getRange(int start, int end) const OVERRIDE
{
int length = end - start;
ASSERT(length >= 0);
ASSERT(start + length <= this->length());
- return JSC::UString(StringImpl::create(m_source.impl(), start, length));
+ return String(StringImpl::create(m_source.impl(), start, length));
}
const StringImpl* data() const { return m_source.impl(); }
@@ -57,7 +57,7 @@
private:
StringSourceProvider(const String& source, const String& url, const TextPosition& startPosition)
- : ScriptSourceProvider(stringToUString(url), startPosition)
+ : ScriptSourceProvider(url, startPosition)
, m_source(source)
{
}
@@ -65,11 +65,6 @@
String m_source;
};
- inline JSC::SourceCode makeSource(const String& source, const String& url = String(), const TextPosition& startPosition = TextPosition::minimumPosition())
- {
- return JSC::SourceCode(StringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt());
- }
-
} // namespace WebCore
#endif // StringSourceProvider_h
diff --git a/Source/WebCore/bindings/objc/WebScriptObject.mm b/Source/WebCore/bindings/objc/WebScriptObject.mm
index c1c198d..e770219 100644
--- a/Source/WebCore/bindings/objc/WebScriptObject.mm
+++ b/Source/WebCore/bindings/objc/WebScriptObject.mm
@@ -317,7 +317,7 @@
JSLockHolder lock(exec);
ASSERT(!exec->hadException());
- JSValue function = [self _imp]->get(exec, Identifier(exec, stringToUString(String(name))));
+ JSValue function = [self _imp]->get(exec, Identifier(exec, String(name)));
CallData callData;
CallType callType = getCallData(function, callData);
if (callType == CallTypeNone)
@@ -379,7 +379,7 @@
JSLockHolder lock(exec);
PutPropertySlot slot;
- [self _imp]->methodTable()->put([self _imp], exec, Identifier(exec, stringToUString(String(key))), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot);
+ [self _imp]->methodTable()->put([self _imp], exec, Identifier(exec, String(key)), convertObjcValueToValue(exec, &value, ObjcObjectType, [self _rootObject]), slot);
if (exec->hadException()) {
addExceptionToConsole(exec);
@@ -404,7 +404,7 @@
// leaving the lock permanently held
JSLockHolder lock(exec);
- JSValue result = [self _imp]->get(exec, Identifier(exec, stringToUString(String(key))));
+ JSValue result = [self _imp]->get(exec, Identifier(exec, String(key)));
if (exec->hadException()) {
addExceptionToConsole(exec);
@@ -433,7 +433,7 @@
ASSERT(!exec->hadException());
JSLockHolder lock(exec);
- [self _imp]->methodTable()->deleteProperty([self _imp], exec, Identifier(exec, stringToUString(String(key))));
+ [self _imp]->methodTable()->deleteProperty([self _imp], exec, Identifier(exec, String(key)));
if (exec->hadException()) {
addExceptionToConsole(exec);
@@ -452,7 +452,7 @@
ASSERT(!exec->hadException());
JSLockHolder lock(exec);
- BOOL result = [self _imp]->hasProperty(exec, Identifier(exec, stringToUString(String(key))));
+ BOOL result = [self _imp]->hasProperty(exec, Identifier(exec, String(key)));
if (exec->hadException()) {
addExceptionToConsole(exec);
@@ -569,7 +569,7 @@
if (value.isString()) {
ExecState* exec = rootObject->globalObject()->globalExec();
- const UString& u = asString(value)->value(exec);
+ const String& u = asString(value)->value(exec);
return [NSString stringWithCharacters:u.characters() length:u.length()];
}
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 4beef9c..6898144 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -165,7 +165,7 @@
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
- impl->${functionName}EventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), $wrapperObject, false, currentWorld(exec))$passRefPtrHandling, exec->argument(2).toBoolean(exec));
+ impl->${functionName}EventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), $wrapperObject, false, currentWorld(exec))$passRefPtrHandling, exec->argument(2).toBoolean(exec));
return JSValue::encode(jsUndefined());
END
return @GenerateEventListenerImpl;
@@ -2845,7 +2845,7 @@
foreach my $param (@params) {
my $paramName = $param->name;
if ($param->type eq "DOMString") {
- push(@implContent, " args.append(jsString(exec, ${paramName}));\n");
+ push(@implContent, " args.append(jsStringWithCache(exec, ${paramName}));\n");
} elsif ($param->type eq "boolean") {
push(@implContent, " args.append(jsBoolean(${paramName}));\n");
} elsif ($param->type eq "SerializedScriptValue") {
@@ -3051,7 +3051,7 @@
return "valueToStringWithNullCheck(exec, $value)"
}
# FIXME: Add the case for 'if ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'.
- return "ustringToString($value.isEmpty() ? UString() : $value.toString(exec)->value(exec))";
+ return "$value.isEmpty() ? String() : $value.toString(exec)->value(exec)";
}
if ($type eq "DOMObject") {
@@ -3144,7 +3144,7 @@
die "Unknown value for TreatReturnedNullStringAs extended attribute";
}
AddToImplIncludes("<runtime/JSString.h>", $conditional);
- return "jsString(exec, $value)";
+ return "jsStringWithCache(exec, $value)";
}
my $globalObject;
@@ -3681,7 +3681,7 @@
if (!executionContext)
return throwVMError(exec, createReferenceError(exec, "Constructor associated execution context is unavailable"));
- AtomicString eventType = ustringToAtomicString(exec->argument(0).toString(exec)->value(exec));
+ AtomicString eventType = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
index f710be1..87b9618 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
@@ -205,7 +205,7 @@
TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl());
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- const String& message(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& message(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->postMessage(message);
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
index f84f915..76234d6 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
@@ -104,7 +104,7 @@
ExecState* exec = m_data->globalObject()->globalExec();
MarkedArgumentBuffer args;
args.append(toJS(exec, m_data->globalObject(), class2Param));
- args.append(jsString(exec, strArg));
+ args.append(jsStringWithCache(exec, strArg));
bool raisedException = false;
m_data->invokeCallback(args, &raisedException);
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
index 96f87ab..b11a637 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
@@ -177,7 +177,7 @@
TestCustomNamedGetter* impl = static_cast<TestCustomNamedGetter*>(castedThis->impl());
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->anotherFunction(str);
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
index d8da358..def384d 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
@@ -85,7 +85,7 @@
if (!executionContext)
return throwVMError(exec, createReferenceError(exec, "Constructor associated execution context is unavailable"));
- AtomicString eventType = ustringToAtomicString(exec->argument(0).toString(exec)->value(exec));
+ AtomicString eventType = exec->argument(0).toString(exec)->value(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -185,7 +185,7 @@
JSTestEventConstructor* castedThis = jsCast<JSTestEventConstructor*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestEventConstructor* impl = static_cast<TestEventConstructor*>(castedThis->impl());
- JSValue result = jsString(exec, impl->attr1());
+ JSValue result = jsStringWithCache(exec, impl->attr1());
return result;
}
@@ -195,7 +195,7 @@
JSTestEventConstructor* castedThis = jsCast<JSTestEventConstructor*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestEventConstructor* impl = static_cast<TestEventConstructor*>(castedThis->impl());
- JSValue result = jsString(exec, impl->attr2());
+ JSValue result = jsStringWithCache(exec, impl->attr2());
return result;
}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
index 4cf95c9..1c64851 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
@@ -253,7 +253,7 @@
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
- impl->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
+ impl->addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
return JSValue::encode(jsUndefined());
}
@@ -268,7 +268,7 @@
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
- impl->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
+ impl->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
return JSValue::encode(jsUndefined());
}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
index 4582aca..e69d6a0 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
@@ -137,7 +137,7 @@
JSTestException* castedThis = jsCast<JSTestException*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestException* impl = static_cast<TestException*>(castedThis->impl());
- JSValue result = jsString(exec, impl->name());
+ JSValue result = jsStringWithCache(exec, impl->name());
return result;
}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
index 0e39c41..d46d47c 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
@@ -132,10 +132,10 @@
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
ExceptionCode ec = 0;
- const String& str1(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str1(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& str2(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str2(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
ScriptExecutionContext* context = castedThis->scriptExecutionContext();
@@ -257,7 +257,7 @@
{
UNUSED_PARAM(slotBase);
UNUSED_PARAM(exec);
- JSValue result = jsString(exec, TestSupplemental::supplementalStaticAttr());
+ JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStaticAttr());
return result;
}
@@ -269,7 +269,7 @@
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- JSValue result = jsString(exec, TestSupplemental::supplementalStr1(impl));
+ JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr1(impl));
return result;
}
@@ -281,7 +281,7 @@
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- JSValue result = jsString(exec, TestSupplemental::supplementalStr2(impl));
+ JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr2(impl));
return result;
}
@@ -327,7 +327,7 @@
void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject*, JSValue value)
{
UNUSED_PARAM(exec);
- TestSupplemental::setSupplementalStaticAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
+ TestSupplemental::setSupplementalStaticAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec));
}
#endif
@@ -338,7 +338,7 @@
UNUSED_PARAM(exec);
JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- TestSupplemental::setSupplementalStr2(impl, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
+ TestSupplemental::setSupplementalStr2(impl, value.isEmpty() ? String() : value.toString(exec)->value(exec));
}
#endif
@@ -398,7 +398,7 @@
ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
if (!scriptContext)
return JSValue::encode(jsUndefined());
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
index eeef66a..16c3457 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
@@ -93,13 +93,13 @@
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
ExceptionCode ec = 0;
- const String& str1(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str1(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& str2(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str2(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& str3(ustringToString(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsNullString).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsNullString).toString(exec)->value(exec)));
+ const String& str3(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsNullString).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsNullString).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
RefPtr<TestNamedConstructor> object = TestNamedConstructor::createForJSConstructor(castedThis->document(), str1, str2, str3, ec);
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index c176143..fae86d0 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -401,7 +401,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->readOnlyStringAttr());
+ JSValue result = jsStringWithCache(exec, impl->readOnlyStringAttr());
return result;
}
@@ -429,7 +429,7 @@
{
UNUSED_PARAM(slotBase);
UNUSED_PARAM(exec);
- JSValue result = jsString(exec, TestObj::staticStringAttr());
+ JSValue result = jsStringWithCache(exec, TestObj::staticStringAttr());
return result;
}
@@ -496,7 +496,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->stringAttr());
+ JSValue result = jsStringWithCache(exec, impl->stringAttr());
return result;
}
@@ -536,7 +536,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+ JSValue result = jsStringWithCache(exec, impl->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
return result;
}
@@ -576,7 +576,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+ JSValue result = jsStringWithCache(exec, impl->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
return result;
}
@@ -586,7 +586,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+ JSValue result = jsStringWithCache(exec, impl->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
return result;
}
@@ -616,7 +616,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+ JSValue result = jsStringWithCache(exec, impl->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
return result;
}
@@ -657,7 +657,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
ExceptionCode ec = 0;
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSC::JSValue result = jsString(exec, impl->stringAttrWithGetterException(ec));
+ JSC::JSValue result = jsStringWithCache(exec, impl->stringAttrWithGetterException(ec));
setDOMException(exec, ec);
return result;
}
@@ -668,7 +668,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->stringAttrWithSetterException());
+ JSValue result = jsStringWithCache(exec, impl->stringAttrWithSetterException());
return result;
}
@@ -936,7 +936,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsString(exec, impl->hash());
+ JSValue result = jsStringWithCache(exec, impl->hash());
return result;
}
@@ -967,7 +967,7 @@
void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject*, JSValue value)
{
UNUSED_PARAM(exec);
- TestObj::setStaticStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
+ TestObj::setStaticStringAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec));
}
@@ -1021,7 +1021,7 @@
UNUSED_PARAM(exec);
JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- impl->setStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
+ impl->setStringAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec));
}
@@ -1170,7 +1170,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
ExceptionCode ec = 0;
- impl->setStringAttrWithGetterException(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)), ec);
+ impl->setStringAttrWithGetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec), ec);
setDOMException(exec, ec);
}
@@ -1181,7 +1181,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
ExceptionCode ec = 0;
- impl->setStringAttrWithSetterException(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)), ec);
+ impl->setStringAttrWithSetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec), ec);
setDOMException(exec, ec);
}
@@ -1433,7 +1433,7 @@
long long Arg(static_cast<long long>(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInteger(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
@@ -1469,7 +1469,7 @@
long long Arg(static_cast<long long>(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInteger(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
@@ -1506,7 +1506,7 @@
long long Arg(static_cast<long long>(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toInteger(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));
@@ -1563,7 +1563,7 @@
if (exec->argumentCount() < 2)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
ExceptionCode ec = 0;
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
@@ -1681,7 +1681,7 @@
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
- impl->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
+ impl->addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
return JSValue::encode(jsUndefined());
}
@@ -1696,7 +1696,7 @@
JSValue listener = exec->argument(1);
if (!listener.isObject())
return JSValue::encode(jsUndefined());
- impl->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)->value(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
+ impl->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
return JSValue::encode(jsUndefined());
}
@@ -1939,7 +1939,7 @@
return JSValue::encode(jsUndefined());
}
- const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->methodWithOptionalString(str);
@@ -1954,7 +1954,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->methodWithOptionalStringIsUndefined(str);
@@ -1969,7 +1969,7 @@
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsNullString).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsNullString).toString(exec)->value(exec)));
+ const String& str(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsNullString).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsNullString).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->methodWithOptionalStringIsNullString(str);
@@ -2047,7 +2047,7 @@
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- JSC::JSValue result = jsString(exec, impl->conditionalMethod1());
+ JSC::JSValue result = jsStringWithCache(exec, impl->conditionalMethod1());
return JSValue::encode(result);
}
@@ -2096,7 +2096,7 @@
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->overloadedMethod(objArg, strArg);
@@ -2140,7 +2140,7 @@
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& strArg(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl->overloadedMethod(strArg);
@@ -2348,7 +2348,7 @@
{
if (exec->argumentCount() < 1)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- const String& type(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& type(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj::overloadedMethod1(type);
@@ -2571,7 +2571,7 @@
if (exec->argumentCount() < 3)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
ExceptionCode ec = 0;
- const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& str(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float a(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined).toFloat(exec));
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
index d7f9a37..a8c0f6b 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
@@ -92,7 +92,7 @@
JSTestSerializedScriptValueInterfaceConstructor* castedThis = jsCast<JSTestSerializedScriptValueInterfaceConstructor*>(exec->callee());
if (exec->argumentCount() < 2)
return throwVMError(exec, createNotEnoughArgumentsError(exec));
- const String& hello(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
+ const String& hello(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined), 0, 0));
diff --git a/Source/WebCore/bridge/IdentifierRep.cpp b/Source/WebCore/bridge/IdentifierRep.cpp
index 2acf141..1f176fc 100644
--- a/Source/WebCore/bridge/IdentifierRep.cpp
+++ b/Source/WebCore/bridge/IdentifierRep.cpp
@@ -28,9 +28,9 @@
#include "JSDOMBinding.h"
#include "PlatformString.h"
-#include <runtime/UString.h>
#include <wtf/HashMap.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/WTFString.h>
using namespace JSC;
@@ -92,7 +92,7 @@
if (!name)
return 0;
- UString string = stringToUString(String::fromUTF8WithLatin1Fallback(name, strlen(name)));
+ String string = String::fromUTF8WithLatin1Fallback(name, strlen(name));
StringIdentifierMap::AddResult result = stringIdentifierMap().add(string.impl(), 0);
if (result.isNewEntry) {
ASSERT(!result.iterator->second);
diff --git a/Source/WebCore/bridge/NP_jsobject.cpp b/Source/WebCore/bridge/NP_jsobject.cpp
index 61e3679..fbf5419 100644
--- a/Source/WebCore/bridge/NP_jsobject.cpp
+++ b/Source/WebCore/bridge/NP_jsobject.cpp
@@ -433,7 +433,7 @@
void _NPN_SetException(NPObject*, const NPUTF8* message)
{
// Ignoring the NPObject param is consistent with the Mozilla implementation.
- UString exception(message);
+ String exception(message);
CInstance::setGlobalException(exception);
}
diff --git a/Source/WebCore/bridge/c/c_class.cpp b/Source/WebCore/bridge/c/c_class.cpp
index cfc026b..ce5fd54 100644
--- a/Source/WebCore/bridge/c/c_class.cpp
+++ b/Source/WebCore/bridge/c/c_class.cpp
@@ -73,7 +73,7 @@
MethodList CClass::methodsNamed(PropertyName propertyName, Instance* instance) const
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
MethodList methodList;
@@ -97,7 +97,7 @@
Field* CClass::fieldNamed(PropertyName propertyName, Instance* instance) const
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
Field* aField = _fields.get(name.impl());
if (aField)
diff --git a/Source/WebCore/bridge/c/c_instance.cpp b/Source/WebCore/bridge/c/c_instance.cpp
index 5b98f6e..201c61e 100644
--- a/Source/WebCore/bridge/c/c_instance.cpp
+++ b/Source/WebCore/bridge/c/c_instance.cpp
@@ -54,15 +54,13 @@
namespace JSC {
namespace Bindings {
-using JSC::UString;
-
-static JSC::UString& globalExceptionString()
+static String& globalExceptionString()
{
- DEFINE_STATIC_LOCAL(JSC::UString, exceptionStr, ());
+ DEFINE_STATIC_LOCAL(String, exceptionStr, ());
return exceptionStr;
}
-void CInstance::setGlobalException(UString exception)
+void CInstance::setGlobalException(String exception)
{
globalExceptionString() = exception;
}
@@ -77,7 +75,7 @@
throwError(exec, createError(exec, globalExceptionString()));
}
- globalExceptionString() = UString();
+ globalExceptionString() = String();
}
CInstance::CInstance(NPObject* o, PassRefPtr<RootObject> rootObject)
@@ -113,7 +111,7 @@
public:
typedef RuntimeMethod Base;
- static CRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const UString& name, Bindings::MethodList& list)
+ static CRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const String& name, Bindings::MethodList& list)
{
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// We need to pass in the right global object for "i".
@@ -136,7 +134,7 @@
{
}
- void finishCreation(JSGlobalData& globalData, const UString& name)
+ void finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
diff --git a/Source/WebCore/bridge/c/c_instance.h b/Source/WebCore/bridge/c/c_instance.h
index 61e3491..ddac0c2 100644
--- a/Source/WebCore/bridge/c/c_instance.h
+++ b/Source/WebCore/bridge/c/c_instance.h
@@ -31,13 +31,12 @@
#include "BridgeJSC.h"
#include "runtime_root.h"
#include <wtf/PassRefPtr.h>
+#include <wtf/text/WTFString.h>
typedef struct NPObject NPObject;
namespace JSC {
-class UString;
-
namespace Bindings {
class CClass;
@@ -49,7 +48,7 @@
return adoptRef(new CInstance(object, rootObject));
}
- static void setGlobalException(JSC::UString exception);
+ static void setGlobalException(String);
static void moveGlobalExceptionToExecState(ExecState*);
~CInstance ();
diff --git a/Source/WebCore/bridge/c/c_utility.cpp b/Source/WebCore/bridge/c/c_utility.cpp
index 308af5a..5fecc5c 100644
--- a/Source/WebCore/bridge/c/c_utility.cpp
+++ b/Source/WebCore/bridge/c/c_utility.cpp
@@ -73,7 +73,7 @@
VOID_TO_NPVARIANT(*result);
if (value.isString()) {
- UString ustring = value.toString(exec)->value(exec);
+ String ustring = value.toString(exec)->value(exec);
CString cstring = ustring.utf8();
NPString string = { (const NPUTF8*)cstring.data(), static_cast<uint32_t>(cstring.length()) };
NPN_InitializeVariantWithStringCopy(result, &string);
@@ -122,7 +122,7 @@
if (type == NPVariantType_Double)
return jsNumber(NPVARIANT_TO_DOUBLE(*variant));
if (type == NPVariantType_String)
- return WebCore::jsString(exec, convertNPStringToUTF16(&variant->value.stringValue));
+ return WebCore::jsStringWithCache(exec, convertNPStringToUTF16(&variant->value.stringValue));
if (type == NPVariantType_Object) {
NPObject* obj = variant->value.objectValue;
@@ -144,7 +144,7 @@
Identifier identifierFromNPIdentifier(ExecState* exec, const NPUTF8* name)
{
- return Identifier(exec, WebCore::stringToUString(convertUTF8ToUTF16WithLatin1Fallback(name, -1)));
+ return Identifier(exec, convertUTF8ToUTF16WithLatin1Fallback(name, -1));
}
} }
diff --git a/Source/WebCore/bridge/jni/jni_jsobject.mm b/Source/WebCore/bridge/jni/jni_jsobject.mm
index b5a7d22..a19d343 100644
--- a/Source/WebCore/bridge/jni/jni_jsobject.mm
+++ b/Source/WebCore/bridge/jni/jni_jsobject.mm
@@ -488,7 +488,7 @@
result = env->NewObject (JSObjectClass, constructorID, (jdouble)value.toNumber(exec));
}
} else if (value.isString()) {
- UString stringValue = value.toString(exec)->value(exec);
+ String stringValue = value.toString(exec)->value(exec);
JNIEnv *env = getJNIEnv();
result = env->NewString ((const jchar *)stringValue.characters(), stringValue.length());
} else if (value.isBoolean()) {
diff --git a/Source/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp b/Source/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
index a3b2c2e..376b02a 100644
--- a/Source/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
+++ b/Source/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
@@ -63,7 +63,7 @@
env->NewStringUTF(""));
for (unsigned i = 0; i < length; i++) {
JSValue item = jsArray->get(exec, i);
- UString stringValue = item.toString(exec)->value(exec);
+ String stringValue = item.toString(exec)->value(exec);
env->SetObjectArrayElement(jarray, i,
env->functions->NewString(env, (const jchar *)stringValue.characters(), stringValue.length()));
}
@@ -98,7 +98,7 @@
jarray = (jobjectArray)env->NewCharArray(length);
for (unsigned i = 0; i < length; i++) {
JSValue item = jsArray->get(exec, i);
- UString stringValue = item.toString(exec)->value(exec);
+ String stringValue = item.toString(exec)->value(exec);
jchar value = 0;
if (stringValue.length() > 0)
value = ((const jchar*)stringValue.characters())[0];
@@ -219,7 +219,7 @@
// Create an appropriate Java object if target type is java.lang.Object.
if (!result.l && !strcmp(javaClassName, "java.lang.Object")) {
if (value.isString()) {
- UString stringValue = asString(value)->value(exec);
+ String stringValue = asString(value)->value(exec);
JNIEnv* env = getJNIEnv();
jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.characters(), stringValue.length());
result.l = javaString;
@@ -238,7 +238,7 @@
jobject javaBoolean = env->functions->NewObject(env, clazz, constructor, boolValue);
result.l = javaBoolean;
} else if (value.isUndefined()) {
- UString stringValue = "undefined";
+ String stringValue = "undefined";
JNIEnv* env = getJNIEnv();
jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.characters(), stringValue.length());
result.l = javaString;
@@ -249,7 +249,7 @@
// converting from a null.
if (!result.l && !strcmp(javaClassName, "java.lang.String")) {
if (!value.isNull()) {
- UString stringValue = value.toString(exec)->value(exec);
+ String stringValue = value.toString(exec)->value(exec);
JNIEnv* env = getJNIEnv();
jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.characters(), stringValue.length());
result.l = javaString;
diff --git a/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.cpp b/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.cpp
index 1ebf1e6..c871755 100644
--- a/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.cpp
+++ b/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.cpp
@@ -147,7 +147,7 @@
break;
}
- LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", UString(name().impl()).utf8().data(), jsresult.toString(exec)->value(exec).ascii().data());
+ LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", String(name().impl()).utf8().data(), jsresult.toString(exec)->value(exec).ascii().data());
return jsresult;
}
@@ -183,7 +183,7 @@
const JavaInstance* instance = static_cast<const JavaInstance*>(i);
jvalue javaValue = convertValueToJValue(exec, i->rootObject(), aValue, m_type, typeClassName());
- LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", UString(name().impl()).utf8().data(), aValue.toString(exec)->value(exec).ascii().data());
+ LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", String(name().impl()).utf8().data(), aValue.toString(exec)->value(exec).ascii().data());
switch (m_type) {
case JavaTypeArray:
diff --git a/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp b/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
index 15dffa5..b2dbe0e 100644
--- a/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
+++ b/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
@@ -93,11 +93,11 @@
// Should throw a JS exception, rather than returning ""? - but better than a null dereference.
if (!stringValue)
- return jsString(exec, UString());
+ return jsString(exec, String()); // FIXME: why not jsEmptyString(exec)?
JNIEnv* env = getJNIEnv();
const jchar* c = getUCharactersFromJStringInEnv(env, stringValue);
- UString u((const UChar*)c, (int)env->GetStringLength(stringValue));
+ String u((const UChar*)c, (int)env->GetStringLength(stringValue));
releaseUCharactersForJStringInEnv(env, stringValue, c);
return jsString(exec, u);
}
@@ -118,7 +118,7 @@
public:
typedef RuntimeMethod Base;
- static JavaRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const UString& name, Bindings::MethodList& list)
+ static JavaRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const String& name, Bindings::MethodList& list)
{
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// We need to pass in the right global object for "i".
@@ -141,7 +141,7 @@
{
}
- void finishCreation(JSGlobalData& globalData, const UString& name)
+ void finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
@@ -187,7 +187,7 @@
}
const JavaMethod* jMethod = static_cast<const JavaMethod*>(method);
- LOG(LiveConnect, "JavaInstance::invokeMethod call %s %s on %p", UString(jMethod->name().impl()).utf8().data(), jMethod->signature(), m_instance->instance());
+ LOG(LiveConnect, "JavaInstance::invokeMethod call %s %s on %p", String(jMethod->name().impl()).utf8().data(), jMethod->signature(), m_instance->instance());
Vector<jvalue> jArgs(count);
diff --git a/Source/WebCore/bridge/jni/jsc/JavaStringJSC.h b/Source/WebCore/bridge/jni/jsc/JavaStringJSC.h
index 1e1803a..1cc5474 100644
--- a/Source/WebCore/bridge/jni/jsc/JavaStringJSC.h
+++ b/Source/WebCore/bridge/jni/jsc/JavaStringJSC.h
@@ -54,7 +54,6 @@
JavaString()
{
JSLockHolder lock(WebCore::JSDOMWindowBase::commonJSGlobalData());
- m_impl = UString().impl();
}
~JavaString()
@@ -67,7 +66,7 @@
{
if (!m_utf8String.data()) {
JSLockHolder lock(WebCore::JSDOMWindowBase::commonJSGlobalData());
- m_utf8String = UString(m_impl).utf8();
+ m_utf8String = String(m_impl).utf8();
}
return m_utf8String.data();
}
@@ -81,7 +80,7 @@
const jchar* uc = getUCharactersFromJStringInEnv(e, s);
{
JSLockHolder lock(WebCore::JSDOMWindowBase::commonJSGlobalData());
- m_impl = UString(reinterpret_cast<const UChar*>(uc), size).impl();
+ m_impl = String(reinterpret_cast<const UChar*>(uc), size).impl();
}
releaseUCharactersForJStringInEnv(e, s, uc);
}
diff --git a/Source/WebCore/bridge/objc/objc_class.mm b/Source/WebCore/bridge/objc/objc_class.mm
index 2d08704..bcbd7e7 100644
--- a/Source/WebCore/bridge/objc/objc_class.mm
+++ b/Source/WebCore/bridge/objc/objc_class.mm
@@ -97,7 +97,7 @@
MethodList ObjcClass::methodsNamed(PropertyName propertyName, Instance*) const
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return MethodList();
@@ -149,7 +149,7 @@
Field* ObjcClass::fieldNamed(PropertyName propertyName, Instance* instance) const
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return 0;
diff --git a/Source/WebCore/bridge/objc/objc_instance.mm b/Source/WebCore/bridge/objc/objc_instance.mm
index 8a97b7d..4f5beca 100644
--- a/Source/WebCore/bridge/objc/objc_instance.mm
+++ b/Source/WebCore/bridge/objc/objc_instance.mm
@@ -181,7 +181,7 @@
class ObjCRuntimeMethod : public RuntimeMethod {
public:
- static ObjCRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const UString& name, Bindings::MethodList& list)
+ static ObjCRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const String& name, Bindings::MethodList& list)
{
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// We need to pass in the right global object for "i".
@@ -206,7 +206,7 @@
{
}
- void finishCreation(JSGlobalData& globalData, const UString& name)
+ void finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
@@ -403,7 +403,7 @@
bool ObjcInstance::setValueOfUndefinedField(ExecState* exec, PropertyName propertyName, JSValue aValue)
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return false;
@@ -435,7 +435,7 @@
JSValue ObjcInstance::getValueOfUndefinedField(ExecState* exec, PropertyName propertyName) const
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return jsUndefined();
diff --git a/Source/WebCore/bridge/objc/objc_runtime.h b/Source/WebCore/bridge/objc/objc_runtime.h
index 1d16040..0dc2b83 100644
--- a/Source/WebCore/bridge/objc/objc_runtime.h
+++ b/Source/WebCore/bridge/objc/objc_runtime.h
@@ -94,7 +94,7 @@
public:
typedef JSNonFinalObject Base;
- static ObjcFallbackObjectImp* create(ExecState* exec, JSGlobalObject* globalObject, ObjcInstance* instance, const UString& propertyName)
+ static ObjcFallbackObjectImp* create(ExecState* exec, JSGlobalObject* globalObject, ObjcInstance* instance, const String& propertyName)
{
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjcFallbackObjectImp>(exec);
@@ -105,7 +105,7 @@
static const ClassInfo s_info;
- const UString& propertyName() const { return _item; }
+ const String& propertyName() const { return m_item; }
static ObjectPrototype* createPrototype(ExecState*, JSGlobalObject* globalObject)
{
@@ -121,7 +121,7 @@
void finishCreation(JSGlobalObject*);
private:
- ObjcFallbackObjectImp(JSGlobalObject*, Structure*, ObjcInstance*, const UString& propertyName);
+ ObjcFallbackObjectImp(JSGlobalObject*, Structure*, ObjcInstance*, const String& propertyName);
static void destroy(JSCell*);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
@@ -134,7 +134,7 @@
bool toBoolean(ExecState*) const; // FIXME: Currently this is broken because none of the superclasses are marked virtual. We need to solve this in the longer term.
RefPtr<ObjcInstance> _instance;
- UString _item;
+ String m_item;
};
} // namespace Bindings
diff --git a/Source/WebCore/bridge/objc/objc_runtime.mm b/Source/WebCore/bridge/objc/objc_runtime.mm
index 335668e..db3f98e 100644
--- a/Source/WebCore/bridge/objc/objc_runtime.mm
+++ b/Source/WebCore/bridge/objc/objc_runtime.mm
@@ -190,10 +190,10 @@
const ClassInfo ObjcFallbackObjectImp::s_info = { "ObjcFallbackObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjcFallbackObjectImp) };
-ObjcFallbackObjectImp::ObjcFallbackObjectImp(JSGlobalObject* globalObject, Structure* structure, ObjcInstance* i, const UString& propertyName)
+ObjcFallbackObjectImp::ObjcFallbackObjectImp(JSGlobalObject* globalObject, Structure* structure, ObjcInstance* i, const String& propertyName)
: JSNonFinalObject(globalObject->globalData(), structure)
, _instance(i)
- , _item(propertyName)
+ , m_item(propertyName)
{
}
@@ -247,8 +247,8 @@
if ([targetObject respondsToSelector:@selector(invokeUndefinedMethodFromWebScript:withArguments:)]){
ObjcClass* objcClass = static_cast<ObjcClass*>(objcInstance->getClass());
OwnPtr<ObjcMethod> fallbackMethod(adoptPtr(new ObjcMethod(objcClass->isa(), @selector(invokeUndefinedMethodFromWebScript:withArguments:))));
- const UString& nameIdentifier = static_cast<ObjcFallbackObjectImp*>(exec->callee())->propertyName();
- RetainPtr<CFStringRef> name(AdoptCF, CFStringCreateWithCharacters(0, nameIdentifier.characters(), nameIdentifier.length()));
+ const String& nameIdentifier = static_cast<ObjcFallbackObjectImp*>(exec->callee())->propertyName();
+ RetainPtr<CFStringRef> name(AdoptCF, nameIdentifier.createCFString());
fallbackMethod->setJavaScriptName(name.get());
result = objcInstance->invokeObjcMethod(exec, fallbackMethod.get());
}
@@ -276,7 +276,7 @@
JSValue ObjcFallbackObjectImp::defaultValue(const JSObject* object, ExecState* exec, PreferredPrimitiveType)
{
const ObjcFallbackObjectImp* thisObject = jsCast<const ObjcFallbackObjectImp*>(object);
- return thisObject->_instance->getValueOfUndefinedField(exec, Identifier(exec, thisObject->_item));
+ return thisObject->_instance->getValueOfUndefinedField(exec, Identifier(exec, thisObject->m_item));
}
bool ObjcFallbackObjectImp::toBoolean(ExecState *) const
diff --git a/Source/WebCore/bridge/objc/objc_utility.mm b/Source/WebCore/bridge/objc/objc_utility.mm
index b62e3df..e860247 100644
--- a/Source/WebCore/bridge/objc/objc_utility.mm
+++ b/Source/WebCore/bridge/objc/objc_utility.mm
@@ -147,14 +147,7 @@
JSValue convertNSStringToString(ExecState* exec, NSString *nsstring)
{
JSLockHolder lock(exec);
-
- unichar *chars;
- unsigned int length = [nsstring length];
- chars = (unichar *)malloc(sizeof(unichar)*length);
- [nsstring getCharacters:chars];
- UString u((const UChar*)chars, length);
- JSValue aValue = jsString(exec, u);
- free((void *)chars);
+ JSValue aValue = jsString(exec, String(nsstring));
return aValue;
}
@@ -311,11 +304,7 @@
JSObject *throwError(ExecState *exec, NSString *message)
{
ASSERT(message);
- size_t length = [message length];
- unichar *buffer = new unichar[length];
- [message getCharacters:buffer];
- JSObject *error = JSC::throwError(exec, JSC::createError(exec, UString(buffer, length)));
- delete [] buffer;
+ JSObject *error = JSC::throwError(exec, JSC::createError(exec, String(message)));
return error;
}
diff --git a/Source/WebCore/bridge/qt/qt_class.cpp b/Source/WebCore/bridge/qt/qt_class.cpp
index e24676a..7617871 100644
--- a/Source/WebCore/bridge/qt/qt_class.cpp
+++ b/Source/WebCore/bridge/qt/qt_class.cpp
@@ -73,7 +73,7 @@
JSContextRef context = toRef(exec);
JSValueRef exception = 0;
- UString ustring(identifier.publicName());
+ String ustring(identifier.publicName());
const QByteArray name = QString(reinterpret_cast<const QChar*>(ustring.characters()), ustring.length()).toLatin1();
// First see if we have a cache hit
@@ -136,7 +136,7 @@
QtInstance* qtinst = static_cast<QtInstance*>(instance);
QObject* obj = qtinst->getObject();
- UString ustring(identifier.publicName());
+ String ustring(identifier.publicName());
const QString name(reinterpret_cast<const QChar*>(ustring.characters()), ustring.length());
const QByteArray ascii = name.toLatin1();
diff --git a/Source/WebCore/bridge/qt/qt_instance.cpp b/Source/WebCore/bridge/qt/qt_instance.cpp
index 0412532..3f06914 100644
--- a/Source/WebCore/bridge/qt/qt_instance.cpp
+++ b/Source/WebCore/bridge/qt/qt_instance.cpp
@@ -213,7 +213,7 @@
QMetaMethod method = meta->method(i);
if (method.access() != QMetaMethod::Private) {
QByteArray sig = method.methodSignature();
- array.add(Identifier(exec, UString(sig.constData(), sig.length())));
+ array.add(Identifier(exec, String(sig.constData(), sig.length())));
}
}
}
diff --git a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
index a2daada..620cc43 100644
--- a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -171,8 +171,8 @@
QBuffer buffer(&byteArray);
instance->toImage().save(&buffer, "PNG");
const QString encodedString = QLatin1String("data:image/png;base64,") + QLatin1String(byteArray.toBase64());
- const UString ustring((UChar*)encodedString.utf16(), encodedString.length());
- return jsString(exec, ustring);
+ const String ustring((UChar*)encodedString.utf16(), encodedString.length());
+ return JSC::jsString(exec, ustring);
}
};
@@ -259,7 +259,7 @@
MethodList QtPixmapClass::methodsNamed(PropertyName identifier, Instance*) const
{
MethodList methods;
- UString ustring(identifier.publicName());
+ String ustring(identifier.publicName());
if (ustring == QtPixmapToDataUrlMethod::name())
methods.append(&qt_pixmap_metaData.toDataUrlMethod);
else if (ustring == QtPixmapToImageDataMethod::name())
@@ -273,7 +273,7 @@
Field* QtPixmapClass::fieldNamed(PropertyName identifier, Instance*) const
{
- UString ustring(identifier.publicName());
+ String ustring(identifier.publicName());
if (ustring == QtPixmapWidthField::name())
return &qt_pixmap_metaData.widthField;
if (ustring == QtPixmapHeightField::name())
@@ -283,12 +283,12 @@
void QtPixmapInstance::getPropertyNames(ExecState*exec, PropertyNameArray& arr)
{
- arr.add(Identifier(exec, UString(QtPixmapToDataUrlMethod::name())));
- arr.add(Identifier(exec, UString(QtPixmapToImageDataMethod::name())));
- arr.add(Identifier(exec, UString(QtPixmapAssignToElementMethod::name())));
- arr.add(Identifier(exec, UString(QtPixmapToStringMethod::name())));
- arr.add(Identifier(exec, UString(QtPixmapWidthField::name())));
- arr.add(Identifier(exec, UString(QtPixmapHeightField::name())));
+ arr.add(Identifier(exec, String(QtPixmapToDataUrlMethod::name())));
+ arr.add(Identifier(exec, String(QtPixmapToImageDataMethod::name())));
+ arr.add(Identifier(exec, String(QtPixmapAssignToElementMethod::name())));
+ arr.add(Identifier(exec, String(QtPixmapToStringMethod::name())));
+ arr.add(Identifier(exec, String(QtPixmapWidthField::name())));
+ arr.add(Identifier(exec, String(QtPixmapHeightField::name())));
}
JSValue QtPixmapInstance::defaultValue(ExecState* exec, PreferredPrimitiveType ptype) const
@@ -308,8 +308,8 @@
JSValue QtPixmapInstance::valueOf(ExecState* exec) const
{
const QString stringValue = QString::fromLatin1("[Qt Native Pixmap %1,%2]").arg(width()).arg(height());
- UString ustring((UChar*)stringValue.utf16(), stringValue.length());
- return jsString(exec, ustring);
+ String ustring((UChar*)stringValue.utf16(), stringValue.length());
+ return JSC::jsString(exec, ustring);
}
QtPixmapInstance::QtPixmapInstance(PassRefPtr<RootObject> rootObj, const QVariant& d)
diff --git a/Source/WebCore/bridge/qt/qt_runtime.cpp b/Source/WebCore/bridge/qt/qt_runtime.cpp
index 0db5a87..9892135 100644
--- a/Source/WebCore/bridge/qt/qt_runtime.cpp
+++ b/Source/WebCore/bridge/qt/qt_runtime.cpp
@@ -97,7 +97,7 @@
Variant = 0,
Number,
Boolean,
- String,
+ RTString,
Date,
Array,
QObj,
@@ -110,7 +110,7 @@
#if defined(QTWK_RUNTIME_CONVERSION_DEBUG) || defined(QTWK_RUNTIME_MATCH_DEBUG)
QDebug operator<<(QDebug dbg, const JSRealType &c)
{
- const char *map[] = { "Variant", "Number", "Boolean", "String", "Date",
+ const char *map[] = { "Variant", "Number", "Boolean", "RTString", "Date",
"Array", "RTObject", "Object", "Null", "RTArray"};
dbg.nospace() << "JSType(" << ((int)c) << ", " << map[c] << ")";
@@ -156,7 +156,7 @@
if (val.isNumber())
return Number;
else if (val.isString())
- return String;
+ return RTString;
else if (val.isBoolean())
return Boolean;
else if (val.isNull())
@@ -176,7 +176,7 @@
return Object;
}
- return String; // I don't know.
+ return RTString; // I don't know.
}
QVariant convertValueToQVariant(ExecState*, JSValue, QMetaType::Type, int*, HashSet<JSObject*>*, int);
@@ -199,7 +199,7 @@
else {
QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit);
if (objdist >= 0) {
- UString ustring = (*it).ustring();
+ WTF::String ustring = (*it).ustring();
QString id = QString((const QChar*)ustring.impl()->characters(), ustring.length());
result.insert(id, v);
}
@@ -246,7 +246,7 @@
case Boolean:
hint = QMetaType::Bool;
break;
- case String:
+ case RTString:
default:
hint = QMetaType::QString;
break;
@@ -354,9 +354,9 @@
else
dist = 6;
} else {
- UString str = value.toString(exec)->value(exec);
+ WTF::String str = value.toString(exec)->value(exec);
ret = QVariant(QChar(str.length() ? *(const ushort*)str.impl()->characters() : 0));
- if (type == String)
+ if (type == RTString)
dist = 3;
else
dist = 10;
@@ -369,9 +369,9 @@
*distance = 1;
return QString();
} else {
- UString ustring = value.toString(exec)->value(exec);
+ WTF::String ustring = value.toString(exec)->value(exec);
ret = QVariant(QString((const QChar*)ustring.impl()->characters(), ustring.length()));
- if (type == String)
+ if (type == RTString)
dist = 0;
else
dist = 10;
@@ -450,7 +450,7 @@
int len = rtarray->getLength();
for (int i = 0; i < len; ++i) {
JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
- UString ustring = val.toString(exec)->value(exec);
+ WTF::String ustring = val.toString(exec)->value(exec);
QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
result.append(qstring);
@@ -464,7 +464,7 @@
int len = array->length();
for (int i = 0; i < len; ++i) {
JSValue val = array->get(exec, i);
- UString ustring = val.toString(exec)->value(exec);
+ WTF::String ustring = val.toString(exec)->value(exec);
QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
result.append(qstring);
@@ -473,7 +473,7 @@
ret = QVariant(result);
} else {
// Make a single length array
- UString ustring = value.toString(exec)->value(exec);
+ WTF::String ustring = value.toString(exec)->value(exec);
QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
QStringList result;
result.append(qstring);
@@ -489,9 +489,9 @@
ret = QVariant(QByteArray(reinterpret_cast<const char*>(arr->data()), arr->length()));
dist = 0;
} else {
- UString ustring = value.toString(exec)->value(exec);
+ WTF::String ustring = value.toString(exec)->value(exec);
ret = QVariant(QString((const QChar*)ustring.impl()->characters(), ustring.length()).toLatin1());
- if (type == String)
+ if (type == RTString)
dist = 5;
else
dist = 10;
@@ -531,8 +531,8 @@
dist = 10;
}
#ifndef QT_NO_DATESTRING
- } else if (type == String) {
- UString ustring = value.toString(exec)->value(exec);
+ } else if (type == RTString) {
+ WTF::String ustring = value.toString(exec)->value(exec);
QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
if (hint == QMetaType::QDateTime) {
diff --git a/Source/WebCore/bridge/runtime_method.cpp b/Source/WebCore/bridge/runtime_method.cpp
index 4dc4e6d..9fdb64d 100644
--- a/Source/WebCore/bridge/runtime_method.cpp
+++ b/Source/WebCore/bridge/runtime_method.cpp
@@ -55,7 +55,7 @@
static_cast<RuntimeMethod*>(cell)->RuntimeMethod::~RuntimeMethod();
}
-void RuntimeMethod::finishCreation(JSGlobalData& globalData, const UString& ident)
+void RuntimeMethod::finishCreation(JSGlobalData& globalData, const String& ident)
{
Base::finishCreation(globalData, ident);
ASSERT(inherits(&s_info));
diff --git a/Source/WebCore/bridge/runtime_method.h b/Source/WebCore/bridge/runtime_method.h
index f629578..7481605 100644
--- a/Source/WebCore/bridge/runtime_method.h
+++ b/Source/WebCore/bridge/runtime_method.h
@@ -39,7 +39,7 @@
static void destroy(JSCell*);
- static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, Bindings::MethodList& methodList)
+ static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& name, Bindings::MethodList& methodList)
{
RuntimeMethod* method = new (NotNull, allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(globalObject, structure, methodList);
method->finishCreation(exec->globalData(), name);
@@ -62,7 +62,7 @@
protected:
RuntimeMethod(JSGlobalObject*, Structure*, Bindings::MethodList&);
- void finishCreation(JSGlobalData&, const UString&);
+ void finishCreation(JSGlobalData&, const String&);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags;
static CallType getCallData(JSCell*, CallData&);
diff --git a/Source/WebCore/bridge/testbindings.cpp b/Source/WebCore/bridge/testbindings.cpp
index fe9fc1b..b43b75d 100644
--- a/Source/WebCore/bridge/testbindings.cpp
+++ b/Source/WebCore/bridge/testbindings.cpp
@@ -336,7 +336,7 @@
class GlobalImp : public ObjectImp {
public:
- virtual UString className() const { return "global"; }
+ virtual String className() const { return "global"; }
};
#define BufferSize 200000
diff --git a/Source/WebCore/bridge/testbindings.mm b/Source/WebCore/bridge/testbindings.mm
index ef3bc4e..e50f16a 100644
--- a/Source/WebCore/bridge/testbindings.mm
+++ b/Source/WebCore/bridge/testbindings.mm
@@ -202,7 +202,7 @@
class GlobalImp : public ObjectImp {
public:
- virtual UString className() const { return "global"; }
+ virtual String className() const { return "global"; }
};
#define BufferSize 200000
diff --git a/Source/WebCore/bridge/testqtbindings.cpp b/Source/WebCore/bridge/testqtbindings.cpp
index a4f4d5a..7d3d416 100644
--- a/Source/WebCore/bridge/testqtbindings.cpp
+++ b/Source/WebCore/bridge/testqtbindings.cpp
@@ -78,7 +78,7 @@
public:
typedef JSNonFinalObject Base;
- static UString className(const JSObject*) { return "global"; }
+ static String className(const JSObject*) { return "global"; }
};
static char code[] =
diff --git a/Source/WebCore/inspector/ContentSearchUtils.cpp b/Source/WebCore/inspector/ContentSearchUtils.cpp
index 054da34..a3f83c2 100644
--- a/Source/WebCore/inspector/ContentSearchUtils.cpp
+++ b/Source/WebCore/inspector/ContentSearchUtils.cpp
@@ -144,7 +144,7 @@
{
String patternString = "//@[\040\t]" + name + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
const char* error = 0;
- JSC::Yarr::YarrPattern pattern(JSC::UString(patternString.impl()), false, true, &error);
+ JSC::Yarr::YarrPattern pattern(patternString, false, true, &error);
ASSERT(!error);
BumpPointerAllocator regexAllocator;
OwnPtr<JSC::Yarr::BytecodePattern> bytecodePattern = JSC::Yarr::byteCompile(pattern, ®exAllocator);
@@ -153,7 +153,7 @@
ASSERT(pattern.m_numSubpatterns == 1);
Vector<int, 4> matches;
matches.resize(4);
- unsigned result = JSC::Yarr::interpret(bytecodePattern.get(), JSC::UString(content.impl()), 0, reinterpret_cast<unsigned*>(matches.data()));
+ unsigned result = JSC::Yarr::interpret(bytecodePattern.get(), content, 0, reinterpret_cast<unsigned*>(matches.data()));
if (result == JSC::Yarr::offsetNoMatch)
return String();
ASSERT(matches[2] > 0 && matches[3] > 0);
diff --git a/Source/WebCore/platform/KURL.h b/Source/WebCore/platform/KURL.h
index fbf9f82..a380edf 100644
--- a/Source/WebCore/platform/KURL.h
+++ b/Source/WebCore/platform/KURL.h
@@ -48,10 +48,6 @@
#include "KURLGooglePrivate.h"
#endif
-#if USE(JSC)
-#include <runtime/UString.h>
-#endif
-
namespace WebCore {
class TextEncoding;
diff --git a/Source/WebCore/platform/text/RegularExpression.cpp b/Source/WebCore/platform/text/RegularExpression.cpp
index f74f957..2369590 100644
--- a/Source/WebCore/platform/text/RegularExpression.cpp
+++ b/Source/WebCore/platform/text/RegularExpression.cpp
@@ -56,7 +56,7 @@
PassOwnPtr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity)
{
- JSC::Yarr::YarrPattern pattern(JSC::UString(patternString.impl()), (caseSensitivity == TextCaseInsensitive), false, &m_constructionError);
+ JSC::Yarr::YarrPattern pattern(patternString, (caseSensitivity == TextCaseInsensitive), false, &m_constructionError);
if (m_constructionError) {
LOG_ERROR("RegularExpression: YARR compile failed with '%s'", m_constructionError);
return nullptr;
@@ -112,7 +112,7 @@
unsigned result;
if (str.length() <= INT_MAX)
- result = JSC::Yarr::interpret(d->m_regExpByteCode.get(), JSC::UString(str.impl()), startFrom, offsetVector);
+ result = JSC::Yarr::interpret(d->m_regExpByteCode.get(), str, startFrom, offsetVector);
else {
// This code can't handle unsigned offsets. Limit our processing to strings with offsets that
// can be represented as ints.
diff --git a/Source/WebCore/platform/win/BString.cpp b/Source/WebCore/platform/win/BString.cpp
index 872ab7e..a577ef5 100644
--- a/Source/WebCore/platform/win/BString.cpp
+++ b/Source/WebCore/platform/win/BString.cpp
@@ -84,14 +84,6 @@
m_bstr = SysAllocStringLen(s.characters(), s.length());
}
-BString::BString(const UString& s)
-{
- if (s.isNull())
- m_bstr = 0;
- else
- m_bstr = SysAllocStringLen(s.characters(), s.length());
-}
-
#if USE(CF)
BString::BString(CFStringRef cfstr)
: m_bstr(0)
diff --git a/Source/WebCore/platform/win/BString.h b/Source/WebCore/platform/win/BString.h
index 922d3e2..7373eed 100644
--- a/Source/WebCore/platform/win/BString.h
+++ b/Source/WebCore/platform/win/BString.h
@@ -34,10 +34,6 @@
typedef wchar_t* BSTR;
-namespace JSC {
- class UString;
-}
-
namespace WebCore {
class KURL;
@@ -50,7 +46,6 @@
BString(const String&);
BString(const AtomicString&);
BString(const KURL&);
- BString(const JSC::UString&);
#if USE(CF)
BString(CFStringRef);
#endif
diff --git a/Source/WebCore/plugins/PluginView.cpp b/Source/WebCore/plugins/PluginView.cpp
index 0d6857f..dd220d8 100644
--- a/Source/WebCore/plugins/PluginView.cpp
+++ b/Source/WebCore/plugins/PluginView.cpp
@@ -64,6 +64,7 @@
#include "Settings.h"
#include "npruntime_impl.h"
#include <wtf/ASCIICType.h>
+#include <wtf/text/WTFString.h>
#if OS(WINDOWS) && ENABLE(NETSCAPE_PLUGIN_API)
#include "PluginMessageThrottlerWin.h"
@@ -81,7 +82,6 @@
using JSC::JSLock;
using JSC::JSObject;
using JSC::JSValue;
-using JSC::UString;
#endif
#if ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp b/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
index 2cc96d5..f5478f0 100644
--- a/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
+++ b/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
@@ -90,7 +90,6 @@
using JSC::Interpreter;
using JSC::JSLock;
using JSC::JSObject;
-using JSC::UString;
using namespace std;
using namespace WTF;
diff --git a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp b/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
index 6844eec..62f9f8d 100644
--- a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -83,7 +83,6 @@
using JSC::Interpreter;
using JSC::JSLock;
using JSC::JSObject;
-using JSC::UString;
using std::min;
diff --git a/Source/WebCore/plugins/mac/PluginViewMac.mm b/Source/WebCore/plugins/mac/PluginViewMac.mm
index 785a74d..42ba6a6 100644
--- a/Source/WebCore/plugins/mac/PluginViewMac.mm
+++ b/Source/WebCore/plugins/mac/PluginViewMac.mm
@@ -70,7 +70,6 @@
using JSC::JSLock;
using JSC::JSObject;
using JSC::JSValue;
-using JSC::UString;
#if PLATFORM(QT)
#include <QWidget>
diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
index 04d710e..9bc0227 100644
--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
@@ -90,7 +90,6 @@
#endif
using JSC::JSLock;
using JSC::JSObject;
-using JSC::UString;
using std::min;
diff --git a/Source/WebCore/plugins/win/PluginViewWin.cpp b/Source/WebCore/plugins/win/PluginViewWin.cpp
index 142fa83..05ff30b 100644
--- a/Source/WebCore/plugins/win/PluginViewWin.cpp
+++ b/Source/WebCore/plugins/win/PluginViewWin.cpp
@@ -69,6 +69,7 @@
#include <runtime/JSLock.h>
#include <runtime/JSValue.h>
#include <wtf/ASCIICType.h>
+#include <wtf/text/WTFString.h>
#if !PLATFORM(WX)
#include "BitmapInfo.h"
@@ -127,7 +128,6 @@
using JSC::ExecState;
using JSC::JSLock;
using JSC::JSObject;
-using JSC::UString;
using std::min;
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index b49598f..953963b 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,16 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Replace UString by String.
+
+ * WebCoreSupport/ClientExtension.cpp:
+ * WebCoreSupport/PagePopupBlackBerry.cpp:
+ (WebCore::PagePopupBlackBerry::installDomFunction):
+
2012-08-30 Jacky Jiang <zhajiang@rim.com>
[BlackBerry] ASSERT failure in JSC::MarkedAllocator::allocateSlowCase
diff --git a/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp b/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp
index 3920971..54c456a 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/ClientExtension.cpp
@@ -103,7 +103,7 @@
JSObjectRef clientClassObject = JSObjectMake(scriptCtx, clientClass, 0);
JSObjectSetPrivate(clientClassObject, reinterpret_cast<void*>(client));
- JSC::UString name("qnx");
+ String name("qnx");
JSC::PutPropertySlot slot;
window->put(window, exec, JSC::Identifier(exec, name), toJS(clientClassObject), slot);
diff --git a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
index 402b523..e2ed349 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
@@ -166,7 +166,7 @@
JSObjectRef clientClassObject = JSObjectMake(context, clientClass, 0);
JSObjectSetPrivate(clientClassObject, reinterpret_cast<void*>(m_client.get()));
- JSC::UString name("popUp");
+ String name("popUp");
JSC::PutPropertySlot slot;
window->put(window, exec, JSC::Identifier(exec, name),
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index 16a891e..853d0a0 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,17 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Replace UString by String.
+
+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+ (DumpRenderTreeSupportEfl::sendWebIntentResponse):
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_script_execute):
+
2012-08-29 Kamil Blank <k.blank@samsung.com>
[EFL] Add setting API for allow universal/file access from file URLs.
diff --git a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
index 96a5791..8a9ef9b 100644
--- a/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
@@ -638,7 +638,7 @@
void DumpRenderTreeSupportEfl::sendWebIntentResponse(Ewk_Intent_Request* request, JSStringRef response)
{
#if ENABLE(WEB_INTENTS)
- JSC::UString responseString = response->ustring();
+ String responseString = response->ustring();
if (responseString.isNull())
ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));
else
diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp
index 7231b54..4b33c62 100644
--- a/Source/WebKit/efl/ewk/ewk_frame.cpp
+++ b/Source/WebKit/efl/ewk/ewk_frame.cpp
@@ -458,7 +458,7 @@
JSC::ExecState* exec = smartData->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec();
JSC::JSLockHolder lock(exec);
- resultString = WebCore::ustringToString(result.toString(exec)->value(exec));
+ resultString = result.toString(exec)->value(exec);
return eina_stringshare_add(resultString.utf8().data());
#else
notImplemented();
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index 04365f3..8bc0346 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,15 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Replace UString by String.
+
+ * gdom/ConvertToGCharPrivate.h:
+ (copyAsGchar):
+
2012-08-30 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Use ASCIILiteral for DEFINE_STATIC_LOCAL string
diff --git a/Source/WebKit/gtk/gdom/ConvertToGCharPrivate.h b/Source/WebKit/gtk/gdom/ConvertToGCharPrivate.h
index afbed49..be02ffb 100644
--- a/Source/WebKit/gtk/gdom/ConvertToGCharPrivate.h
+++ b/Source/WebKit/gtk/gdom/ConvertToGCharPrivate.h
@@ -35,7 +35,7 @@
return copyAsGchar(s.string());
}
-inline gchar* copyAsGchar(const JSC::UString& s)
+inline gchar* copyAsGchar(const String& s)
{
return g_strdup(s.UTF8String().c_str());
}
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 5c10b36..6c3c0e5 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,41 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ 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:
+ (identifierFromIdentifierRep):
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::addValueToArray):
+ (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyRuntimeMethod::create):
+ (WebKit::ProxyRuntimeMethod::finishCreation):
+ (WebKit::ProxyInstance::getPropertyNames):
+ (WebKit::ProxyInstance::methodsNamed):
+ (WebKit::ProxyInstance::fieldNamed):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame functionName]):
+ (-[WebScriptCallFrame evaluateWebScript:]):
+ * WebView/WebScriptDebugger.h:
+ (WTF):
+ (JSC):
+ (WebScriptDebugger):
+ * WebView/WebScriptDebugger.mm:
+ (toNSURL):
+ (WebScriptDebugger::sourceParsed):
+ * WebView/WebView.mm:
+ (aeDescFromJSValue):
+
2012-08-30 Jon Lee <jonlee@apple.com>
[Mac] Add testRunner.dumpWebNotificationCallbacks() to DRT
diff --git a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index af6f2be..0f9f07d 100644
--- a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -607,7 +607,7 @@
ASSERT(identifier->isString());
const char* str = identifier->string();
- return Identifier(JSDOMWindow::commonJSGlobalData(), stringToUString(String::fromUTF8WithLatin1Fallback(str, strlen(str))));
+ return Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str)));
}
kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier,
diff --git a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 9104430..174a3a4 100644
--- a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -1265,7 +1265,7 @@
if (value.isString()) {
[array addObject:[NSNumber numberWithInt:StringValueType]];
- [array addObject:ustringToString(value.toString(exec)->value(exec))];
+ [array addObject:value.toWTFString(exec)];
} else if (value.isNumber()) {
[array addObject:[NSNumber numberWithInt:DoubleValueType]];
[array addObject:[NSNumber numberWithDouble:value.toNumber(exec)]];
@@ -1672,7 +1672,7 @@
{
JSLockHolder lock(exec);
- throwError(exec, createError(exec, stringToUString(globalExceptionString())));
+ throwError(exec, createError(exec, globalExceptionString()));
}
globalExceptionString() = String();
diff --git a/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index 898c5e2..49e98fe 100644
--- a/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -181,7 +181,7 @@
public:
typedef RuntimeMethod Base;
- static ProxyRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const UString& name, Bindings::MethodList& list)
+ static ProxyRuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, const String& name, Bindings::MethodList& list)
{
// FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
// exec-globalData() is also likely wrong.
@@ -204,7 +204,7 @@
{
}
- void finishCreation(JSGlobalData& globalData, const UString& name)
+ void finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
@@ -340,7 +340,7 @@
if (identifier->isString()) {
const char* str = identifier->string();
- nameArray.add(Identifier(JSDOMWindow::commonJSGlobalData(), stringToUString(String::fromUTF8WithLatin1Fallback(str, strlen(str)))));
+ nameArray.add(Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str))));
} else
nameArray.add(Identifier::from(exec, identifier->number()));
}
@@ -348,7 +348,7 @@
MethodList ProxyInstance::methodsNamed(PropertyName propertyName)
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return MethodList();
@@ -392,7 +392,7 @@
Field* ProxyInstance::fieldNamed(PropertyName propertyName)
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return 0;
diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm
index 92f9e0b..f91ffd8 100644
--- a/Source/WebKit/mac/WebView/WebFrame.mm
+++ b/Source/WebKit/mac/WebView/WebFrame.mm
@@ -598,7 +598,7 @@
JSC::ExecState* exec = _private->coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec();
JSC::JSLockHolder lock(exec);
- return ustringToString(result.toString(exec)->value(exec));
+ return result.toWTFString(exec);
}
- (NSRect)_caretRectAtPosition:(const Position&)pos affinity:(NSSelectionAffinity)affinity
@@ -1124,7 +1124,7 @@
JSC::ExecState* exec = anyWorldGlobalObject->globalExec();
JSC::JSLockHolder lock(exec);
- return ustringToString(result.toString(exec)->value(exec));
+ return result.toWTFString(exec);
}
- (JSGlobalContextRef)_globalContextForScriptWorld:(WebScriptWorld *)world
diff --git a/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm b/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm
index 91d4735..0fcfc8b 100644
--- a/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm
+++ b/Source/WebKit/mac/WebView/WebScriptDebugDelegate.mm
@@ -203,8 +203,8 @@
if (!_private->debuggerCallFrame)
return nil;
- const UString* functionName = _private->debuggerCallFrame->functionName();
- return functionName ? toNSString(*functionName) : nil;
+ const String* functionName = _private->debuggerCallFrame->functionName();
+ return functionName ? nsStringNilIfEmpty(*functionName) : nil;
}
// Returns the pending exception for this frame (nil if none).
@@ -242,14 +242,14 @@
DynamicGlobalObjectScope globalObjectScope(globalObject->globalData(), globalObject);
JSValue exception;
- JSValue result = evaluateInGlobalCallFrame(stringToUString(script), exception, globalObject);
+ JSValue result = evaluateInGlobalCallFrame(script, exception, globalObject);
if (exception)
return [self _convertValueToObjcValue:exception];
return result ? [self _convertValueToObjcValue:result] : nil;
}
JSValue exception;
- JSValue result = _private->debuggerCallFrame->evaluate(stringToUString(script), exception);
+ JSValue result = _private->debuggerCallFrame->evaluate(script, exception);
if (exception)
return [self _convertValueToObjcValue:exception];
return result ? [self _convertValueToObjcValue:result] : nil;
diff --git a/Source/WebKit/mac/WebView/WebScriptDebugger.h b/Source/WebKit/mac/WebView/WebScriptDebugger.h
index b551f7d..c7da8fe 100644
--- a/Source/WebKit/mac/WebView/WebScriptDebugger.h
+++ b/Source/WebKit/mac/WebView/WebScriptDebugger.h
@@ -34,26 +34,27 @@
#include <wtf/RetainPtr.h>
+namespace WTF {
+class String;
+}
+
namespace JSC {
class DebuggerCallFrame;
class ExecState;
class JSGlobalObject;
class JSObject;
class ArgList;
- class UString;
}
@class WebScriptCallFrame;
-NSString *toNSString(const JSC::UString&);
-
class WebScriptDebugger : public JSC::Debugger {
public:
WebScriptDebugger(JSC::JSGlobalObject*);
void initGlobalCallFrame(const JSC::DebuggerCallFrame&);
- virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const JSC::UString& errorMsg);
+ virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const WTF::String& errorMsg);
virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int columnNumber);
virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int columnNumber);
virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int columnNumber);
diff --git a/Source/WebKit/mac/WebView/WebScriptDebugger.mm b/Source/WebKit/mac/WebView/WebScriptDebugger.mm
index 4ffe725..13c4f7c 100644
--- a/Source/WebKit/mac/WebView/WebScriptDebugger.mm
+++ b/Source/WebKit/mac/WebView/WebScriptDebugger.mm
@@ -51,13 +51,6 @@
- (void)_clearDebuggerCallFrame;
@end
-NSString *toNSString(const UString& s)
-{
- if (s.isEmpty())
- return nil;
- return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.characters()) length:s.length()];
-}
-
static NSString *toNSString(SourceProvider* s)
{
if (!s->length())
@@ -65,12 +58,12 @@
return [NSString stringWithCharacters:s->data()->characters() length:s->length()];
}
-// convert UString to NSURL
-static NSURL *toNSURL(const UString& s)
+// Convert String to NSURL.
+static NSURL *toNSURL(const String& s)
{
if (s.isEmpty())
return nil;
- return KURL(ParsedURLString, ustringToString(s));
+ return KURL(ParsedURLString, s);
}
static WebFrame *toWebFrame(JSGlobalObject* globalObject)
@@ -105,7 +98,7 @@
}
// callbacks - relay to delegate
-void WebScriptDebugger::sourceParsed(ExecState* exec, SourceProvider* sourceProvider, int errorLine, const UString& errorMsg)
+void WebScriptDebugger::sourceParsed(ExecState* exec, SourceProvider* sourceProvider, int errorLine, const String& errorMsg)
{
if (m_callingDelegate)
return;
@@ -128,7 +121,7 @@
CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:), nsSource, [nsURL absoluteString], sourceProvider->asID(), webFrame);
}
} else {
- NSString* nsErrorMessage = toNSString(errorMsg);
+ NSString* nsErrorMessage = nsStringNilIfEmpty(errorMsg);
NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:nsErrorMessage, WebScriptErrorDescriptionKey, [NSNumber numberWithUnsignedInt:errorLine], WebScriptErrorLineNumberKey, nil];
NSError *error = [[NSError alloc] initWithDomain:WebScriptErrorDomain code:WebScriptGeneralErrorCode userInfo:info];
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index 88af20c..358c07b 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -4790,7 +4790,7 @@
if (jsValue.isBoolean())
return [NSAppleEventDescriptor descriptorWithBoolean:jsValue.asBoolean()];
if (jsValue.isString())
- return [NSAppleEventDescriptor descriptorWithString:ustringToString(jsValue.getString(exec))];
+ return [NSAppleEventDescriptor descriptorWithString:jsValue.getString(exec)];
if (jsValue.isNumber()) {
double value = jsValue.asNumber();
int intValue = value;
diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp
index a208cbc..062cdd2 100644
--- a/Source/WebKit/qt/Api/qwebelement.cpp
+++ b/Source/WebKit/qt/Api/qwebelement.cpp
@@ -751,7 +751,7 @@
if (!setupScriptContext(m_element, thisValue, state, scriptController))
return QVariant();
JSC::ScopeChainNode* scopeChain = state->dynamicGlobalObject()->globalScopeChain();
- JSC::UString script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
+ String script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
JSC::JSValue evaluationException;
JSC::JSValue evaluationResult = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue, &evaluationException);
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 7d6959d..1181aa8 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Replace UString by String.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::evaluateJavaScript):
+
2012-08-29 Simon Hausmann <simon.hausmann@nokia.com>
[Qt] Fix doc generation with make docs
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index f6019a2..07e4a6e 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,17 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Replace UString by String.
+
+ * WebFrame.cpp:
+ (WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
+ * WebView.cpp:
+ (WebView::stringByEvaluatingJavaScriptFromString):
+
2012-08-29 Dominic Mazzoni <dmazzoni@google.com>
AX: Canvas should have a distinct role
diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp
index d1880cf..062cf14 100644
--- a/Source/WebKit/win/WebFrame.cpp
+++ b/Source/WebKit/win/WebFrame.cpp
@@ -2539,7 +2539,7 @@
JSC::ExecState* exec = anyWorldGlobalObject->globalExec();
JSC::JSLockHolder lock(exec);
- String resultString = ustringToString(result.toString(exec)->value(exec));
+ String resultString = result.toWTFString(exec);
*evaluationResult = BString(resultString).release();
return S_OK;
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp
index 70d491e..c3fded6 100644
--- a/Source/WebKit/win/WebView.cpp
+++ b/Source/WebKit/win/WebView.cpp
@@ -3198,7 +3198,7 @@
else if (scriptExecutionResult.isString()) {
JSC::ExecState* exec = coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec();
JSC::JSLockHolder lock(exec);
- *result = BString(ustringToString(scriptExecutionResult.getString(exec)));
+ *result = BString(scriptExecutionResult.getString(exec));
}
return S_OK;
diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog
index 1952bbb..37183cf 100644
--- a/Source/WebKit/wx/ChangeLog
+++ b/Source/WebKit/wx/ChangeLog
@@ -1,3 +1,15 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Update the #includes to use the correct types.
+
+ * WebFrame.cpp:
+ * WebView.cpp:
+
2012-08-13 Tom Sepez <tsepez@chromium.org>
[chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
diff --git a/Source/WebKit/wx/WebFrame.cpp b/Source/WebKit/wx/WebFrame.cpp
index 942c4be..aaa7614 100644
--- a/Source/WebKit/wx/WebFrame.cpp
+++ b/Source/WebKit/wx/WebFrame.cpp
@@ -54,8 +54,8 @@
#include "JSDOMBinding.h"
#include <runtime/JSValue.h>
-#include <runtime/UString.h>
#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
#include "EditorClientWx.h"
#include "FrameLoaderClientWx.h"
diff --git a/Source/WebKit/wx/WebView.cpp b/Source/WebKit/wx/WebView.cpp
index acb60f6..4f84a1b 100644
--- a/Source/WebKit/wx/WebView.cpp
+++ b/Source/WebKit/wx/WebView.cpp
@@ -72,9 +72,9 @@
#include "JSDOMBinding.h"
#include <runtime/InitializeThreading.h>
#include <runtime/JSValue.h>
-#include <runtime/UString.h>
#include <wtf/MainThread.h>
#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
#if ENABLE(SQL_DATABASE)
#include "AbstractDatabase.h"
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 126399e..93ff8c2 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,23 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Update to code to switch from UString to String.
+
+ * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
+ (WebKit::JSNPMethod::finishCreation):
+ * WebProcess/Plugins/Netscape/JSNPMethod.h:
+ (WebKit::JSNPMethod::create):
+ (JSNPMethod):
+ * WebProcess/Plugins/Netscape/JSNPObject.cpp:
+ (WebKit::npIdentifierFromIdentifier):
+ * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+ (WebKit::NPRuntimeObjectMap::evaluate):
+ (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
+
2012-08-29 Mark Hahnenberg <mhahnenberg@apple.com>
JSNPObject doesn't always protect its data when calling into plugin code
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
index edf42e4..46eff09 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
@@ -51,7 +51,7 @@
{
}
-void JSNPMethod::finishCreation(JSGlobalData& globalData, const UString& name)
+void JSNPMethod::finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
index 3cb33fc..93614d5 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
@@ -41,7 +41,7 @@
public:
typedef JSC::InternalFunction Base;
- static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::UString& name, NPIdentifier npIdent)
+ static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const String& name, NPIdentifier npIdent)
{
JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());
JSNPMethod* method = new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(globalObject, structure, npIdent);
@@ -54,7 +54,7 @@
NPIdentifier npIdentifier() const { return m_npIdentifier; }
protected:
- void finishCreation(JSC::JSGlobalData&, const JSC::UString& name);
+ void finishCreation(JSC::JSGlobalData&, const String& name);
private:
JSNPMethod(JSC::JSGlobalObject*, JSC::Structure*, NPIdentifier);
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
index d3034d3..30530a6 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
@@ -48,7 +48,7 @@
static NPIdentifier npIdentifierFromIdentifier(PropertyName propertyName)
{
- UString name(propertyName.publicName());
+ String name(propertyName.publicName());
if (name.isNull())
return 0;
return static_cast<NPIdentifier>(IdentifierRep::get(name.utf8().data()));
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
index 358533f..a525fb9 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
@@ -178,7 +178,7 @@
ASSERT_NOT_REACHED();
}
-bool NPRuntimeObjectMap::evaluate(NPObject* npObject, const String&scriptString, NPVariant* result)
+bool NPRuntimeObjectMap::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result)
{
Strong<JSGlobalObject> globalObject(this->globalObject()->globalData(), this->globalObject());
if (!globalObject)
@@ -190,7 +190,7 @@
JSValue thisValue = getOrCreateJSObject(globalObject.get(), npObject);
globalObject->globalData().timeoutChecker.start();
- JSValue resultValue = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(UString(scriptString.impl())), thisValue);
+ JSValue resultValue = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(scriptString), thisValue);
globalObject->globalData().timeoutChecker.stop();
convertJSValueToNPVariant(exec, resultValue, *result);
@@ -267,7 +267,7 @@
{
JSLockHolder lock(exec);
- throwError(exec, createError(exec, stringToUString(globalExceptionString())));
+ throwError(exec, createError(exec, globalExceptionString()));
}
globalExceptionString() = String();
diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def
index 1bf078f..f5102e6 100644
--- a/Source/WebKit2/win/WebKit2.def
+++ b/Source/WebKit2/win/WebKit2.def
@@ -276,7 +276,7 @@
?setAllowsRoundingHacks@TextRun@WebCore@@SAX_N@Z
?profilerEnabled@InspectorController@WebCore@@QAE_NXZ
?setProfilerEnabled@InspectorController@WebCore@@QAEX_N@Z
- ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
+ ?jsStringWithCacheSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ
diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def
index 561db22..bb1a0d2 100644
--- a/Source/WebKit2/win/WebKit2CFLite.def
+++ b/Source/WebKit2/win/WebKit2CFLite.def
@@ -267,6 +267,6 @@
?profilerEnabled@InspectorController@WebCore@@QAE_NXZ
?setProfilerEnabled@InspectorController@WebCore@@QAEX_N@Z
??1ContextDestructionObserver@WebCore@@MAE@XZ
- ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
+ ?jsStringWithCacheSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z
diff --git a/Source/autotools/symbols.filter b/Source/autotools/symbols.filter
index af4bff6..6a8d1ec 100644
--- a/Source/autotools/symbols.filter
+++ b/Source/autotools/symbols.filter
@@ -69,7 +69,6 @@
_ZN7WebCore15toDOMStringListEPN3JSC9ExecStateENS0_7JSValueE;
_ZN7WebCore16HTMLInputElement17setSuggestedValueERKN3WTF6StringE;
_ZN7WebCore16HTMLInputElement15setEditingValueERKN3WTF6StringE;
-_ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_;
_ZN7WebCore16scriptNameToCodeERKN3WTF6StringE;
_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
_ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv;
@@ -92,6 +91,7 @@
_ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeENS_14DocumentMarker11MarkerTypesE;
_ZN7WebCore24DocumentMarkerController18addTextMatchMarkerEPKNS_5RangeEb;
_ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiifNS_7IntSizeE;
+_ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_;
_ZN7WebCore30overrideUserPreferredLanguagesERKN3WTF6VectorINS0_6StringELj0EEE;
_ZN7WebCore30overrideUserPreferredLanguagesERKN3WTF6VectorINS0_6StringELm0EEE;
_ZN7WebCore40restrictMinimumScaleFactorToViewportSizeERNS_18ViewportAttributesENS_7IntSizeE;
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 26f0292..5ed3126 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,19 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Get rid of UString.
+
+ * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
+ * gdb/webkit.py:
+ (WTFStringPrinter.to_string):
+ (JSCIdentifierPrinter.to_string):
+ (JSCJSStringPrinter.to_string):
+ (add_pretty_printers):
+
2012-08-30 Dirk Pranke <dpranke@chromium.org>
nrwt should have TestExpectations everywhere we have Skipped files for apple ports
diff --git a/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp b/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp
index 61ff7ba..1b6c0b0 100644
--- a/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp
+++ b/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp
@@ -28,8 +28,8 @@
#include <EWebKit.h>
#include <JavaScriptCore/JSStringRef.h>
#include <JavaScriptCore/OpaqueJSString.h>
-#include <JavaScriptCore/runtime/UString.h>
#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
bool LoadItem::invoke() const
{
diff --git a/Tools/gdb/webkit.py b/Tools/gdb/webkit.py
index 1b2ae57..bdf3d08 100644
--- a/Tools/gdb/webkit.py
+++ b/Tools/gdb/webkit.py
@@ -151,13 +151,11 @@
return self.stringimpl_ptr().dereference()
-JSCUStringPrinter = WTFStringImplPrinter
-
class JSCIdentifierPrinter(StringPrinter):
"Print a JSC::Identifier"
def to_string(self):
- return JSCUStringPrinter(self.val['m_string']).to_string()
+ return WTFStringImplPrinter(self.val['m_string']).to_string()
class JSCJSStringPrinter(StringPrinter):
@@ -166,7 +164,7 @@
if self.val['m_length'] == 0:
return ''
- return JSCUStringPrinter(self.val['m_value']).to_string()
+ return WTFStringImplPrinter(self.val['m_value']).to_string()
class WebCoreKURLGooglePrivatePrinter(StringPrinter):
@@ -282,7 +280,6 @@
(re.compile("^WTF::StringImpl$"), WTFStringImplPrinter),
(re.compile("^WebCore::KURLGooglePrivate$"), WebCoreKURLGooglePrivatePrinter),
(re.compile("^WebCore::QualifiedName$"), WebCoreQualifiedNamePrinter),
- (re.compile("^JSC::UString$"), JSCUStringPrinter),
(re.compile("^JSC::Identifier$"), JSCIdentifierPrinter),
(re.compile("^JSC::JSString$"), JSCJSStringPrinter),
)
diff --git a/Websites/webkit.org/ChangeLog b/Websites/webkit.org/ChangeLog
index 7149e19..3a28921 100644
--- a/Websites/webkit.org/ChangeLog
+++ b/Websites/webkit.org/ChangeLog
@@ -1,3 +1,14 @@
+2012-08-30 Benjamin Poulain <bpoulain@apple.com>
+
+ Replace JSC::UString by WTF::String
+ https://bugs.webkit.org/show_bug.cgi?id=95271
+
+ Reviewed by Geoffrey Garen.
+
+ Update the coding style to avoid mentioning a class that no longer exist.
+
+ * coding/coding-style.html:
+
2012-08-09 Ryosuke Niwa <rniwa@webkit.org>
Address one more review comment.
diff --git a/Websites/webkit.org/coding/coding-style.html b/Websites/webkit.org/coding/coding-style.html
index 2a5d6d6..735ab38 100644
--- a/Websites/webkit.org/coding/coding-style.html
+++ b/Websites/webkit.org/coding/coding-style.html
@@ -941,7 +941,7 @@
</pre>
<h4 class="wrong">Wrong:</h4>
<pre class="code">
-// runtime/UString.h
+// runtime/JSObject.h
namespace WTF {