Commit cff06e46 authored by benjamin@webkit.org's avatar benjamin@webkit.org

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
parent 17d32ec6
......@@ -49,7 +49,7 @@ JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCal
{
}
void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const UString& name)
void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const String& name)
{
Base::finishCreation(globalData, name);
ASSERT(inherits(&s_info));
......
......@@ -34,12 +34,12 @@ namespace JSC {
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);
......
......@@ -171,7 +171,7 @@ protected:
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*);
......
......@@ -111,10 +111,10 @@ void JSCallbackObject<Parent>::init(ExecState* exec)
}
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;
......
......@@ -42,20 +42,6 @@ using namespace WTF::Unicode;
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 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
, 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 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
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 @@ OpaqueJSClassContextData& OpaqueJSClass::contextData(ExecState* exec)
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)
......
......@@ -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 @@ struct OpaqueJSClass : public ThreadSafeRefCounted<OpaqueJSClass> {
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 @@ private:
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;
};
......
......@@ -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 @@ JSStringRef JSContextCreateBacktrace(JSContextRef ctx, unsigned maxStackSize)
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 @@ JSStringRef JSContextCreateBacktrace(JSContextRef ctx, unsigned maxStackSize)
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 @@ JSStringRef JSContextCreateBacktrace(JSContextRef ctx, unsigned maxStackSize)
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();
}
......@@ -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>
......
......@@ -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 @@ JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string)
{
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 @@ JSStringRef JSValueCreateJSONString(JSContextRef ctx, JSValueRef apiValue, unsig
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()) {
......
......@@ -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
......
......@@ -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 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
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:
......
......@@ -255,7 +255,6 @@ SET(JavaScriptCore_SOURCES
runtime/StructureChain.cpp
runtime/SymbolTable.cpp
runtime/TimeoutChecker.cpp
runtime/UString.cpp
tools/CodeProfile.cpp
tools/CodeProfiling.cpp
......
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
......
......@@ -658,10 +658,6 @@ javascriptcore_sources += \
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 \
......
......@@ -1293,26 +1293,6 @@
RelativePath="..\..\runtime\TimeoutChecker.h"
>
</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"
>
......
......@@ -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 */,
......
......@@ -255,7 +255,6 @@ SOURCES += \
runtime/Structure.cpp \
runtime/SymbolTable.cpp \
runtime/TimeoutChecker.cpp \
runtime/UString.cpp \
tools/CodeProfile.cpp \
tools/CodeProfiling.cpp \
yarr/YarrJIT.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 @@ namespace JSC {
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)), "\"");