Changeset 65104 in webkit for trunk/JavaScriptCore/bytecompiler


Ignore:
Timestamp:
Aug 10, 2010, 5:16:38 PM (15 years ago)
Author:
[email protected]
Message:

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):

Location:
trunk/JavaScriptCore/bytecompiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r64790 r65104  
    166166    int index = m_calleeRegisters.size();
    167167    SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
    168     pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
     168    pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry);
    169169
    170170    if (!result.second) {
     
    181181    int index = m_nextGlobalIndex;
    182182    SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
    183     pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
     183    pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry);
    184184
    185185    if (!result.second)
     
    351351        FunctionBodyNode* function = functionStack[i];
    352352        const Identifier& ident = function->ident();
    353         m_functions.add(ident.ustring().rep());
     353        m_functions.add(ident.impl());
    354354        emitNewFunction(addVar(ident, false), function);
    355355    }
     
    438438{
    439439    // Parameters overwrite var declarations, but not function declarations.
    440     UString::Rep* rep = ident.ustring().rep();
     440    StringImpl* rep = ident.impl();
    441441    if (!m_functions.contains(rep)) {
    442442        symbolTable().set(rep, parameterIndex);
     
    458458        return 0;
    459459
    460     SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
     460    SymbolTableEntry entry = symbolTable().get(ident.impl());
    461461    if (entry.isNull())
    462462        return 0;
     
    476476        return false;
    477477   
    478     SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
     478    SymbolTableEntry entry = symbolTable().get(ident.impl());
    479479    if (entry.isNull())
    480480        return false;
     
    490490    ASSERT(willResolveToArguments(propertyNames().arguments));
    491491
    492     SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.ustring().rep());
     492    SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.impl());
    493493    ASSERT(!entry.isNull());
    494494    return &registerFor(entry.getIndex());
     
    500500        return 0;
    501501
    502     SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
     502    SymbolTableEntry entry = symbolTable().get(ident.impl());
    503503    if (entry.isNull())
    504504        return 0;
     
    512512        return true;
    513513   
    514     return shouldOptimizeLocals() && symbolTable().contains(ident.ustring().rep());
     514    return shouldOptimizeLocals() && symbolTable().contains(ident.impl());
    515515}
    516516
    517517bool BytecodeGenerator::isLocalConstant(const Identifier& ident)
    518518{
    519     return symbolTable().get(ident.ustring().rep()).isReadOnly();
     519    return symbolTable().get(ident.impl()).isReadOnly();
    520520}
    521521
     
    830830unsigned BytecodeGenerator::addConstant(const Identifier& ident)
    831831{
    832     UString::Rep* rep = ident.ustring().rep();
     832    StringImpl* rep = ident.impl();
    833833    pair<IdentifierMap::iterator, bool> result = m_identifierMap.add(rep, m_codeBlock->numberOfIdentifiers());
    834834    if (result.second) // new entry
     
    10021002RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, const Identifier& identifier)
    10031003{
    1004     JSString*& stringInMap = m_stringMap.add(identifier.ustring().rep(), 0).first->second;
     1004    JSString*& stringInMap = m_stringMap.add(identifier.impl(), 0).first->second;
    10051005    if (!stringInMap)
    10061006        stringInMap = jsOwnedString(globalData(), identifier.ustring());
     
    10401040            break;
    10411041        JSVariableObject* currentVariableObject = static_cast<JSVariableObject*>(currentScope);
    1042         SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.ustring().rep());
     1042        SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.impl());
    10431043
    10441044        // Found the property
     
    19751975    UNUSED_PARAM(max);
    19761976    ASSERT(node->isString());
    1977     UString::Rep* clause = static_cast<StringNode*>(node)->value().ustring().rep();
     1977    StringImpl* clause = static_cast<StringNode*>(node)->value().impl();
    19781978    ASSERT(clause->length() == 1);
    19791979   
     
    20052005       
    20062006        ASSERT(nodes[i]->isString());
    2007         UString::Rep* clause = static_cast<StringNode*>(nodes[i])->value().ustring().rep();
     2007        StringImpl* clause = static_cast<StringNode*>(nodes[i])->value().impl();
    20082008        OffsetLocation location;
    20092009        location.branchOffset = labels[i]->bind(switchAddress, switchAddress + 3);
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r64790 r65104  
    437437        };
    438438
    439         typedef HashMap<RefPtr<UString::Rep>, int, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap;
     439        typedef HashMap<RefPtr<StringImpl>, int, IdentifierRepHash, HashTraits<RefPtr<StringImpl> >, IdentifierMapIndexHashTraits> IdentifierMap;
    440440        typedef HashMap<double, JSValue> NumberMap;
    441         typedef HashMap<UString::Rep*, JSString*, IdentifierRepHash> IdentifierStringMap;
     441        typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
    442442       
    443443        RegisterID* emitCall(OpcodeID, RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset);
     
    525525        // Some of these objects keep pointers to one another. They are arranged
    526526        // to ensure a sane destruction order that avoids references to freed memory.
    527         HashSet<RefPtr<UString::Rep>, IdentifierRepHash> m_functions;
     527        HashSet<RefPtr<StringImpl>, IdentifierRepHash> m_functions;
    528528        RegisterID m_ignoredResultRegister;
    529529        RegisterID m_thisRegister;
  • trunk/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r63515 r65104  
    17491749            const UString& value = static_cast<StringNode*>(clauseExpression)->value().ustring();
    17501750            if (singleCharacterSwitch &= value.size() == 1) {
    1751                 int32_t intVal = value.rep()->characters()[0];
     1751                int32_t intVal = value.impl()->characters()[0];
    17521752                if (intVal < min_num)
    17531753                    min_num = intVal;
Note: See TracChangeset for help on using the changeset viewer.