Commit ee2085b2 authored by barraclough@apple.com's avatar barraclough@apple.com

Bug 43817 - Remove UString::Rep

UString::Rep has for a long time been replaced by UStringImpl (Rep
remaining as a typedef).  UStringImpl has since been removed too
(unified with StringImpl). Remove Rep, rename rep() to impl() and
m_rep to m_impl.  Also add impl() method to Identifier, and rename
its UString member from _ustring to m_string.

Rubber stamped by Sam Weinig

JavaScriptCore: 

* API/JSCallbackObject.h:
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
* API/JSCallbackObjectFunctions.h:
(JSC::::getOwnPropertySlot):
(JSC::::put):
(JSC::::deleteProperty):
(JSC::::getOwnPropertyNames):
(JSC::::staticValueGetter):
(JSC::::staticFunctionGetter):
* API/JSClassRef.cpp:
(tryCreateStringFromUTF8):
(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClass::~OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):
* API/JSClassRef.h:
* API/OpaqueJSString.cpp:
(OpaqueJSString::ustring):
* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::get):
* bytecode/JumpTable.h:
(JSC::StringJumpTable::offsetForValue):
(JSC::StringJumpTable::ctiForValue):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::addGlobalVar):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::addParameter):
(JSC::BytecodeGenerator::registerFor):
(JSC::BytecodeGenerator::willResolveToArguments):
(JSC::BytecodeGenerator::uncheckedRegisterForArguments):
(JSC::BytecodeGenerator::constRegisterFor):
(JSC::BytecodeGenerator::isLocal):
(JSC::BytecodeGenerator::isLocalConstant):
(JSC::BytecodeGenerator::addConstant):
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::findScopedProperty):
(JSC::keyForCharacterSwitch):
(JSC::prepareJumpTableForStringSwitch):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::processClauseList):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* parser/JSParser.cpp:
(JSC::JSParser::parseStrictObjectLiteral):
* pcre/pcre_exec.cpp:
(Histogram::add):
* profiler/CallIdentifier.h:
(JSC::CallIdentifier::Hash::hash):
* profiler/Profile.cpp:
* profiler/ProfileNode.cpp:
(JSC::ProfileNode::debugPrintDataSampleStyle):
* profiler/ProfileNode.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToString):
* runtime/Identifier.cpp:
(JSC::Identifier::equal):
(JSC::IdentifierCStringTranslator::hash):
(JSC::IdentifierCStringTranslator::equal):
(JSC::IdentifierCStringTranslator::translate):
(JSC::Identifier::add):
(JSC::IdentifierUCharBufferTranslator::hash):
(JSC::IdentifierUCharBufferTranslator::equal):
(JSC::IdentifierUCharBufferTranslator::translate):
(JSC::Identifier::addSlowCase):
* runtime/Identifier.h:
(JSC::Identifier::Identifier):
(JSC::Identifier::ustring):
(JSC::Identifier::impl):
(JSC::Identifier::data):
(JSC::Identifier::size):
(JSC::Identifier::ascii):
(JSC::Identifier::isNull):
(JSC::Identifier::isEmpty):
(JSC::Identifier::toUInt32):
(JSC::Identifier::toStrictUInt32):
(JSC::Identifier::toArrayIndex):
(JSC::Identifier::toDouble):
(JSC::Identifier::equal):
(JSC::Identifier::add):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::displayName):
* runtime/JSFunction.cpp:
(JSC::JSFunction::displayName):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::addStaticGlobals):
* runtime/JSStaticScopeObject.h:
(JSC::JSStaticScopeObject::JSStaticScopeObject):
* runtime/JSString.h:
(JSC::):
(JSC::RopeBuilder::appendStringInConstruct):
(JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
(JSC::jsSingleCharacterSubstring):
(JSC::jsSubstring):
* runtime/JSVariableObject.cpp:
(JSC::JSVariableObject::deleteProperty):
(JSC::JSVariableObject::symbolTableGet):
* runtime/JSVariableObject.h:
(JSC::JSVariableObject::symbolTableGet):
(JSC::JSVariableObject::symbolTablePut):
(JSC::JSVariableObject::symbolTablePutWithAttributes):
* runtime/Lookup.cpp:
(JSC::HashTable::createTable):
(JSC::HashTable::deleteTable):
* runtime/Lookup.h:
(JSC::HashEntry::initialize):
(JSC::HashEntry::setKey):
(JSC::HashEntry::key):
(JSC::HashTable::entry):
* runtime/PropertyMapHashTable.h:
(JSC::PropertyMapEntry::PropertyMapEntry):
* runtime/PropertyNameArray.cpp:
(JSC::PropertyNameArray::add):
* runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::add):
(JSC::PropertyNameArray::addKnownUnique):
* runtime/RegExp.cpp:
(JSC::RegExp::match):
* runtime/RegExpCache.cpp:
(JSC::RegExpCache::create):
* runtime/RegExpKey.h:
(JSC::RegExpKey::RegExpKey):
* runtime/SmallStrings.cpp:
(JSC::SmallStringsStorage::rep):
(JSC::SmallStrings::singleCharacterStringRep):
* runtime/SmallStrings.h:
* runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):
* runtime/Structure.cpp:
(JSC::Structure::~Structure):
(JSC::Structure::despecifyDictionaryFunction):
(JSC::Structure::addPropertyTransitionToExistingStructure):
(JSC::Structure::addPropertyTransition):
(JSC::Structure::copyPropertyTable):
(JSC::Structure::get):
(JSC::Structure::despecifyFunction):
(JSC::Structure::put):
(JSC::Structure::hasTransition):
(JSC::Structure::remove):
(JSC::Structure::checkConsistency):
* runtime/Structure.h:
(JSC::Structure::get):
(JSC::Structure::hasTransition):
* runtime/StructureTransitionTable.h:
* runtime/SymbolTable.h:
* runtime/UString.cpp:
(JSC::UString::UString):
(JSC::UString::toStrictUInt32):
(JSC::UString::substr):
* runtime/UString.h:
(JSC::UString::UString):
(JSC::UString::adopt):
(JSC::UString::data):
(JSC::UString::size):
(JSC::UString::isNull):
(JSC::UString::isEmpty):
(JSC::UString::impl):
(JSC::UString::cost):
(JSC::operator==):
(JSC::codePointCompare):
(JSC::IdentifierRepHash::hash):
(WTF::):

WebCore: 

* bindings/js/JSDOMBinding.cpp:
(WebCore::findAtomicString):
* bindings/js/JSDOMBinding.h:
(WebCore::ustringToString):
(WebCore::identifierToString):
(WebCore::ustringToAtomicString):
(WebCore::identifierToAtomicString):
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValueData::SerializedScriptValueData):
* bridge/IdentifierRep.cpp:
(WebCore::IdentifierRep::get):
* bridge/c/c_class.cpp:
(JSC::Bindings::CClass::methodsNamed):
(JSC::Bindings::CClass::fieldNamed):
* bridge/jni/jsc/JavaClassJSC.cpp:
(JavaClass::JavaClass):
(JavaClass::methodsNamed):
(JavaClass::fieldNamed):
* bridge/jni/jsc/JavaStringJSC.h:
(JSC::Bindings::JavaStringImpl::~JavaStringImpl):
(JSC::Bindings::JavaStringImpl::init):
(JSC::Bindings::JavaStringImpl::UTF8String):
(JSC::Bindings::JavaStringImpl::uchars):
(JSC::Bindings::JavaStringImpl::length):
(JSC::Bindings::JavaStringImpl::uString):
* bridge/jsc/BridgeJSC.h:

WebKit/mac: 

* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::methodsNamed):
(WebKit::ProxyInstance::fieldNamed):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 23ae52f3
......@@ -80,7 +80,7 @@ struct JSCallbackObjectData {
struct JSPrivatePropertyMap {
JSValue getPrivateProperty(const Identifier& propertyName) const
{
PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.ustring().rep());
PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.impl());
if (location == m_propertyMap.end())
return JSValue();
return location->second;
......@@ -88,12 +88,12 @@ struct JSCallbackObjectData {
void setPrivateProperty(const Identifier& propertyName, JSValue value)
{
m_propertyMap.set(propertyName.ustring().rep(), value);
m_propertyMap.set(propertyName.impl(), value);
}
void deletePrivateProperty(const Identifier& propertyName)
{
m_propertyMap.remove(propertyName.ustring().rep());
m_propertyMap.remove(propertyName.impl());
}
void markChildren(MarkStack& markStack)
......@@ -105,7 +105,7 @@ struct JSCallbackObjectData {
}
private:
typedef HashMap<RefPtr<UString::Rep>, JSValue, IdentifierRepHash> PrivatePropertyMap;
typedef HashMap<RefPtr<StringImpl>, JSValue, IdentifierRepHash> PrivatePropertyMap;
PrivatePropertyMap m_propertyMap;
};
OwnPtr<JSPrivatePropertyMap> m_privateProperties;
......
......@@ -146,14 +146,14 @@ bool JSCallbackObject<Base>::getOwnPropertySlot(ExecState* exec, const Identifie
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
if (staticValues->contains(propertyName.ustring().rep())) {
if (staticValues->contains(propertyName.impl())) {
slot.setCustom(this, staticValueGetter);
return true;
}
}
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
if (staticFunctions->contains(propertyName.ustring().rep())) {
if (staticFunctions->contains(propertyName.impl())) {
slot.setCustom(this, staticFunctionGetter);
return true;
}
......@@ -213,7 +213,7 @@ void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) {
if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeReadOnly)
return;
if (JSObjectSetPropertyCallback setProperty = entry->setProperty) {
......@@ -235,7 +235,7 @@ void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName
}
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeReadOnly)
return;
JSCallbackObject<Base>::putDirect(propertyName, value); // put as override property
......@@ -271,7 +271,7 @@ bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, const Identifier& p
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) {
if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeDontDelete)
return false;
return true;
......@@ -279,7 +279,7 @@ bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, const Identifier& p
}
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeDontDelete)
return false;
return true;
......@@ -417,7 +417,7 @@ void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameAr
typedef OpaqueJSClassStaticValuesTable::const_iterator iterator;
iterator end = staticValues->end();
for (iterator it = staticValues->begin(); it != end; ++it) {
UString::Rep* name = it->first.get();
StringImpl* name = it->first.get();
StaticValueEntry* entry = it->second;
if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)))
propertyNames.add(Identifier(exec, name));
......@@ -428,7 +428,7 @@ void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameAr
typedef OpaqueJSClassStaticFunctionsTable::const_iterator iterator;
iterator end = staticFunctions->end();
for (iterator it = staticFunctions->begin(); it != end; ++it) {
UString::Rep* name = it->first.get();
StringImpl* name = it->first.get();
StaticFunctionEntry* entry = it->second;
if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))
propertyNames.add(Identifier(exec, name));
......@@ -528,7 +528,7 @@ JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, JSValue slotB
for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass)
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec))
if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep()))
if (StaticValueEntry* entry = staticValues->get(propertyName.impl()))
if (JSObjectGetPropertyCallback getProperty = entry->getProperty) {
if (!propertyNameRef)
propertyNameRef = OpaqueJSString::create(propertyName.ustring());
......@@ -561,7 +561,7 @@ JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue sl
for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) {
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);
......
......@@ -45,13 +45,13 @@ const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
static inline UString tryCreateStringFromUTF8(const char* string)
{
if (!string)
return UString::null();
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::null();
return UString();
return UString(buffer.data(), p - buffer.data());
}
......@@ -83,7 +83,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
if (!valueName.isNull()) {
// Use a local variable here to sidestep an RVCT compiler bug.
StaticValueEntry* entry = new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes);
StringImpl* impl = valueName.rep();
StringImpl* impl = valueName.impl();
impl->ref();
m_staticValues->add(impl, entry);
}
......@@ -98,7 +98,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
if (!functionName.isNull()) {
// Use a local variable here to sidestep an RVCT compiler bug.
StaticFunctionEntry* entry = new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes);
StringImpl* impl = functionName.rep();
StringImpl* impl = functionName.impl();
impl->ref();
m_staticFunctions->add(impl, entry);
}
......@@ -113,7 +113,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
OpaqueJSClass::~OpaqueJSClass()
{
// The empty string is shared across threads & is an identifier, in all other cases we should have done a deep copy in className(), below.
ASSERT(!m_className.size() || !m_className.rep()->isIdentifier());
ASSERT(!m_className.size() || !m_className.impl()->isIdentifier());
if (m_staticValues) {
OpaqueJSClassStaticValuesTable::const_iterator end = m_staticValues->end();
......@@ -173,7 +173,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass)
ASSERT(!it->first->isIdentifier());
// Use a local variable here to sidestep an RVCT compiler bug.
StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes);
staticValues->add(UString::Rep::create(it->first->characters(), it->first->length()), entry);
staticValues->add(StringImpl::create(it->first->characters(), it->first->length()), entry);
}
} else
staticValues = 0;
......@@ -185,7 +185,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass)
ASSERT(!it->first->isIdentifier());
// Use a local variable here to sidestep an RVCT compiler bug.
StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes);
staticFunctions->add(UString::Rep::create(it->first->characters(), it->first->length()), entry);
staticFunctions->add(StringImpl::create(it->first->characters(), it->first->length()), entry);
}
} else
......
......@@ -55,8 +55,8 @@ struct StaticFunctionEntry : FastAllocBase {
JSPropertyAttributes attributes;
};
typedef HashMap<RefPtr<JSC::UString::Rep>, StaticValueEntry*> OpaqueJSClassStaticValuesTable;
typedef HashMap<RefPtr<JSC::UString::Rep>, StaticFunctionEntry*> OpaqueJSClassStaticFunctionsTable;
typedef HashMap<RefPtr<StringImpl>, StaticValueEntry*> OpaqueJSClassStaticValuesTable;
typedef HashMap<RefPtr<StringImpl>, StaticFunctionEntry*> OpaqueJSClassStaticFunctionsTable;
struct OpaqueJSClass;
......
......@@ -43,7 +43,7 @@ UString OpaqueJSString::ustring() const
{
if (this && m_characters)
return UString(m_characters, m_length);
return UString::null();
return UString();
}
Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
......
2010-08-10 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
Bug 43817 - Remove UString::Rep
UString::Rep has for a long time been replaced by UStringImpl (Rep
remaining as a typedef). UStringImpl has since been removed too
(unified with StringImpl). Remove Rep, rename rep() to impl() and
m_rep to m_impl. Also add impl() method to Identifier, and rename
its UString member from _ustring to m_string.
* API/JSCallbackObject.h:
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
* API/JSCallbackObjectFunctions.h:
(JSC::::getOwnPropertySlot):
(JSC::::put):
(JSC::::deleteProperty):
(JSC::::getOwnPropertyNames):
(JSC::::staticValueGetter):
(JSC::::staticFunctionGetter):
* API/JSClassRef.cpp:
(tryCreateStringFromUTF8):
(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClass::~OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):
* API/JSClassRef.h:
* API/OpaqueJSString.cpp:
(OpaqueJSString::ustring):
* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::get):
* bytecode/JumpTable.h:
(JSC::StringJumpTable::offsetForValue):
(JSC::StringJumpTable::ctiForValue):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::addGlobalVar):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::addParameter):
(JSC::BytecodeGenerator::registerFor):
(JSC::BytecodeGenerator::willResolveToArguments):
(JSC::BytecodeGenerator::uncheckedRegisterForArguments):
(JSC::BytecodeGenerator::constRegisterFor):
(JSC::BytecodeGenerator::isLocal):
(JSC::BytecodeGenerator::isLocalConstant):
(JSC::BytecodeGenerator::addConstant):
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::findScopedProperty):
(JSC::keyForCharacterSwitch):
(JSC::prepareJumpTableForStringSwitch):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::processClauseList):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* parser/JSParser.cpp:
(JSC::JSParser::parseStrictObjectLiteral):
* pcre/pcre_exec.cpp:
(Histogram::add):
* profiler/CallIdentifier.h:
(JSC::CallIdentifier::Hash::hash):
* profiler/Profile.cpp:
* profiler/ProfileNode.cpp:
(JSC::ProfileNode::debugPrintDataSampleStyle):
* profiler/ProfileNode.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncToString):
* runtime/Identifier.cpp:
(JSC::Identifier::equal):
(JSC::IdentifierCStringTranslator::hash):
(JSC::IdentifierCStringTranslator::equal):
(JSC::IdentifierCStringTranslator::translate):
(JSC::Identifier::add):
(JSC::IdentifierUCharBufferTranslator::hash):
(JSC::IdentifierUCharBufferTranslator::equal):
(JSC::IdentifierUCharBufferTranslator::translate):
(JSC::Identifier::addSlowCase):
* runtime/Identifier.h:
(JSC::Identifier::Identifier):
(JSC::Identifier::ustring):
(JSC::Identifier::impl):
(JSC::Identifier::data):
(JSC::Identifier::size):
(JSC::Identifier::ascii):
(JSC::Identifier::isNull):
(JSC::Identifier::isEmpty):
(JSC::Identifier::toUInt32):
(JSC::Identifier::toStrictUInt32):
(JSC::Identifier::toArrayIndex):
(JSC::Identifier::toDouble):
(JSC::Identifier::equal):
(JSC::Identifier::add):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::displayName):
* runtime/JSFunction.cpp:
(JSC::JSFunction::displayName):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::addStaticGlobals):
* runtime/JSStaticScopeObject.h:
(JSC::JSStaticScopeObject::JSStaticScopeObject):
* runtime/JSString.h:
(JSC::):
(JSC::RopeBuilder::appendStringInConstruct):
(JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
(JSC::jsSingleCharacterSubstring):
(JSC::jsSubstring):
* runtime/JSVariableObject.cpp:
(JSC::JSVariableObject::deleteProperty):
(JSC::JSVariableObject::symbolTableGet):
* runtime/JSVariableObject.h:
(JSC::JSVariableObject::symbolTableGet):
(JSC::JSVariableObject::symbolTablePut):
(JSC::JSVariableObject::symbolTablePutWithAttributes):
* runtime/Lookup.cpp:
(JSC::HashTable::createTable):
(JSC::HashTable::deleteTable):
* runtime/Lookup.h:
(JSC::HashEntry::initialize):
(JSC::HashEntry::setKey):
(JSC::HashEntry::key):
(JSC::HashTable::entry):
* runtime/PropertyMapHashTable.h:
(JSC::PropertyMapEntry::PropertyMapEntry):
* runtime/PropertyNameArray.cpp:
(JSC::PropertyNameArray::add):
* runtime/PropertyNameArray.h:
(JSC::PropertyNameArray::add):
(JSC::PropertyNameArray::addKnownUnique):
* runtime/RegExp.cpp:
(JSC::RegExp::match):
* runtime/RegExpCache.cpp:
(JSC::RegExpCache::create):
* runtime/RegExpKey.h:
(JSC::RegExpKey::RegExpKey):
* runtime/SmallStrings.cpp:
(JSC::SmallStringsStorage::rep):
(JSC::SmallStrings::singleCharacterStringRep):
* runtime/SmallStrings.h:
* runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstringsWithSeparators):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):
* runtime/Structure.cpp:
(JSC::Structure::~Structure):
(JSC::Structure::despecifyDictionaryFunction):
(JSC::Structure::addPropertyTransitionToExistingStructure):
(JSC::Structure::addPropertyTransition):
(JSC::Structure::copyPropertyTable):
(JSC::Structure::get):
(JSC::Structure::despecifyFunction):
(JSC::Structure::put):
(JSC::Structure::hasTransition):
(JSC::Structure::remove):
(JSC::Structure::checkConsistency):
* runtime/Structure.h:
(JSC::Structure::get):
(JSC::Structure::hasTransition):
* runtime/StructureTransitionTable.h:
* runtime/SymbolTable.h:
* runtime/UString.cpp:
(JSC::UString::UString):
(JSC::UString::toStrictUInt32):
(JSC::UString::substr):
* runtime/UString.h:
(JSC::UString::UString):
(JSC::UString::adopt):
(JSC::UString::data):
(JSC::UString::size):
(JSC::UString::isNull):
(JSC::UString::isEmpty):
(JSC::UString::impl):
(JSC::UString::cost):
(JSC::operator==):
(JSC::codePointCompare):
(JSC::IdentifierRepHash::hash):
(WTF::):
2010-08-10 Gavin Barraclough <barraclough@apple.com>
Bug 43816 - Remove UStringImpl
......
......@@ -48,7 +48,7 @@ namespace JSC {
RefPtr<EvalExecutable> evalExecutable;
if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject())
evalExecutable = m_cacheMap.get(evalSource.rep());
evalExecutable = m_cacheMap.get(evalSource.impl());
if (!evalExecutable) {
evalExecutable = EvalExecutable::create(exec, makeSource(evalSource));
......@@ -57,7 +57,7 @@ namespace JSC {
return 0;
if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries)
m_cacheMap.set(evalSource.rep(), evalExecutable);
m_cacheMap.set(evalSource.impl(), evalExecutable);
}
return evalExecutable.release();
......@@ -69,7 +69,7 @@ namespace JSC {
static const unsigned maxCacheableSourceLength = 256;
static const int maxCacheEntries = 64;
typedef HashMap<RefPtr<UString::Rep>, RefPtr<EvalExecutable> > EvalCacheMap;
typedef HashMap<RefPtr<StringImpl>, RefPtr<EvalExecutable> > EvalCacheMap;
EvalCacheMap m_cacheMap;
};
......
......@@ -45,13 +45,13 @@ namespace JSC {
};
struct StringJumpTable {
typedef HashMap<RefPtr<UString::Rep>, OffsetLocation> StringOffsetTable;
typedef HashMap<RefPtr<StringImpl>, OffsetLocation> StringOffsetTable;
StringOffsetTable offsetTable;
#if ENABLE(JIT)
CodeLocationLabel ctiDefault; // FIXME: it should not be necessary to store this.
#endif
inline int32_t offsetForValue(UString::Rep* value, int32_t defaultOffset)
inline int32_t offsetForValue(StringImpl* value, int32_t defaultOffset)
{
StringOffsetTable::const_iterator end = offsetTable.end();
StringOffsetTable::const_iterator loc = offsetTable.find(value);
......@@ -61,7 +61,7 @@ namespace JSC {
}
#if ENABLE(JIT)
inline CodeLocationLabel ctiForValue(UString::Rep* value)
inline CodeLocationLabel ctiForValue(StringImpl* value)
{
StringOffsetTable::const_iterator end = offsetTable.end();
StringOffsetTable::const_iterator loc = offsetTable.find(value);
......
......@@ -165,7 +165,7 @@ bool BytecodeGenerator::addVar(const Identifier& ident, bool isConstant, Registe
{
int index = m_calleeRegisters.size();
SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry);
if (!result.second) {
r0 = &registerFor(result.first->second.getIndex());
......@@ -180,7 +180,7 @@ bool BytecodeGenerator::addGlobalVar(const Identifier& ident, bool isConstant, R
{
int index = m_nextGlobalIndex;
SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry);
if (!result.second)
index = result.first->second.getIndex();
......@@ -350,7 +350,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug
for (size_t i = 0; i < functionStack.size(); ++i) {
FunctionBodyNode* function = functionStack[i];
const Identifier& ident = function->ident();
m_functions.add(ident.ustring().rep());
m_functions.add(ident.impl());
emitNewFunction(addVar(ident, false), function);
}
......@@ -437,7 +437,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge
void BytecodeGenerator::addParameter(const Identifier& ident, int parameterIndex)
{
// Parameters overwrite var declarations, but not function declarations.
UString::Rep* rep = ident.ustring().rep();
StringImpl* rep = ident.impl();
if (!m_functions.contains(rep)) {
symbolTable().set(rep, parameterIndex);
RegisterID& parameter = registerFor(parameterIndex);
......@@ -457,7 +457,7 @@ RegisterID* BytecodeGenerator::registerFor(const Identifier& ident)
if (!shouldOptimizeLocals())
return 0;
SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
SymbolTableEntry entry = symbolTable().get(ident.impl());
if (entry.isNull())
return 0;
......@@ -475,7 +475,7 @@ bool BytecodeGenerator::willResolveToArguments(const Identifier& ident)
if (!shouldOptimizeLocals())
return false;
SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
SymbolTableEntry entry = symbolTable().get(ident.impl());
if (entry.isNull())
return false;
......@@ -489,7 +489,7 @@ RegisterID* BytecodeGenerator::uncheckedRegisterForArguments()
{
ASSERT(willResolveToArguments(propertyNames().arguments));
SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.ustring().rep());
SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.impl());
ASSERT(!entry.isNull());
return &registerFor(entry.getIndex());
}
......@@ -499,7 +499,7 @@ RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident)
if (m_codeType == EvalCode)
return 0;
SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
SymbolTableEntry entry = symbolTable().get(ident.impl());
if (entry.isNull())
return 0;
......@@ -511,12 +511,12 @@ bool BytecodeGenerator::isLocal(const Identifier& ident)
if (ident == propertyNames().thisIdentifier)
return true;
return shouldOptimizeLocals() && symbolTable().contains(ident.ustring().rep());
return shouldOptimizeLocals() && symbolTable().contains(ident.impl());
}
bool BytecodeGenerator::isLocalConstant(const Identifier& ident)
{
return symbolTable().get(ident.ustring().rep()).isReadOnly();
return symbolTable().get(ident.impl()).isReadOnly();
}
RegisterID* BytecodeGenerator::newRegister()
......@@ -829,7 +829,7 @@ PassRefPtr<Label> BytecodeGenerator::emitJumpIfNotFunctionApply(RegisterID* cond
unsigned BytecodeGenerator::addConstant(const Identifier& ident)
{
UString::Rep* rep = ident.ustring().rep();
StringImpl* rep = ident.impl();
pair<IdentifierMap::iterator, bool> result = m_identifierMap.add(rep, m_codeBlock->numberOfIdentifiers());
if (result.second) // new entry
m_codeBlock->addIdentifier(Identifier(m_globalData, rep));
......@@ -1001,7 +1001,7 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number)
RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, const Identifier& identifier)
{
JSString*& stringInMap = m_stringMap.add(identifier.ustring().rep(), 0).first->second;
JSString*& stringInMap = m_stringMap.add(identifier.impl(), 0).first->second;
if (!stringInMap)
stringInMap = jsOwnedString(globalData(), identifier.ustring());
return emitLoad(dst, JSValue(stringInMap));
......@@ -1039,7 +1039,7 @@ bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& inde
if (!currentScope->isVariableObject())
break;
JSVariableObject* currentVariableObject = static_cast<JSVariableObject*>(currentScope);
SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.ustring().rep());
SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.impl());
// Found the property
if (!entry.isNull()) {
......@@ -1974,7 +1974,7 @@ static int32_t keyForCharacterSwitch(ExpressionNode* node, int32_t min, int32_t
{
UNUSED_PARAM(max);
ASSERT(node->isString());
UString::Rep* clause = static_cast<StringNode*>(node)->value().ustring().rep();
StringImpl* clause = static_cast<StringNode*>(node)->value().impl();
ASSERT(clause->length() == 1);
int32_t key = clause->characters()[0];
......@@ -2004,7 +2004,7 @@ static void prepareJumpTableForStringSwitch(StringJumpTable& jumpTable, int32_t
ASSERT(!labels[i]->isForward());
ASSERT(nodes[i]->isString());
UString::Rep* clause = static_cast<StringNode*>(nodes[i])->value().ustring().rep();
StringImpl* clause = static_cast<StringNode*>(nodes[i])->value().impl();
OffsetLocation location;
location.branchOffset = labels[i]->bind(switchAddress, switchAddress + 3);
jumpTable.offsetTable.add(clause, location);
......
......@@ -436,9 +436,9 @@ namespace JSC {
static const bool needsRef = false;
};
typedef HashMap<RefPtr<UString::Rep>, int, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap;
typedef HashMap<RefPtr<StringImpl>, int, IdentifierRepHash, HashTraits<RefPtr<StringImpl> >, IdentifierMapIndexHashTraits> IdentifierMap;
typedef HashMap<double, JSValue> NumberMap;
typedef HashMap<UString::Rep*, JSString*, IdentifierRepHash> IdentifierStringMap;
typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
RegisterID* emitCall(OpcodeID, RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset);
......@@ -524,7 +524,7 @@ namespace JSC {
// Some of these objects keep pointers to one another. They are arranged
// to ensure a sane destruction order that avoids references to freed memory.
HashSet<RefPtr<UString::Rep>, IdentifierRepHash> m_functions;
HashSet<RefPtr<StringImpl>, IdentifierRepHash> m_functions;
RegisterID m_ignoredResultRegister;
RegisterID m_thisRegister;
RegisterID* m_activationRegister;
......
......@@ -1748,7 +1748,7 @@ static void processClauseList(ClauseListNode* list, Vector<ExpressionNode*, 8>&
}
const UString& value = static_cast<StringNode*>(clauseExpression)->value().ustring();
if (singleCharacterSwitch &= value.size() == 1) {
int32_t intVal = value.rep()->characters()[0];
int32_t intVal = value.impl()->characters()[0];
if (intVal < min_num)
min_num = intVal;
if (intVal > max_num)
......
......@@ -3574,7 +3574,7 @@ skip_id_custom_self:
if (!scrutinee.isString())
vPC += defaultOffset;
else {
UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
StringImpl* value = asString(scrutinee)->value(callFrame).impl();
if (value->length() != 1)
vPC += defaultOffset;
else
......@@ -3597,7 +3597,7 @@ skip_id_custom_self:
if (!scrutinee.isString())
vPC += defaultOffset;
else
vPC += codeBlock->stringSwitchJumpTable(tableIndex).offsetForValue(asString(scrutinee)->value(callFrame).rep(), defaultOffset);
vPC += codeBlock->stringSwitchJumpTable(tableIndex).offsetForValue(asString(scrutinee)->value(callFrame).impl(), defaultOffset);
NEXT_INSTRUCTION();
}
DEFINE_OPCODE(op_new_func) {
......
......@@ -3362,7 +3362,7 @@ DEFINE_STUB_FUNCTION(void*, op_switch_char)
void* result = codeBlock->characterSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
if (scrutinee.isString()) {
UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
StringImpl* value = asString(scrutinee)->value(callFrame).impl();
if (value->length() == 1)
result = codeBlock->characterSwitchJumpTable(tableIndex).ctiForValue(value->characters()[0]).executableAddress();
}
......@@ -3383,7 +3383,7 @@ DEFINE_STUB_FUNCTION(void*, op_switch_string)
void* result = codeBlock->stringSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
if (scrutinee.isString()) {
UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
StringImpl* value = asString(scrutinee)->value(callFrame).impl();
result = codeBlock->stringSwitchJumpTable(tableIndex).ctiForValue(value).executableAddress();
}
......
......@@ -1186,11 +1186,11 @@ template <class TreeBuilder> TreeExpression JSParser::parseStrictObjectLiteral(T
TreeProperty property = parseProperty<true>(context);